mirror of https://github.com/sbt/sbt.git
Don't force scala version if autoScalaLibrary is false
This commit is contained in:
parent
ce6c7a2c64
commit
594eb47bc5
|
|
@ -814,6 +814,8 @@ object Tasks {
|
|||
|
||||
val (currentProject, fallbackDependencies, configGraphs) = currentProjectTask.value
|
||||
|
||||
val autoScalaLib = autoScalaLibrary.value
|
||||
|
||||
val resolvers = resolversTask.value
|
||||
|
||||
// TODO Warn about possible duplicated modules from source repositories?
|
||||
|
|
@ -909,7 +911,7 @@ object Tasks {
|
|||
forceVersions =
|
||||
// order matters here
|
||||
userForceVersions ++
|
||||
(if (configs("compile") || configs("scala-tool")) forcedScalaModules(so, sv) else Map()) ++
|
||||
(if (autoScalaLib && (configs("compile") || configs("scala-tool"))) forcedScalaModules(so, sv) else Map()) ++
|
||||
interProjectDependencies.map(_.moduleVersion),
|
||||
projectCache = parentProjectCache,
|
||||
mapDependencies = if (typelevel && (configs("compile") || configs("scala-tool"))) typelevelOrgSwap else None
|
||||
|
|
|
|||
|
|
@ -0,0 +1,20 @@
|
|||
autoScalaLibrary := false
|
||||
libraryDependencies += "com.chuusai" % "shapeless_2.12" % "2.3.2"
|
||||
|
||||
val checkScalaLibrary = TaskKey[Unit]("checkScalaLibrary")
|
||||
|
||||
checkScalaLibrary := {
|
||||
val scalaLibsJars = managedClasspath
|
||||
.in(Compile)
|
||||
.value
|
||||
.map(_.data.getName)
|
||||
.filter(_.startsWith("scala-library"))
|
||||
.sorted
|
||||
val expectedScalaLibsJars = Seq(
|
||||
"scala-library-2.12.0.jar"
|
||||
)
|
||||
assert(
|
||||
scalaLibsJars == expectedScalaLibsJars,
|
||||
s"$scalaLibsJars != $expectedScalaLibsJars"
|
||||
)
|
||||
}
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
{
|
||||
val pluginVersion = sys.props.getOrElse(
|
||||
"plugin.version",
|
||||
throw new RuntimeException(
|
||||
"""|The system property 'plugin.version' is not defined.
|
||||
|Specify this property using the scriptedLaunchOpts -D.""".stripMargin
|
||||
)
|
||||
)
|
||||
|
||||
addSbtPlugin("io.get-coursier" % "sbt-coursier" % pluginVersion)
|
||||
}
|
||||
|
|
@ -0,0 +1 @@
|
|||
> checkScalaLibrary
|
||||
Loading…
Reference in New Issue