diff options
author | Felix Mulder <felix.mulder@gmail.com> | 2016-04-11 18:20:42 +0200 |
---|---|---|
committer | Felix Mulder <felix.mulder@gmail.com> | 2016-08-19 15:37:18 +0200 |
commit | 8d8d87b9cecef81e2b2813137bb3f71e13418b11 (patch) | |
tree | 3c53e99bd6b33ff0f6bde1a72658124a9bab5d7c /project/Build.scala | |
parent | 5a5f9d7ed37ca6449ef61ee5e0f6fbf9731df795 (diff) | |
download | dotty-8d8d87b9cecef81e2b2813137bb3f71e13418b11.tar.gz dotty-8d8d87b9cecef81e2b2813137bb3f71e13418b11.tar.bz2 dotty-8d8d87b9cecef81e2b2813137bb3f71e13418b11.zip |
Add project and impl for initial barebones dottydoc
Diffstat (limited to 'project/Build.scala')
-rw-r--r-- | project/Build.scala | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/project/Build.scala b/project/Build.scala index b7822907d..7322f131b 100644 --- a/project/Build.scala +++ b/project/Build.scala @@ -264,6 +264,63 @@ object DottyInjectedPlugin extends AutoPlugin { settings(publishing) + lazy val dottydoc = crossProject.in(file("dottydoc")) + .jsSettings( + libraryDependencies ++= Seq( + "org.scala-js" %%% "scalajs-dom" % "0.8.0", + "com.github.benhutchison" %%% "prickle" % "1.1.10", + "com.lihaoyi" %%% "scalatags" % "0.5.4" + ) + ) + + lazy val dottydocJS = dottydoc.js.dependsOn(dotty).settings( + scalaSource in Compile := baseDirectory.value / "src" + ) + + lazy val dottydocJVM = dottydoc.jvm.dependsOn(dotty).settings( + (resources in Compile) += (fastOptJS in (dottydocJS, Compile)).value.data, + scalaSource in Compile := baseDirectory.value / "src", + libraryDependencies ++= Seq( + "com.github.benhutchison" %% "prickle" % "1.1.10", + "com.lihaoyi" %% "scalatags" % "0.5.4" + ), + + // enable improved incremental compilation algorithm + incOptions := incOptions.value.withNameHashing(true), + + mainClass in (Compile, run) := Some("dotty.tools.dottydoc.DottyDoc"), + fork in run := true, + fork in Test := true, + parallelExecution in Test := false, + + // http://grokbase.com/t/gg/simple-build-tool/135ke5y90p/sbt-setting-jvm-boot-paramaters-for-scala + javaOptions <++= (dependencyClasspath in Runtime, packageBin in Compile) map { (attList, bin) => + // put the Scala {library, reflect} in the classpath + val path = for { + file <- attList.map(_.data) + path = file.getAbsolutePath + } yield "-Xbootclasspath/p:" + path + // dotty itself needs to be in the bootclasspath + val fullpath = ("-Xbootclasspath/a:" + bin) :: path.toList + // System.err.println("BOOTPATH: " + fullpath) + + val travis_build = // propagate if this is a travis build + if (sys.props.isDefinedAt(JENKINS_BUILD)) + List(s"-D$JENKINS_BUILD=${sys.props(JENKINS_BUILD)}") ::: jenkinsMemLimit + else + List() + + val tuning = + if (sys.props.isDefinedAt("Oshort")) + // Optimize for short-running applications, see https://github.com/lampepfl/dotty/issues/222 + List("-XX:+TieredCompilation", "-XX:TieredStopAtLevel=1") + else + List() + + ("-DpartestParentID=" + pid) :: tuning ::: agentOptions ::: travis_build ::: fullpath + } + ) + /** A sandbox to play with the Scala.js back-end of dotty. * * This sandbox is compiled with dotty with support for Scala.js. It can be |