mirror of https://github.com/sbt/sbt.git
Merge pull request #8394 from eed3si9n/wip/repro-resource
[2.x] fix: Fixes managed resources missing from the JAR
This commit is contained in:
commit
ba8acdd27c
|
|
@ -4084,6 +4084,7 @@ object Classpaths {
|
|||
val resourceDirs = resourceDirectories.value
|
||||
val vfBackendDir = compileIncremental.value._2
|
||||
val backendDir = c.toPath(vfBackendDir)
|
||||
val _ = resources.value
|
||||
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