This commit is contained in:
kenji yoshida 2026-04-13 05:17:09 +00:00 committed by GitHub
commit 955e8f31c2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 17 additions and 0 deletions

View File

@ -140,6 +140,7 @@ jobs:
./sbt -v --client doc
./sbt -v --client publishLocal
./sbt -v --client test
./sbt -v --client lmCoursierShaded/test
./sbt -v --client "serverTestProj/test"
./sbt -v --client "all $UTIL_TESTS"
- name: Build and test (2)

View File

@ -1316,6 +1316,8 @@ lazy val lmCoursier = project
)
.dependsOn(lmCore)
lazy val checkLmcoursierPackage = taskKey[Unit]("")
lazy val lmCoursierShaded = project
.in(file("lm-coursier/target/shaded-module"))
.settings(
@ -1332,6 +1334,20 @@ lazy val lmCoursierShaded = project
),
assembly / assemblyOption ~= { _.withIncludeScala(false) },
conflictWarning := ConflictWarning.disable,
checkLmcoursierPackage := {
val jarFile = assembly.value
IO.withTemporaryDirectory { tmp =>
val notLmcoursierPackageClasses = IO
.unzip(jarFile, tmp, _.endsWith(".class"))
.toSeq
.map(f => IO.relativize(tmp, f).getOrElse(sys.error(s"invalid path ${f}")))
.filterNot(f => f.startsWith("lmcoursier") || f.startsWith("META-INF"))
.sorted
notLmcoursierPackageClasses.foreach(println)
assert(notLmcoursierPackageClasses.isEmpty)
}
},
Test / test := (Test / test).dependsOn(checkLmcoursierPackage).value,
Utils.noPublish,
assemblyShadeRules := {
val namespacesToShade = Seq(