summaryrefslogtreecommitdiff
path: root/build.sbt
diff options
context:
space:
mode:
authorHaoyi Li <haoyi@haoyi-mbp.corp.dropbox.com>2014-11-26 01:43:13 -0800
committerHaoyi Li <haoyi@haoyi-mbp.corp.dropbox.com>2014-11-26 01:43:13 -0800
commit0489a0d6c8d3beceeedb8c2f6eaad7b9387073c0 (patch)
tree95efbc083dee7d9ce8211d44d3f98c4a34c26ad4 /build.sbt
parent88595a41e3ec13c1a516e847fe3d0b279facf3fc (diff)
downloadhands-on-scala-js-0489a0d6c8d3beceeedb8c2f6eaad7b9387073c0.tar.gz
hands-on-scala-js-0489a0d6c8d3beceeedb8c2f6eaad7b9387073c0.tar.bz2
hands-on-scala-js-0489a0d6c8d3beceeedb8c2f6eaad7b9387073c0.zip
one-button build
Diffstat (limited to 'build.sbt')
-rw-r--r--build.sbt28
1 files changed, 27 insertions, 1 deletions
diff --git a/build.sbt b/build.sbt
index 8df7b50..441d8d5 100644
--- a/build.sbt
+++ b/build.sbt
@@ -2,6 +2,8 @@
import scala.scalajs.sbtplugin.ScalaJSPlugin._
import ScalaJSKeys._
+val cloneRepos = taskKey[Unit]("Clone stuff from github")
+
lazy val scalaParser = project.in(file("scalaParser")).settings(
scalaVersion := "2.11.4",
libraryDependencies ++= Seq(
@@ -76,7 +78,31 @@ lazy val book = Project(
},
libraryDependencies += "com.lihaoyi" %% "acyclic" % "0.1.2" % "provided",
autoCompilerPlugins := true,
- addCompilerPlugin("com.lihaoyi" %% "acyclic" % "0.1.2")
+ addCompilerPlugin("com.lihaoyi" %% "acyclic" % "0.1.2"),
+ cloneRepos := {
+ val localPath = crossTarget.value / "clones"
+ if (!localPath.isDirectory){
+ val paths = Seq(
+ "scala-js" -> "scala-js",
+ "lihaoyi" -> "workbench-example-app"
+ )
+ localPath.delete()
+ for ((user, repo) <- paths){
+ println(s"Cloning $repo...")
+ org.eclipse.jgit.api.Git.cloneRepository()
+ .setURI(s"https://github.com/$user/$repo")
+ .setDirectory(localPath / repo)
+ .call()
+ }
+ println("Done Cloning")
+ }else{
+ println("Already Cloned")
+ }
+ },
+ (run in Compile) <<= (run in Compile).dependsOn(cloneRepos),
+ initialize := {
+ System.setProperty("clone.root", crossTarget.value.getAbsolutePath + "/clones")
+ }
)
lazy val demos = project.in(file("examples/demos"))