-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for partially-shared src dirs
- Loading branch information
1 parent
fd991e8
commit b61c500
Showing
14 changed files
with
175 additions
and
22 deletions.
There are no files selected for viewing
5 changes: 5 additions & 0 deletions
5
sbt-crossproject-test/src/sbt-test/new-api/partially-shared-sources/build.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 @@ | ||
import sbtcrossproject.{crossProject, CrossType} | ||
|
||
lazy val foo = crossProject(JVMPlatform, JSPlatform, NativePlatform) | ||
.settings(scalaVersion := "2.11.11") | ||
.jsSettings(scalaJSUseMainModuleInitializer := true) |
3 changes: 3 additions & 0 deletions
3
...est/src/sbt-test/new-api/partially-shared-sources/foo/js-jvm/src/main/scala/JSOrJVM.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,3 @@ | ||
object JSOrJVM { | ||
def check = true | ||
} |
3 changes: 3 additions & 0 deletions
3
...c/sbt-test/new-api/partially-shared-sources/foo/js-native/src/main/scala/JSOrNative.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,3 @@ | ||
object JSOrNative { | ||
def check = true | ||
} |
3 changes: 3 additions & 0 deletions
3
...est/src/sbt-test/new-api/partially-shared-sources/foo/js/src/main/scala/JVMOrNative.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,3 @@ | ||
object JVMOrNative { | ||
def check = false | ||
} |
5 changes: 5 additions & 0 deletions
5
...t-test/src/sbt-test/new-api/partially-shared-sources/foo/js/src/main/scala/Platform.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 @@ | ||
object Platform { | ||
def isJVM = false | ||
def isJS = true | ||
def isNative = false | ||
} |
3 changes: 3 additions & 0 deletions
3
...sbt-test/new-api/partially-shared-sources/foo/jvm-native/src/main/scala/JVMOrNative.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,3 @@ | ||
object JVMOrNative { | ||
def check = true | ||
} |
3 changes: 3 additions & 0 deletions
3
...est/src/sbt-test/new-api/partially-shared-sources/foo/jvm/src/main/scala/JSOrNative.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,3 @@ | ||
object JSOrNative { | ||
def check = false | ||
} |
5 changes: 5 additions & 0 deletions
5
...-test/src/sbt-test/new-api/partially-shared-sources/foo/jvm/src/main/scala/Platform.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 @@ | ||
object Platform { | ||
def isJVM = true | ||
def isJS = false | ||
def isNative = false | ||
} |
3 changes: 3 additions & 0 deletions
3
...est/src/sbt-test/new-api/partially-shared-sources/foo/native/src/main/scala/JSOrJVM.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,3 @@ | ||
object JSOrJVM { | ||
def check = false | ||
} |
5 changes: 5 additions & 0 deletions
5
...st/src/sbt-test/new-api/partially-shared-sources/foo/native/src/main/scala/Platform.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 @@ | ||
object Platform { | ||
def isJVM = false | ||
def isJS = false | ||
def isNative = true | ||
} |
13 changes: 13 additions & 0 deletions
13
...ct-test/src/sbt-test/new-api/partially-shared-sources/foo/shared/src/main/scala/Foo.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,13 @@ | ||
import Platform._ | ||
object Foo { | ||
def main(args: Array[String]): Unit = { | ||
assert(List(isJVM, isJS, isNative).count(identity) == 1) | ||
|
||
if (isJVM) | ||
assert(JSOrJVM.check && JVMOrNative.check && !JSOrNative.check) | ||
if (isJS) | ||
assert(JSOrJVM.check && !JVMOrNative.check && JSOrNative.check) | ||
if (isNative) | ||
assert(!JSOrJVM.check && JVMOrNative.check && JSOrNative.check) | ||
} | ||
} |
3 changes: 3 additions & 0 deletions
3
sbt-crossproject-test/src/sbt-test/new-api/partially-shared-sources/test
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,3 @@ | ||
> fooJVM/run | ||
> fooJS/run | ||
> fooNative/run |
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