This message was deleted.
# community-support
s
This message was deleted.
v
Using
afterEvaluate
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('...').
m
Thank you for your answer. I see that the
javaDocReleaseGeneration
task is not listed on the Gradle Tasks output. with
tasks.withType(JavaDoc)
I don't get a match unfortunately
v
If it is not listed in
gw tasks --all
then are you sure that is its name?
m
Oh yes it is listed with
task --all
but it's a 'dynamic' task built by the variant 'release'. So it's there but i can not reference to it with
Copy code
tasks.named("javaDocReleaseGeneration"){
    println it
}
v
Also not with
matching
? o_O
tasks.named
only works if the task is already registered the moment you call
named
m
There is no 'JavaDoc' type task. Maybe it's from another type
v
gw help --task javaDocReleaseGeneration
shows you the type
But you can also just leave out the
withType
and directly do
tasks.matching
but you need to know the task anyway or you don't now how to configure it.
1
m
Type JavaDocGenerationTask (com.android.build.gradle.tasks.JavaDocGenerationTask)
v
Well, then go on 🙂
m
Ok,
Copy code
tasks.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 for
It seems it does not have 'excludes' property but i think i can proceed now. I at least have a grip on the config of the task
Thank you for the help @Vampire
👌 1