Issue Description
Gradle plugin documentation uses old pattern that can cause some issues. Firstly buildDir is deprecated, but I also have a build issue because my schema in resources, and so it thought I needed to depend on processResource. I suspect this is an old gradle pattern that's changed at some point. Not only is the solution simpler it has less issues because the inputs/outputs are correctly defined.
WRONG
// Automatically generate GraphQL code on project build:
compileJava.dependsOn 'graphqlCodegen'
// Add generated sources to your project source sets:
sourceSets.main.java.srcDir "$buildDir/generated"
RIGHT
groovy
sourceSets.main.java.srcDirs(tasks.graphqlCodegen, "src/main/java")
this is kotlin (this should be doubly verified as I haven't made certain that tasks.graphqCodgen is available, but it should be, I'm currently using groovy.)
sourceSets {
main {
java.srcDirs(tasks.graphqlCodegen, "src/main/java")
}
}
Your Environment and Setup
- graphql-java-codegen version: 5.10.0
- Build tool: Gradle
can create a PR if you want
Issue Description
Gradle plugin documentation uses old pattern that can cause some issues. Firstly
buildDiris deprecated, but I also have a build issue because my schema in resources, and so it thought I needed to depend on processResource. I suspect this is an old gradle pattern that's changed at some point. Not only is the solution simpler it has less issues because the inputs/outputs are correctly defined.WRONG
RIGHT
groovy
this is kotlin (this should be doubly verified as I haven't made certain that
tasks.graphqCodgenis available, but it should be, I'm currently using groovy.)sourceSets { main { java.srcDirs(tasks.graphqlCodegen, "src/main/java") } }Your Environment and Setup
can create a PR if you want