diff --git a/sbt-coursier/src/sbt-test/sbt-coursier/no-pom-artifact/build.sbt b/sbt-coursier/src/sbt-test/sbt-coursier/no-pom-artifact/build.sbt index 274b6a675..19c403d7c 100644 --- a/sbt-coursier/src/sbt-test/sbt-coursier/no-pom-artifact/build.sbt +++ b/sbt-coursier/src/sbt-test/sbt-coursier/no-pom-artifact/build.sbt @@ -1,4 +1,6 @@ +import Compatibility._ + lazy val noPomCheck = TaskKey[Unit]("noPomCheck") noPomCheck := { @@ -6,7 +8,7 @@ noPomCheck := { val log = streams.value.log val configReport = update.value - .configuration("compile") + .configuration(Compile) .getOrElse { throw new Exception( "compile configuration not found in update report" diff --git a/sbt-coursier/src/sbt-test/sbt-coursier/no-pom-artifact/project/src/main/scala-2.10/Compatibility.scala b/sbt-coursier/src/sbt-test/sbt-coursier/no-pom-artifact/project/src/main/scala-2.10/Compatibility.scala new file mode 100644 index 000000000..8824f1209 --- /dev/null +++ b/sbt-coursier/src/sbt-test/sbt-coursier/no-pom-artifact/project/src/main/scala-2.10/Compatibility.scala @@ -0,0 +1,8 @@ +object Compatibility { + + implicit class UpdateReportOps(val rep: sbt.UpdateReport) extends AnyVal { + def configuration(conf: sbt.Configuration) = + rep.configuration(conf.name) + } + +} diff --git a/sbt-coursier/src/sbt-test/sbt-coursier/no-pom-artifact/project/src/main/scala-2.12/Compatibility.scala b/sbt-coursier/src/sbt-test/sbt-coursier/no-pom-artifact/project/src/main/scala-2.12/Compatibility.scala new file mode 100644 index 000000000..19835e1be --- /dev/null +++ b/sbt-coursier/src/sbt-test/sbt-coursier/no-pom-artifact/project/src/main/scala-2.12/Compatibility.scala @@ -0,0 +1 @@ +object Compatibility diff --git a/sbt-coursier/src/sbt-test/sbt-coursier/publish-local-sources-javadoc-conf/build.sbt b/sbt-coursier/src/sbt-test/sbt-coursier/publish-local-sources-javadoc-conf/build.sbt index 83b642554..8bebbda09 100644 --- a/sbt-coursier/src/sbt-test/sbt-coursier/publish-local-sources-javadoc-conf/build.sbt +++ b/sbt-coursier/src/sbt-test/sbt-coursier/publish-local-sources-javadoc-conf/build.sbt @@ -1,4 +1,6 @@ +import Compatibility._ + val org = "io.get-coursier.scriptedtest" val ver = "0.1.0-SNAPSHOT" @@ -25,13 +27,13 @@ lazy val shared = Seq( val updateReport = update.value val updateClassifiersReport = updateClassifiers.value - def artifacts(config: String, classifier: Option[String], useClassifiersReport: Boolean = false) = { + def artifacts(classifier: Option[String], useClassifiersReport: Boolean = false) = { val configReport = (if (useClassifiersReport) updateClassifiersReport else updateReport) - .configuration(config) + .configuration(Compile) .getOrElse { throw new Exception( - s"$config configuration not found in update report" + "Compile configuration not found in update report" ) } @@ -44,7 +46,7 @@ lazy val shared = Seq( } log.info( - s"Found ${artifacts.length} artifacts for config $config / classifier $classifier" + + s"Found ${artifacts.length} artifacts for config Compile / classifier $classifier" + (if (useClassifiersReport) " in classifiers report" else "") ) for (a <- artifacts) @@ -53,11 +55,11 @@ lazy val shared = Seq( artifacts } - val compileSourceArtifacts = artifacts("compile", Some("sources")) - val sourceArtifacts = artifacts("compile", Some("sources"), useClassifiersReport = true) + val compileSourceArtifacts = artifacts(Some("sources")) + val sourceArtifacts = artifacts(Some("sources"), useClassifiersReport = true) - val compileDocArtifacts = artifacts("compile", Some("javadoc")) - val docArtifacts = artifacts("compile", Some("javadoc"), useClassifiersReport = true) + val compileDocArtifacts = artifacts(Some("javadoc")) + val docArtifacts = artifacts(Some("javadoc"), useClassifiersReport = true) assert( compileSourceArtifacts.isEmpty, diff --git a/sbt-coursier/src/sbt-test/sbt-coursier/publish-local-sources-javadoc-conf/project/src/main/scala-2.10/Compatibility.scala b/sbt-coursier/src/sbt-test/sbt-coursier/publish-local-sources-javadoc-conf/project/src/main/scala-2.10/Compatibility.scala new file mode 100644 index 000000000..8824f1209 --- /dev/null +++ b/sbt-coursier/src/sbt-test/sbt-coursier/publish-local-sources-javadoc-conf/project/src/main/scala-2.10/Compatibility.scala @@ -0,0 +1,8 @@ +object Compatibility { + + implicit class UpdateReportOps(val rep: sbt.UpdateReport) extends AnyVal { + def configuration(conf: sbt.Configuration) = + rep.configuration(conf.name) + } + +} diff --git a/sbt-coursier/src/sbt-test/sbt-coursier/publish-local-sources-javadoc-conf/project/src/main/scala-2.12/Compatibility.scala b/sbt-coursier/src/sbt-test/sbt-coursier/publish-local-sources-javadoc-conf/project/src/main/scala-2.12/Compatibility.scala new file mode 100644 index 000000000..19835e1be --- /dev/null +++ b/sbt-coursier/src/sbt-test/sbt-coursier/publish-local-sources-javadoc-conf/project/src/main/scala-2.12/Compatibility.scala @@ -0,0 +1 @@ +object Compatibility diff --git a/sbt-coursier/src/sbt-test/sbt-coursier/scala-sources-javadoc-jars/build.sbt b/sbt-coursier/src/sbt-test/sbt-coursier/scala-sources-javadoc-jars/build.sbt index 30308c1b3..846809c67 100644 --- a/sbt-coursier/src/sbt-test/sbt-coursier/scala-sources-javadoc-jars/build.sbt +++ b/sbt-coursier/src/sbt-test/sbt-coursier/scala-sources-javadoc-jars/build.sbt @@ -1,3 +1,6 @@ + +import Compatibility._ + scalaVersion := appConfiguration.value.provider.scalaProvider.version lazy val updateClassifiersCheck = TaskKey[Unit]("updateClassifiersCheck") @@ -5,7 +8,7 @@ lazy val updateClassifiersCheck = TaskKey[Unit]("updateClassifiersCheck") updateClassifiersCheck := { val configReport = updateClassifiers.value - .configuration("compile") + .configuration(Compile) .getOrElse { throw new Exception( "compile configuration not found in updateClassifiers report" diff --git a/sbt-coursier/src/sbt-test/sbt-coursier/scala-sources-javadoc-jars/project/src/main/scala-2.10/Compatibility.scala b/sbt-coursier/src/sbt-test/sbt-coursier/scala-sources-javadoc-jars/project/src/main/scala-2.10/Compatibility.scala new file mode 100644 index 000000000..8824f1209 --- /dev/null +++ b/sbt-coursier/src/sbt-test/sbt-coursier/scala-sources-javadoc-jars/project/src/main/scala-2.10/Compatibility.scala @@ -0,0 +1,8 @@ +object Compatibility { + + implicit class UpdateReportOps(val rep: sbt.UpdateReport) extends AnyVal { + def configuration(conf: sbt.Configuration) = + rep.configuration(conf.name) + } + +} diff --git a/sbt-coursier/src/sbt-test/sbt-coursier/scala-sources-javadoc-jars/project/src/main/scala-2.12/Compatibility.scala b/sbt-coursier/src/sbt-test/sbt-coursier/scala-sources-javadoc-jars/project/src/main/scala-2.12/Compatibility.scala new file mode 100644 index 000000000..19835e1be --- /dev/null +++ b/sbt-coursier/src/sbt-test/sbt-coursier/scala-sources-javadoc-jars/project/src/main/scala-2.12/Compatibility.scala @@ -0,0 +1 @@ +object Compatibility diff --git a/sbt-shading/src/sbt-test/sbt-shading-0.13/cross-project-shading/project/plugins.sbt b/sbt-shading/src/sbt-test/sbt-shading-0.13/cross-project-shading/project/plugins.sbt index fc3a48bf6..046224961 100644 --- a/sbt-shading/src/sbt-test/sbt-shading-0.13/cross-project-shading/project/plugins.sbt +++ b/sbt-shading/src/sbt-test/sbt-shading-0.13/cross-project-shading/project/plugins.sbt @@ -10,24 +10,4 @@ addSbtPlugin("io.get-coursier" % "sbt-shading" % pluginVersion) } -// for the locally publish jarjar -resolvers += Resolver.mavenLocal - -val coursierJarjarVersion = "1.0.1-coursier-SNAPSHOT" - -def coursierJarjarFoundInM2 = - (file(sys.props("user.home")) / s".m2/repository/org/anarres/jarjar/jarjar-core/$coursierJarjarVersion").exists() - -def jarjarVersion = - if (coursierJarjarFoundInM2) - coursierJarjarVersion - else - sys.error( - "Ad hoc jarjar version not found. Run\n" + - " git clone https://github.com/alexarchambault/jarjar.git && cd jarjar && git checkout 249c8dbb970f8 && ./gradlew install\n" + - "to run this test" - ) - -libraryDependencies += "org.anarres.jarjar" % "jarjar-core" % jarjarVersion - addSbtPlugin("org.scala-js" % "sbt-scalajs" % "0.6.13") diff --git a/sbt-shading/src/sbt-test/sbt-shading/exclude-dependencies/project/plugins.sbt b/sbt-shading/src/sbt-test/sbt-shading/exclude-dependencies/project/plugins.sbt index 8f83e814d..022e99e06 100644 --- a/sbt-shading/src/sbt-test/sbt-shading/exclude-dependencies/project/plugins.sbt +++ b/sbt-shading/src/sbt-test/sbt-shading/exclude-dependencies/project/plugins.sbt @@ -9,23 +9,3 @@ addSbtPlugin("io.get-coursier" % "sbt-shading" % pluginVersion) } - -// for the locally publish jarjar -resolvers += Resolver.mavenLocal - -val coursierJarjarVersion = "1.0.1-coursier-SNAPSHOT" - -def coursierJarjarFoundInM2 = - (file(sys.props("user.home")) / s".m2/repository/org/anarres/jarjar/jarjar-core/$coursierJarjarVersion").exists() - -def jarjarVersion = - if (coursierJarjarFoundInM2) - coursierJarjarVersion - else - sys.error( - "Ad hoc jarjar version not found. Run\n" + - " git clone https://github.com/alexarchambault/jarjar.git && cd jarjar && git checkout 249c8dbb970f8 && ./gradlew install\n" + - "to run this test" - ) - -libraryDependencies += "org.anarres.jarjar" % "jarjar-core" % jarjarVersion diff --git a/sbt-shading/src/sbt-test/sbt-shading/shade-namespace/project/plugins.sbt b/sbt-shading/src/sbt-test/sbt-shading/shade-namespace/project/plugins.sbt index 8f83e814d..022e99e06 100644 --- a/sbt-shading/src/sbt-test/sbt-shading/shade-namespace/project/plugins.sbt +++ b/sbt-shading/src/sbt-test/sbt-shading/shade-namespace/project/plugins.sbt @@ -9,23 +9,3 @@ addSbtPlugin("io.get-coursier" % "sbt-shading" % pluginVersion) } - -// for the locally publish jarjar -resolvers += Resolver.mavenLocal - -val coursierJarjarVersion = "1.0.1-coursier-SNAPSHOT" - -def coursierJarjarFoundInM2 = - (file(sys.props("user.home")) / s".m2/repository/org/anarres/jarjar/jarjar-core/$coursierJarjarVersion").exists() - -def jarjarVersion = - if (coursierJarjarFoundInM2) - coursierJarjarVersion - else - sys.error( - "Ad hoc jarjar version not found. Run\n" + - " git clone https://github.com/alexarchambault/jarjar.git && cd jarjar && git checkout 249c8dbb970f8 && ./gradlew install\n" + - "to run this test" - ) - -libraryDependencies += "org.anarres.jarjar" % "jarjar-core" % jarjarVersion diff --git a/sbt-shading/src/sbt-test/sbt-shading/shading/project/plugins.sbt b/sbt-shading/src/sbt-test/sbt-shading/shading/project/plugins.sbt index 8f83e814d..022e99e06 100644 --- a/sbt-shading/src/sbt-test/sbt-shading/shading/project/plugins.sbt +++ b/sbt-shading/src/sbt-test/sbt-shading/shading/project/plugins.sbt @@ -9,23 +9,3 @@ addSbtPlugin("io.get-coursier" % "sbt-shading" % pluginVersion) } - -// for the locally publish jarjar -resolvers += Resolver.mavenLocal - -val coursierJarjarVersion = "1.0.1-coursier-SNAPSHOT" - -def coursierJarjarFoundInM2 = - (file(sys.props("user.home")) / s".m2/repository/org/anarres/jarjar/jarjar-core/$coursierJarjarVersion").exists() - -def jarjarVersion = - if (coursierJarjarFoundInM2) - coursierJarjarVersion - else - sys.error( - "Ad hoc jarjar version not found. Run\n" + - " git clone https://github.com/alexarchambault/jarjar.git && cd jarjar && git checkout 249c8dbb970f8 && ./gradlew install\n" + - "to run this test" - ) - -libraryDependencies += "org.anarres.jarjar" % "jarjar-core" % jarjarVersion diff --git a/sbt-shading/src/sbt-test/sbt-shading/transitive-shading/project/plugins.sbt b/sbt-shading/src/sbt-test/sbt-shading/transitive-shading/project/plugins.sbt index 8f83e814d..022e99e06 100644 --- a/sbt-shading/src/sbt-test/sbt-shading/transitive-shading/project/plugins.sbt +++ b/sbt-shading/src/sbt-test/sbt-shading/transitive-shading/project/plugins.sbt @@ -9,23 +9,3 @@ addSbtPlugin("io.get-coursier" % "sbt-shading" % pluginVersion) } - -// for the locally publish jarjar -resolvers += Resolver.mavenLocal - -val coursierJarjarVersion = "1.0.1-coursier-SNAPSHOT" - -def coursierJarjarFoundInM2 = - (file(sys.props("user.home")) / s".m2/repository/org/anarres/jarjar/jarjar-core/$coursierJarjarVersion").exists() - -def jarjarVersion = - if (coursierJarjarFoundInM2) - coursierJarjarVersion - else - sys.error( - "Ad hoc jarjar version not found. Run\n" + - " git clone https://github.com/alexarchambault/jarjar.git && cd jarjar && git checkout 249c8dbb970f8 && ./gradlew install\n" + - "to run this test" - ) - -libraryDependencies += "org.anarres.jarjar" % "jarjar-core" % jarjarVersion