aboutsummaryrefslogtreecommitdiff
path: root/stage2
diff options
context:
space:
mode:
authorChristopher Vogt <oss.nsp@cvogt.org>2016-09-28 10:37:15 -0400
committerChristopher Vogt <oss.nsp@cvogt.org>2016-09-28 10:53:55 -0400
commitfc29c605ab5c7fcb671495789698e93482d3a8e5 (patch)
treee3ed46ad8d5a62d087ba3be0250964a24f87d452 /stage2
parentbdf5ef17cd0f03ee95ad905dea0d52b1541f5fbb (diff)
downloadcbt-fc29c605ab5c7fcb671495789698e93482d3a8e5.tar.gz
cbt-fc29c605ab5c7fcb671495789698e93482d3a8e5.tar.bz2
cbt-fc29c605ab5c7fcb671495789698e93482d3a8e5.zip
prototype dotty doc generation, but that class does not exist
Diffstat (limited to 'stage2')
-rw-r--r--stage2/plugins/Dotty.scala32
1 files changed, 32 insertions, 0 deletions
diff --git a/stage2/plugins/Dotty.scala b/stage2/plugins/Dotty.scala
index 8869860..5fdf066 100644
--- a/stage2/plugins/Dotty.scala
+++ b/stage2/plugins/Dotty.scala
@@ -23,6 +23,11 @@ trait Dotty extends BaseBuild{
)
}
+ def doc: ExitCode =
+ dottyLib.doc(
+ sourceFiles, compileClasspath, docTarget, dottyOptions
+ )
+
def repl = dottyLib.repl(context.args, classpath)
override def dependencies = Resolver(mavenCentral).bind(
@@ -59,6 +64,33 @@ class DottyLib(
)
}
+ def doc(
+ sourceFiles: Seq[File],
+ dependencyClasspath: ClassPath,
+ docTarget: File,
+ compileArgs: Seq[String]
+ ): ExitCode = {
+ if(sourceFiles.isEmpty){
+ ExitCode.Success
+ } else {
+ docTarget.mkdirs
+ val args = Seq(
+ // FIXME: can we use compiler dependency here?
+ "-bootclasspath", dottyDependency.classpath.string, // FIXME: does this break for builds that don't have scalac dependencies?
+ "-classpath", (dependencyClasspath ++ dottyDependency.classpath).string, // FIXME: does this break for builds that don't have scalac dependencies?
+ "-d", docTarget.toString
+ ) ++ compileArgs ++ sourceFiles.map(_.toString)
+ logger.lib("creating docs for source files "+args.mkString(", "))
+ redirectOutToErr{
+ runMain(
+ "dotty.tools.dottydoc.DottyDoc",
+ args,
+ dottyDependency.classLoader(classLoaderCache)
+ )
+ }
+ }
+ }
+
def compile(
needsRecompile: Boolean,
files: Seq[File],