diff --git a/.scalafmt.conf b/.scalafmt.conf index 5c84156..3d0aaf9 100644 --- a/.scalafmt.conf +++ b/.scalafmt.conf @@ -1,2 +1,2 @@ -version = "2.3.2" +version = "2.4.2" maxColumn = 120 diff --git a/.travis.yml b/.travis.yml index 4877140..e2a0aa6 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,10 +8,10 @@ addons: language: scala scala: - - "2.10.7" - - "2.11.12" - - "2.12.6" - - "2.13.0" + - 2.10.7 + - 2.11.12 + - 2.12.11 + - 2.13.2 jdk: - openjdk8 @@ -32,8 +32,19 @@ before_deploy: deploy: - provider: script - script: sbt ++$TRAVIS_SCALA_VERSION "set every Seq(sonatypeSessionName := \"Travis Job $TRAVIS_JOB_NAME $TRAVIS_JOB_NUMBER ($TRAVIS_JOB_WEB_URL)\", publishTo := sonatypePublishToBundle.value)" publishSigned sonatypeBundleRelease + script: sbt $SBT_ARGS ++$TRAVIS_SCALA_VERSION "set every Seq(sonatypeSessionName := \"Travis Job $TRAVIS_JOB_NAME $TRAVIS_JOB_NUMBER ($TRAVIS_JOB_WEB_URL)\", publishTo := sonatypePublishToBundle.value)" publishSigned sonatypeBundleRelease skip_cleanup: true on: all_branches: true condition: $GITHUB_PERSONAL_ACCESS_TOKEN + +env: + - SBT_ARGS= + - SBT_ARGS=--addPluginSbtFile=project/plugins.sbt.scalajs06 + +sbt_args: $SBT_ARGS + +jobs: + exclude: + - scala: 2.10.7 + env: SBT_ARGS= diff --git a/build.sbt b/build.sbt index a272d5f..d987fcc 100644 --- a/build.sbt +++ b/build.sbt @@ -1,12 +1,10 @@ +import sbtcrossproject.CrossPlugin.autoImport.crossProject + publish / skip := true organization in ThisBuild := "com.thoughtworks.extractor" -lazy val extractor = crossProject in file(".") - -lazy val extractorJVM = extractor.jvm - -lazy val extractorJS = extractor.js +lazy val extractor = crossProject(JSPlatform, JVMPlatform) in file(".") // Workaround for randomly Travis CI fail parallelExecution in Global := false diff --git a/jvm/jvm.sbt b/jvm/jvm.sbt new file mode 100644 index 0000000..8c42c95 --- /dev/null +++ b/jvm/jvm.sbt @@ -0,0 +1,4 @@ +import Ordering.Implicits._ + +// To prevent duplicate JVM releases, only publish JVM artifacts when Scala.js version is 1.x +publish / skip := VersionNumber(scalaJSVersion).numbers < Seq(1) && VersionNumber(scalaBinaryVersion.value).numbers >= Seq(2, 11) diff --git a/project/build.properties b/project/build.properties index 8522443..797e7cc 100644 --- a/project/build.properties +++ b/project/build.properties @@ -1 +1 @@ -sbt.version=1.3.2 +sbt.version=1.3.10 diff --git a/project/plugins.sbt b/project/plugins.sbt index 38b24a4..e38ff8f 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -1,10 +1,10 @@ -addSbtPlugin("com.thoughtworks.sbt-best-practice" % "sbt-best-practice" % "7.1.1") +addSbtPlugin("com.thoughtworks.sbt-best-practice" % "sbt-best-practice" % "7.2.0") addSbtPlugin("org.xerial.sbt" % "sbt-sonatype" % "3.8.1") addSbtPlugin("com.dwijnand" % "sbt-dynver" % "4.0.0") -addSbtPlugin("com.jsuereth" % "sbt-pgp" % "1.1.2") +addSbtPlugin("com.jsuereth" % "sbt-pgp" % "2.0.1") addSbtPlugin("org.lyranthe.sbt" % "partial-unification" % "1.1.2") @@ -12,4 +12,7 @@ addSbtPlugin("com.thoughtworks.example" % "sbt-example" % "7.0.0") addSbtPlugin("com.thoughtworks.sbt-scala-js-map" % "sbt-scala-js-map" % "4.0.0") -addSbtPlugin("org.scala-js" % "sbt-scalajs" % "0.6.31") +addSbtPlugin("org.portable-scala" % "sbt-scalajs-crossproject" % "1.0.0") + +addSbtPlugin("org.scala-js" % "sbt-scalajs" % "1.0.1") + diff --git a/project/plugins.sbt.scalajs06 b/project/plugins.sbt.scalajs06 new file mode 100644 index 0000000..73b34fc --- /dev/null +++ b/project/plugins.sbt.scalajs06 @@ -0,0 +1,6 @@ +// An optional sbt file to replace Scala.js 1.0 with 0.6 +dependencyOverrides += Defaults.sbtPluginExtra( + "org.scala-js" % "sbt-scalajs" % "0.6.32", + sbtBinaryVersion.value, + scalaBinaryVersion.value, +) diff --git a/shared/build.sbt b/shared/build.sbt index 1a4d922..d3a76a9 100644 --- a/shared/build.sbt +++ b/shared/build.sbt @@ -1,3 +1,3 @@ enablePlugins(Example) -libraryDependencies += "org.scalatest" %%% "scalatest" % "3.1.0" % Test +libraryDependencies += "org.scalatest" %%% "scalatest" % "3.1.1" % Test