Merge pull request #6265 from adpi2/scala3-doc

[1.5.0-M1] Improve error report for scala3doc missing
This commit is contained in:
eugene yokota 2021-01-24 21:36:26 -05:00 committed by GitHub
commit feaea5d943
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 13 additions and 1 deletions

View File

@ -2055,13 +2055,25 @@ object Defaults extends BuildCommon {
val converter = fileConverter.value
val tFiles = tastyFiles.value
val sv = scalaVersion.value
val allDeps = allDependencies.value
(hasScala, hasJava) match {
case (true, _) =>
val options = sOpts ++ Opts.doc.externalAPI(xapis)
val runDoc = Doc.scaladoc(label, s.cacheStoreFactory sub "scala", cs.scalac match {
case ac: AnalyzingCompiler => ac.onArgs(exported(s, "scaladoc"))
}, fiOpts)
val docSrcs = if (ScalaArtifacts.isScala3(sv)) tFiles else srcs
val isScala3 = ScalaArtifacts.isScala3(sv)
def isScala3Doc(module: ModuleID): Boolean = {
module.configurations.exists(_.startsWith(Configurations.ScalaDocTool.name)) &&
module.name == ScalaArtifacts.Scala3DocID
}
if (isScala3 && !allDeps.exists(isScala3Doc)) {
Array(
"Unresolved scala3doc artifact",
"add 'ThisBuild / resolvers += Resolver.JCenterRepository'"
).foreach(m => s.log.error(m))
}
val docSrcs = if (isScala3) tFiles else srcs
runDoc(docSrcs, cp, out, options, maxErrors.value, s.log)
case (_, true) =>
val javadoc =