Question

I'm writing an sbt plugin to help with deployment. It depends on sbt-native-packager. Principally it adds a deploy task. However, I also need it to copy a bash script run-class.sh into the /bin folder of the package.

How do I copy a file from the sbt plugin to my project? Presently my only idea is to add the file to src/main/resources/run-class.sh in the plugin and generate a file using sbt. Then I can supply a Universal mapping to put the file in the sbt-native-packager package.

Is there an easier way to get a file from the plugin into my sbt project?

Was it helpful?

Solution

You are on the right track with Generating files, specifically Generate resources. You can keep your original file either as a resource or String, but important thing is that the files are generated into resourceManaged in Compile, which is under target. This folder is typically skipped from version control.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top