diff --git a/.travis.yml b/.travis.yml index e6eebaa..2378349 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,8 +8,10 @@ scala: - 2.13.3 env: - - ADOPTOPENJDK=8 - - ADOPTOPENJDK=11 + - SCALAJS_BUILD= ADOPTOPENJDK=8 + - SCALAJS_BUILD= ADOPTOPENJDK=11 + - SCALAJS_BUILD=true ADOPTOPENJDK=8 + - SCALAJS_BUILD=true ADOPTOPENJDK=11 install: - git fetch --tags # get all tags for sbt-dynver diff --git a/build.sbt b/build.sbt index 2dddf96..8ad7552 100644 --- a/build.sbt +++ b/build.sbt @@ -1,11 +1,24 @@ lazy val root = project.in(file(".")) - .settings(ScalaModulePlugin.scalaModuleSettings) .settings( - name := "scala-library-next", - scalacOptions ++= Seq("-deprecation", "-feature", "-Werror"), + publish / skip := true + ) + +lazy val `scala-library-next` = crossProject(JVMPlatform, JSPlatform) + .crossType(CrossType.Pure) + .withoutSuffixFor(JVMPlatform) + .in(file(".")) + .jvmSettings( + libraryDependencies += "junit" % "junit" % "4.13.1" % Test, + ) + .jsConfigure(_.enablePlugins(ScalaJSJUnitPlugin)) + .settings( + ScalaModulePlugin.scalaModuleSettings, scalaModuleMimaPreviousVersion := None, + scalacOptions ++= Seq("-deprecation", "-feature", "-Werror"), libraryDependencies ++= Seq( - "junit" % "junit" % "4.13.1" % Test, - "org.scalacheck" %% "scalacheck" % "1.14.3" % Test, - ) + "org.scalacheck" %%% "scalacheck" % "1.14.3" % Test, + ), + ) + .jsSettings( + Test / fork := false, ) diff --git a/build.sh b/build.sh index bd12a25..5358d55 100755 --- a/build.sh +++ b/build.sh @@ -24,10 +24,10 @@ isReleaseJob() { fi } -if [[ "$SCALAJS_VERSION" == "" ]]; then - projectPrefix="" +if [[ "$SCALAJS_BUILD" == "true" ]]; then + projectPrefix="scala-library-nextJS/" else - projectPrefix="TODO/" + projectPrefix="scala-library-next/" fi verPat="[0-9]+\.[0-9]+\.[0-9]+(-[A-Za-z0-9-]+)?" diff --git a/project/plugins.sbt b/project/plugins.sbt index 81fac90..5ccad05 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -1 +1,3 @@ addSbtPlugin("org.scala-lang.modules" % "sbt-scala-module" % "2.2.3") +addSbtPlugin("org.scala-js" % "sbt-scalajs" % "1.3.0") +addSbtPlugin("org.portable-scala" % "sbt-scalajs-crossproject" % "1.0.0")