mirror of https://github.com/sbt/sbt.git
fix: Fixes managed resources missing from the JAR
**Problem** RC-7 is missing the managed resources. **Solution** This triggers managed resources so they get generated.
This commit is contained in:
parent
1fbe516465
commit
ffc2f8c35d
|
|
@ -4084,6 +4084,7 @@ object Classpaths {
|
||||||
val resourceDirs = resourceDirectories.value
|
val resourceDirs = resourceDirectories.value
|
||||||
val vfBackendDir = compileIncremental.value._2
|
val vfBackendDir = compileIncremental.value._2
|
||||||
val backendDir = c.toPath(vfBackendDir)
|
val backendDir = c.toPath(vfBackendDir)
|
||||||
|
val _ = resources.value
|
||||||
backendDir.toFile() :: resourceDirs.toList.filter(_.exists())
|
backendDir.toFile() :: resourceDirs.toList.filter(_.exists())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,3 @@
|
||||||
|
import sbt.*
|
||||||
|
|
||||||
|
object A extends AutoPlugin
|
||||||
|
|
@ -0,0 +1,23 @@
|
||||||
|
scalaVersion := "3.7.4"
|
||||||
|
|
||||||
|
organization := "com.example"
|
||||||
|
|
||||||
|
@transient
|
||||||
|
lazy val check = taskKey[Unit]("extract jar file")
|
||||||
|
|
||||||
|
lazy val a = (project in file("a"))
|
||||||
|
.enablePlugins(SbtPlugin)
|
||||||
|
.settings(
|
||||||
|
name := "a",
|
||||||
|
check := Def.uncached {
|
||||||
|
val converter = fileConverter.value
|
||||||
|
val p = converter.toPath((Compile / packageBin).value)
|
||||||
|
val outDir = target.value / "extracted"
|
||||||
|
IO.unzip(p.toFile(), outDir)
|
||||||
|
val expectedResource = outDir / "sbt" / "sbt.autoplugins"
|
||||||
|
if !expectedResource.exists() then
|
||||||
|
sys.error(s"$expectedResource doesn't exist")
|
||||||
|
val content = IO.read(outDir / "sbt" / "sbt.autoplugins").trim
|
||||||
|
assert(content == "A", s"expected A, but content was '$content'")
|
||||||
|
},
|
||||||
|
)
|
||||||
|
|
@ -0,0 +1,2 @@
|
||||||
|
> a/packageBin
|
||||||
|
> a/check
|
||||||
Loading…
Reference in New Issue