diff options
author | Jan Christopher Vogt <oss.nsp@cvogt.org> | 2016-03-12 00:09:26 -0500 |
---|---|---|
committer | Jan Christopher Vogt <oss.nsp@cvogt.org> | 2016-03-12 00:09:26 -0500 |
commit | b143c01a2e180b647eb27338cb7302aa38ef10c6 (patch) | |
tree | 9608d8ff36a80ac68f968aea8fcc31e4dae4150f /stage2/Lib.scala | |
parent | fae67dc6124a12710599ede6e091e2de236079aa (diff) | |
parent | 55fff670befc97a871cf0f85c65764e108f3d3c1 (diff) | |
download | cbt-b143c01a2e180b647eb27338cb7302aa38ef10c6.tar.gz cbt-b143c01a2e180b647eb27338cb7302aa38ef10c6.tar.bz2 cbt-b143c01a2e180b647eb27338cb7302aa38ef10c6.zip |
Merge pull request #78 from cvogt/chris
Chris
Diffstat (limited to 'stage2/Lib.scala')
-rw-r--r-- | stage2/Lib.scala | 32 |
1 files changed, 14 insertions, 18 deletions
diff --git a/stage2/Lib.scala b/stage2/Lib.scala index 6f83859..e87a19d 100644 --- a/stage2/Lib.scala +++ b/stage2/Lib.scala @@ -80,35 +80,29 @@ final class Lib(logger: Logger) extends Stage1Lib(logger) with Scaffold{ } def docJar( + scalaVersion: String, sourceFiles: Seq[File], - dependenyClasspath: ClassPath, + dependencyClasspath: ClassPath, apiTarget: File, jarTarget: File, artifactId: String, version: String, compileArgs: Seq[String] ): File = { - // FIXME: get this dynamically somehow, or is this even needed? - val javacp = ClassPath( - "/Library/Java/JavaVirtualMachines/jdk1.8.0_60.jdk/Contents/Home/jre/lib/ext/cldrdata.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_60.jdk/Contents/Home/jre/lib/ext/dnsns.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_60.jdk/Contents/Home/jre/lib/ext/jaccess.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_60.jdk/Contents/Home/jre/lib/ext/jfxrt.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_60.jdk/Contents/Home/jre/lib/ext/localedata.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_60.jdk/Contents/Home/jre/lib/ext/nashorn.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_60.jdk/Contents/Home/jre/lib/ext/sunec.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_60.jdk/Contents/Home/jre/lib/ext/sunjce_provider.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_60.jdk/Contents/Home/jre/lib/ext/sunpkcs11.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_60.jdk/Contents/Home/jre/lib/ext/zipfs.jar:/System/Library/Java/Extensions/MRJToolkit.jar".split(":").toVector.map(new File(_)) - ) - mkdir(Path(apiTarget)) if(sourceFiles.nonEmpty){ - System.err.println("creating docs") + val args = Seq( + // FIXME: can we use compiler dependency here? + "-cp", dependencyClasspath.string, // FIXME: does this break for builds that don't have scalac dependencies? + "-d", apiTarget.toString + ) ++ compileArgs ++ sourceFiles.map(_.toString) + logger.lib("creating docs for source files "+args.mkString(", ")) trapExitCode{ redirectOutToErr{ runMain( "scala.tools.nsc.ScalaDoc", - Seq( - // FIXME: can we use compiler dependency here? - "-cp", /*javacp++":"++*/ScalaDependencies(logger).classpath.string ++ ":" ++ dependenyClasspath.string, - "-d", apiTarget.toString - ) ++ compileArgs ++ sourceFiles.map(_.toString), - new URLClassLoader( - ScalaDependencies(logger).classpath ++ javacp, - ClassLoader.getSystemClassLoader - ) + args, + ScalaDependencies(scalaVersion)(logger).classLoader ) } } @@ -149,7 +143,7 @@ final class Lib(logger: Logger) extends Stage1Lib(logger) with Scaffold{ } class ReflectBuild(val build: Build) extends ReflectObject(build){ - def usage = { + def usage: String = { val baseTasks = lib.taskNames(ru.typeOf[Build]) val thisTasks = lib.taskNames(subclassType) diff baseTasks ( @@ -197,7 +191,9 @@ final class Lib(logger: Logger) extends Stage1Lib(logger) with Scaffold{ System.err.println("") } System.err.println(usage) - System.exit(1) + taskName.foreach{ _ => + ExitCode.Failure + } } } } |