Jorge Costa
02/04/2024, 6:17 PMval outputDir = project.layout.buildDirectory.dir(BUILD_FOLDER + it.name)
val task =
project.tasks.register(taskName, MyTask::class.java) { task ->
task.group = "my-custom-task"
task.source.set(it.sources.res?.all) // Input
task.destination.set(outputDir) // Output
}
// This will add the new folder to the sourceSet of the variant
it.sources.res?.addGeneratedSourceDirectory(
task,
MyTask::destination
)