-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #23 from sbt/wip/percent
Add % syntax for configuration scoping
- Loading branch information
Showing
9 changed files
with
103 additions
and
11 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
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
5 changes: 5 additions & 0 deletions
5
src/sbt-test/projectMatrix/jvm-with-scoping/app/src/main/scala/Main.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 a | ||
|
||
object Main extends App { | ||
val core = Core | ||
} |
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,42 @@ | ||
lazy val check = taskKey[Unit]("") | ||
|
||
lazy val root = (project in file(".")) | ||
.aggregate(core.projectRefs ++ app.projectRefs: _*) | ||
.settings( | ||
) | ||
|
||
lazy val app = (projectMatrix in file("app")) | ||
.aggregate(core, intf) | ||
.dependsOn(core % Compile, intf % "compile->compile;test->test") | ||
.settings( | ||
name := "app" | ||
) | ||
.jvmPlatform(scalaVersions = Seq("2.12.8")) | ||
|
||
lazy val core = (projectMatrix in file("core")) | ||
.settings( | ||
check := { | ||
assert(moduleName.value == "core", s"moduleName is ${moduleName.value}") | ||
|
||
val directs = libraryDependencies.value | ||
assert(directs.size == 2, s"$directs") | ||
}, | ||
) | ||
.jvmPlatform(scalaVersions = Seq("2.12.8", "2.11.12")) | ||
.configure(addStuff) | ||
|
||
lazy val intf = (projectMatrix in file("intf")) | ||
.settings( | ||
check := { | ||
assert(moduleName.value == "intf", s"moduleName is ${moduleName.value}") | ||
}, | ||
) | ||
.jvmPlatform(autoScalaLibrary = false) | ||
|
||
lazy val core212 = core.jvm("2.12.8") | ||
|
||
def addStuff(p: Project): Project = { | ||
p.settings( | ||
libraryDependencies += "junit" % "junit" % "4.12" % Test | ||
) | ||
} |
6 changes: 6 additions & 0 deletions
6
src/sbt-test/projectMatrix/jvm-with-scoping/core/src/main/scala/Core.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,6 @@ | ||
package a | ||
|
||
class Core { | ||
} | ||
|
||
object Core extends Core |
5 changes: 5 additions & 0 deletions
5
src/sbt-test/projectMatrix/jvm-with-scoping/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,5 @@ | ||
sys.props.get("plugin.version") match { | ||
case Some(x) => addSbtPlugin("com.eed3si9n" % "sbt-projectmatrix" % x) | ||
case _ => sys.error("""|The system property 'plugin.version' is not defined. | ||
|Specify this property using the scriptedLaunchOpts -D.""".stripMargin) | ||
} |
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,6 @@ | ||
> compile | ||
|
||
$ exists core/target/jvm-2.12/classes/a/Core.class | ||
$ exists core/target/jvm-2.11/classes/a/Core.class | ||
|
||
> coreJVM2_12/check |