diff --git a/main/src/main/scala/sbt/Defaults.scala b/main/src/main/scala/sbt/Defaults.scala index 349152564..d8cb03695 100755 --- a/main/src/main/scala/sbt/Defaults.scala +++ b/main/src/main/scala/sbt/Defaults.scala @@ -275,7 +275,8 @@ object Defaults extends BuildCommon { if (plugin) scalaBase / ("sbt-" + sbtv) else scalaBase } - def compilersSetting = compilers := Compiler.compilers(scalaInstance.value, classpathOptions.value, javaHome.value, ivyConfiguration.value, scalaCompilerBridgeSource.value)(appConfiguration.value, streams.value.log) + def compilersSetting = compilers := Compiler.compilers(scalaInstance.value, classpathOptions.value, javaHome.value, + bootIvyConfiguration.value, scalaCompilerBridgeSource.value)(appConfiguration.value, streams.value.log) lazy val configTasks = docTaskSettings(doc) ++ inTask(compile)(compileInputsSettings) ++ configGlobal ++ compileAnalysisSettings ++ Seq( compile <<= compileTask, @@ -1334,7 +1335,7 @@ object Classpaths { IvyActions.transitiveScratch(is, "sbt", GetClassifiersConfiguration(mod, excludes, c, noExplicitCheck), uwConfig, LogicalClock(state.value.hashCode), Some(depDir), s.log) } } tag (Tags.Update, Tags.Network) - )) + )) ++ Seq(bootIvyConfiguration := (ivyConfiguration in updateSbtClassifiers).value) def deliverTask(config: TaskKey[DeliverConfiguration]): Initialize[Task[File]] = (ivyModule, config, update, streams) map { (module, config, _, s) => IvyActions.deliver(module, config, s.log) } diff --git a/main/src/main/scala/sbt/Keys.scala b/main/src/main/scala/sbt/Keys.scala index 15e6f3e4e..dccc48b23 100644 --- a/main/src/main/scala/sbt/Keys.scala +++ b/main/src/main/scala/sbt/Keys.scala @@ -288,6 +288,8 @@ object Keys { val classpathConfiguration = TaskKey[Configuration]("classpath-configuration", "The configuration used to define the classpath.", CTask) val ivyConfiguration = TaskKey[IvyConfiguration]("ivy-configuration", "General dependency management (Ivy) settings, such as the resolvers and paths to use.", DTask) val ivyConfigurations = SettingKey[Seq[Configuration]]("ivy-configurations", "The defined configurations for dependency management. This may be different from the configurations for Project settings.", BSetting) + // This setting was created to workaround the limitation of derived tasks not being able to use task-scoped task: ivyConfiguration in updateSbtClassifiers + val bootIvyConfiguration = TaskKey[IvyConfiguration]("boot-ivy-configuration", "General dependency management (Ivy) settings, configured to retrieve sbt's components.", DTask) val moduleSettings = TaskKey[ModuleSettings]("module-settings", "Module settings, which configure dependency management for a specific module, such as a project.", DTask) val unmanagedBase = SettingKey[File]("unmanaged-base", "The default directory for manually managed libraries.", ASetting) val updateConfiguration = SettingKey[UpdateConfiguration]("update-configuration", "Configuration for resolving and retrieving managed dependencies.", DSetting) diff --git a/notes/0.13.10/use-ivyConfiguration-in-updateSbtClassifiers-in-compilers-to-fetch-compiler-bridge-sources.markdown b/notes/0.13.10/use-ivyConfiguration-in-updateSbtClassifiers-in-compilers-to-fetch-compiler-bridge-sources.markdown new file mode 100644 index 000000000..f95c35348 --- /dev/null +++ b/notes/0.13.10/use-ivyConfiguration-in-updateSbtClassifiers-in-compilers-to-fetch-compiler-bridge-sources.markdown @@ -0,0 +1,19 @@ + + [@Duhemm]: http://github.com/Duhemm + [2106]: https://github.com/sbt/sbt/pull/2106 + [2197]: https://github.com/sbt/sbt/pull/2197 + [2336]: https://github.com/sbt/sbt/issues/2336 + +### Fixes with compatibility implications + +### Improvements + +- Adds configurable compiler bridge. See below. + +### Bug fixes + +### Configurable Scala compiler bridge + +sbt 0.13.10 adds `scalaCompilerBridgeSource` setting to specify the compiler brigde source. This allows different implementation of the bridge for Scala versions, and also allows future versions of Scala compiler implementation to diverge. The source module will be retrieved using library management configured by `bootIvyConfiguration` task. + +[#2106][2106]/[#2197][2197]/[#2336][2336] by [@Duhemm][@Duhemm] diff --git a/sbt/src/sbt-test/ivy-deps-management/update-classifiers-snapshot-srcs/project/plugins.sbt b/sbt/src/sbt-test/ivy-deps-management/update-classifiers-snapshot-srcs/project/plugins.sbt new file mode 100644 index 000000000..661896f9b --- /dev/null +++ b/sbt/src/sbt-test/ivy-deps-management/update-classifiers-snapshot-srcs/project/plugins.sbt @@ -0,0 +1 @@ +resolvers += Resolver.file("ivy-local", file(sys.props("user.home")) / ".ivy2" / "local")(Resolver.ivyStylePatterns)