Slackbot
12/04/2023, 2:03 PMVampire
12/04/2023, 2:11 PMsrcDir(openApiGenerateTask) instead of hard-wiring directory paths, you should already have the necessary dependency automatically.Caleb Cushing
12/04/2023, 3:09 PMCaleb Cushing
12/04/2023, 5:41 PMsourceSets {
main {
java {
// srcDir(tasks.named('openApiGenerate'))
// need to add subfolder instead of root of the task output
srcDir(tasks.openApiGenerate.getOutputDir().get() + "/src/main/java")
}
}
}
is, insufficient? what else should I be looking at?Caleb Cushing
12/04/2023, 5:45 PMCaleb Cushing
12/04/2023, 5:45 PMVampire
12/04/2023, 5:48 PMsrcDir(tasks.openApiGenerate) if it declares the outputs properly.
If you need that mapping, do
srcDir(tasks.openApiGenerate.map { it.getOutputDir().get() + "/src/main/java" }) or something like that.
This way the task provider still carries over the necessary task dependency.Caleb Cushing
12/04/2023, 5:58 PMVampire
12/04/2023, 6:02 PMCaleb Cushing
12/04/2023, 6:03 PMgetOutputDir() right... guess not... I'm not going to play guessing games or source dive for this. Other dev can do it if it's that important to him not to use dependsOn. Based on the API for spotless I'm not even sure it would work anyways
> Could not find method getOutputDir() for arguments [] on provider(task 'openApiGenerate', class org.openapitools.generator.gradle.plugin.tasks.GenerateTask) of type org.gradle.api.internal.tasks.DefaultTaskCollection$ExistingTaskProvider_Vampire
12/04/2023, 6:06 PMCaleb Cushing
12/04/2023, 6:07 PMCaleb Cushing
12/04/2023, 6:07 PMCaleb Cushing
12/04/2023, 6:07 PMCaleb Cushing
12/04/2023, 6:08 PMVampire
12/04/2023, 6:08 PMVampire
12/04/2023, 6:08 PMCaleb Cushing
12/04/2023, 6:09 PMCaleb Cushing
12/04/2023, 6:10 PMCaleb Cushing
12/04/2023, 6:10 PMVampire
12/04/2023, 6:12 PMCaleb Cushing
12/04/2023, 6:15 PMCaleb Cushing
12/04/2023, 6:15 PMtasks.named("spotlessJava") {
dependsOn(tasks.named("openApiGenerate"))
}Caleb Cushing
12/04/2023, 6:15 PMCaleb Cushing
12/04/2023, 6:17 PM