diff --git a/compile/ClasspathOptions.scala b/compile/ClasspathOptions.scala new file mode 100644 index 000000000..bd649b325 --- /dev/null +++ b/compile/ClasspathOptions.scala @@ -0,0 +1,11 @@ +/* sbt -- Simple Build Tool + * Copyright 2009, 2010 Mark Harrah + */ +package sbt + +final case class ClasspathOptions(autoBoot: Boolean, compiler: Boolean, extra: Boolean) +object ClasspathOptions +{ + def manual = ClasspathOptions(false, false, false) + def auto = ClasspathOptions(true, true, true) +} \ No newline at end of file diff --git a/compile/CompilerArguments.scala b/compile/CompilerArguments.scala index 809a7f27d..445d56d7e 100644 --- a/compile/CompilerArguments.scala +++ b/compile/CompilerArguments.scala @@ -12,7 +12,7 @@ package compiler * order to add these jars to the boot classpath. The 'scala.home' property must be unset because Scala * puts jars in that directory on the bootclasspath. Because we use multiple Scala versions, * this would lead to compiling against the wrong library jar.*/ -class CompilerArguments(scalaInstance: ScalaInstance, cp: ClasspathOptions) extends NotNull +final class CompilerArguments(scalaInstance: ScalaInstance, cp: ClasspathOptions) { def apply(sources: Seq[File], classpath: Seq[File], outputDirectory: File, options: Seq[String]): Seq[String] = { @@ -41,12 +41,6 @@ class CompilerArguments(scalaInstance: ScalaInstance, cp: ClasspathOptions) exte def bootClasspathOption = if(cp.autoBoot) Seq("-bootclasspath", createBootClasspath) else Nil def bootClasspath = if(cp.autoBoot) sbt.IO.pathSplit(createBootClasspath).map(new File(_)).toSeq else Nil } -class ClasspathOptions(val autoBoot: Boolean, val compiler: Boolean, val extra: Boolean) extends NotNull -object ClasspathOptions -{ - def manual = new ClasspathOptions(false, false, false) - def auto = new ClasspathOptions(true, true, true) -} object CompilerArguments { def abs(files: Seq[File]): Seq[String] = files.map(_.getAbsolutePath) diff --git a/main/Defaults.scala b/main/Defaults.scala index 73229a09a..80f5e6099 100755 --- a/main/Defaults.scala +++ b/main/Defaults.scala @@ -106,7 +106,8 @@ object Defaults ) def compileBase = Seq( - compilers <<= (scalaInstance, appConfiguration, streams) map { (si, app, s) => Compiler.compilers(si)(app, s.log) }, + classpathOptions in GlobalScope :== ClasspathOptions.auto, + compilers <<= (scalaInstance, appConfiguration, streams, classpathOptions) map { (si, app, s, co) => Compiler.compilers(si, co)(app, s.log) }, javacOptions in GlobalScope :== Nil, scalacOptions in GlobalScope :== Nil, scalaInstance <<= (appConfiguration, scalaVersion){ (app, version) => ScalaInstance(version, app.provider.scalaProvider.launcher) }, diff --git a/main/Keys.scala b/main/Keys.scala index b88709038..541b113cd 100644 --- a/main/Keys.scala +++ b/main/Keys.scala @@ -68,6 +68,7 @@ object Keys val compileInputs = TaskKey[Compiler.Inputs]("compile-inputs") val scalaInstance = SettingKey[ScalaInstance]("scala-instance") val scalaVersion = SettingKey[String]("scala-version") + val classpathOptions = SettingKey[ClasspathOptions]("classpath-options") val webappDir = SettingKey[File]("webapp-dir")