forked from lihaoyi/hands-on-scala-js
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
clientserver examples now work with crossProject
- Loading branch information
Li Haoyi
committed
Feb 4, 2015
1 parent
b094df4
commit 3e92267
Showing
27 changed files
with
51 additions
and
121 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,27 @@ | ||
import NativePackagerKeys._ | ||
val sharedSettings = Seq( | ||
|
||
val app = crossProject.settings( | ||
unmanagedSourceDirectories in Compile += | ||
baseDirectory.value / "shared" / "main" / "scala", | ||
libraryDependencies ++= Seq( | ||
"com.lihaoyi" %%% "scalatags" % "0.4.5", | ||
"com.lihaoyi" %%% "upickle" % "0.2.7" | ||
"com.lihaoyi" %%% "upickle" % "0.2.6" | ||
), | ||
scalaVersion := "2.11.5" | ||
) | ||
|
||
lazy val client = project.in(file("client")) | ||
.enablePlugins(ScalaJSPlugin) | ||
.settings(sharedSettings:_*) | ||
.settings( | ||
).jsSettings( | ||
libraryDependencies ++= Seq( | ||
"org.scala-js" %%% "scalajs-dom" % "0.8.0" | ||
) | ||
) | ||
|
||
lazy val server = project.in(file("server")) | ||
.settings(sharedSettings:_*) | ||
.settings(packageArchetype.java_application:_*) | ||
.settings( | ||
).jvmSettings( | ||
libraryDependencies ++= Seq( | ||
"io.spray" %% "spray-can" % "1.3.2", | ||
"io.spray" %% "spray-routing" % "1.3.2", | ||
"com.typesafe.akka" %% "akka-actor" % "2.3.6" | ||
), | ||
(resources in Compile) += (fastOptJS in (client, Compile)).value.data | ||
) | ||
) | ||
|
||
lazy val appJS = app.js | ||
lazy val appJVM = app.jvm.settings( | ||
(resources in Compile) += (fastOptJS in (appJS, Compile)).value.data | ||
) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
/*project/build.sbt*/ | ||
addSbtPlugin("org.scala-js" % "sbt-scalajs" % "0.6.0-RC2") | ||
addSbtPlugin("org.scala-js" % "sbt-scalajs" % "0.6.0") | ||
|
||
addSbtPlugin("com.typesafe.sbt" % "sbt-native-packager" % "0.7.4") |
This file was deleted.
Oops, something went wrong.
3 changes: 2 additions & 1 deletion
3
...client/src/main/scala/simple/Client.scala → ...app/js/src/main/scala/simple/Client.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,27 @@ | ||
val sharedSettings = Seq( | ||
val app = crossProject.settings( | ||
unmanagedSourceDirectories in Compile += | ||
baseDirectory.value / "shared" / "main" / "scala", | ||
libraryDependencies ++= Seq( | ||
"com.lihaoyi" %%% "scalatags" % "0.4.3-RC1", | ||
"com.lihaoyi" %%% "upickle" % "0.2.6-RC1", | ||
"com.lihaoyi" %%% "autowire" % "0.2.4-RC1" | ||
"com.lihaoyi" %%% "scalatags" % "0.4.5", | ||
"com.lihaoyi" %%% "upickle" % "0.2.6", | ||
"com.lihaoyi" %%% "autowire" % "0.2.4" | ||
), | ||
scalaVersion := "2.11.5" | ||
) | ||
|
||
lazy val client = project.in(file("client")) | ||
.enablePlugins(ScalaJSPlugin) | ||
.settings(sharedSettings:_*) | ||
.settings( | ||
libraryDependencies ++= Seq( | ||
"org.scala-js" %%% "scalajs-dom" % "0.7.0" | ||
).jsSettings( | ||
libraryDependencies ++= Seq( | ||
"org.scala-js" %%% "scalajs-dom" % "0.8.0" | ||
) | ||
).jvmSettings( | ||
libraryDependencies ++= Seq( | ||
"io.spray" %% "spray-can" % "1.3.2", | ||
"io.spray" %% "spray-routing" % "1.3.2", | ||
"com.typesafe.akka" %% "akka-actor" % "2.3.6" | ||
) | ||
) | ||
) | ||
|
||
lazy val server = project.in(file("server")) | ||
.settings(sharedSettings:_*) | ||
.settings( | ||
libraryDependencies ++= Seq( | ||
"io.spray" %% "spray-can" % "1.3.2", | ||
"io.spray" %% "spray-routing" % "1.3.2", | ||
"com.typesafe.akka" %% "akka-actor" % "2.3.6" | ||
), | ||
(resources in Compile) += (fastOptJS in (client, Compile)).value.data | ||
lazy val appJS = app.js | ||
lazy val appJVM = app.jvm.settings( | ||
(resources in Compile) += (fastOptJS in (appJS, Compile)).value.data | ||
) | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
/*project/build.sbt*/ | ||
addSbtPlugin("org.scala-js" % "sbt-scalajs" % "0.6.0-RC2") | ||
addSbtPlugin("org.scala-js" % "sbt-scalajs" % "0.6.0") | ||
|
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,12 @@ | ||
val sharedSettings = Seq( | ||
unmanagedSourceDirectories in Compile += | ||
baseDirectory.value / "shared" / "main" / "scala" | ||
|
||
val cross = crossProject.settings( | ||
// Shared settings here | ||
).jsSettings( | ||
// JS-specific settings here | ||
).jvmSettings( | ||
// JVM-specific settings here | ||
) | ||
|
||
lazy val js = project.in(file("js")).enablePlugins(ScalaJSPlugin) | ||
.settings(sharedSettings:_*) | ||
lazy val js = cross.js | ||
|
||
lazy val jvm = project.in(file("jvm")).settings(sharedSettings:_*) | ||
lazy val jvm = cross.jvm |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
/*project/build.sbt*/ | ||
addSbtPlugin("org.scala-js" % "sbt-scalajs" % "0.6.0-RC2") | ||
addSbtPlugin("org.scala-js" % "sbt-scalajs" % "0.6.0") |
This file was deleted.
Oops, something went wrong.
7 changes: 0 additions & 7 deletions
7
examples/crossBuilds/simple2/js/shared/main/scala/simple/Simple.scala
This file was deleted.
Oops, something went wrong.
9 changes: 0 additions & 9 deletions
9
examples/crossBuilds/simple2/js/src/main/scala/simple/Platform.scala
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
14 changes: 0 additions & 14 deletions
14
examples/crossBuilds/simple2/jvm/src/main/scala/simple/Platform.scala
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters