Declare generated SourceSets correctly

Allow Gradle to keep the track of the task generating the sources
KTI-1502 Fixed
This commit is contained in:
cristiangarcia
2023-12-24 00:01:59 +00:00
committed by Space Team
parent 88f7b085e6
commit 5a1fb78fcd
7 changed files with 49 additions and 73 deletions
+10 -11
View File
@@ -17,14 +17,6 @@ dependencies {
compileOnly(intellijCore())
}
sourceSets {
"main" {
projectDefault()
generatedDir()
}
"test" { none() }
}
val generatorClasspath by configurations.creating
dependencies {
@@ -59,9 +51,16 @@ val generateCheckersComponents by tasks.registering(NoDebugJavaExec::class) {
systemProperties["line.separator"] = "\n"
}
val compileKotlin by tasks
compileKotlin.dependsOn(generateCheckersComponents)
sourceSets {
"main" {
projectDefault()
java.srcDirs(generateCheckersComponents.map {
// This is required because that task is generating all the platforms too
generationRoot
})
}
"test" { none() }
}
if (kotlinBuildProperties.isInJpsBuildIdeaSync) {
apply(plugin = "idea")
+5 -9
View File
@@ -18,13 +18,6 @@ dependencies {
compileOnly(intellijCore())
}
sourceSets {
"main" {
projectDefault()
generatedDir()
}
}
val generatorClasspath by configurations.creating
dependencies {
@@ -51,8 +44,11 @@ val generateTree by tasks.registering(NoDebugJavaExec::class) {
systemProperties["line.separator"] = "\n"
}
tasks.named("compileKotlin") {
dependsOn(generateTree)
sourceSets {
"main" {
projectDefault()
java.srcDir(generateTree)
}
}
if (kotlinBuildProperties.isInJpsBuildIdeaSync) {
+7 -11
View File
@@ -20,14 +20,6 @@ dependencies {
optInToUnsafeDuringIrConstructionAPI()
sourceSets {
"main" {
projectDefault()
generatedDir()
}
"test" {}
}
val generatorClasspath by configurations.creating
dependencies {
@@ -54,9 +46,13 @@ val generateTree by tasks.registering(NoDebugJavaExec::class) {
systemProperties["line.separator"] = "\n"
}
val compileKotlin by tasks
compileKotlin.dependsOn(generateTree)
sourceSets {
"main" {
projectDefault()
java.srcDirs(generateTree)
}
"test" {}
}
tasks.withType<org.jetbrains.kotlin.gradle.dsl.KotlinCompile<*>> {
kotlinOptions {