Remove 2.10 stuff

This commit is contained in:
Alexandre Archambault 2018-09-20 16:17:55 +02:00
parent 826ac55482
commit db1884a84e
36 changed files with 35 additions and 219 deletions

View File

@ -25,35 +25,18 @@ matrix:
sudo: required sudo: required
services: services:
- docker - docker
- env: SCALA_VERSION=2.10
os: linux
jdk: oraclejdk8
sudo: required
services:
- docker
- env: SCALA_VERSION=2.12 SBT_COURSIER=1 - env: SCALA_VERSION=2.12 SBT_COURSIER=1
os: linux os: linux
jdk: oraclejdk8 jdk: oraclejdk8
- env: SCALA_VERSION=2.12 SBT_SHADING=1 - env: SCALA_VERSION=2.12 SBT_SHADING=1
os: linux os: linux
jdk: oraclejdk8 jdk: oraclejdk8
- env: SCALA_VERSION=2.10 SBT_COURSIER=1
os: linux
jdk: oraclejdk8
services:
- docker
- env: SCALA_VERSION=2.10 SBT_SHADING=1
os: linux
jdk: oraclejdk8
- env: SCALA_VERSION=2.12 SCALA_JS=1 - env: SCALA_VERSION=2.12 SCALA_JS=1
os: linux os: linux
jdk: oraclejdk8 jdk: oraclejdk8
- env: SCALA_VERSION=2.11 SCALA_JS=1 - env: SCALA_VERSION=2.11 SCALA_JS=1
os: linux os: linux
jdk: oraclejdk8 jdk: oraclejdk8
- env: SCALA_VERSION=2.10 SCALA_JS=1
os: linux
jdk: oraclejdk8
- os: linux - os: linux
jdk: oraclejdk8 jdk: oraclejdk8
script: script:

View File

@ -25,16 +25,12 @@ build_script:
- ps: Start-Job -filepath .\scripts\start-it-auth-server.ps1 -ArgumentList $pwd, $env:TEST_REPOSITORY_HOST, $env:TEST_REPOSITORY_PORT, $env:TEST_REPOSITORY_USER, $env:TEST_REPOSITORY_PASSWORD - ps: Start-Job -filepath .\scripts\start-it-auth-server.ps1 -ArgumentList $pwd, $env:TEST_REPOSITORY_HOST, $env:TEST_REPOSITORY_PORT, $env:TEST_REPOSITORY_USER, $env:TEST_REPOSITORY_PASSWORD
- sbt scala212 coreJVM/publishLocal cacheJVM/publishLocal extra/publishLocal scalazJVM/publishLocal cli/publishLocal - sbt scala212 coreJVM/publishLocal cacheJVM/publishLocal extra/publishLocal scalazJVM/publishLocal cli/publishLocal
- sbt scala211 compile coreJVM/publishLocal - sbt scala211 compile coreJVM/publishLocal
- sbt scala210 compile
test_script: test_script:
- sbt scala212 testsJVM/test - sbt scala212 testsJVM/test
- sbt scala211 testsJVM/test - sbt scala211 testsJVM/test
- sbt scala210 testsJVM/test
- sbt scala212 testsJVM/it:test - sbt scala212 testsJVM/it:test
- sbt scala211 testsJVM/it:test - sbt scala211 testsJVM/it:test
- sbt scala210 testsJVM/it:test - sbt scala212 sbt-coursier/scripted sbt-shading/scripted
- sbt scala212 "sbt-coursier/scripted sbt-coursier/simple" "sbt-shading/scripted sbt-shading/*" # for sbt 1.0
- sbt scala210 "sbt-coursier/scripted sbt-coursier/*" "sbt-coursier/scripted sbt-coursier-0.13/*" "sbt-shading/scripted sbt-shading/*" "sbt-shading/scripted sbt-shading-0.13/*" # for sbt 0.13
branches: branches:
only: only:
- master - master

View File

