summaryrefslogtreecommitdiff
path: root/project
diff options
context:
space:
mode:
authorJosh Suereth <joshua.suereth@gmail.com>2012-05-23 14:27:42 -0400
committerJosh Suereth <joshua.suereth@gmail.com>2012-05-23 14:27:42 -0400
commitfad0bf216e196c78fdabc19227435d5e5e593a67 (patch)
tree67d312f4a7f4eede8fe719cae12b83c60ae64fb0 /project
parentd3bb612195dbaa8996ff98187cd51452a5f72f6c (diff)
downloadscala-fad0bf216e196c78fdabc19227435d5e5e593a67.tar.gz
scala-fad0bf216e196c78fdabc19227435d5e5e593a67.tar.bz2
scala-fad0bf216e196c78fdabc19227435d5e5e593a67.zip
ASM now compiled once in the build.
* Moved ASM sources to src/asm * New ant task builds asm *ONCE*. Build times improve by a few seconds * Fixed SBT build for new asm location. SBT build still broken from actors-migration and partest Review by @magarciaEPFL
Diffstat (limited to 'project')
-rw-r--r--project/Build.scala12
-rw-r--r--project/Layers.scala15
2 files changed, 15 insertions, 12 deletions
diff --git a/project/Build.scala b/project/Build.scala
index d3be8cd810..0cc0c5c5d7 100644
--- a/project/Build.scala
+++ b/project/Build.scala
@@ -184,6 +184,8 @@ object ScalaBuild extends Build with Layers {
lazy val jline = Project("jline", file("src/jline"))
// Fast Java Bytecode Generator (nested in every scala-compiler.jar)
lazy val fjbg = Project("fjbg", file(".")) settings(settingOverrides : _*)
+ // Our wrapped version of msil.
+ lazy val asm = Project("asm", file(".")) settings(settingOverrides : _*)
// Forkjoin backport
lazy val forkjoin = Project("forkjoin", file(".")) settings(settingOverrides : _*)
@@ -208,11 +210,11 @@ object ScalaBuild extends Build with Layers {
lazy val locker = Project("locker", file(".")) aggregate(lockerLib, lockerComp)
// Quick is the general purpose project layer for the Scala compiler.
- lazy val (quickLib, quickComp) = makeLayer("quick", makeScalaReference("locker", lockerLib, lockerComp, fjbg))
+ lazy val (quickLib, quickComp) = makeLayer("quick", makeScalaReference("locker", lockerLib, lockerComp))
lazy val quick = Project("quick", file(".")) aggregate(quickLib, quickComp)
// Reference to quick scala instance.
- lazy val quickScalaInstance = makeScalaReference("quick", quickLib, quickComp, fjbg)
+ lazy val quickScalaInstance = makeScalaReference("quick", quickLib, quickComp)
def quickScalaLibraryDependency = unmanagedClasspath in Compile <++= (exportedProducts in quickLib in Compile).identity
def quickScalaCompilerDependency = unmanagedClasspath in Compile <++= (exportedProducts in quickComp in Compile).identity
@@ -312,7 +314,7 @@ object ScalaBuild extends Build with Layers {
// --------------------------------------------------------------
// Real Compiler Artifact
// --------------------------------------------------------------
- lazy val packageScalaBinTask = Seq(quickComp, fjbg).map(p => products in p in Compile).join.map(_.flatten).map(productTaskToMapping)
+ lazy val packageScalaBinTask = Seq(quickComp, fjbg, asm).map(p => products in p in Compile).join.map(_.flatten).map(productTaskToMapping)
lazy val scalaBinArtifactSettings : Seq[Setting[_]] = inConfig(Compile)(Defaults.packageTasks(packageBin, packageScalaBinTask)) ++ Seq(
name := "scala-compiler",
crossPaths := false,
@@ -324,7 +326,7 @@ object ScalaBuild extends Build with Layers {
target <<= (baseDirectory, name) apply (_ / "target" / _)
)
lazy val scalaCompiler = Project("scala-compiler", file(".")) settings(publishSettings:_*) settings(scalaBinArtifactSettings:_*) dependsOn(scalaLibrary)
- lazy val fullQuickScalaReference = makeScalaReference("pack", scalaLibrary, scalaCompiler, fjbg)
+ lazy val fullQuickScalaReference = makeScalaReference("pack", scalaLibrary, scalaCompiler)
// --------------------------------------------------------------
// Testing
@@ -368,7 +370,7 @@ object ScalaBuild extends Build with Layers {
// TODO - Migrate this into the dist project.
// Scaladocs
- def distScalaInstance = makeScalaReference("dist", scalaLibrary, scalaCompiler, fjbg)
+ def distScalaInstance = makeScalaReference("dist", scalaLibrary, scalaCompiler)
lazy val documentationSettings: Seq[Setting[_]] = dependentProjectSettings ++ Seq(
// TODO - Make these work for realz.
defaultExcludes in unmanagedSources in Compile := ((".*" - ".") || HiddenFileFilter ||
diff --git a/project/Layers.scala b/project/Layers.scala
index 3d6d780f8f..58fcb1b254 100644
--- a/project/Layers.scala
+++ b/project/Layers.scala
@@ -14,6 +14,8 @@ trait Layers extends Build {
def forkjoin: Project
/** Reference to Fast-Java-Bytecode-Generator library */
def fjbg: Project
+ /** Reference to the ASM wrapped project. */
+ def asm: Project
/** A setting that adds some external dependencies. */
def externalDeps: Setting[_]
/** The root project. */
@@ -22,14 +24,15 @@ trait Layers extends Build {
/** Creates a reference Scala version that can be used to build other projects. This takes in the raw
* library, compiler and fjbg libraries as well as a string representing the layer name (used for compiling the compile-interface).
*/
- def makeScalaReference(layer : String, library: Project, compiler: Project, fjbg: Project) =
+ def makeScalaReference(layer : String, library: Project, compiler: Project) =
scalaInstance <<= (appConfiguration in library,
version in library,
(exportedProducts in library in Compile),
(exportedProducts in compiler in Compile),
(exportedProducts in fjbg in Compile),
- (fullClasspath in jline in Runtime)) map {
- (app, version: String, lib: Classpath, comp: Classpath, fjbg: Classpath, jline: Classpath) =>
+ (fullClasspath in jline in Runtime),
+ (exportedProducts in asm in Runtime)) map {
+ (app, version: String, lib: Classpath, comp: Classpath, fjbg: Classpath, jline: Classpath, asm: Classpath) =>
val launcher = app.provider.scalaProvider.launcher
(lib,comp) match {
case (Seq(libraryJar), Seq(compilerJar)) =>
@@ -38,7 +41,7 @@ trait Layers extends Build {
libraryJar.data,
compilerJar.data,
launcher,
- ((fjbg.files++jline.files):_*))
+ ((fjbg.files++jline.files ++ asm.files):_*))
case _ => error("Cannot build a ScalaReference with more than one classpath element")
}
}
@@ -58,7 +61,6 @@ trait Layers extends Build {
defaultExcludes in unmanagedResources := ("*.scala" | "*.java" | "*.disabled"),
// TODO - Allow other scalac option settings.
scalacOptions in Compile <++= (scalaSource in Compile) map (src => Seq("-sourcepath", src.getAbsolutePath)),
- classpathOptions := ClasspathOptions.manual,
resourceGenerators in Compile <+= (resourceManaged, Versions.scalaVersions, skip in Compile, streams) map Versions.generateVersionPropertiesFile("library.properties"),
referenceScala
)
@@ -80,8 +82,7 @@ trait Layers extends Build {
dirs.descendentsExcept( ("*.xml" | "*.html" | "*.gif" | "*.png" | "*.js" | "*.css" | "*.tmpl" | "*.swf" | "*.properties" | "*.txt"),"*.scala").get
},
// TODO - Use depends on *and* SBT's magic dependency mechanisms...
- unmanagedClasspath in Compile <<= Seq(forkjoin, library, fjbg, jline).map(exportedProducts in Compile in _).join.map(_.flatten),
- classpathOptions := ClasspathOptions.manual,
+ unmanagedClasspath in Compile <<= Seq(forkjoin, library, fjbg, jline, asm).map(exportedProducts in Compile in _).join.map(_.flatten),
externalDeps,
referenceScala
)