From 64d0b70feecac3450e2d660f3def0a2071db0b09 Mon Sep 17 00:00:00 2001 From: Yang Bo Date: Mon, 26 Sep 2016 11:38:47 +0800 Subject: [PATCH] Support Scala.js --- build.sbt | 11 ++++++++++- project/plugins.sbt | 4 ++++ shared/build.sbt | 1 + .../src}/main/scala/com/thoughtworks/Extractor.scala | 0 .../test/scala/com/thoughtworks/ExtractorSpec.scala | 0 5 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 shared/build.sbt rename {src => shared/src}/main/scala/com/thoughtworks/Extractor.scala (100%) rename {src => shared/src}/test/scala/com/thoughtworks/ExtractorSpec.scala (100%) diff --git a/build.sbt b/build.sbt index f0e1191..0b1b612 100644 --- a/build.sbt +++ b/build.sbt @@ -1,7 +1,16 @@ -libraryDependencies += "org.scalatest" %% "scalatest" % "3.0.0" % Test +publishArtifact := false organization in ThisBuild := "com.thoughtworks.extractor" name := "extractor" crossScalaVersions in ThisBuild := Seq("2.10.6", "2.11.8", "2.12.0-RC1") + +lazy val extractor = crossProject in file(".") + +lazy val extractorJVM = extractor.jvm.addSbtFiles(file("../shared/build.sbt")) + +lazy val extractorJS = extractor.js.addSbtFiles(file("../shared/build.sbt")) + +// Workaround for randomly Travis CI fail +parallelExecution in Global := false diff --git a/project/plugins.sbt b/project/plugins.sbt index b9a210b..a098cba 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -1 +1,5 @@ addSbtPlugin("com.thoughtworks.sbt-best-practice" % "sbt-best-practice" % "1.6.0") + +addSbtPlugin("com.thoughtworks.sbt-scala-js-map" % "sbt-scala-js-map" % "latest.release") + +addSbtPlugin("org.scala-js" % "sbt-scalajs" % "0.6.12") diff --git a/shared/build.sbt b/shared/build.sbt new file mode 100644 index 0000000..f2362a0 --- /dev/null +++ b/shared/build.sbt @@ -0,0 +1 @@ +libraryDependencies += "org.scalatest" %%% "scalatest" % "3.0.0" % Test diff --git a/src/main/scala/com/thoughtworks/Extractor.scala b/shared/src/main/scala/com/thoughtworks/Extractor.scala similarity index 100% rename from src/main/scala/com/thoughtworks/Extractor.scala rename to shared/src/main/scala/com/thoughtworks/Extractor.scala diff --git a/src/test/scala/com/thoughtworks/ExtractorSpec.scala b/shared/src/test/scala/com/thoughtworks/ExtractorSpec.scala similarity index 100% rename from src/test/scala/com/thoughtworks/ExtractorSpec.scala rename to shared/src/test/scala/com/thoughtworks/ExtractorSpec.scala