From bf72e4341b5478f3e8416781a2f03a0d5b6a6841 Mon Sep 17 00:00:00 2001 From: Jakob Odersky Date: Wed, 7 Mar 2018 22:05:36 -0800 Subject: Add support for Scala Native --- build.sbt | 21 +++++++++++++++++---- project/plugins.sbt | 5 ++++- 2 files changed, 21 insertions(+), 5 deletions(-) diff --git a/build.sbt b/build.sbt index 9bd5cad..be6a2a5 100644 --- a/build.sbt +++ b/build.sbt @@ -1,24 +1,39 @@ +// shadow sbt-scalajs' crossProject and CrossType until Scala.js 1.0.0 is released +import sbtcrossproject.{crossProject, CrossType} import com.typesafe.sbt.pgp.PgpKeys.publishSigned -lazy val core = crossProject +lazy val core = crossProject(JVMPlatform, JSPlatform, NativePlatform) .in(file("core")) .settings(buildSettings: _*) .settings(publishSettings: _*) .settings(scalaMacroDependencies: _*) .settings(moduleName := "magnolia") + .settings( + crossScalaVersions := "2.12.4" :: "2.11.12" :: Nil, + scalaVersion := crossScalaVersions.value.head + ) + .nativeSettings( + crossScalaVersions := "2.11.12" :: Nil, + ) lazy val coreJVM = core.jvm lazy val coreJS = core.js +lazy val coreNative = core.native -lazy val examples = crossProject +lazy val examples = crossProject(JVMPlatform, JSPlatform, NativePlatform) .in(file("examples")) .settings(buildSettings: _*) .settings(publishSettings: _*) .settings(moduleName := "magnolia-examples") + .nativeSettings( + crossScalaVersions := (crossScalaVersions in coreNative).value, + scalaVersion := (scalaVersion in coreNative).value + ) .dependsOn(core) lazy val examplesJVM = examples.jvm lazy val examplesJS = examples.js +lazy val examplesNative = examples.native lazy val tests = project .in(file("tests")) @@ -39,7 +54,6 @@ lazy val tests = project - lazy val benchmarks = project .in(file("benchmarks")) .settings(buildSettings: _*) @@ -48,7 +62,6 @@ lazy val benchmarks = project lazy val buildSettings = Seq( organization := "com.propensive", - crossScalaVersions := Seq("2.11.11", "2.12.4"), name := "magnolia", version := "0.7.1", scalacOptions ++= Seq( diff --git a/project/plugins.sbt b/project/plugins.sbt index 595dbcc..baee37a 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -2,4 +2,7 @@ addSbtPlugin("com.jsuereth" % "sbt-pgp" % "1.1.0") addSbtPlugin("org.xerial.sbt" % "sbt-sonatype" % "2.1") addSbtPlugin("org.scoverage" % "sbt-scoverage" % "1.5.1") -addSbtPlugin("org.scala-js" % "sbt-scalajs" % "0.6.21") +addSbtPlugin("org.scala-js" % "sbt-scalajs" % "0.6.21") +addSbtPlugin("org.portable-scala" % "sbt-crossproject" % "0.3.1") +addSbtPlugin("org.portable-scala" % "sbt-scalajs-crossproject" % "0.3.1") +addSbtPlugin("org.scala-native" % "sbt-scala-native" % "0.3.6") \ No newline at end of file -- cgit v1.2.3