diff options
author | Haoyi Li <haoyi@haoyi-mbp.corp.dropbox.com> | 2014-11-26 01:43:13 -0800 |
---|---|---|
committer | Haoyi Li <haoyi@haoyi-mbp.corp.dropbox.com> | 2014-11-26 01:43:13 -0800 |
commit | 0489a0d6c8d3beceeedb8c2f6eaad7b9387073c0 (patch) | |
tree | 95efbc083dee7d9ce8211d44d3f98c4a34c26ad4 /build.sbt | |
parent | 88595a41e3ec13c1a516e847fe3d0b279facf3fc (diff) | |
download | hands-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.sbt | 28 |
1 files changed, 27 insertions, 1 deletions
@@ -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")) |