Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable scalajs cross-compilation. #23

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 14 additions & 4 deletions build.sbt
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// shadow sbt-scalajs' crossProject and CrossType from Scala.js 0.6.x
import sbtcrossproject.CrossPlugin.autoImport.{crossProject, CrossType}

organization := "tv.cntt"
name := "scaposer"
version := "1.11.1-SNAPSHOT"
Expand All @@ -9,9 +12,16 @@ scalacOptions ++= Seq("-deprecation", "-feature", "-unchecked")
javacOptions ++= Seq("-source", "1.8", "-target", "1.8")

// Scala 2.11+ core does not include scala.util.parsing.combinator
libraryDependencies += "org.scala-lang.modules" %% "scala-parser-combinators" % "1.1.2"
libraryDependencies += "org.scala-lang.modules" %%% "scala-parser-combinators" % "1.1.2"

libraryDependencies += "org.specs2" %%% "specs2-core" % "4.10.2" % "test"

lazy val scaposer = crossProject(JVMPlatform, JSPlatform)
.crossType(CrossType.Pure)

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

//https://github.com/scala/scala-parser-combinators/issues/197
fork in Test := true
lazy val root = (project in file("."))
.aggregate(scaposerJS, scaposerJVM)
.settings(skip in publish := true)
3 changes: 3 additions & 0 deletions jitpack.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
install:
- sbt '++ publishM2'
- env SCALAJS_VERSION="0.6.32" sbt '++ publishM2'
2 changes: 1 addition & 1 deletion project/build.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
sbt.version=0.13.18
sbt.version=1.3.12
5 changes: 5 additions & 0 deletions project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -1,2 +1,7 @@
// Run sbt eclipse to create Eclipse project file
addSbtPlugin("com.typesafe.sbteclipse" % "sbteclipse-plugin" % "5.2.4")

// http://www.scala-js.org/news/2020/02/25/announcing-scalajs-1.0.0/#cross-building-for-scalajs-06x-and-1x
val scalaJSVersion = scala.util.Properties.envOrElse("SCALAJS_VERSION", "1.1.1")
addSbtPlugin("org.scala-js" % "sbt-scalajs" % scalaJSVersion)
addSbtPlugin("org.portable-scala" % "sbt-scalajs-crossproject" % "1.0.0")