@ -10,11 +10,10 @@ lazy val core = crossProject(JSPlatform, JVMPlatform)
.jvmConfigure(_.enablePlugins(ShadingPlugin)) .jvmConfigure(_.enablePlugins(ShadingPlugin))
.jvmSettings( .jvmSettings(
shading, shading,
quasiQuotesIfNecessary,
scalaXmlIfNecessary,
libs ++= Seq( libs ++= Seq(
Deps.fastParse % "shaded", Deps.fastParse % "shaded",
Deps.jsoup % "shaded" Deps.jsoup % "shaded",
Deps.scalaXml
), ),
shadeNamespaces ++= Set( shadeNamespaces ++= Set(
"org.jsoup", "org.jsoup",
@ -52,7 +51,7 @@ lazy val tests = crossProject(JSPlatform, JVMPlatform)
dontPublish, dontPublish,
hasITs, hasITs,
coursierPrefix, coursierPrefix,
libs += Deps.scalaAsync.value, libs += Deps.scalaAsync,
utest, utest,
sharedTestResources sharedTestResources
) )
@ -71,7 +70,7 @@ lazy val `proxy-tests` = project
coursierPrefix, coursierPrefix,
libs ++= Seq( libs ++= Seq(
Deps.dockerClient, Deps.dockerClient,
Deps.scalaAsync.value, Deps.scalaAsync,
Deps.slf4JNop Deps.slf4JNop
), ),
utest, utest,

View File

@ -1,6 +0,0 @@
package coursier.cli
// dummy app to keep proguard quiet in 2.10
object Coursier {
def main(args: Array[String]): Unit = {}
}

View File

@ -81,13 +81,8 @@ object Aliases {
scriptedSettings.filterNot(_.key.key.label == libraryDependencies.key.label) ++ Seq( scriptedSettings.filterNot(_.key.key.label == libraryDependencies.key.label) ++ Seq(
libraryDependencies ++= { libraryDependencies ++= {
scalaBinaryVersion.value match { scalaBinaryVersion.value match {
case "2.10" | "2.12" => case "2.12" =>
partialVersion(scriptedSbt.value) match { partialVersion(scriptedSbt.value) match {
case Some((0, 13)) =>
Seq(
"org.scala-sbt" % "scripted-sbt" % scriptedSbt.value % ScriptedConf,
"org.scala-sbt" % "sbt-launch" % scriptedSbt.value % ScriptedLaunchConf
)
case Some((1, _)) => case Some((1, _)) =>
Seq( Seq(
"org.scala-sbt" %% "scripted-sbt" % scriptedSbt.value % ScriptedConf, "org.scala-sbt" %% "scripted-sbt" % scriptedSbt.value % ScriptedConf,

View File

@ -24,14 +24,7 @@ object Deps {
sbtPluginExtra("com.jsuereth" % "sbt-pgp" % ver, sbtv, sv) sbtPluginExtra("com.jsuereth" % "sbt-pgp" % ver, sbtv, sv)
} }
def scalaAsync = Def.setting { def scalaAsync = "org.scala-lang.modules" %% "scala-async" % "0.9.7"
val version =
if (scalaBinaryVersion.value == "2.10") "0.9.5"
else "0.9.7"
"org.scala-lang.modules" %% "scala-async" % version
}
def jarjar = "io.get-coursier.jarjar" % "jarjar-core" % "1.0.1-coursier-1" def jarjar = "io.get-coursier.jarjar" % "jarjar-core" % "1.0.1-coursier-1"

View File

@ -3,9 +3,8 @@ object ScalaVersion {
def scala212 = "2.12.6" def scala212 = "2.12.6"
def scala211 = "2.11.12" def scala211 = "2.11.12"
def scala210 = "2.10.7"
val versions = Seq(scala212, scala211, scala210) val versions = Seq(scala212, scala211)
val map = versions val map = versions
.map { v => .map { v =>

View File

@ -30,7 +30,7 @@ object Settings {
organization := "io.get-coursier", organization := "io.get-coursier",
scalazBintrayRepository, scalazBintrayRepository,
sonatypeRepository("releases"), sonatypeRepository("releases"),
crossScalaVersions := Seq(scala212, scala211, scala210), // defined for all projects to trump sbt-doge crossScalaVersions := Seq(scala212, scala211), // defined for all projects to trump sbt-doge
scalacOptions ++= Seq( scalacOptions ++= Seq(
"-target:jvm-1.8", "-target:jvm-1.8",
"-feature", "-feature",
@ -68,13 +68,7 @@ object Settings {
} }
lazy val shared = javaScalaPluginShared ++ Seq( lazy val shared = javaScalaPluginShared ++ Seq(
scalaVersion := scala212, scalaVersion := scala212
libs ++= {
if (scalaBinaryVersion.value == "2.10")
Seq(compilerPlugin("org.scalamacros" % "paradise" % "2.1.0" cross CrossVersion.full))
else
Seq()
}
) )
lazy val pureJava = javaScalaPluginShared ++ Seq( lazy val pureJava = javaScalaPluginShared ++ Seq(
@ -110,23 +104,6 @@ object Settings {
name := "coursier-" + name.value name := "coursier-" + name.value
} }
lazy val scalaXmlIfNecessary = Seq(
libs ++= {
if (scalaBinaryVersion.value == "2.10") Seq()
else Seq(Deps.scalaXml)
}
)
lazy val quasiQuotesIfNecessary = Seq(
libs ++= {
if (scalaBinaryVersion.value == "2.10")
// directly depending on that one so that it doesn't get shaded
Seq(Deps.quasiQuotes)
else
Nil
}
)
lazy val noTests = Seq( lazy val noTests = Seq(
test.in(Test) := {}, test.in(Test) := {},
testOnly.in(Test) := {} testOnly.in(Test) := {}
@ -159,7 +136,6 @@ object Settings {
) )
val sbtPluginScalaVersions = Map( val sbtPluginScalaVersions = Map(
"0.13" -> "2.10",
"1.0" -> "2.12" "1.0" -> "2.12"
) )
@ -200,11 +176,10 @@ object Settings {
) )
} }
val sbt013Version = "0.13.8"
val sbt10Version = "1.0.2" val sbt10Version = "1.0.2"
val pluginOverrideCrossScalaVersion = Seq( val pluginOverrideCrossScalaVersion = Seq(
crossScalaVersions := Seq(scala212, scala210) crossScalaVersions := Seq(scala212)
) )
lazy val plugin = lazy val plugin =
@ -220,19 +195,19 @@ object Settings {
scriptedBufferLog := false, scriptedBufferLog := false,
sbtPlugin := { sbtPlugin := {
scalaBinaryVersion.value match { scalaBinaryVersion.value match {
case "2.10" | "2.12" => true case "2.12" => true
case _ => false case _ => false
} }
}, },
sbtVersion.in(pluginCrossBuild) := { sbtVersion.in(pluginCrossBuild) := {
scalaBinaryVersion.value match { scalaBinaryVersion.value match {
case "2.10" => sbt013Version
case "2.12" => sbt10Version case "2.12" => sbt10Version
case _ => sbtVersion.in(pluginCrossBuild).value case _ => sbtVersion.in(pluginCrossBuild).value
} }
}, },
resolvers ++= Seq( resolvers ++= Seq(
// added so that 2.10 artifacts of the other modules can be found by // Still necessary?
// added so that 2.12 artifacts of the other modules can be found by
// the too-naive-for-now inter-project resolver of the coursier SBT plugin // the too-naive-for-now inter-project resolver of the coursier SBT plugin
Resolver.sonatypeRepo("snapshots"), Resolver.sonatypeRepo("snapshots"),
// added for sbt-scripted to be fine even with ++2.11.x // added for sbt-scripted to be fine even with ++2.11.x

View File

@ -5,8 +5,6 @@ import sbt.librarymanagement._
import sbt.{ Configuration, Resolver, _ } import sbt.{ Configuration, Resolver, _ }
import sbt.Keys._ import sbt.Keys._
import SbtCompatibility._
object CoursierPlugin extends AutoPlugin { object CoursierPlugin extends AutoPlugin {
override def trigger = allRequirements override def trigger = allRequirements
@ -317,4 +315,19 @@ object CoursierPlugin extends AutoPlugin {
inConfig(Compile)(treeSettings) ++ inConfig(Compile)(treeSettings) ++
inConfig(Test)(treeSettings) inConfig(Test)(treeSettings)
private lazy val needsIvyXmlLocal = Seq(publishLocalConfiguration) ++ getPubConf("makeIvyXmlLocalConfiguration")
private lazy val needsIvyXml = Seq(publishConfiguration) ++ getPubConf("makeIvyXmlConfiguration")
private[this] def getPubConf(method: String): List[TaskKey[PublishConfiguration]] =
try {
val cls = Keys.getClass
val m = cls.getMethod(method)
val task = m.invoke(Keys).asInstanceOf[TaskKey[PublishConfiguration]]
List(task)
} catch {
case _: Throwable => // FIXME Too wide
Nil
}
} }

View File

@ -1,7 +1,4 @@
// for SbtExclusionRule with sbt 1.0
import Compatibility._
scalaVersion := "2.11.8" scalaVersion := "2.11.8"
organization := "io.get-coursier.test" organization := "io.get-coursier.test"
@ -10,5 +7,5 @@ version := "0.1.0-SNAPSHOT"
libraryDependencies += "com.github.alexarchambault" %% "argonaut-shapeless_6.1" % "1.0.0-RC1" libraryDependencies += "com.github.alexarchambault" %% "argonaut-shapeless_6.1" % "1.0.0-RC1"
excludeDependencies += SbtExclusionRule("com.chuusai", "shapeless_2.11") excludeDependencies += sbt.ExclusionRule("com.chuusai", "shapeless_2.11")
excludeDependencies += "io.argonaut" %% "argonaut" excludeDependencies += "io.argonaut" %% "argonaut"

View File

@ -1,5 +0,0 @@
object Compatibility {
val SbtExclusionRule = sbt.ExclusionRule
}

View File

@ -1,6 +1,4 @@
import Compatibility._
lazy val noPomCheck = TaskKey[Unit]("noPomCheck") lazy val noPomCheck = TaskKey[Unit]("noPomCheck")
noPomCheck := { noPomCheck := {

View File

@ -1,8 +0,0 @@
object Compatibility {
implicit class UpdateReportOps(val rep: sbt.UpdateReport) extends AnyVal {
def configuration(conf: sbt.Configuration) =
rep.configuration(conf.name)
}
}

View File

@ -1,6 +1,4 @@
import Compatibility._
val org = "io.get-coursier.scriptedtest" val org = "io.get-coursier.scriptedtest"
val ver = "0.1.0-SNAPSHOT" val ver = "0.1.0-SNAPSHOT"

View File

@ -1,8 +0,0 @@
object Compatibility {
implicit class UpdateReportOps(val rep: sbt.UpdateReport) extends AnyVal {
def configuration(conf: sbt.Configuration) =
rep.configuration(conf.name)
}
}

View File

@ -1,6 +1,4 @@
import Compatibility._
lazy val noJbossInterceptorCheck = TaskKey[Unit]("noJbossInterceptorCheck") lazy val noJbossInterceptorCheck = TaskKey[Unit]("noJbossInterceptorCheck")
noJbossInterceptorCheck := { noJbossInterceptorCheck := {

View File

@ -1,8 +0,0 @@
object Compatibility {
implicit class UpdateReportOps(val rep: sbt.UpdateReport) extends AnyVal {
def configuration(conf: sbt.Configuration) =
rep.configuration(conf.name)
}
}

View File

@ -1,6 +1,4 @@
import Compatibility._
scalaVersion := appConfiguration.value.provider.scalaProvider.version scalaVersion := appConfiguration.value.provider.scalaProvider.version
lazy val updateClassifiersCheck = TaskKey[Unit]("updateClassifiersCheck") lazy val updateClassifiersCheck = TaskKey[Unit]("updateClassifiersCheck")

View File

@ -1,8 +0,0 @@
object Compatibility {
implicit class UpdateReportOps(val rep: sbt.UpdateReport) extends AnyVal {
def configuration(conf: sbt.Configuration) =
rep.configuration(conf.name)
}
}

View File

@ -1,4 +1,3 @@
import Compatibility._
scalaVersion := "2.12.2-bin-typelevel-4" scalaVersion := "2.12.2-bin-typelevel-4"
scalaOrganization := "org.typelevel" scalaOrganization := "org.typelevel"

View File

@ -1,19 +0,0 @@
object Compatibility {
// patch method not available in sbt 0.13.8
implicit class CrossVersionOps(val companion: sbt.CrossVersion.type) extends AnyVal {
def patch: sbt.CrossVersion = new sbt.CrossVersion.Full(patchFun)
}
// adapted from sbt.CrossVersion from the sbt 0.13.16 sources
private val BinCompatV = """(\d+)\.(\d+)\.(\d+)(-\w+)??-bin(-.*)?""".r
private def patchFun(fullVersion: String): String =
fullVersion match {
case BinCompatV(x, y, z, w, _) => s"""$x.$y.$z${if (w == null) "" else w}"""
case other => other
}
}

View File

@ -1,6 +1,4 @@
import Compatibility._
scalaVersion := appConfiguration.value.provider.scalaProvider.version scalaVersion := appConfiguration.value.provider.scalaProvider.version
lazy val updateSbtClassifiersCheck = TaskKey[Unit]("updateSbtClassifiersCheck") lazy val updateSbtClassifiersCheck = TaskKey[Unit]("updateSbtClassifiersCheck")

View File

@ -1,8 +0,0 @@
object Compatibility {
implicit class UpdateReportOps(val rep: sbt.UpdateReport) extends AnyVal {
def configuration(conf: sbt.Configuration) =
rep.configuration(conf.name)
}
}

View File

@ -1,7 +1,4 @@
// for SbtExclusionRule with sbt 1.0
import Compatibility._
enablePlugins(coursier.ShadingPlugin) enablePlugins(coursier.ShadingPlugin)
shadingNamespace := "test.shaded" shadingNamespace := "test.shaded"
shadeNamespaces += "argonaut" shadeNamespaces += "argonaut"
@ -12,7 +9,7 @@ libraryDependencies ++= Seq(
"org.scala-lang" % "scala-reflect" % scalaVersion.value "org.scala-lang" % "scala-reflect" % scalaVersion.value
) )
excludeDependencies += SbtExclusionRule("com.chuusai", "shapeless_2.11") excludeDependencies += sbt.ExclusionRule("com.chuusai", "shapeless_2.11")
scalaVersion := "2.11.8" scalaVersion := "2.11.8"
organization := "io.get-coursier.test" organization := "io.get-coursier.test"

View File

@ -1,5 +0,0 @@
object Compatibility {
val SbtExclusionRule = sbt.ExclusionRule
}

View File

@ -1,10 +0,0 @@
package coursier
object SbtCompatibility {
def needsIvyXmlLocal = List(sbt.Keys.deliverLocalConfiguration)
def needsIvyXml = List(sbt.Keys.deliverConfiguration)
implicit class ResolverCompationExtraOps(val res: sbt.Resolver.type) {
def SbtRepositoryRoot = res.SbtPluginRepositoryRoot
}
}

View File

@ -1,19 +0,0 @@
package coursier
import sbt._, Keys._
object SbtCompatibility {
lazy val needsIvyXmlLocal = Seq(publishLocalConfiguration) ++ getPubConf("makeIvyXmlLocalConfiguration")
lazy val needsIvyXml = Seq(publishConfiguration) ++ getPubConf("makeIvyXmlConfiguration")
private[this] def getPubConf(method: String) =
try {
val cls = Keys.getClass
val m = cls.getMethod(method)
val task = m.invoke(Keys).asInstanceOf[TaskKey[PublishConfiguration]]
List(task)
} catch {
case _: Throwable => // FIXME Too wide
Nil
}
}

View File

@ -32,20 +32,12 @@ sbtShading() {
runSbtCoursierTests() { runSbtCoursierTests() {
addPgpKeys addPgpKeys
if [ "$SCALA_VERSION" = "2.10" ]; then ./scripts/with-test-repo.sh sbt scalaFromEnv sbt-coursier/scripted
CMDS=("sbt-coursier/scripted sbt-coursier/*" "sbt-coursier/scripted sbt-coursier-0.13/*")
else
CMDS=("sbt-coursier/scripted sbt-coursier/simple") # full scripted suite currently taking too long on Travis CI...
fi
./scripts/with-test-repo.sh sbt scalaFromEnv "${CMD[@]}"
sbt scalaFromEnv sbt-pgp-coursier/scripted sbt scalaFromEnv sbt-pgp-coursier/scripted
} }
runSbtShadingTests() { runSbtShadingTests() {
sbt scalaFromEnv "sbt-shading/scripted sbt-shading/*" sbt scalaFromEnv sbt-shading/scripted
if [ "$SCALA_VERSION" = "2.10" ]; then
sbt scalaFromEnv "sbt-shading/scripted sbt-shading-0.13/*"
fi
} }
jsCompile() { jsCompile() {
@ -200,11 +192,11 @@ else
jvmCompile jvmCompile
if sbtCoursier; then if sbtCoursier; then
if [ "$SCALA_VERSION" = "2.10" -o "$SCALA_VERSION" = "2.12" ]; then if [ "$SCALA_VERSION" = "2.12" ]; then
runSbtCoursierTests runSbtCoursierTests
fi fi
elif sbtShading; then elif sbtShading; then
if [ "$SCALA_VERSION" = "2.10" -o "$SCALA_VERSION" = "2.12" ]; then if [ "$SCALA_VERSION" = "2.12" ]; then
runSbtShadingTests runSbtShadingTests
fi fi
else else