Skip to content

Commit 198bb5b

Browse files
authored
refactor: generate clients into ignored src folder (#88)
1 parent 461a7aa commit 198bb5b

File tree

3 files changed

+14
-3
lines changed

3 files changed

+14
-3
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,6 @@ build/
1111
*.iml
1212
.idea/
1313
local.properties
14+
# ignore generated files
15+
services/*/generated-src
16+
services/*/build.gradle.kts

codegen/sdk/build.gradle.kts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -195,8 +195,12 @@ task("stageSdks") {
195195
discoveredServices.forEach {
196196
logger.info("copying ${it.outputDir} to ${it.destinationDir}")
197197
copy {
198-
from(it.outputDir)
199-
into(it.destinationDir)
198+
from("${it.outputDir}/src")
199+
into("${it.destinationDir}/generated-src")
200+
}
201+
copy {
202+
from("${it.outputDir}/build.gradle.kts")
203+
into("${it.destinationDir}")
200204
}
201205
}
202206
}

services/build.gradle.kts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,10 @@ subprojects {
2727
// have generated sdk's opt-in to internal runtime features
2828
kotlin.sourceSets.all {
2929
experimentalAnnotations.forEach { languageSettings.useExperimentalAnnotation(it) }
30+
31+
if (name == "main") {
32+
kotlin.srcDir("generated-src/main/kotlin")
33+
}
3034
}
3135

3236
tasks.test {
@@ -58,4 +62,4 @@ subprojects {
5862
}
5963

6064
apply(from = rootProject.file("gradle/publish.gradle"))
61-
}
65+
}

0 commit comments

Comments
 (0)