From e66282433a9f07cea6f41bcf9399a23e514601ed Mon Sep 17 00:00:00 2001 From: Eugene Yokota Date: Wed, 17 Jun 2020 19:37:26 -0400 Subject: [PATCH] Reproduce missingOk bug Ref https://github.com/sbt/sbt/issues/4707 --- .../dependency-management/missingok/build.sbt | 40 +++++++++++++++++++ .../dependency-management/missingok/test | 1 + 2 files changed, 41 insertions(+) create mode 100644 sbt/src/sbt-test/dependency-management/missingok/build.sbt create mode 100644 sbt/src/sbt-test/dependency-management/missingok/test diff --git a/sbt/src/sbt-test/dependency-management/missingok/build.sbt b/sbt/src/sbt-test/dependency-management/missingok/build.sbt new file mode 100644 index 000000000..51257fd6e --- /dev/null +++ b/sbt/src/sbt-test/dependency-management/missingok/build.sbt @@ -0,0 +1,40 @@ +ThisBuild / scalaVersion := "2.13.2" +libraryDependencies ++= Seq( + "com.chuusai" %% "shapeless" % "2.3.3", + // non-existing + "org.webjars" % "npm" % "0.0.99" +) +updateConfiguration := updateConfiguration.value.withMissingOk(true) + +lazy val check = taskKey[Unit]("") + +check := { + val updateReport = update.value + val updateClassifiersReport = updateClassifiers.value + + val compileReport = updateReport + .configuration(Compile) + .getOrElse { + sys.error("Compile configuration not found in update report") + } + + val compileClassifiersReport = updateClassifiersReport + .configuration(Compile) + .getOrElse { + sys.error("Compile configuration not found in update classifiers report") + } + + val shapelessModule = compileReport + .modules + .find(_.module.name == "shapeless_2.13") + .getOrElse { + sys.error(s"shapeless module not found in ${compileReport.modules.map(_.module)}") + } + + val shapelessClassifiersModule = compileClassifiersReport + .modules + .find(_.module.name == "shapeless_2.13") + .getOrElse { + sys.error(s"shapeless module not found in ${compileClassifiersReport.modules.map(_.module)}") + } +} diff --git a/sbt/src/sbt-test/dependency-management/missingok/test b/sbt/src/sbt-test/dependency-management/missingok/test new file mode 100644 index 000000000..15675b169 --- /dev/null +++ b/sbt/src/sbt-test/dependency-management/missingok/test @@ -0,0 +1 @@ +> check