mirror of https://github.com/sbt/sbt.git
Merge pull request #267 from alexarchambault/topic/scala-org
Take into account scalaOrganization setting
This commit is contained in:
commit
bde69ecb10
|
|
@ -212,12 +212,15 @@ object Tasks {
|
|||
// are cached
|
||||
private val reportsCache = new mutable.HashMap[ReportCacheKey, UpdateReport]
|
||||
|
||||
private def forcedScalaModules(scalaVersion: String): Map[Module, String] =
|
||||
private def forcedScalaModules(
|
||||
scalaOrganization: String,
|
||||
scalaVersion: String
|
||||
): Map[Module, String] =
|
||||
Map(
|
||||
Module("org.scala-lang", "scala-library") -> scalaVersion,
|
||||
Module("org.scala-lang", "scala-compiler") -> scalaVersion,
|
||||
Module("org.scala-lang", "scala-reflect") -> scalaVersion,
|
||||
Module("org.scala-lang", "scalap") -> scalaVersion
|
||||
Module(scalaOrganization, "scala-library") -> scalaVersion,
|
||||
Module(scalaOrganization, "scala-compiler") -> scalaVersion,
|
||||
Module(scalaOrganization, "scala-reflect") -> scalaVersion,
|
||||
Module(scalaOrganization, "scalap") -> scalaVersion
|
||||
)
|
||||
|
||||
private def projectDescription(project: Project) =
|
||||
|
|
@ -270,7 +273,9 @@ object Tasks {
|
|||
|
||||
val log = streams.value.log
|
||||
|
||||
val sv = scalaVersion.value // is this always defined? (e.g. for Java only projects?)
|
||||
// are these always defined? (e.g. for Java only projects?)
|
||||
val so = scalaOrganization.value
|
||||
val sv = scalaVersion.value
|
||||
val sbv = scalaBinaryVersion.value
|
||||
|
||||
val userForceVersions = dependencyOverrides.value.map(
|
||||
|
|
@ -348,7 +353,7 @@ object Tasks {
|
|||
// order matters here
|
||||
userForceVersions ++
|
||||
sourceRepositoriesForcedDependencies ++
|
||||
forcedScalaModules(sv) ++
|
||||
forcedScalaModules(so, sv) ++
|
||||
projects.map(_.moduleVersion)
|
||||
)
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,13 @@
|
|||
scalaOrganization := "org.typelevel"
|
||||
scalaVersion := "2.11.7"
|
||||
scalacOptions += "-Xexperimental"
|
||||
|
||||
// no effect, as the right version is forced anyway (to scalaVersion.value)
|
||||
libraryDependencies += "org.typelevel" % "scala-library" % "2.11.12345"
|
||||
|
||||
coursierCachePolicies := {
|
||||
if (sys.props("os.name").startsWith("Windows"))
|
||||
coursierCachePolicies.value
|
||||
else
|
||||
Seq(coursier.CachePolicy.ForceDownload)
|
||||
}
|
||||
|
|
@ -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,8 @@
|
|||
import java.io.File
|
||||
import java.nio.file.Files
|
||||
|
||||
object Main extends App {
|
||||
val n': 2.type = 2
|
||||
|
||||
Files.write(new File("output").toPath, "OK".getBytes("UTF-8"))
|
||||
}
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
$ delete output
|
||||
> run
|
||||
$ exists output
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
scalaOrganization := "org.typelevel"
|
||||
scalaVersion := "2.11.7"
|
||||
scalacOptions += "-Xexperimental"
|
||||
|
||||
coursierCachePolicies := {
|
||||
if (sys.props("os.name").startsWith("Windows"))
|
||||
coursierCachePolicies.value
|
||||
else
|
||||
Seq(coursier.CachePolicy.ForceDownload)
|
||||
}
|
||||
|
|
@ -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,8 @@
|
|||
import java.io.File
|
||||
import java.nio.file.Files
|
||||
|
||||
object Main extends App {
|
||||
val n': 2.type = 2
|
||||
|
||||
Files.write(new File("output").toPath, "OK".getBytes("UTF-8"))
|
||||
}
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
$ delete output
|
||||
> run
|
||||
$ exists output
|
||||
Loading…
Reference in New Issue