summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordcaoyuan <dcaoyuan@epfl.ch>2009-11-27 21:15:24 +0000
committerdcaoyuan <dcaoyuan@epfl.ch>2009-11-27 21:15:24 +0000
commitcf92cfb928f8a3ff5b178e438ee7bb9b8136086b (patch)
tree88c651b118b33354616c385fd6635d61d6ee23dc
parentd56190908fa2f4fab3a1beb46a68a39d81f475e3 (diff)
downloadscala-cf92cfb928f8a3ff5b178e438ee7bb9b8136086b.tar.gz
scala-cf92cfb928f8a3ff5b178e438ee7bb9b8136086b.tar.bz2
scala-cf92cfb928f8a3ff5b178e438ee7bb9b8136086b.zip
Added -make option transitivenocp which won't c...
Added -make option transitivenocp which won't check classpath, so some build tools such as maven can manage this by itself
-rw-r--r--src/compiler/scala/tools/nsc/Settings.scala2
-rw-r--r--src/compiler/scala/tools/nsc/dependencies/DependencyAnalysis.scala11
2 files changed, 9 insertions, 4 deletions
diff --git a/src/compiler/scala/tools/nsc/Settings.scala b/src/compiler/scala/tools/nsc/Settings.scala
index 50ef58232b..22dd700d1e 100644
--- a/src/compiler/scala/tools/nsc/Settings.scala
+++ b/src/compiler/scala/tools/nsc/Settings.scala
@@ -748,7 +748,7 @@ trait ScalacSettings {
val extdirs = StringSetting ("-extdirs", "dirs", "Override location of installed extensions", extdirsDefault)
val debuginfo = DebugSetting ("-g", "Specify level of generated debugging info", List("none", "source", "line", "vars", "notailcalls"), "vars", "vars")
val help = BooleanSetting ("-help", "Print a synopsis of standard options")
- val make = ChoiceSetting ("-make", "Specify recompilation detection strategy", List("all", "changed", "immediate", "transitive"), "all") .
+ val make = ChoiceSetting ("-make", "Specify recompilation detection strategy", List("all", "changed", "immediate", "transitive", "transitivenocp"), "all") .
withHelpSyntax("-make:<strategy>")
val nowarnings = BooleanSetting ("-nowarn", "Generate no warnings")
val XO = BooleanSetting ("-optimise", "Generates faster bytecode by applying optimisations to the program").withAbbreviation("-optimize")
diff --git a/src/compiler/scala/tools/nsc/dependencies/DependencyAnalysis.scala b/src/compiler/scala/tools/nsc/dependencies/DependencyAnalysis.scala
index c5ac031406..b46a13f447 100644
--- a/src/compiler/scala/tools/nsc/dependencies/DependencyAnalysis.scala
+++ b/src/compiler/scala/tools/nsc/dependencies/DependencyAnalysis.scala
@@ -16,10 +16,15 @@ trait DependencyAnalysis extends SubComponent with Files {
lazy val maxDepth = settings.make.value match {
case "changed" => 0
- case "transitive" => Int.MaxValue
+ case "transitive" | "transitivenocp" => Int.MaxValue
case "immediate" => 1
}
+ def shouldCheckClasspath = settings.make.value != "transitivenocp"
+
+ // todo: order insensible checking and, also checking timestamp?
+ def validateClasspath(cp1: String, cp2: String): Boolean = cp1 == cp2
+
def nameToFile(src: AbstractFile, name : String) =
settings.outputDirs.outputDirFor(src)
.lookupPathUnchecked(name.toString.replace(".", java.io.File.separator) + ".class", false)
@@ -64,9 +69,9 @@ trait DependencyAnalysis extends SubComponent with Files {
dependenciesFile = f
FileDependencies.readFrom(f, toFile) match {
case Some(fd) =>
- val success = fd.classpath == classpath
+ val success = if (shouldCheckClasspath) validateClasspath(fd.classpath, classpath) else true
dependencies = if (success) fd else {
- if(settings.debug.value){
+ if (settings.debug.value) {
println("Classpath has changed. Nuking dependencies");
}
newDeps