1
1
import ScalaModulePlugin ._
2
+ import sbtcrossproject .{crossProject , CrossType }
2
3
3
4
scalaVersionsByJvm in ThisBuild := {
4
5
val v211 = " 2.11.11"
@@ -14,12 +15,11 @@ scalaVersionsByJvm in ThisBuild := {
14
15
}
15
16
16
17
lazy val root = project.in(file(" ." ))
17
- .aggregate(`scala-parser-combinatorsJS`, `scala-parser-combinatorsJVM`)
18
+ .aggregate(`scala-parser-combinatorsJS`, `scala-parser-combinatorsJVM`, `scala-parser-combinatorsNative` )
18
19
.settings(disablePublishing)
19
20
20
- lazy val `scala-parser-combinators` = crossProject.in(file(" ." )).
21
+ lazy val `scala-parser-combinators` = crossProject( JSPlatform , JVMPlatform , NativePlatform ) .in(file(" ." )).
21
22
settings(scalaModuleSettings : _* ).
22
- jvmSettings(scalaModuleSettingsJVM).
23
23
settings(
24
24
name := " scala-parser-combinators" ,
25
25
version := " 1.0.7-SNAPSHOT" ,
@@ -40,16 +40,33 @@ lazy val `scala-parser-combinators` = crossProject.in(file(".")).
40
40
version.value
41
41
)
42
42
).
43
+ jvmSettings(scalaModuleSettingsJVM).
43
44
jvmSettings(
45
+ // Mima uses the name of the jvm project in the artifactId
46
+ // when resolving previous versions (so no "-jvm" project)
47
+ name := " scala-parser-combinators" ,
44
48
OsgiKeys .exportPackage := Seq (s " scala.util.parsing.*;version= ${version.value}" ),
45
49
libraryDependencies += " junit" % " junit" % " 4.12" % " test" ,
46
50
libraryDependencies += " com.novocode" % " junit-interface" % " 0.11" % " test"
47
51
).
48
52
jsSettings(
53
+ name := " scala-parser-combinators-js" ,
49
54
// Scala.js cannot run forked tests
50
55
fork in Test := false
51
56
).
52
- jsConfigure(_.enablePlugins(ScalaJSJUnitPlugin ))
57
+ jsConfigure(_.enablePlugins(ScalaJSJUnitPlugin )).
58
+ nativeSettings(
59
+ name := " scala-parser-combinators-native" ,
60
+ scalaVersion := " 2.11.11" ,
61
+ skip in compile := System .getProperty(" java.version" ).startsWith(" 1.6" ),
62
+ test := {},
63
+ libraryDependencies := {
64
+ if (! scalaVersion.value.startsWith(" 2.11" ))
65
+ libraryDependencies.value.filterNot(_.organization == " org.scala-native" )
66
+ else libraryDependencies.value
67
+ }
68
+ )
53
69
54
70
lazy val `scala-parser-combinatorsJVM` = `scala-parser-combinators`.jvm
55
71
lazy val `scala-parser-combinatorsJS` = `scala-parser-combinators`.js
72
+ lazy val `scala-parser-combinatorsNative` = `scala-parser-combinators`.native
0 commit comments