-
-
Notifications
You must be signed in to change notification settings - Fork 25
/
Copy pathksp-module.gradle.kts
35 lines (30 loc) · 971 Bytes
/
ksp-module.gradle.kts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
plugins {
java
idea
id("com.google.devtools.ksp")
}
tasks { // Hack to get KSP to pick up the module definitions
afterEvaluate {
"kspKotlin" {
if (project.name != "kord-extensions") {
dependsOn(":kord-extensions:build")
}
}
}
}
idea { // We use this instead of sourceSets b/c we're all IJ users and this fixes build optimisations
module {
// Not using += due to https://github.com/gradle/gradle/issues/8749
// (Gradle closed this as fixed, but they broke it again)
sourceDirs = sourceDirs +
file("${layout.buildDirectory}/generated/ksp/main/kotlin")
testSources.setFrom(
testSources.from + file("${layout.buildDirectory}/generated/ksp/test/kotlin")
)
// testSourceDirs = testSourceDirs +
// file("$buildDir/generated/ksp/test/kotlin")
generatedSourceDirs = generatedSourceDirs +
file("${layout.buildDirectory}/generated/ksp/main/kotlin") +
file("${layout.buildDirectory}/generated/ksp/test/kotlin")
}
}