diff --git a/src/main/scala/sbt/BasicProjectTypes.scala b/src/main/scala/sbt/BasicProjectTypes.scala index 299e21631..b512e70d1 100644 --- a/src/main/scala/sbt/BasicProjectTypes.scala +++ b/src/main/scala/sbt/BasicProjectTypes.scala @@ -254,7 +254,7 @@ trait BasicManagedProject extends ManagedProject with ReflectiveManagedProject w Configurations.removeDuplicates(Configurations.defaultMavenConfigurations ++ reflective ++ extra) } else - reflective ++ extraDefaultConfigurations + reflective ++ extra } def extraDefaultConfigurations: List[Configuration] = Nil def useIntegrationTestConfiguration = false diff --git a/src/main/scala/sbt/FileUtilities.scala b/src/main/scala/sbt/FileUtilities.scala index 6bb4ff04c..4174d9ab6 100644 --- a/src/main/scala/sbt/FileUtilities.scala +++ b/src/main/scala/sbt/FileUtilities.scala @@ -148,12 +148,12 @@ object FileUtilities nextEntry.setTime(sourceFile.lastModified) output.putNextEntry(nextEntry) transferAndClose(new FileInputStream(sourceFile), output, log) + output.closeEntry() } else log.warn("\tSource " + source + " does not exist.") } sources.foreach(add) - output.closeEntry() None } diff --git a/src/main/scala/sbt/ManageDependencies.scala b/src/main/scala/sbt/ManageDependencies.scala index d7bfb4f4f..e136e64b7 100644 --- a/src/main/scala/sbt/ManageDependencies.scala +++ b/src/main/scala/sbt/ManageDependencies.scala @@ -235,7 +235,10 @@ object ManageDependencies val (module, conf) = moduleAndConf val explicitCheck = if(check.checkExplicit) + { + log.debug("Checking explicit Scala dependencies") checkDependencies(module, check.scalaVersion, check.configurations) + } else None explicitCheck match @@ -243,15 +246,18 @@ object ManageDependencies case None => if(check.filterImplicit) { + log.debug("Filtering transitive Scala dependencies") val asDefault = toDefaultModuleDescriptor(module) - excludeScalaJars(asDefault, check.configurations) + excludeScalaJars(asDefault, check.configurations, config.log) Right( (asDefault, conf) ) } else Right(moduleAndConf) case Some(err) => Left(err) } - case None => Right(moduleAndConf) + case None => + log.debug("Not checking Scala dependencies") + Right(moduleAndConf) } this.synchronized // Ivy is not thread-safe. In particular, it uses a static DocumentBuilder, which is not thread-safe @@ -294,7 +300,7 @@ object ManageDependencies /** Adds exclusions for the scala library and compiler jars so that they are not downloaded. This is * done because normally these jars are already on the classpath and cannot/should not be overridden. The version * of Scala to use is done by setting scala.version in the project definition. */ - private def excludeScalaJars(module: DefaultModuleDescriptor, configurations: Iterable[Configuration]) + private def excludeScalaJars(module: DefaultModuleDescriptor, configurations: Iterable[Configuration], log: Logger) { val configurationNames = { @@ -310,7 +316,7 @@ object ManageDependencies } } def excludeScalaJar(name: String): Unit = - module.addExcludeRule(excludeRule(ScalaArtifacts.Organization, name, configurationNames)) + module.addExcludeRule(excludeRule(ScalaArtifacts.Organization, name, configurationNames, log)) excludeScalaJar(ScalaArtifacts.LibraryID) excludeScalaJar(ScalaArtifacts.CompilerID) } @@ -325,9 +331,10 @@ object ManageDependencies } /** Creates an ExcludeRule that excludes artifacts with the given module organization and name for * the given configurations. */ - private def excludeRule(organization: String, name: String, configurationNames: Iterable[String]): ExcludeRule = + private def excludeRule(organization: String, name: String, configurationNames: Iterable[String], log: Logger): ExcludeRule = { val artifact = new ArtifactId(ModuleId.newInstance(organization, name), "*", "*", "*") + log.debug("Excluding " + artifact + " in " + configurationNames.mkString(", ")) val rule = new DefaultExcludeRule(artifact, ExactPatternMatcher.INSTANCE, Collections.emptyMap[AnyRef,AnyRef]) configurationNames.foreach(rule.addConfiguration) rule diff --git a/src/main/scala/sbt/Project.scala b/src/main/scala/sbt/Project.scala index d1b6dcaad..19e88d85a 100644 --- a/src/main/scala/sbt/Project.scala +++ b/src/main/scala/sbt/Project.scala @@ -214,10 +214,10 @@ trait Project extends TaskManager with Dag[Project] with BasicEnvironment * version of Scala being used to build the project. ScalaVersion.current and ScalaVersion.cross should be used * to read the version of Scala building the project. This should only be used to change the version of Scala used * for normal development (not cross-building)*/ - final val scalaVersion = propertyOptional[String]("") - final val sbtVersion = propertyOptional[String]("") + final val scalaVersion = propertyOptional[String]("", true) + final val sbtVersion = propertyOptional[String]("", true) final val projectInitialize = propertyOptional[Boolean](false) - final val projectScratch = propertyOptional[Boolean](false) + final val projectScratch = propertyOptional[Boolean](false, true) /** If this project is cross-building, returns `base` with an additional path component containing the scala version. * Otherwise, this returns `base`. diff --git a/src/main/scala/sbt/ScalaProject.scala b/src/main/scala/sbt/ScalaProject.scala index a6e42e9b2..c894637c1 100644 --- a/src/main/scala/sbt/ScalaProject.scala +++ b/src/main/scala/sbt/ScalaProject.scala @@ -120,8 +120,8 @@ trait ScalaProject extends SimpleScalaProject with FileTasks with MultiTaskProje } completeWith(classNames(conditional, compilePath)) private def classNames(conditional: CompileConditional, compilePath: Path) = { - val classes = conditional.analysis.allProducts.flatMap(Path.relativize(compilePath, _)) - classes.map(_.relativePath.replace(java.io.File.separatorChar, '.').toList.dropRight(".class".length).mkString).toSeq + val classes = conditional.analysis.allProducts.flatMap(path => Path.relativize(compilePath.asFile, path.asFile)) + classes.map(_.replace(java.io.File.separatorChar, '.').toList.dropRight(".class".length).mkString).toSeq } def consoleTask(classpath : PathFinder): Task =