Slackbot
12/26/2023, 6:29 PMCaleb Cushing
12/26/2023, 7:05 PMsourceSets {
openApi {
java {
srcDir(tasks.openApiGenerate.outputDir)
}
}
}
kind of looks like it works (would love to know why they don't create their own...)Caleb Cushing
12/26/2023, 7:05 PMCaleb Cushing
12/26/2023, 7:06 PMCaleb Cushing
12/26/2023, 7:43 PMCaleb Cushing
12/26/2023, 7:44 PMsourceSets {
openApi {
java {
srcDir(tasks.openApiGenerate)
}
}
}
configurations {
main.extendsFrom(openApiCompile)
}
]Caleb Cushing
12/26/2023, 9:54 PMmain still does not depend on the openApi source set. Although at least at this point it looks like the openApi source set is pointed at the correct directory (openapi/src/main)Vampire
12/28/2023, 10:24 PMmain.extendsFrom(openApiCompile)
just means that all dependencies that are declared on openApiCompile or any it extends are also declared on main, but it does not imply any dependency from either to the other other than that.Vampire
12/28/2023, 10:25 PMsourceSets {
main {
java {
srcDir(tasks.openApiGenerate)
}
}
}Vampire
12/28/2023, 10:26 PMVampire
12/28/2023, 10:26 PMCaleb Cushing
12/28/2023, 10:37 PMCaleb Cushing
12/28/2023, 10:38 PMVampire
12/28/2023, 11:08 PMWell that didn't work because the generator generates a repository route and not a source directoryLet me quote myself:
and the open api generation tasks can be configured to meet that criterionI did this already in the past myself already, so I know it works if you bend it to your will
Vampire
12/28/2023, 11:09 PMIt wouldn't generate build files unless they intended you to make a repository from it.Not really, afair it is meant to be used as subproject or included build. Wheter you check it in or not is not relevant for that. But checking in generated files imho is always the wrong way. No file generated by the build process should ever be checked in except as very last resort imho. 🙂
Caleb Cushing
12/28/2023, 11:09 PMCaleb Cushing
12/28/2023, 11:10 PMVampire
12/28/2023, 11:10 PMCaleb Cushing
12/28/2023, 11:11 PMVampire
12/28/2023, 11:12 PMCaleb Cushing
12/28/2023, 11:12 PMCaleb Cushing
12/28/2023, 11:13 PMVampire
12/28/2023, 11:14 PMmain sourceSet but a separate like you already half-way did and then depend from main to thatCaleb Cushing
12/28/2023, 11:15 PMCaleb Cushing
12/28/2023, 11:15 PMVampire
12/28/2023, 11:16 PMVampire
12/28/2023, 11:17 PMCaleb Cushing
12/28/2023, 11:19 PMCaleb Cushing
12/28/2023, 11:20 PMVampire
12/28/2023, 11:33 PMmain is special here?
Can you show an example?
It should not really be specials except that it is wired to some places.Caleb Cushing
12/29/2023, 3:25 PMcompileJava.dependsOn tasks.openApiGenerate
sourcesJar.dependsOn tasks.openApiGenerate
sourceSets {
main {
java {
srcDir(tasks.openApiGenerate)
}
}
}Caleb Cushing
12/29/2023, 3:47 PMVampire
12/29/2023, 7:33 PMdependsOn that does not have a lifecycle task on the left-hand side is a code smell anyway.
And by defining the generation task as source dir, any task needing sources gets the generated sources and automatically has the necessary task dependency, that's the point. :-)
> unfortunately, this doesn't do the right thing... it's still generating the entire structure
>
Well, try to follow what I wrote in the conversation I linked you to. Your configuration is different from what I wrote.Caleb Cushing
12/29/2023, 7:39 PMCaleb Cushing
12/29/2023, 7:41 PMCaleb Cushing
12/29/2023, 7:42 PMVampire
12/29/2023, 7:43 PMVampire
12/29/2023, 7:44 PMCaleb Cushing
12/29/2023, 7:45 PMCaleb Cushing
12/29/2023, 7:45 PM