Skip to content

Commit 301e655

Browse files
authored
Merge pull request #10 from sjrd/scalajs
Fix #5: Set up Scala.js.
2 parents 3ced2fd + fa3b6bf commit 301e655

File tree

4 files changed

+28
-11
lines changed

4 files changed

+28
-11
lines changed

.travis.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,10 @@ scala:
88
- 2.13.3
99

1010
env:
11-
- ADOPTOPENJDK=8
12-
- ADOPTOPENJDK=11
11+
- SCALAJS_BUILD= ADOPTOPENJDK=8
12+
- SCALAJS_BUILD= ADOPTOPENJDK=11
13+
- SCALAJS_BUILD=true ADOPTOPENJDK=8
14+
- SCALAJS_BUILD=true ADOPTOPENJDK=11
1315

1416
install:
1517
- git fetch --tags # get all tags for sbt-dynver

build.sbt

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,24 @@
11
lazy val root = project.in(file("."))
2-
.settings(ScalaModulePlugin.scalaModuleSettings)
32
.settings(
4-
name := "scala-library-next",
5-
scalacOptions ++= Seq("-deprecation", "-feature", "-Werror"),
3+
publish / skip := true
4+
)
5+
6+
lazy val `scala-library-next` = crossProject(JVMPlatform, JSPlatform)
7+
.crossType(CrossType.Pure)
8+
.withoutSuffixFor(JVMPlatform)
9+
.in(file("."))
10+
.jvmSettings(
11+
libraryDependencies += "junit" % "junit" % "4.13.1" % Test,
12+
)
13+
.jsConfigure(_.enablePlugins(ScalaJSJUnitPlugin))
14+
.settings(
15+
ScalaModulePlugin.scalaModuleSettings,
616
scalaModuleMimaPreviousVersion := None,
17+
scalacOptions ++= Seq("-deprecation", "-feature", "-Werror"),
718
libraryDependencies ++= Seq(
8-
"junit" % "junit" % "4.13.1" % Test,
9-
"org.scalacheck" %% "scalacheck" % "1.14.3" % Test,
10-
)
19+
"org.scalacheck" %%% "scalacheck" % "1.14.3" % Test,
20+
),
21+
)
22+
.jsSettings(
23+
Test / fork := false,
1124
)

build.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@ isReleaseJob() {
2424
fi
2525
}
2626

27-
if [[ "$SCALAJS_VERSION" == "" ]]; then
28-
projectPrefix=""
27+
if [[ "$SCALAJS_BUILD" == "true" ]]; then
28+
projectPrefix="scala-library-nextJS/"
2929
else
30-
projectPrefix="TODO/"
30+
projectPrefix="scala-library-next/"
3131
fi
3232

3333
verPat="[0-9]+\.[0-9]+\.[0-9]+(-[A-Za-z0-9-]+)?"

project/plugins.sbt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
11
addSbtPlugin("org.scala-lang.modules" % "sbt-scala-module" % "2.2.3")
2+
addSbtPlugin("org.scala-js" % "sbt-scalajs" % "1.3.0")
3+
addSbtPlugin("org.portable-scala" % "sbt-scalajs-crossproject" % "1.0.0")

0 commit comments

Comments
 (0)