Permalink
Browse files

scala-native

  • Loading branch information...
xuwei-k committed Dec 29, 2017
1 parent 4408f1a commit 0f32bc07920056cafa277bef812594ca73a50950
Showing with 35 additions and 7 deletions.
  1. +7 −0 .travis.yml
  2. +10 −4 build.sbt
  3. +3 −1 project/Common.scala
  4. +13 −2 project/CustomCrossType.scala
  5. +2 −0 project/plugin.sbt
@@ -22,5 +22,12 @@ env:
matrix:
include:
- scala: "2.11.12"
jdk: oraclejdk8
sudo: required
before_install:
- curl https://raw.githubusercontent.com/scala-native/scala-native/0f69c875d2cb23f/bin/travis_setup.sh | bash -x
script:
- sbt ++$TRAVIS_SCALA_VERSION "msgpack4z-argonautNative/test:nativeLink"
- scala: "2.12.4"
jdk: oraclejdk9
@@ -1,12 +1,13 @@
import build._
import org.scalajs.sbtplugin.cross.CrossProject
import sbtcrossproject.CrossProject
val argonautVersion = "6.2.1"
val msgpack4zArgonaut = CrossProject(
msgpack4zArgonautName,
file("."),
CustomCrossType
id = msgpack4zArgonautName,
base = file("."),
crossType = CustomCrossType,
platforms = JSPlatform, JVMPlatform, NativePlatform
).settings(
Common.settings,
scalapropsCoreSettings,
@@ -33,10 +34,15 @@ val msgpack4zArgonaut = CrossProject(
s"-P:scalajs:mapSourceURI:$a->$g/"
},
scalaJSSemantics ~= { _.withStrictFloats(true) }
).nativeSettings(
scalapropsNativeSettings,
test in Test := {}, // TODO scala.Float roundtrip fail
scalaVersion := Common.Scala211
)
val msgpack4zArgonautJVM = msgpack4zArgonaut.jvm
val msgpack4zArgonautJS = msgpack4zArgonaut.js
val msgpack4zArgonautNative = msgpack4zArgonaut.native
val root = Project("root", file(".")).settings(
Common.settings,
@@ -20,6 +20,7 @@ object Common {
)
private[this] val Scala212 = "2.12.4"
val Scala211 = "2.11.12"
val settings = Seq(
ReleasePlugin.extraReleaseCommands
@@ -50,6 +51,7 @@ object Common {
},
enableCrossBuild = true
),
releaseStepCommandAndRemaining(s"; ++ $Scala211 ; msgpack4z-argonautNative/publishSigned"),
setNextVersion,
commitNextVersion,
releaseStepCommand("sonatypeReleaseAll"),
@@ -75,7 +77,7 @@ object Common {
Nil
) ::: unusedWarnings,
scalaVersion := Scala212,
crossScalaVersions := Scala212 :: "2.11.12" :: Nil,
crossScalaVersions := Scala212 :: Scala211 :: Nil,
scalacOptions in (Compile, doc) ++= {
val tag = tagOrHash.value
Seq(
@@ -1,10 +1,21 @@
import sbt._
import org.scalajs.sbtplugin.cross.CrossType
import scalanative.sbtplugin.ScalaNativePlugin.autoImport._
import scalajscrossproject.ScalaJSCrossPlugin.autoImport._
import sbtcrossproject.CrossPlugin.autoImport._
object CustomCrossType extends CrossType {
object CustomCrossType extends sbtcrossproject.CrossType {
override def projectDir(crossBase: File, projectType: String) =
crossBase / projectType
override def projectDir(crossBase: File, projectType: sbtcrossproject.Platform) = {
val dir = projectType match {
case JVMPlatform => "jvm"
case JSPlatform => "js"
case NativePlatform => "native"
}
crossBase / dir
}
def shared(projectBase: File, conf: String) =
projectBase.getParentFile / "src" / conf / "scala"
@@ -3,6 +3,8 @@ addSbtPlugin("com.github.gseitz" % "sbt-release" % "1.0.7")
addSbtPlugin("org.xerial.sbt" % "sbt-sonatype" % "2.0")
addSbtPlugin("com.github.scalaprops" % "sbt-scalaprops" % "0.2.4")
addSbtPlugin("org.scala-js" % "sbt-scalajs" % "0.6.21")
addSbtPlugin("org.portable-scala" % "sbt-scalajs-crossproject" % "0.3.0")
addSbtPlugin("org.scala-native" % "sbt-scala-native" % "0.3.6")
scalacOptions ++= (
"-deprecation" ::

0 comments on commit 0f32bc0

Please sign in to comment.