77
88Cross-platform compilation support for sbt.
99
10+ Requirements:
11+
12+ * sbt 0.13.17+ or 1.2.1+
13+ * For ` JSPlatform ` : Scala.js 0.6.23+ or 1.0.0-M2+
14+ * For ` NativePlatform ` : Scala Native 0.3.7+
15+
1016<h2 >Installation</h2 >
1117
1218<h3 >Cross-Compiling Scala.js, JVM and Native</h3 >
1319
1420In ` project/plugins.sbt ` :
1521
1622``` scala
17- addSbtPlugin(" org.portable-scala" % " sbt-scalajs-crossproject" % " 0.5 .0" )
18- addSbtPlugin(" org.portable-scala" % " sbt-scala-native-crossproject" % " 0.5 .0" )
23+ addSbtPlugin(" org.portable-scala" % " sbt-scalajs-crossproject" % " 0.6 .0" )
24+ addSbtPlugin(" org.portable-scala" % " sbt-scala-native-crossproject" % " 0.6 .0" )
1925addSbtPlugin(" org.scala-js" % " sbt-scalajs" % " 0.6.23" )
2026addSbtPlugin(" org.scala-native" % " sbt-scala-native" % " 0.3.7" )
2127```
@@ -38,6 +44,7 @@ lazy val bar =
3844 // configure Scala-Native settings
3945 .nativeSettings(/* ... */ ) // defined in sbt-scala-native
4046
47+ // Optional in sbt 1.x (mandatory in sbt 0.13.x)
4148lazy val barJS = bar.js
4249lazy val barJVM = bar.jvm
4350lazy val barNative = bar.native
@@ -49,6 +56,7 @@ lazy val foo =
4956 libraryDependencies += " org.example" %%% " foo" % " 1.2.3"
5057 )
5158
59+ // Optional in sbt 1.x (mandatory in sbt 0.13.x)
5260lazy val fooJS = foo.js
5361lazy val fooJVM = foo.jvm
5462lazy val fooNative = foo.native
@@ -66,6 +74,7 @@ lazy val bar =
6674 .crossType(...)
6775 .settings(...)
6876
77+ // Optional in sbt 1.x (mandatory in sbt 0.13.x)
6978lazy val barJS = bar.js
7079lazy val barJVM = bar.jvm
7180lazy val barNative = bar.native
@@ -90,7 +99,7 @@ Note that *inside the build*, you still need to use `barJVM` to the JVM `Project
9099In ` project/plugins.sbt ` :
91100
92101``` scala
93- addSbtPlugin(" org.portable-scala" % " sbt-scala-native-crossproject" % " 0.5 .0" )
102+ addSbtPlugin(" org.portable-scala" % " sbt-scala-native-crossproject" % " 0.6 .0" )
94103addSbtPlugin(" org.scala-native" % " sbt-scala-native" % " 0.3.7" )
95104```
96105
@@ -108,6 +117,7 @@ lazy val bar =
108117 // configure Scala-Native settings
109118 .nativeSettings(/* ... */ ) // defined in sbt-scala-native
110119
120+ // Optional in sbt 1.x (mandatory in sbt 0.13.x)
111121lazy val barJVM = bar.jvm
112122lazy val barNative = bar.native
113123```
@@ -119,7 +129,7 @@ We carefully implemented sbt-crossproject to be mostly source compatible with Sc
119129In ` project/plugins.sbt ` :
120130
121131``` scala
122- addSbtPlugin(" org.portable-scala" % " sbt-scalajs-crossproject" % " 0.5 .0" )
132+ addSbtPlugin(" org.portable-scala" % " sbt-scalajs-crossproject" % " 0.6 .0" )
123133addSbtPlugin(" org.scala-js" % " sbt-scalajs" % " 0.6.23" )
124134```
125135
@@ -137,6 +147,7 @@ lazy val bar =
137147 .jsSettings(/* ... */ ) // defined in sbt-scalajs-crossproject
138148 .jvmSettings(/* ... */ )
139149
150+ // Optional in sbt 1.x (mandatory in sbt 0.13.x)
140151lazy val barJS = bar.js
141152lazy val barJVM = bar.jvm
142153```
0 commit comments