Merge pull request #616 from coursier/topic/fix-scripted-tests

Fix scripted tests
This commit is contained in:
Alexandre Archambault 2017-07-19 22:40:36 +02:00 committed by GitHub
commit e6bac2bc4a
14 changed files with 44 additions and 110 deletions

View File

@ -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"

View File

@ -0,0 +1,8 @@
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,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,

View File

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

View File

@ -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"

View File

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

View File

@ -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")

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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