xerial / sbt-pack

A sbt plugin for creating distributable Scala packages.
496 stars 76 forks source link

Pack task is not available when aggregating project after 0.17 update #354

Closed RustedBones closed 1 year ago

RustedBones commented 1 year ago

when aggregating modules, it was possible to call pack on the root project which would run the task on aggregated modules with the SbtPack plugin enabled.

Since release 0.17, the pack task is not defined at root level. sbt fails with

[error] Not a valid command: pack (similar: tasks)
[error] No such setting/task
[error] pack

As a workaround, is is possible to call Compile/pack on the root.

I would expect that pack would still be defined at root level, defaulting to Compile/pack as it used to be

Note: the root project does not have SbtPack plugin enabled

xerial commented 1 year ago

It's due to the support for Test/pack introduced in 0.17 and now the root project should have .enablePlugins(PackPlugin) like this example https://github.com/xerial/sbt-pack/blob/master/src/sbt-test/sbt-pack/multi-module/build.sbt

I thought it still has a fallback to Compile/pack as discussed in https://github.com/xerial/sbt-pack/pull/324, but apparently, it's not as found in your use case.

RustedBones commented 1 year ago

Thanks for the answer. As I stated

As a workaround, is is possible to call Compile/pack on the root.

Just wanted to make sure this was not a regression. We'll update our setup to follow the new structure then.