Created
June 26, 2011 14:49
-
-
Save retronym/1047666 to your computer and use it in GitHub Desktop.
SBT 0.10 dynamic scalac options
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| object StandardBuild { | |
| lazy val standardSettings: Seq[Project.Setting[_]] = | |
| Defaults.defaultSettings ++ compilerSettings | |
| lazy val scalacBaseOptions = SettingKey[Seq[String]]("scalac-base-options", "Options for the Scala Compiler in all modes") | |
| lazy val scalacSnapshotOptions = SettingKey[Seq[String]]("scalac-snapshot-options", "Options for the Scala Compiler in Development Mode") | |
| lazy val scalacReleaseOptions = SettingKey[Seq[String]]("scalac-release-options", "Options for the Scala Compiler in Release Build") | |
| lazy val compilerSettings: Seq[Project.Setting[_]] = Seq( | |
| scalacSnapshotOptions := Seq("-Xcheckinit"), | |
| scalacReleaseOptions := Seq(), | |
| scalacBaseOptions := Seq("-deprecation", "-unchecked"), | |
| scalacOptions <++= (version, scalacBaseOptions, scalacSnapshotOptions, scalacReleaseOptions).map { | |
| (v: String, baseOptions: Seq[String], snapOptions: Seq[String], releaseOptions: Seq[String]) => | |
| baseOptions ++ (if (isSnapshot(v)) snapOptions else releaseOptions) | |
| } | |
| ) | |
| private def isSnapshot(version: String) = version.trim.endsWith("-SNAPSHOT") | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| > inspect scalac-options | |
| [info] Task | |
| [info] Description: | |
| [info] Options for the Scala compiler. | |
| [info] Provided by: | |
| [info] {file:/E:/code/payoff/}payoff/*:scalac-options | |
| [info] Dependencies: | |
| [info] {file:/E:/code/payoff/}payoff/*:version | |
| [info] {file:/E:/code/payoff/}payoff/*:scalac-base-options | |
| [info] {file:/E:/code/payoff/}payoff/*:scalac-snapshot-options | |
| [info] {file:/E:/code/payoff/}payoff/*:scalac-release-options | |
| [info] Delegates: | |
| [info] {file:/E:/code/payoff/}payoff/*:scalac-options | |
| [info] {file:/E:/code/payoff/}/*:scalac-options | |
| [info] */*:scalac-options | |
| [info] Related: | |
| [info] {file:/E:/code/payoff/}payoff/scalac-options | |
| [info] */*:scalac-options | |
| [info] {file:/E:/code/payoff/}payoff/test:scalac-options |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment