To generate a distribution ZIP with Simple Build Tool one can simply do
def distPath = (
((outputPath ##) / defaultJarName) +++
mainDependencies.scalaJars
)
lazy val dist = zipTask(distPath, "dist", "distribution.zip") dependsOn (`package`) describedAs("Zips up the project.")
This adds the JAR files into the root of the ZIP. How does one add the JARs into a lib subfolder in the ZIP?
For sbt 0.7.x:
Nothing implemented by default as far as I know. However, you can use SBT’s FileUtilities.
Try playing around with the following example, which copies your artifact jar into a tmp dir, zips the dir, and deletes it. It should be straightforward to extend it to dependent libs.
The following functions from
FileUtilitieswere used above:Their declarations should be self-explanatory.