diff options
author | Li Haoyi <haoyi.sg@gmail.com> | 2018-01-21 13:41:46 -0800 |
---|---|---|
committer | Li Haoyi <haoyi.sg@gmail.com> | 2018-01-21 13:41:56 -0800 |
commit | f9f413d82bf81864dafd24d86400646b089bc410 (patch) | |
tree | 0e99ab9adfa8f732bf2290a0ffc047dfa9266163 /scalalib/src | |
parent | 0b80a077168293dec684e2cdfe365b3163c76585 (diff) | |
download | mill-f9f413d82bf81864dafd24d86400646b089bc410.tar.gz mill-f9f413d82bf81864dafd24d86400646b089bc410.tar.bz2 mill-f9f413d82bf81864dafd24d86400646b089bc410.zip |
- Make `docsJar` and `sourcesJar` more robust against empty inputs
- `sourcesJar` now de-dupes items by default, rather than crashing
- Resolving commands now works properly within cross-builds
Diffstat (limited to 'scalalib/src')
-rw-r--r-- | scalalib/src/mill/scalalib/ScalaModule.scala | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/scalalib/src/mill/scalalib/ScalaModule.scala b/scalalib/src/mill/scalalib/ScalaModule.scala index 1b2bd28d..975a5972 100644 --- a/scalalib/src/mill/scalalib/ScalaModule.scala +++ b/scalalib/src/mill/scalalib/ScalaModule.scala @@ -192,27 +192,27 @@ trait ScalaModule extends mill.Module with TaskModule { outer => val javadocDir = outDir / 'javadoc mkdir(javadocDir) - val options = { - - val files = for{ - ref <- sources() - p <- ls.rec(ref.path) - if p.isFile - } yield p.toNIO.toString - files ++ Seq("-d", javadocDir.toNIO.toString, "-usejavacp") - } + val files = for{ + ref <- sources() + if exists(ref.path) + p <- ls.rec(ref.path) + if p.isFile + } yield p.toNIO.toString - subprocess( + + val options = Seq("-d", javadocDir.toNIO.toString, "-usejavacp") + + if (files.nonEmpty) subprocess( "scala.tools.nsc.ScalaDoc", compileDepClasspath().filter(_.path.ext != "pom").map(_.path), - options = options.toSeq + options = (files ++ options).toSeq ) createJar(Agg(javadocDir))(outDir / "javadoc.jar") } def sourcesJar = T { - createJar((sources() ++ resources()).map(_.path).filter(exists))(T.ctx().dest / "sources.jar") + createJar((allSources() ++ resources()).map(_.path).filter(exists))(T.ctx().dest / "sources.jar") } def forkArgs = T{ Seq.empty[String] } |