summaryrefslogtreecommitdiff
path: root/build.sbt
diff options
context:
space:
mode:
authorGrzegorz Kossakowski <grzegorz.kossakowski@gmail.com>2015-03-10 11:42:46 -0700
committerAdriaan Moors <adriaan.moors@typesafe.com>2015-04-17 11:48:46 -0700
commite29646b0e7d3c25a73748d7d64223ebd5188db4a (patch)
treef148805865235949c4740f56529c197c56e4aa67 /build.sbt
parent42dace101f1239e3dfd6f522de4e97b807dfc0aa (diff)
downloadscala-e29646b0e7d3c25a73748d7d64223ebd5188db4a.tar.gz
scala-e29646b0e7d3c25a73748d7d64223ebd5188db4a.tar.bz2
scala-e29646b0e7d3c25a73748d7d64223ebd5188db4a.zip
Included required resources in jars
Static resources are stored along source files in our current layout. Therefore we set resourceDirectory to be sourceDirectory but make sure that includeFilter includes nothing by default. Subprojects like library or compiler set their own include filters. The include filters have been ported from the Ant build definition. Generate properties for: library, reflect, compiler & actors.
Diffstat (limited to 'build.sbt')
-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)