mirror of https://github.com/sbt/sbt.git
Override scala organization and version transitively at the Ivy level
This commit is contained in:
parent
b6bd05b3a7
commit
1e9bb93285
|
|
@ -1227,7 +1227,7 @@ object Classpaths {
|
|||
projectDependencies.value ++ libraryDependencies.value
|
||||
},
|
||||
ivyScala <<= ivyScala or (scalaHome, scalaVersion in update, scalaBinaryVersion in update, scalaOrganization, sbtPlugin) { (sh, fv, bv, so, plugin) =>
|
||||
Some(new IvyScala(fv, bv, Nil, filterImplicit = false, checkExplicit = true, overrideScalaVersion = plugin, scalaOrganization = so))
|
||||
Some(new IvyScala(fv, bv, Nil, filterImplicit = false, checkExplicit = true, overrideScalaVersion = true, scalaOrganization = so))
|
||||
},
|
||||
artifactPath in makePom <<= artifactPathSetting(artifact in makePom),
|
||||
publishArtifact in makePom := publishMavenStyle.value && publishArtifact.value,
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ object Dependencies {
|
|||
// sbt modules
|
||||
val ioVersion = "1.0.0-M6"
|
||||
val utilVersion = "0.1.0-M13"
|
||||
val librarymanagementVersion = "0.1.0-M11"
|
||||
val librarymanagementVersion = "0.1.0-M12"
|
||||
val zincVersion = "1.0.0-M3"
|
||||
lazy val sbtIO = "org.scala-sbt" %% "io" % ioVersion
|
||||
lazy val utilCollection = "org.scala-sbt" %% "util-collection" % utilVersion
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ lazy val root = (project in file(".")).
|
|||
settings(
|
||||
libraryDependencies <++= baseDirectory(dependencies),
|
||||
scalaVersion := "2.9.2",
|
||||
ivyScala := { ivyScala.value map {_.copy(overrideScalaVersion = sbtPlugin.value)} },
|
||||
autoScalaLibrary <<= baseDirectory(base => !(base / "noscala").exists ),
|
||||
scalaOverride <<= check("scala.App")
|
||||
)
|
||||
|
|
|
|||
|
|
@ -0,0 +1,54 @@
|
|||
organization := "org.dummy"
|
||||
|
||||
scalaOrganization := "org.other"
|
||||
|
||||
scalaVersion := "2.11.8"
|
||||
|
||||
resolvers += Resolver.file("buggy", (baseDirectory in LocalRootProject).value / "repo")(
|
||||
Patterns(
|
||||
ivyPatterns = Seq("[organization]/[module]/[revision]/ivy.xml"),
|
||||
artifactPatterns = Seq("[organization]/[module]/[revision]/dummy.jar"),
|
||||
isMavenCompatible = false,
|
||||
descriptorOptional = true,
|
||||
skipConsistencyCheck = true
|
||||
)
|
||||
)
|
||||
|
||||
libraryDependencies += "org.typelevel" %% "cats" % "0.6.0"
|
||||
|
||||
val checkDependencies = taskKey[Unit]("Checks that dependcies are correct.")
|
||||
|
||||
checkDependencies := {
|
||||
val expected: Set[ModuleID] = Set(
|
||||
"com.github.mpilquist" % "simulacrum_2.11" % "0.7.0",
|
||||
"jline" % "jline" % "2.12.1",
|
||||
"org.other" % "scala-compiler" % "2.11.8",
|
||||
"org.other" % "scala-library" % "2.11.8",
|
||||
"org.other" % "scala-reflect" % "2.11.8",
|
||||
"org.scala-lang.modules" % "scala-parser-combinators_2.11" % "1.0.4",
|
||||
"org.scala-lang.modules" % "scala-xml_2.11" % "1.0.5",
|
||||
"org.scala-sbt" % "test-interface" % "1.0",
|
||||
"org.scalacheck" % "scalacheck_2.11" % "1.12.5",
|
||||
"org.typelevel" % "catalysts-macros_2.11" % "0.0.2",
|
||||
"org.typelevel" % "catalysts-platform_2.11" % "0.0.2",
|
||||
"org.typelevel" % "cats-core_2.11" % "0.6.0",
|
||||
"org.typelevel" % "cats-free_2.11" % "0.6.0",
|
||||
"org.typelevel" % "cats-kernel-laws_2.11" % "0.6.0",
|
||||
"org.typelevel" % "cats-kernel_2.11" % "0.6.0",
|
||||
"org.typelevel" % "cats-laws_2.11" % "0.6.0",
|
||||
"org.typelevel" % "cats-macros_2.11" % "0.6.0",
|
||||
"org.typelevel" % "cats_2.11" % "0.6.0",
|
||||
"org.typelevel" % "discipline_2.11" % "0.4",
|
||||
"org.typelevel" % "machinist_2.11" % "0.4.1",
|
||||
"org.typelevel" % "macro-compat_2.11" % "1.1.0"
|
||||
)
|
||||
|
||||
val resolved: Set[ModuleID] =
|
||||
(for {
|
||||
c <- update.value.configurations
|
||||
m <- c.modules
|
||||
if !m.evicted
|
||||
} yield m.module.copy(extraAttributes = Map.empty)).toSet
|
||||
|
||||
assert(resolved == expected)
|
||||
}
|
||||
|
|
@ -0,0 +1,37 @@
|
|||
<?xml version='1.0' encoding='ISO-8859-1'?>
|
||||
<ivy-module version="2.0" xmlns:e="http://ant.apache.org/ivy/extra">
|
||||
<info publication="20160520164059" status="release" revision="2.11.8" module="scala-compiler" organisation="org.other">
|
||||
<license url="http://www.scala-lang.org/license.html" name="BSD 3-Clause"/>
|
||||
<description homepage="http://www.scala-lang.org">
|
||||
Scala Compiler
|
||||
</description>
|
||||
</info>
|
||||
<configurations>
|
||||
<conf description="" visibility="public" name="compile"/>
|
||||
<conf extends="compile" description="" visibility="public" name="runtime"/>
|
||||
<conf extends="runtime" description="" visibility="public" name="test"/>
|
||||
<conf description="" visibility="public" name="provided"/>
|
||||
<conf description="" visibility="public" name="optional"/>
|
||||
<conf description="" visibility="public" name="sources"/>
|
||||
<conf description="" visibility="public" name="docs"/>
|
||||
<conf description="" visibility="public" name="pom"/>
|
||||
<conf extends="runtime" description="Default" visibility="public" name="default"/>
|
||||
</configurations>
|
||||
<publications>
|
||||
<artifact conf="pom" ext="pom" type="pom" name="scala-compiler"/>
|
||||
<artifact conf="compile" ext="jar" type="jar" name="scala-compiler"/>
|
||||
<artifact e:classifier="sources" conf="sources" ext="jar" type="src" name="scala-compiler"/>
|
||||
<artifact e:classifier="javadoc" conf="docs" ext="jar" type="doc" name="scala-compiler"/>
|
||||
</publications>
|
||||
<dependencies>
|
||||
<dependency conf="compile->default(compile)" rev="2.11.8" name="scala-library" org="org.other"/>
|
||||
<dependency conf="compile->default(compile)" rev="2.11.8" name="scala-reflect" org="org.other"/>
|
||||
<dependency conf="compile->default(compile)" rev="1.0.5" name="scala-xml_2.11" org="org.scala-lang.modules">
|
||||
<exclude matcher="exact" conf="" ext="*" type="*" name="*" module="*" org="org.scala-lang"/>
|
||||
</dependency>
|
||||
<dependency conf="compile->default(compile)" rev="1.0.4" name="scala-parser-combinators_2.11" org="org.scala-lang.modules">
|
||||
<exclude matcher="exact" conf="" ext="*" type="*" name="*" module="*" org="org.scala-lang"/>
|
||||
</dependency>
|
||||
<dependency conf="optional->default(compile)" rev="2.12.1" name="jline" org="jline"/>
|
||||
</dependencies>
|
||||
</ivy-module>
|
||||
|
|
@ -0,0 +1,28 @@
|
|||
<?xml version='1.0' encoding='ISO-8859-1'?>
|
||||
<ivy-module version="2.0" xmlns:e="http://ant.apache.org/ivy/extra">
|
||||
<info publication="20160520164058" status="release" revision="2.11.8" module="scala-library" organisation="org.other">
|
||||
<license url="http://www.scala-lang.org/license.html" name="BSD 3-Clause"/>
|
||||
<description homepage="http://www.scala-lang.org">
|
||||
Scala Standard Library
|
||||
</description>
|
||||
</info>
|
||||
<configurations>
|
||||
<conf description="" visibility="public" name="compile"/>
|
||||
<conf extends="compile" description="" visibility="public" name="runtime"/>
|
||||
<conf extends="runtime" description="" visibility="public" name="test"/>
|
||||
<conf description="" visibility="public" name="provided"/>
|
||||
<conf description="" visibility="public" name="optional"/>
|
||||
<conf description="" visibility="public" name="sources"/>
|
||||
<conf description="" visibility="public" name="docs"/>
|
||||
<conf description="" visibility="public" name="pom"/>
|
||||
<conf extends="runtime" description="Default" visibility="public" name="default"/>
|
||||
</configurations>
|
||||
<publications>
|
||||
<artifact conf="pom" ext="pom" type="pom" name="scala-library"/>
|
||||
<artifact conf="compile" ext="jar" type="jar" name="scala-library"/>
|
||||
<artifact e:classifier="sources" conf="sources" ext="jar" type="src" name="scala-library"/>
|
||||
<artifact e:classifier="javadoc" conf="docs" ext="jar" type="doc" name="scala-library"/>
|
||||
</publications>
|
||||
<dependencies>
|
||||
</dependencies>
|
||||
</ivy-module>
|
||||
|
|
@ -0,0 +1,29 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ivy-module version="2.0" xmlns:e="http://ant.apache.org/ivy/extra">
|
||||
<info organisation="org.other" module="scala-reflect" revision="2.11.8" status="release" publication="20160520164058">
|
||||
<license name="BSD 3-Clause" url="http://www.scala-lang.org/license.html"/>
|
||||
<description homepage="http://www.scala-lang.org">
|
||||
Scala Reflection Library
|
||||
</description>
|
||||
</info>
|
||||
<configurations>
|
||||
<conf name="compile" visibility="public" description=""/>
|
||||
<conf name="runtime" visibility="public" description="" extends="compile"/>
|
||||
<conf name="test" visibility="public" description="" extends="runtime"/>
|
||||
<conf name="provided" visibility="public" description=""/>
|
||||
<conf name="optional" visibility="public" description=""/>
|
||||
<conf name="sources" visibility="public" description=""/>
|
||||
<conf name="docs" visibility="public" description=""/>
|
||||
<conf name="pom" visibility="public" description=""/>
|
||||
<conf name="default" visibility="public" description="Default" extends="runtime"/>
|
||||
</configurations>
|
||||
<publications>
|
||||
<artifact name="scala-reflect" type="pom" ext="pom" conf="pom"/>
|
||||
<artifact name="scala-reflect" type="jar" ext="jar" conf="compile"/>
|
||||
<artifact name="scala-reflect" type="src" ext="jar" conf="sources" e:classifier="sources"/>
|
||||
<artifact name="scala-reflect" type="doc" ext="jar" conf="docs" e:classifier="javadoc"/>
|
||||
</publications>
|
||||
<dependencies>
|
||||
<dependency org="org.other" name="scala-library" rev="2.11.8" conf="compile->default(compile)"/>
|
||||
</dependencies>
|
||||
</ivy-module>
|
||||
|
|
@ -0,0 +1 @@
|
|||
> checkDependencies
|
||||
|
|
@ -28,3 +28,5 @@ libraryDependencies += "com.novocode" % "junit-interface" % "0.11" % "test"
|
|||
libraryDependencies += "com.typesafe.akka" %% "akka-actor" % "2.3.3" % "test"
|
||||
|
||||
scalaVersion := "2.11.0"
|
||||
|
||||
ivyScala := ivyScala.value map {_.copy(overrideScalaVersion = sbtPlugin.value)}
|
||||
|
|
|
|||
Loading…
Reference in New Issue