Reputation: 1
I have a sbt project with multiple sub modules which look like this:
--\ root
-- module 1
-- module 2
Using packageBin, I can get two zip files: module1.zip and module2.zip.
This is my build.sbt:
import Dependencies._
import NativePackagerHelper._
lazy val commonSettings = Seq(
organization := "com.zhyea.sbt",
version := "0.1-SNAPSHOT",
scalaVersion := "2.11.12",
exportJars := true,
artifactName := {
(sv: ScalaVersion, module: ModuleID, artifact: Artifact) => artifact.name + "." + artifact.extension
}
)
lazy val module2 = project.settings(commonSettings).settings()
.enablePlugins(JavaAppPackaging, UniversalPlugin)
.settings(libraryDependencies ++= module2Dependencies)
lazy val module1 = project.settings(commonSettings)
.enablePlugins(JavaAppPackaging, UniversalPlugin)
.settings(libraryDependencies ++= module1Dependencies)
lazy val root = project.in(file("."))
.settings(commonSettings)
.aggregate(module2, module1)
.enablePlugins(JavaAppPackaging, UniversalPlugin)
.dependsOn(module2, module1).configs()
mappings in Universal ++= directory("module2/target/universal")
The mappings in Universal ++= directory("module1/target/universal")
Now I want to execute the packageBin task at root and add sub module zips into root.zip.
The problem is that when the root module executes packageBin task, the sub modules' packageBin tasks haven't finished, and the root cannot get module1.zip and mudule2.zip.
How can I tell sbt to execute the packageBin task in order?
Upvotes: 0
Views: 605
Reputation: 1
i just pack all sub modules' files into one zip by adding a new module named pack.
Upvotes: 0