mirror of https://github.com/sbt/sbt.git
Add regression test for #8405
This commit is contained in:
parent
0acb12a978
commit
b7cb338171
|
|
@ -0,0 +1,32 @@
|
|||
ivyConfiguration := Def.uncached {
|
||||
throw new RuntimeException("updateSbtClassifiers should use updateSbtClassifiers / ivyConfiguration")
|
||||
}
|
||||
|
||||
dependencyResolution := Def.uncached {
|
||||
throw new RuntimeException("updateSbtClassifiers should use updateSbtClassifiers / dependencyResolution")
|
||||
}
|
||||
|
||||
lazy val root = (project in file("."))
|
||||
.settings(
|
||||
scalaVersion := "2.11.12",
|
||||
scalaOrganization := "doesnt.exist",
|
||||
name := "myProjectName",
|
||||
|
||||
TaskKey[Unit]("checkPluginsInUpdateSbtClassifiers") := Def.uncached {
|
||||
val updateReport = updateSbtClassifiers.value
|
||||
val moduleReports = updateReport.configurations.find(_.configuration.name == "default").get.modules
|
||||
|
||||
// Calling "distinct" as there are different entries for sources and javadoc classifiers with same module
|
||||
val moduleIds = moduleReports.map(_.module).distinct
|
||||
val moduleIdsShort = moduleIds.map(m => s"${m.organization}:${m.name}")
|
||||
|
||||
// Verify that the target plugin sbt-buildinfo is included in the output
|
||||
// The plugin may be cross-versioned as sbt-buildinfo_sbt2_3, etc.
|
||||
val hasBuildinfoPlugin = moduleIdsShort.exists(id => id.startsWith("com.eed3si9n:sbt-buildinfo"))
|
||||
assert(
|
||||
hasBuildinfoPlugin,
|
||||
s"Plugin com.eed3si9n:sbt-buildinfo was not found in updateSbtClassifiers output. Found modules: ${moduleIdsShort.sorted.mkString(", ")}"
|
||||
)
|
||||
}
|
||||
)
|
||||
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
ThisBuild / pluginCrossBuild / sbtVersion := "2.0.0"
|
||||
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
// Add a plugin to test that it's included in updateSbtClassifiers output
|
||||
addSbtPlugin("com.eed3si9n" % "sbt-buildinfo" % "0.13.1")
|
||||
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
> updateSbtClassifiers
|
||||
|
||||
# see assertion definition in build.sbt
|
||||
> checkPluginsInUpdateSbtClassifiers
|
||||
|
||||
Loading…
Reference in New Issue