I am trying to update from Gradle 7.4 to Gradle 8.9 and have run into an issue I do not know how to solve.
I have two tasks, call them taskA and taskB in a module call it modM, and I am using a 3rd party plugin, the Android Gradle Plugin (AGP)
taskA generates some files that are consumed by tasks dynamically generated from AGP. This all used to work fine in 7.4 but in 8.9 Gradle fails hard saying
Task ':modM:generateReleaseLintVitalModel' uses this output of task ':modM:taskA'
I am able to work around this by adding a dependsOn statement as so
afterEvaluate {
tasks.generateReleaseLintVitalModel.dependsOn taskA
}
All well and good until I go to execute taskB.
taskB makes a small change to an xml file. Nothing more. When I execute taskB Gradle fails hard saying
Could not get unknown property 'generateReleaseLintVitalModel' for task set of type org.gradle.api.internal.tasks.DefaultTaskContainer
taskA is executed as part of the assemble task, taskB is executed independent, and before, the assemble task, but I need to execute taskB before taskA.
This worked just fine in 7.4 and I have no idea how to fix it in 8.9.