@@ -141,27 +141,33 @@ tasks.named("test") {
141
141
dependsOn(" copySchemaToResources" )
142
142
}
143
143
144
+ tasks.named(" processResources" ) {
145
+ dependsOn(" copySchemaToResources" )
146
+ }
147
+
144
148
tasks.named(" graphqlGenerateClient" ) {
149
+ dependsOn(" copySchemaToResources" )
145
150
dependsOn(" downloadPdlSDL" )
146
151
}
147
152
153
+ val Project .buildDir_: File get() = layout.buildDirectory.get().asFile
148
154
val schema = " schema.graphql"
149
155
150
156
val graphqlGenerateClient by tasks.getting(com.expediagroup.graphql.plugin.gradle.tasks.GraphQLGenerateClientTask ::class ) {
151
157
packageName.set(" no.nav.pdl" )
152
- schemaFile.set(File (" $buildDir /$schema " ))
158
+ schemaFile.set(File (" $buildDir_ /$schema " ))
153
159
queryFileDirectory.set(File (" $projectDir /src/main/resources" ))
154
160
}
155
161
156
162
val downloadPdlSDL by tasks.register< de.undercouch.gradle.tasks.download.Download > (" downloadPdlSDL" ) {
157
163
src(" https://navikt.github.io/pdl/pdl-api-sdl.graphqls" )
158
- dest(File (buildDir , schema))
164
+ dest(File (buildDir_ , schema))
159
165
}
160
166
161
167
tasks.register<Copy >(" copySchemaToResources" ) {
162
168
dependsOn(downloadPdlSDL)
163
169
164
- from(buildDir ) {
170
+ from(buildDir_ ) {
165
171
include(schema)
166
172
}
167
173
into(" $projectDir /src/main/resources" )
@@ -170,7 +176,7 @@ tasks.register<Copy>("copySchemaToResources") {
170
176
// To get intellij to make sense of generated sources from graphql client
171
177
java {
172
178
val mainJavaSourceSet: SourceDirectorySet = sourceSets.getByName(" main" ).java
173
- val graphqlDir = " $buildDir /generated/source/graphql/main"
179
+ val graphqlDir = " $buildDir_ /generated/source/graphql/main"
174
180
mainJavaSourceSet.srcDirs(graphqlDir)
175
181
}
176
182
0 commit comments