summaryrefslogtreecommitdiff
path: root/build.sbt
diff options
context:
space:
mode:
authorStefan Zeiger <szeiger@novocode.com>2016-10-27 12:16:37 +0200
committerGitHub <noreply@github.com>2016-10-27 12:16:37 +0200
commit4a487ca5d0da7925fcd23772e25cc10d8167a351 (patch)
treebca03e68deafc33d8303516cb81622826eaa39ca /build.sbt
parent92db1dcc7f9bf7161bb986060d7151f86d5fca66 (diff)
parent86d492c0b79b265a596cae1e4d8fd05cc1b11d53 (diff)
downloadscala-4a487ca5d0da7925fcd23772e25cc10d8167a351.tar.gz
scala-4a487ca5d0da7925fcd23772e25cc10d8167a351.tar.bz2
scala-4a487ca5d0da7925fcd23772e25cc10d8167a351.zip
Merge pull request #5379 from szeiger/wip/persist-buildcharacter
Store buildcharacter.properties in scala-compiler.jar
Diffstat (limited to 'build.sbt')
-rw-r--r--build.sbt15
1 files changed, 15 insertions, 0 deletions
diff --git a/build.sbt b/build.sbt
index 17ff3bfb6d..786311e77c 100644
--- a/build.sbt
+++ b/build.sbt
@@ -378,6 +378,7 @@ lazy val reflect = configureAsSubproject(project)
lazy val compiler = configureAsSubproject(project)
.settings(generatePropertiesFileSettings: _*)
+ .settings(generateBuildCharacterFileSettings: _*)
.settings(Osgi.settings: _*)
.settings(
name := "scala-compiler",
@@ -385,6 +386,8 @@ lazy val compiler = configureAsSubproject(project)
libraryDependencies ++= Seq(antDep, asmDep),
// These are only needed for the POM:
libraryDependencies ++= Seq(scalaXmlDep, jlineDep % "optional"),
+ buildCharacterPropertiesFile := (resourceManaged in Compile).value / "scala-buildcharacter.properties",
+ resourceGenerators in Compile += generateBuildCharacterPropertiesFile.map(file => Seq(file)).taskValue,
// this a way to make sure that classes from interactive and scaladoc projects
// end up in compiler jar. note that we need to use LocalProject references
// (with strings) to deal with mutual recursion
@@ -751,6 +754,18 @@ lazy val root: Project = (project in file("."))
publish := {},
publishLocal := {},
commands ++= ScriptCommands.all,
+ extractBuildCharacterPropertiesFile := {
+ val jar = (scalaInstance in bootstrap).value.compilerJar
+ val bc = buildCharacterPropertiesFile.value
+ val packagedName = "scala-buildcharacter.properties"
+ IO.withTemporaryDirectory { tmp =>
+ val extracted = IO.unzip(jar, tmp, new SimpleFilter(_ == packagedName)).headOption.getOrElse {
+ throw new RuntimeException(s"No file $packagedName found in bootstrap compiler $jar")
+ }
+ IO.copyFile(extracted, bc)
+ bc
+ }
+ },
// Generate (Product|TupleN|Function|AbstractFunction)*.scala files and scaladoc stubs for all AnyVal sources.
// They should really go into a managedSources dir instead of overwriting sources checked into git but scaladoc
// source links (could be fixed by shipping these sources with the scaladoc bundles) and scala-js source maps