Igor Mukhin
07/11/2024, 2:44 PM/build/generated/resources . I need to add this directory to the resource source set.
As I understand I can do it like this:
project.sourceSets.main.get().resources.srcDirs.add(outputDir.get().asFile)
But I don't know at what point at time should it happen. In the @TaskAction method?ephemient
07/11/2024, 2:50 PMephemient
07/11/2024, 2:52 PMoutputDir is a task property and also its only output, you should simply
sourceSets.main { resources.srcDir(task) }
which will pick up both the output dir and the task dependency so that it is automatically builtIgor Mukhin
07/11/2024, 2:59 PMproject.afterEvaluate {
sourceSets.named("main") {
resources.srcDir(task.get().outputDir.get().asFile)
}
inside the plugin.ephemient
07/11/2024, 2:59 PMephemient
07/11/2024, 3:00 PMafterEvaluate and you are losing the task dependency by using asFileephemient
07/11/2024, 3:00 PMIgor Mukhin
07/11/2024, 5:49 PM