Closed Marc-Ducret closed 1 year ago
Interesting. Just from curiosity, could you tell me how you use the packed test code?
It seems this forces the user to always select Compile or Test target for the pack command. Any idea so as not to introduce such a breaking change?
Interesting. Just from curiosity, could you tell me how you use the packed test code?
We use ZIO-test, therefore each test suite is a runnable main class. Also we have a custom RunAllSpecs main that uses reflection to run all test suites in our package in the classpath.
Then we simply add Test / packMain := Map("app-test" -> "com.ayolab.testing.RunAllSpecs")
to build.sbt
.
It seems this forces the user to always select Compile or Test target for the pack command. Any idea so as not to introduce such a breaking change?
Running sbt pack
does still fallback on Compile / pack
as expected. Though I pushed a commit to pass the tests.
The only test I had to change is archive-modules
, I had to add > packagedArtifacts
, and I don't understand how it was automatically called before.
OK. Let me merge. Will release a new version soon
@Marc-Ducret Released 0.17, but it seems projects using sbt-pack is broken like this. https://github.com/wvlet/airframe/pull/2584
I guess some tests are missing
ok. I've found a fix. If pack
task is overwritten, it needs to be properly scoped like Compile / pack := ....
Using Def.derive allows to propagate Compile/Test configurations.
Therefore
Compile / pack
packs without the tests andTest / pack
packs with the tests.