With Gradle 6.5, querying a mapped output value of a task before it has completed has been deprecated.
I’ve been using this to declare a subfolder of the @OutputDirectory of a task as java.main.srcDir:
val task = project.tasks.create("sablecc", SableccTask::class) {
sableccClasspath = sableccConfiguration
}
val sourceSet = java.sourceSets.getByName("main")
sourceSet.java.srcDir(task.outputDir.map { it.dir("java") })
sourceSet.resources.srcDir(task.outputDir.map { it.dir("resources") })
What would be the best practice for this use-case without triggering the deprecation?