diff options
author | Tobias Roeser <le.petit.fou@web.de> | 2019-02-25 17:13:39 +0100 |
---|---|---|
committer | Tobias Roeser <le.petit.fou@web.de> | 2019-02-25 17:13:39 +0100 |
commit | e94e73291360c76429b9ab4428f1560dfea1bf39 (patch) | |
tree | e5c7bad4b9a56f0def7c18b69aec82187ad79005 /scalalib | |
parent | b19b5a4d36ed5015eb59d621dab13e9742408805 (diff) | |
download | mill-e94e73291360c76429b9ab4428f1560dfea1bf39.tar.gz mill-e94e73291360c76429b9ab4428f1560dfea1bf39.tar.bz2 mill-e94e73291360c76429b9ab4428f1560dfea1bf39.zip |
Introduced JavaModule.docOptions to add extra (Java)Doc procesing options
E.g. disabling picky JavaDoc linter with `-Xdoclint:none`.
The method is called `docOptions` instead of `javadocOptions` so that other modules like `ScalaModule` can reuse it.
Diffstat (limited to 'scalalib')
-rw-r--r-- | scalalib/src/JavaModule.scala | 27 |
1 files changed, 16 insertions, 11 deletions
diff --git a/scalalib/src/JavaModule.scala b/scalalib/src/JavaModule.scala index 1a5bc47b..fb128f3c 100644 --- a/scalalib/src/JavaModule.scala +++ b/scalalib/src/JavaModule.scala @@ -298,36 +298,41 @@ trait JavaModule extends mill.Module with TaskModule { outer => } /** - * The documentation jar, containing all the Javadoc/Scaladoc HTML files, for - * publishing to Maven Central - */ + * Additional options for the used doc tool (e.g. javadoc). + */ + def docOptions: T[Seq[String]] = T { Seq[String]() } + + /** + * The documentation jar, containing all the Javadoc/Scaladoc HTML files, for + * publishing to Maven Central + */ def docJar = T[PathRef] { val outDir = T.ctx().dest val javadocDir = outDir / 'javadoc os.makeDir.all(javadocDir) - val files = for{ + val files = for { ref <- allSources() if os.exists(ref.path) p <- (if (os.isDir(ref.path)) os.walk(ref.path) else Seq(ref.path)) if os.isFile(p) && (p.ext == "java") } yield p.toNIO.toString - val options = Seq("-d", javadocDir.toNIO.toString) + val options = docOptions() ++ Seq("-d", javadocDir.toNIO.toString) - if (files.nonEmpty) Jvm.baseInteractiveSubprocess( + if (files.nonEmpty) Jvm.runSubprocess( commandArgs = Seq( "javadoc" ) ++ options ++ - Seq( - "-classpath", - compileClasspath() + Seq( + "-classpath", + compileClasspath() .map(_.path) .filter(_.ext != "pom") .mkString(java.io.File.pathSeparator) - ) ++ - files.map(_.toString), + ) ++ + files.map(_.toString), envArgs = Map(), workingDir = T.ctx().dest ) |