Skip to content

Commit 117593d

Browse files
authored
Merge pull request #54 from ThoughtWorksInc/scala-js-1
Cross build for Scala.js 1.x and 0.6
2 parents 5bd60e6 + 5f18697 commit 117593d

File tree

8 files changed

+34
-12
lines changed

8 files changed

+34
-12
lines changed

.scalafmt.conf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
version = "2.3.2"
1+
version = "2.4.2"
22
maxColumn = 120

.travis.yml

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,19 @@ before_deploy:
3232

3333
deploy:
3434
- provider: script
35-
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
35+
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
3636
skip_cleanup: true
3737
on:
3838
all_branches: true
3939
condition: $GITHUB_PERSONAL_ACCESS_TOKEN
40+
41+
env:
42+
- SBT_ARGS=
43+
- SBT_ARGS=--addPluginSbtFile=project/plugins.sbt.scalajs06
44+
45+
sbt_args: $SBT_ARGS
46+
47+
jobs:
48+
exclude:
49+
- scala: 2.10.7
50+
env: SBT_ARGS=

build.sbt

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
1+
import sbtcrossproject.CrossPlugin.autoImport.crossProject
2+
13
publish / skip := true
24

35
organization in ThisBuild := "com.thoughtworks.extractor"
46

5-
lazy val extractor = crossProject in file(".")
6-
7-
lazy val extractorJVM = extractor.jvm
8-
9-
lazy val extractorJS = extractor.js
7+
lazy val extractor = crossProject(JSPlatform, JVMPlatform) in file(".")
108

119
// Workaround for randomly Travis CI fail
1210
parallelExecution in Global := false

jvm/jvm.sbt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
import Ordering.Implicits._
2+
3+
// To prevent duplicate JVM releases, only publish JVM artifacts when Scala.js version is 1.x
4+
publish / skip := VersionNumber(scalaJSVersion).numbers < Seq(1) && VersionNumber(scalaBinaryVersion.value).numbers >= Seq(2, 11)

project/build.properties

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

project/plugins.sbt

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,18 @@
1-
addSbtPlugin("com.thoughtworks.sbt-best-practice" % "sbt-best-practice" % "7.1.1")
1+
addSbtPlugin("com.thoughtworks.sbt-best-practice" % "sbt-best-practice" % "7.2.0")
22

33
addSbtPlugin("org.xerial.sbt" % "sbt-sonatype" % "3.8.1")
44

55
addSbtPlugin("com.dwijnand" % "sbt-dynver" % "4.0.0")
66

7-
addSbtPlugin("com.jsuereth" % "sbt-pgp" % "1.1.2")
7+
addSbtPlugin("com.jsuereth" % "sbt-pgp" % "2.0.1")
88

99
addSbtPlugin("org.lyranthe.sbt" % "partial-unification" % "1.1.2")
1010

1111
addSbtPlugin("com.thoughtworks.example" % "sbt-example" % "7.0.0")
1212

1313
addSbtPlugin("com.thoughtworks.sbt-scala-js-map" % "sbt-scala-js-map" % "4.0.0")
1414

15-
addSbtPlugin("org.scala-js" % "sbt-scalajs" % "0.6.31")
15+
addSbtPlugin("org.portable-scala" % "sbt-scalajs-crossproject" % "1.0.0")
16+
17+
addSbtPlugin("org.scala-js" % "sbt-scalajs" % "1.0.1")
18+

project/plugins.sbt.scalajs06

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
// An optional sbt file to replace Scala.js 1.0 with 0.6
2+
dependencyOverrides += Defaults.sbtPluginExtra(
3+
"org.scala-js" % "sbt-scalajs" % "0.6.32",
4+
sbtBinaryVersion.value,
5+
scalaBinaryVersion.value,
6+
)

shared/build.sbt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
enablePlugins(Example)
22

3-
libraryDependencies += "org.scalatest" %%% "scalatest" % "3.1.0" % Test
3+
libraryDependencies += "org.scalatest" %%% "scalatest" % "3.1.1" % Test

0 commit comments

Comments
 (0)