mirror of https://github.com/sbt/sbt.git
Code gen no longer needed
This commit is contained in:
parent
319054fa32
commit
887cb7cc3e
|
|
@ -40,7 +40,7 @@ lazy val root = (project in file(".")).
|
|||
lazy val lm = (project in file("librarymanagement")).
|
||||
settings(
|
||||
commonSettings,
|
||||
libraryDependencies ++= Seq(interfaceProj, crossProj, logProj % "compile;test->test", ioProj % "compile;test->test", collectionProj),
|
||||
libraryDependencies ++= Seq(interfaceProj, logProj % "compile;test->test", ioProj % "compile;test->test", collectionProj),
|
||||
libraryDependencies ++= Seq(ivy, jsch, sbtSerialization, scalaReflect.value, launcherInterface),
|
||||
name := "librarymanagement"
|
||||
)
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
package ${{cross.package0}}.${{cross.package1}}
|
||||
package sbt.cross
|
||||
|
||||
object CrossVersionUtil
|
||||
{
|
||||
|
|
@ -15,12 +15,12 @@ object CrossVersionUtil
|
|||
def isDisabled(s: String): Boolean = (s == falseString) || (s == noneString) || (s == disabledString)
|
||||
def isBinary(s: String): Boolean = (s == binaryString)
|
||||
|
||||
private[${{cross.package0}}] def isSbtApiCompatible(v: String): Boolean = sbtApiVersion(v).isDefined
|
||||
private[sbt] def isSbtApiCompatible(v: String): Boolean = sbtApiVersion(v).isDefined
|
||||
/** Returns sbt binary interface x.y API compatible with the given version string v.
|
||||
* RCs for x.y.0 are considered API compatible.
|
||||
* Compatibile versions include 0.12.0-1 and 0.12.0-RC1 for Some(0, 12).
|
||||
*/
|
||||
private[${{cross.package0}}] def sbtApiVersion(v: String): Option[(Int, Int)] =
|
||||
private[sbt] def sbtApiVersion(v: String): Option[(Int, Int)] =
|
||||
{
|
||||
val ReleaseV = """(\d+)\.(\d+)\.(\d+)(-\d+)?""".r
|
||||
val CandidateV = """(\d+)\.(\d+)\.(\d+)(-RC\d+)""".r
|
||||
|
|
@ -32,11 +32,11 @@ object CrossVersionUtil
|
|||
case _ => None
|
||||
}
|
||||
}
|
||||
private[${{cross.package0}}] def isScalaApiCompatible(v: String): Boolean = scalaApiVersion(v).isDefined
|
||||
private[sbt] def isScalaApiCompatible(v: String): Boolean = scalaApiVersion(v).isDefined
|
||||
/** Returns Scala binary interface x.y API compatible with the given version string v.
|
||||
* Compatibile versions include 2.10.0-1 and 2.10.1-M1 for Some(2, 10), but not 2.10.0-RC1.
|
||||
*/
|
||||
private[${{cross.package0}}] def scalaApiVersion(v: String): Option[(Int, Int)] =
|
||||
private[sbt] def scalaApiVersion(v: String): Option[(Int, Int)] =
|
||||
{
|
||||
val ReleaseV = """(\d+)\.(\d+)\.(\d+)(-\d+)?""".r
|
||||
val BinCompatV = """(\d+)\.(\d+)\.(\d+)-bin(-.*)?""".r
|
||||
|
|
@ -48,15 +48,15 @@ object CrossVersionUtil
|
|||
case _ => None
|
||||
}
|
||||
}
|
||||
private[${{cross.package0}}] val PartialVersion = """(\d+)\.(\d+)(?:\..+)?""".r
|
||||
private[${{cross.package0}}] def partialVersion(s: String): Option[(Int,Int)] =
|
||||
private[sbt] val PartialVersion = """(\d+)\.(\d+)(?:\..+)?""".r
|
||||
private[sbt] def partialVersion(s: String): Option[(Int,Int)] =
|
||||
s match {
|
||||
case PartialVersion(major, minor) => Some((major.toInt, minor.toInt))
|
||||
case _ => None
|
||||
}
|
||||
def binaryScalaVersion(full: String): String = binaryVersionWithApi(full, TransitionScalaVersion)(scalaApiVersion)
|
||||
def binarySbtVersion(full: String): String = binaryVersionWithApi(full, TransitionSbtVersion)(sbtApiVersion)
|
||||
private[${{cross.package0}}] def binaryVersion(full: String, cutoff: String): String = binaryVersionWithApi(full, cutoff)(scalaApiVersion)
|
||||
private[sbt] def binaryVersion(full: String, cutoff: String): String = binaryVersionWithApi(full, cutoff)(scalaApiVersion)
|
||||
private[this] def isNewer(major: Int, minor: Int, minMajor: Int, minMinor: Int): Boolean =
|
||||
major > minMajor || (major == minMajor && minor >= minMinor)
|
||||
private[this] def binaryVersionWithApi(full: String, cutoff: String)(apiVersion: String => Option[(Int,Int)]): String =
|
||||
|
|
@ -7,7 +7,7 @@ object Dependencies {
|
|||
lazy val ioProj = "org.scala-sbt" % "io" % bootstrapSbtVersion
|
||||
lazy val collectionProj = "org.scala-sbt" % "collections" % bootstrapSbtVersion
|
||||
lazy val logProj = "org.scala-sbt" % "logging" % bootstrapSbtVersion
|
||||
lazy val crossProj = "org.scala-sbt" % "cross" % bootstrapSbtVersion
|
||||
// lazy val crossProj = "org.scala-sbt" % "cross" % bootstrapSbtVersion
|
||||
|
||||
lazy val launcherInterface = "org.scala-sbt" % "launcher-interface" % "1.0.0-M1"
|
||||
lazy val ivy = "org.scala-sbt.ivy" % "ivy" % "2.3.0-sbt-927bc9ded7f8fba63297cddd0d5a3d01d6ad5d8d"
|
||||
|
|
|
|||
Loading…
Reference in New Issue