summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--build.sbt23
1 files changed, 20 insertions, 3 deletions
diff --git a/build.sbt b/build.sbt
index 6d35345fce..d883aac057 100644
--- a/build.sbt
+++ b/build.sbt
@@ -78,6 +78,10 @@ lazy val commonSettings = Seq[Setting[_]](
sourceDirectories in Compile := Seq(sourceDirectory.value),
scalaSource in Compile := (sourceDirectory in Compile).value,
javaSource in Compile := (sourceDirectory in Compile).value,
+ // resources are stored along source files in our current layout
+ resourceDirectory in Compile := (sourceDirectory in Compile).value,
+ // each subproject has to ask specifically for files they want to include
+ includeFilter in unmanagedResources in Compile := NothingFilter,
target := (baseDirectory in ThisBuild).value / "target" / thisProject.value.id,
target in Compile in doc := buildDirectory.value / "scaladoc" / thisProject.value.id,
classDirectory in Compile := buildDirectory.value / "quick/classes" / thisProject.value.id,
@@ -108,13 +112,18 @@ lazy val scalaSubprojectSettings = commonSettings ++ Seq[Setting[_]](
val resolvedArtifact = artifact.value
val resolvedArtifactName = s"${resolvedArtifact.name}.${resolvedArtifact.extension}"
buildDirectory.value / "pack/lib" / resolvedArtifactName
- },
+ }
+)
+
+lazy val generatePropertiesFileSettings = Seq[Setting[_]](
copyrightString := "Copyright 2002-2013, LAMP/EPFL",
resourceGenerators in Compile += generateVersionPropertiesFile.map(file => Seq(file)).taskValue,
generateVersionPropertiesFile := generateVersionPropertiesFileImpl.value
)
+val libIncludes: FileFilter = "*.tmpl" | "*.xml" | "*.js" | "*.css" | "rootdoc.txt"
lazy val library = configureAsSubproject(project).
+ settings(generatePropertiesFileSettings: _*).
settings(
name := "scala-library",
scalacOptions in Compile ++= Seq[String]("-sourcepath", (scalaSource in Compile).value.toString),
@@ -128,14 +137,20 @@ lazy val library = configureAsSubproject(project).
scalacOptions in Compile in doc ++= {
val libraryAuxDir = (baseDirectory in ThisBuild).value / "src/library-aux"
Seq("-doc-no-compile", libraryAuxDir.toString)
- }
+ },
+ includeFilter in unmanagedResources in Compile := libIncludes
) dependsOn (forkjoin)
lazy val reflect = configureAsSubproject(project).
+ settings(generatePropertiesFileSettings: _*).
settings(name := "scala-reflect").
dependsOn(library)
+val compilerIncludes: FileFilter =
+ "*.tmpl" | "*.xml" | "*.js" | "*.css" | "*.html" | "*.properties" | "*.swf" |
+ "*.png" | "*.gif" | "*.gif" | "*.txt"
lazy val compiler = configureAsSubproject(project).
+ settings(generatePropertiesFileSettings: _*).
settings(
name := "scala-compiler",
libraryDependencies += "org.apache.ant" % "ant" % "1.9.4",
@@ -146,7 +161,8 @@ lazy val compiler = configureAsSubproject(project).
(mappings in Compile in packageBin).value ++
(mappings in Compile in packageBin in LocalProject("interactive")).value ++
(mappings in Compile in packageBin in LocalProject("scaladoc")).value ++
- (mappings in Compile in packageBin in LocalProject("repl")).value
+ (mappings in Compile in packageBin in LocalProject("repl")).value,
+ includeFilter in unmanagedResources in Compile := compilerIncludes
).
dependsOn(library, reflect, asm)
@@ -178,6 +194,7 @@ lazy val scalap = configureAsSubproject(project).
// deprecated Scala Actors project
// TODO: it packages into actors.jar but it should be scala-actors.jar
lazy val actors = configureAsSubproject(project).
+ settings(generatePropertiesFileSettings: _*).
settings(name := "scala-actors").
dependsOn(library)