-
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.
Introduce
sbt-scala-native-crossproject
(#89)
* Introduce sbt-scala-native-crossproject This PR introduces sbt-scala-native-crossproject with identical functionality to sbt-scalajs-crossproject. It's a blocker for 0.3.7 release as it doesn't depend on old sbt-crossproject any longer, and requires platforms-deps based cross projects instead. * Bump to sbt 0.13.17
- Loading branch information
Showing
10 changed files
with
98 additions
and
32 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
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 |
---|---|---|
@@ -1 +1 @@ | ||
sbt.version=0.13.16 | ||
sbt.version=0.13.17 |
7 changes: 5 additions & 2 deletions
7
sbt-crossproject-test/src/sbt-test/new-api/scala-native-only/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
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
18 changes: 18 additions & 0 deletions
18
sbt-scala-native-crossproject/src/main/scala/scalanativecrossproject/NativePlatform.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,18 @@ | ||
package scalanativecrossproject | ||
|
||
import sbt._ | ||
import sbtcrossproject._ | ||
import scalanative.sbtplugin._ | ||
|
||
case object NativePlatform extends Platform { | ||
def identifier: String = "native" | ||
def sbtSuffix: String = "Native" | ||
def enable(project: Project): Project = | ||
project.enablePlugins(ScalaNativePlugin) | ||
|
||
@deprecated("Will be removed", "0.3.0") | ||
val crossBinary: CrossVersion = ScalaNativeCrossVersion.binary | ||
|
||
@deprecated("Will be removed", "0.3.0") | ||
val crossFull: CrossVersion = ScalaNativeCrossVersion.full | ||
} |
25 changes: 25 additions & 0 deletions
25
sbt-scala-native-crossproject/src/main/scala/scalanativecrossproject/ScalaNativeCross.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,25 @@ | ||
package scalanativecrossproject | ||
|
||
import sbt._ | ||
import sbtcrossproject._ | ||
import scalanative.sbtplugin._ | ||
|
||
import scala.language.implicitConversions | ||
|
||
trait ScalaNativeCross { | ||
val NativePlatform = scalanativecrossproject.NativePlatform | ||
|
||
implicit def NativeCrossProjectBuilderOps( | ||
builder: CrossProject.Builder): NativeCrossProjectOps = | ||
new NativeCrossProjectOps(builder.crossType(CrossType.Full)) | ||
|
||
implicit class NativeCrossProjectOps(project: CrossProject) { | ||
def native: Project = project.projects(NativePlatform) | ||
|
||
def nativeSettings(ss: Def.SettingsDefinition*): CrossProject = | ||
nativeConfigure(_.settings(ss: _*)) | ||
|
||
def nativeConfigure(transformer: Project => Project): CrossProject = | ||
project.configurePlatform(NativePlatform)(transformer) | ||
} | ||
} |
5 changes: 5 additions & 0 deletions
5
...a-native-crossproject/src/main/scala/scalanativecrossproject/ScalaNativeCrossPlugin.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 scalanativecrossproject | ||
|
||
object ScalaNativeCrossPlugin extends sbt.AutoPlugin { | ||
object autoImport extends ScalaNativeCross | ||
} |