diff options
author | Li Haoyi <haoyi@dropbox.com> | 2014-08-18 00:59:08 -0700 |
---|---|---|
committer | Li Haoyi <haoyi@dropbox.com> | 2014-08-18 00:59:08 -0700 |
commit | 424cc28d19f7e23cab6af9795a6c6a5c4adf5e3c (patch) | |
tree | ceaef4aab4e9377330a452da0742981e12611e97 | |
parent | 6dcc72f2fa678256c3529e51c83d2d77f711bdf2 (diff) | |
download | workbench-424cc28d19f7e23cab6af9795a6c6a5c4adf5e3c.tar.gz workbench-424cc28d19f7e23cab6af9795a6c6a5c4adf5e3c.tar.bz2 workbench-424cc28d19f7e23cab6af9795a6c6a5c4adf5e3c.zip |
wipscalajs
-rw-r--r-- | build.sbt | 86 | ||||
-rw-r--r-- | client/src/main/scala/workbench/Main.scala | 10 | ||||
-rw-r--r-- | plugin/src/main/scala/workbench/Plugin.scala (renamed from Plugin.scala) | 5 | ||||
-rw-r--r-- | plugin/src/main/scala/workbench/Server.scala (renamed from Server.scala) | 0 | ||||
-rw-r--r-- | project/build.sbt | 1 | ||||
-rw-r--r-- | shared/src/main/scala/workbench/Shared.scala | 1 |
6 files changed, 59 insertions, 44 deletions
@@ -1,44 +1,52 @@ import sbt.Keys._ -name := "workbench" - -version := "0.1.5" - -organization := "com.lihaoyi" - -sbtPlugin := true - -// Sonatype -publishArtifact in Test := false - -publishTo := Some("releases" at "https://oss.sonatype.org/service/local/staging/deploy/maven2") +val defaultSettings = Seq( + unmanagedSourceDirectories in Compile <+= baseDirectory(_ / "shared" / "main" / "scala"), + unmanagedSourceDirectories in Test <+= baseDirectory(_ / "shared" / "test" / "scala") +) -pomExtra := ( - <url>https://github.com/lihaoyi/workbench</url> - <licenses> - <license> - <name>MIT license</name> - <url>http://www.opensource.org/licenses/mit-license.php</url> - </license> - </licenses> - <scm> - <url>git://github.com/lihaoyi/workbench.git</url> - <connection>scm:git://github.com/lihaoyi/workbench.git</connection> - </scm> - <developers> - <developer> - <id>lihaoyi</id> - <name>Li Haoyi</name> - <url>https://github.com/lihaoyi</url> - </developer> - </developers> +lazy val plugin = project.in(file("plugin")).settings(defaultSettings:_*).settings( + name := "workbench", + version := "0.1.5", + organization := "com.lihaoyi", + sbtPlugin := true, + publishArtifact in Test := false, + publishTo := Some("releases" at "https://oss.sonatype.org/service/local/staging/deploy/maven2"), + pomExtra := ( + <url>https://github.com/lihaoyi/workbench</url> + <licenses> + <license> + <name>MIT license</name> + <url>http://www.opensource.org/licenses/mit-license.php</url> + </license> + </licenses> + <scm> + <url>git://github.com/lihaoyi/workbench.git</url> + <connection>scm:git://github.com/lihaoyi/workbench.git</connection> + </scm> + <developers> + <developer> + <id>lihaoyi</id> + <name>Li Haoyi</name> + <url>https://github.com/lihaoyi</url> + </developer> + </developers> + ), + (resources in Compile) := {(resources in Compile).value ++ (baseDirectory.value * "*.js").get}, + libraryDependencies ++= Seq( + "io.spray" % "spray-can" % "1.3.1", + "io.spray" % "spray-routing" % "1.3.1", + "com.typesafe.akka" %% "akka-actor" % "2.3.0", + "com.lihaoyi" %% "upickle" % "0.2.1" ) - -(resources in Compile) := {(resources in Compile).value ++ (baseDirectory.value * "*.js").get} - -libraryDependencies ++= Seq( - "io.spray" % "spray-can" % "1.3.1", - "io.spray" % "spray-routing" % "1.3.1", - "com.typesafe.akka" %% "akka-actor" % "2.3.0", - "com.lihaoyi" %% "upickle" % "0.2.1" ) + +lazy val client = project.in(file("client")) + .settings(defaultSettings ++ scalaJSSettings:_*) + .settings( + libraryDependencies ++= Seq( + "org.scala-lang.modules.scalajs" %%% "scalajs-dom" % "0.6", + "org.scala-lang.modules" %% "scala-async" % "0.9.2", + "com.lihaoyi" %%% "upickle" % "0.2.1" + ) +)
\ No newline at end of file diff --git a/client/src/main/scala/workbench/Main.scala b/client/src/main/scala/workbench/Main.scala new file mode 100644 index 0000000..0b0cea7 --- /dev/null +++ b/client/src/main/scala/workbench/Main.scala @@ -0,0 +1,10 @@ +package workbench +import org.scalajs.dom.extensions._ +import async.Async._ +object Main{ + def main(bootSnippet: String, host: String, port: Int): Unit = async{ + while(true){ + val data = await(Ajax.get(s"http://$host:$port/notifications")) + } + } +}
\ No newline at end of file diff --git a/Plugin.scala b/plugin/src/main/scala/workbench/Plugin.scala index c155ac1..3a434e8 100644 --- a/Plugin.scala +++ b/plugin/src/main/scala/workbench/Plugin.scala @@ -1,8 +1,3 @@ -package com.lihaoyi.workbench - -import sbt._ -import Keys._ -import upickle._ object Plugin extends sbt.Plugin { val refreshBrowsers = taskKey[Unit]("Sends a message to all connected web pages asking them to refresh the page") diff --git a/Server.scala b/plugin/src/main/scala/workbench/Server.scala index b9773a7..b9773a7 100644 --- a/Server.scala +++ b/plugin/src/main/scala/workbench/Server.scala diff --git a/project/build.sbt b/project/build.sbt new file mode 100644 index 0000000..d5974dd --- /dev/null +++ b/project/build.sbt @@ -0,0 +1 @@ +addSbtPlugin("org.scala-lang.modules.scalajs" % "scalajs-sbt-plugin" % "0.5.3")
\ No newline at end of file diff --git a/shared/src/main/scala/workbench/Shared.scala b/shared/src/main/scala/workbench/Shared.scala new file mode 100644 index 0000000..be0ee43 --- /dev/null +++ b/shared/src/main/scala/workbench/Shared.scala @@ -0,0 +1 @@ +package workbench |