diff --git a/sbt-app/src/sbt-test/dependency-management/i8405-update-sbt-classifiers-plugins/build.sbt b/sbt-app/src/sbt-test/dependency-management/i8405-update-sbt-classifiers-plugins/build.sbt new file mode 100644 index 000000000..5ea88cc5b --- /dev/null +++ b/sbt-app/src/sbt-test/dependency-management/i8405-update-sbt-classifiers-plugins/build.sbt @@ -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(", ")}" + ) + } + ) + diff --git a/sbt-app/src/sbt-test/dependency-management/i8405-update-sbt-classifiers-plugins/project/build.sbt b/sbt-app/src/sbt-test/dependency-management/i8405-update-sbt-classifiers-plugins/project/build.sbt new file mode 100644 index 000000000..bebd4da68 --- /dev/null +++ b/sbt-app/src/sbt-test/dependency-management/i8405-update-sbt-classifiers-plugins/project/build.sbt @@ -0,0 +1,2 @@ +ThisBuild / pluginCrossBuild / sbtVersion := "2.0.0" + diff --git a/sbt-app/src/sbt-test/dependency-management/i8405-update-sbt-classifiers-plugins/project/plugins.sbt b/sbt-app/src/sbt-test/dependency-management/i8405-update-sbt-classifiers-plugins/project/plugins.sbt new file mode 100644 index 000000000..4ef1cf760 --- /dev/null +++ b/sbt-app/src/sbt-test/dependency-management/i8405-update-sbt-classifiers-plugins/project/plugins.sbt @@ -0,0 +1,3 @@ +// Add a plugin to test that it's included in updateSbtClassifiers output +addSbtPlugin("com.eed3si9n" % "sbt-buildinfo" % "0.13.1") + diff --git a/sbt-app/src/sbt-test/dependency-management/i8405-update-sbt-classifiers-plugins/test b/sbt-app/src/sbt-test/dependency-management/i8405-update-sbt-classifiers-plugins/test new file mode 100644 index 000000000..19e2b66ee --- /dev/null +++ b/sbt-app/src/sbt-test/dependency-management/i8405-update-sbt-classifiers-plugins/test @@ -0,0 +1,5 @@ +> updateSbtClassifiers + +# see assertion definition in build.sbt +> checkPluginsInUpdateSbtClassifiers +