Skip to content

Commit 6f99a22

Browse files
committed
Cross compile to scalajs
1 parent ea2ba0a commit 6f99a22

File tree

4 files changed

+23
-5
lines changed

4 files changed

+23
-5
lines changed

build.sbt

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
// shadow sbt-scalajs' crossProject and CrossType from Scala.js 0.6.x
2+
import sbtcrossproject.CrossPlugin.autoImport.{crossProject, CrossType}
3+
14
organization := "tv.cntt"
25
name := "scaposer"
36
version := "1.11.1-SNAPSHOT"
@@ -9,9 +12,16 @@ scalacOptions ++= Seq("-deprecation", "-feature", "-unchecked")
912
javacOptions ++= Seq("-source", "1.8", "-target", "1.8")
1013

1114
// Scala 2.11+ core does not include scala.util.parsing.combinator
12-
libraryDependencies += "org.scala-lang.modules" %% "scala-parser-combinators" % "1.1.2"
15+
libraryDependencies += "org.scala-lang.modules" %%% "scala-parser-combinators" % "1.1.2"
16+
17+
libraryDependencies += "org.specs2" %%% "specs2-core" % "4.10.2" % "test"
18+
19+
lazy val scaposer = crossProject(JVMPlatform, JSPlatform)
20+
.crossType(CrossType.Pure)
1321

14-
libraryDependencies += "org.specs2" %% "specs2-core" % "4.6.0" % "test"
22+
lazy val scaposerJS = scaposer.js
23+
lazy val scaposerJVM = scaposer.jvm
1524

16-
//https://github.com/scala/scala-parser-combinators/issues/197
17-
fork in Test := true
25+
lazy val root = (project in file("."))
26+
.aggregate(scaposerJS, scaposerJVM)
27+
.settings(skip in publish := true)

jitpack.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
install:
2+
- sbt '++ publishM2'
3+
- env SCALAJS_VERSION="0.6.32" sbt '++ publishM2'

project/build.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
sbt.version=0.13.18
1+
sbt.version=1.3.12

project/plugins.sbt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,7 @@
11
// Run sbt eclipse to create Eclipse project file
22
addSbtPlugin("com.typesafe.sbteclipse" % "sbteclipse-plugin" % "5.2.4")
3+
4+
// http://www.scala-js.org/news/2020/02/25/announcing-scalajs-1.0.0/#cross-building-for-scalajs-06x-and-1x
5+
val scalaJSVersion = scala.util.Properties.envOrElse("SCALAJS_VERSION", "1.1.1")
6+
addSbtPlugin("org.scala-js" % "sbt-scalajs" % scalaJSVersion)
7+
addSbtPlugin("org.portable-scala" % "sbt-scalajs-crossproject" % "1.0.0")

0 commit comments

Comments
 (0)