Fix scripted tests for sbt 1.0.0-M6

This commit is contained in:
Alexandre Archambault 2017-06-15 13:16:31 +02:00
parent 8106a1837f
commit f83a377bb5
9 changed files with 22 additions and 6 deletions

View File

@ -1,6 +1,6 @@
// for SbtExclusionRule with sbt 1.0
import sbt.internal.librarymanagement._
import Compatibility._
scalaVersion := "2.11.8"

View File

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

View File

@ -3,6 +3,8 @@ lazy val noPomCheck = TaskKey[Unit]("noPomCheck")
noPomCheck := {
val log = streams.value.log
val configReport = update.value
.configuration("compile")
.getOrElse {
@ -22,7 +24,7 @@ noPomCheck := {
}
for (a <- pomArtifacts)
streams.value.log.error(s"Found POM artifact $a")
log.error(s"Found POM artifact $a")
assert(pomArtifacts.isEmpty)
}

View File

@ -20,6 +20,8 @@ lazy val shared = Seq(
scalaVersion := "2.11.8",
confCheck := {
val log = streams.value.log
val updateReport = update.value
val updateClassifiersReport = updateClassifiers.value
@ -41,12 +43,12 @@ lazy val shared = Seq(
a
}
streams.value.log.info(
log.info(
s"Found ${artifacts.length} artifacts for config $config / classifier $classifier" +
(if (useClassifiersReport) " in classifiers report" else "")
)
for (a <- artifacts)
streams.value.log.info(" " + a)
log.info(" " + a)
artifacts
}

View File

@ -1,6 +1,6 @@
// for SbtExclusionRule with sbt 1.0
import sbt.internal.librarymanagement._
import Compatibility._
enablePlugins(coursier.ShadingPlugin)
shadingNamespace := "test.shaded"

View File

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

View File

@ -19,9 +19,9 @@ lazy val checkToShadeClasses = TaskKey[Unit]("check-to-shade-classes")
checkToShadeClasses := {
val toShadeClasses0 = toShadeClasses.in(Shading).value
val log = streams.value.log
if (toShadeClasses0.nonEmpty) {
val log = streams.value.log
log.error(s"Found ${toShadeClasses0.length} classes to be explicitly shaded")
for (name <- toShadeClasses0)
log.error(" " + name)