-
Notifications
You must be signed in to change notification settings - Fork 76
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Currently when project dependencies are worked out in a multi-project build, there is no check to ensure that we are only including projects with a compile dependency, i.e. those with .dependsOn(module1) or .dependsOn(module1, "compile->...") This fixes that issue and filters out projects that don't have compile dependencies.
- Loading branch information
Showing
8 changed files
with
87 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
scalaVersion in ThisBuild := "2.12.6" | ||
|
||
val commonSettings = Seq( | ||
scalaVersion := "2.12.6", | ||
version := "0.1", | ||
crossPaths := false | ||
) | ||
|
||
lazy val module1 = | ||
project | ||
.settings(commonSettings) | ||
.settings( | ||
libraryDependencies ++= Seq( | ||
"org.slf4j" % "slf4j-api" % "1.7.6" | ||
), | ||
) | ||
.enablePlugins(PackPlugin) | ||
|
||
lazy val module2 = | ||
project | ||
.settings(commonSettings) | ||
.settings( | ||
libraryDependencies ++= Seq( | ||
"org.xerial.snappy" % "snappy-java" % "1.1.1.6" | ||
) | ||
) | ||
.enablePlugins(PackPlugin) | ||
|
||
lazy val client = | ||
project | ||
.settings(commonSettings) | ||
.dependsOn(module1, module2 % "test->test") | ||
.enablePlugins(PackPlugin) | ||
|
||
lazy val server = | ||
project | ||
.dependsOn(module2) | ||
.settings(commonSettings) | ||
.dependsOn(module1, module2 % "compile->compile;test->test") | ||
.enablePlugins(PackPlugin) |
5 changes: 5 additions & 0 deletions
5
src/sbt-test/sbt-pack/exclude-test-config/client/src/main/scala/Client.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
package sample | ||
|
||
object Client { | ||
def main(args: Array[String]) { println("hello client") } | ||
} |
5 changes: 5 additions & 0 deletions
5
src/sbt-test/sbt-pack/exclude-test-config/module1/src/main/scala/Module1.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
package sample | ||
|
||
object Module1 { | ||
def main(args: Array[String]) { println("hello module1") } | ||
} |
5 changes: 5 additions & 0 deletions
5
src/sbt-test/sbt-pack/exclude-test-config/module2/src/main/scala/Module2.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
package sample | ||
|
||
object Module2 { | ||
def main(args: Array[String]) { println("hello module2") } | ||
} |
7 changes: 7 additions & 0 deletions
7
src/sbt-test/sbt-pack/exclude-test-config/project/plugins.sbt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
val pluginVersion = System.getProperty("plugin.version") | ||
if(pluginVersion == null) | ||
throw new RuntimeException("""|The system property 'plugin.version' is not defined. | ||
|Specify this property using the scriptedLaunchOpts -D.""".stripMargin) | ||
else addSbtPlugin("org.xerial.sbt" % "sbt-pack" % pluginVersion) | ||
} |
5 changes: 5 additions & 0 deletions
5
src/sbt-test/sbt-pack/exclude-test-config/server/src/main/scala/Server.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
package sample | ||
|
||
object Server { | ||
def main(args: Array[String]) { println("hello server") } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#exec commands are system dependent and have been tested in a Linux environment | ||
> 'set version := "0.1"' | ||
|
||
>server/pack | ||
$exists server/target/pack/lib/slf4j-api-1.7.6.jar | ||
$exists server/target/pack/lib/module1-0.1.jar | ||
$exists server/target/pack/lib/snappy-java-1.1.1.6.jar | ||
$exists server/target/pack/lib/module2-0.1.jar | ||
$exists server/target/pack/lib/server-0.1.jar | ||
|
||
>client/pack | ||
$exists client/target/pack/lib/slf4j-api-1.7.6.jar | ||
$exists client/target/pack/lib/module1-0.1.jar | ||
$absent client/target/pack/lib/snappy-java-1.1.1.6.jar | ||
$absent client/target/pack/lib/module2-0.1.jar | ||
$exists client/target/pack/lib/client-0.1.jar |