Slackbot
09/21/2023, 12:12 PMVampire
09/21/2023, 12:22 PMafterEvaluate
is practically always wrong.
It is in 98.7 % of the cases just a symptom treatment, shifting problems to later times and makes them harder to reproduce, debug, and fix, and mainly introduces timing problems and race conditions.
Also on "how to configure it", I strongly suggest using Kotlin DSL instead of Groovy DSL. With Kotlin DSL you immediately get type-safe build scripts, much better and actually helpful error messages if you mess up the syntax, and amazingly better IDE support if you use a proper IDE like IntelliJ or AS.
If the task is not readily available (tasks.named("javaDocReleaseGeneration")
saying the task does not exist), the proper way is tasks.withType(JavaDoc).matching { it.name == 'javaDocReleaseGeneration' }.configureEach { ... }
and in the docs of JavaDoc
and in the Gradle userguide you can find how to configure the task, like for example excludes.add('...').
Michael
09/21/2023, 12:36 PMjavaDocReleaseGeneration
task is not listed on the Gradle Tasks output. with tasks.withType(JavaDoc)
I don't get a match unfortunatelyVampire
09/21/2023, 1:45 PMgw tasks --all
then are you sure that is its name?Michael
09/21/2023, 2:22 PMtask --all
but it's a 'dynamic' task built by the variant 'release'. So it's there but i can not reference to it with
tasks.named("javaDocReleaseGeneration"){
println it
}
Vampire
09/21/2023, 2:23 PMmatching
? o_OVampire
09/21/2023, 2:23 PMtasks.named
only works if the task is already registered the moment you call named
Michael
09/21/2023, 2:24 PMVampire
09/21/2023, 2:24 PMgw help --task javaDocReleaseGeneration
shows you the typeVampire
09/21/2023, 2:25 PMwithType
and directly do tasks.matching
but you need to know the task anyway or you don't now how to configure it.Michael
09/21/2023, 2:25 PMVampire
09/21/2023, 2:25 PMMichael
09/21/2023, 2:32 PMtasks.matching { it.name == 'javaDocReleaseGeneration' }.configureEach {
println it.dokkaPlugins
}
It seems it's not a Javadoc Task but some kind of com.android.build.gradle.tasks.JavaDocGenerationTask i'm trying to find documentation forMichael
09/21/2023, 2:33 PMMichael
09/26/2023, 3:16 PM