aboutsummaryrefslogtreecommitdiff
path: root/examples/scalajs-react-example/js/build/build.scala
diff options
context:
space:
mode:
authorChristopher Vogt <oss.nsp@cvogt.org>2016-06-17 22:38:18 -0400
committerChristopher Vogt <oss.nsp@cvogt.org>2016-06-19 20:57:54 -0400
commit47cc41ecaa2eaf5677fcb1794db7bbba6533b559 (patch)
tree8708b8cd5954dfa03f2478b77440340c7664972b /examples/scalajs-react-example/js/build/build.scala
parent12d5bad267b5759e941b7101578808aeb6351e66 (diff)
downloadcbt-47cc41ecaa2eaf5677fcb1794db7bbba6533b559.tar.gz
cbt-47cc41ecaa2eaf5677fcb1794db7bbba6533b559.tar.bz2
cbt-47cc41ecaa2eaf5677fcb1794db7bbba6533b559.zip
refactor/simplify scalaJs plugin and example
- Restructure code as 1 library case class and 1 Build mixin trait. A library is generally easier to understand and could be re-used independently. 1 trait seems simpler than several here. - Let not the plugin create the multi-project build, but the user project manually. I think while this adds some minor code overhead it is much simpler to understand. Fewer tasks and other moving parts needed. - Remove verbose nested sbt-style folder structure. It's simpler without it :).
Diffstat (limited to 'examples/scalajs-react-example/js/build/build.scala')
-rw-r--r--examples/scalajs-react-example/js/build/build.scala22
1 files changed, 22 insertions, 0 deletions
diff --git a/examples/scalajs-react-example/js/build/build.scala b/examples/scalajs-react-example/js/build/build.scala
new file mode 100644
index 0000000..29f1c73
--- /dev/null
+++ b/examples/scalajs-react-example/js/build/build.scala
@@ -0,0 +1,22 @@
+import cbt._
+class Build(val context: Context) extends ScalaJsBuild{
+ override val projectName = "my-project"
+
+ override def sources = super.sources ++ Seq(
+ projectDirectory.getParentFile ++ "/shared"
+ )
+
+ override def dependencies = (
+ super.dependencies ++
+ Resolver( mavenCentral ).bind(
+ //"org.scalatest" %%% "scalatest" % "3.0.0-RC2",
+ "com.github.japgolly.scalajs-react" %%% "core" % "0.10.4", // for example
+ // for example if you want explicitely state scala version
+ "org.scala-js" % "scalajs-dom_sjs0.6_2.11" % "0.9.0"
+ )
+ )
+
+ override protected def fastOptJSFile = {
+ projectDirectory.getParentFile ++ "/server/public" ++ ("/"++super.fastOptJSFile.getName)
+ }
+}