Search code examples
sbt-native-packager

Extending sbt-native-packager (Docker)


I'm having a problem with sbt-native-packager's Docker module. It uses an (overridable) bash template but this template has ${{template_declares}} that substitutes some important project information into the bash file.

My problem is I can't use bash--I'm using busybox, which uses ash. Some of the generated stuff from sbt is incompatible with ash. Specifically the code dropped in for ${{template_declares}} is incompatible and I need to have it generate something different.

I see there are both Windows and bash "generators" predefined. How can I make an ash generator that modifies the bash version?

I can certainly clone the repo and make an ash generator but I'm hoping to extend rather than clone. I've never extended a sbt plugin. How is that done?


Solution

  • Things have changed since the OP first opened the question. There is also a AshScriptPlugin which is better suited to a Docker container running alpine.

    enablePlugin(AshScriptPlugin)
    

    You can find out more in the current docs