diff options
author | Christopher Vogt <oss.nsp@cvogt.org> | 2016-09-28 10:37:15 -0400 |
---|---|---|
committer | Christopher Vogt <oss.nsp@cvogt.org> | 2016-09-28 10:53:55 -0400 |
commit | fc29c605ab5c7fcb671495789698e93482d3a8e5 (patch) | |
tree | e3ed46ad8d5a62d087ba3be0250964a24f87d452 /stage2/plugins | |
parent | bdf5ef17cd0f03ee95ad905dea0d52b1541f5fbb (diff) | |
download | cbt-fc29c605ab5c7fcb671495789698e93482d3a8e5.tar.gz cbt-fc29c605ab5c7fcb671495789698e93482d3a8e5.tar.bz2 cbt-fc29c605ab5c7fcb671495789698e93482d3a8e5.zip |
prototype dotty doc generation, but that class does not exist
Diffstat (limited to 'stage2/plugins')
-rw-r--r-- | stage2/plugins/Dotty.scala | 32 |
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], |