diff options
author | Grzegorz Kossakowski <grzegorz.kossakowski@gmail.com> | 2015-02-19 15:05:37 +0100 |
---|---|---|
committer | Adriaan Moors <adriaan.moors@typesafe.com> | 2015-04-17 11:40:27 -0700 |
commit | a5e64642bc706dd781708d218deaafbf34ed5da8 (patch) | |
tree | c4e177a0c2ee2b6e2adeef1af919643a88833674 /build.sbt | |
parent | 22ab71c826a1a7fae332ffc68a73d2946990c0c1 (diff) | |
download | scala-a5e64642bc706dd781708d218deaafbf34ed5da8.tar.gz scala-a5e64642bc706dd781708d218deaafbf34ed5da8.tar.bz2 scala-a5e64642bc706dd781708d218deaafbf34ed5da8.zip |
Introduce `buildDirectory` setting.
This settings determines location of where class files, jars, and other
build products will go. By default, it's `./build-sbt`. It makes it easier
to compare what Ant and sbt builds do.
Also, changed `SettingKey` to `settingKey`. The latter is a macro that
automatically determines `label` of a setting and takes a description as
argument. Before that, `SettingKey("my desc")` would create a setting key
with `label` set to "my desc". Not what we wanted.
Diffstat (limited to 'build.sbt')
-rw-r--r-- | build.sbt | 10 |
1 files changed, 6 insertions, 4 deletions
@@ -70,7 +70,7 @@ lazy val commonSettings = Seq[Setting[_]]( scalaSource in Compile := (sourceDirectory in Compile).value, javaSource in Compile := (sourceDirectory in Compile).value, target := (baseDirectory in ThisBuild).value / "target" / name.value, - classDirectory in Compile := (baseDirectory in ThisBuild).value / "build/quick/classes" / name.value, + classDirectory in Compile := buildDirectory.value / "quick/classes" / name.value, artifactPath in packageBin in Compile := { // two lines below are copied over from sbt's sources: // https://github.com/sbt/sbt/blob/0.13/main/src/main/scala/sbt/Defaults.scala#L628 @@ -80,7 +80,7 @@ lazy val commonSettings = Seq[Setting[_]]( // uncomment the other definition of the `resolvedArtifactName` val resolvedArtifact = artifact.value val resolvedArtifactName = s"${resolvedArtifact.name}.${resolvedArtifact.extension}" - (baseDirectory in ThisBuild).value / "build/pack/lib" / resolvedArtifactName + buildDirectory.value / "pack/lib" / resolvedArtifactName }, // given that classDirectory is overriden to be _outside_ of target directory, we have // to make sure its being cleaned properly @@ -158,8 +158,8 @@ def configureAsSubproject(project: Project): Project = { (project in base).settings(commonSettings: _*) } -lazy val copyrightString = SettingKey[String]("Copyright string.") - +lazy val buildDirectory = settingKey[File]("The directory where all build products go. By default ./build") +lazy val copyrightString = settingKey[String]("Copyright string.") lazy val generateVersionPropertiesFile = taskKey[File]("Generating version properties file.") lazy val generateVersionPropertiesFileImpl: Def.Initialize[Task[File]] = Def.task { @@ -208,3 +208,5 @@ lazy val generateVersionPropertiesFileImpl: Def.Initialize[Task[File]] = Def.tas propFile } + +buildDirectory in ThisBuild := (baseDirectory in ThisBuild).value / "build-sbt" |