Declare generated SourceSets correctly
Allow Gradle to keep the track of the task generating the sources KTI-1502 Fixed
This commit is contained in:
committed by
Space Team
parent
88f7b085e6
commit
5a1fb78fcd
@@ -17,14 +17,6 @@ dependencies {
|
|||||||
compileOnly(intellijCore())
|
compileOnly(intellijCore())
|
||||||
}
|
}
|
||||||
|
|
||||||
sourceSets {
|
|
||||||
"main" {
|
|
||||||
projectDefault()
|
|
||||||
generatedDir()
|
|
||||||
}
|
|
||||||
"test" { none() }
|
|
||||||
}
|
|
||||||
|
|
||||||
val generatorClasspath by configurations.creating
|
val generatorClasspath by configurations.creating
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
@@ -59,9 +51,16 @@ val generateCheckersComponents by tasks.registering(NoDebugJavaExec::class) {
|
|||||||
systemProperties["line.separator"] = "\n"
|
systemProperties["line.separator"] = "\n"
|
||||||
}
|
}
|
||||||
|
|
||||||
val compileKotlin by tasks
|
sourceSets {
|
||||||
|
"main" {
|
||||||
compileKotlin.dependsOn(generateCheckersComponents)
|
projectDefault()
|
||||||
|
java.srcDirs(generateCheckersComponents.map {
|
||||||
|
// This is required because that task is generating all the platforms too
|
||||||
|
generationRoot
|
||||||
|
})
|
||||||
|
}
|
||||||
|
"test" { none() }
|
||||||
|
}
|
||||||
|
|
||||||
if (kotlinBuildProperties.isInJpsBuildIdeaSync) {
|
if (kotlinBuildProperties.isInJpsBuildIdeaSync) {
|
||||||
apply(plugin = "idea")
|
apply(plugin = "idea")
|
||||||
|
|||||||
@@ -18,13 +18,6 @@ dependencies {
|
|||||||
compileOnly(intellijCore())
|
compileOnly(intellijCore())
|
||||||
}
|
}
|
||||||
|
|
||||||
sourceSets {
|
|
||||||
"main" {
|
|
||||||
projectDefault()
|
|
||||||
generatedDir()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
val generatorClasspath by configurations.creating
|
val generatorClasspath by configurations.creating
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
@@ -51,8 +44,11 @@ val generateTree by tasks.registering(NoDebugJavaExec::class) {
|
|||||||
systemProperties["line.separator"] = "\n"
|
systemProperties["line.separator"] = "\n"
|
||||||
}
|
}
|
||||||
|
|
||||||
tasks.named("compileKotlin") {
|
sourceSets {
|
||||||
dependsOn(generateTree)
|
"main" {
|
||||||
|
projectDefault()
|
||||||
|
java.srcDir(generateTree)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (kotlinBuildProperties.isInJpsBuildIdeaSync) {
|
if (kotlinBuildProperties.isInJpsBuildIdeaSync) {
|
||||||
|
|||||||
@@ -20,14 +20,6 @@ dependencies {
|
|||||||
|
|
||||||
optInToUnsafeDuringIrConstructionAPI()
|
optInToUnsafeDuringIrConstructionAPI()
|
||||||
|
|
||||||
sourceSets {
|
|
||||||
"main" {
|
|
||||||
projectDefault()
|
|
||||||
generatedDir()
|
|
||||||
}
|
|
||||||
"test" {}
|
|
||||||
}
|
|
||||||
|
|
||||||
val generatorClasspath by configurations.creating
|
val generatorClasspath by configurations.creating
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
@@ -54,9 +46,13 @@ val generateTree by tasks.registering(NoDebugJavaExec::class) {
|
|||||||
systemProperties["line.separator"] = "\n"
|
systemProperties["line.separator"] = "\n"
|
||||||
}
|
}
|
||||||
|
|
||||||
val compileKotlin by tasks
|
sourceSets {
|
||||||
|
"main" {
|
||||||
compileKotlin.dependsOn(generateTree)
|
projectDefault()
|
||||||
|
java.srcDirs(generateTree)
|
||||||
|
}
|
||||||
|
"test" {}
|
||||||
|
}
|
||||||
|
|
||||||
tasks.withType<org.jetbrains.kotlin.gradle.dsl.KotlinCompile<*>> {
|
tasks.withType<org.jetbrains.kotlin.gradle.dsl.KotlinCompile<*>> {
|
||||||
kotlinOptions {
|
kotlinOptions {
|
||||||
|
|||||||
+1
-2
@@ -188,11 +188,10 @@ class NamedNativeInteropConfig implements Named {
|
|||||||
interopStubs = project.sourceSets.create(interopStubsName)
|
interopStubs = project.sourceSets.create(interopStubsName)
|
||||||
configuration = project.configurations.create(interopStubs.name)
|
configuration = project.configurations.create(interopStubs.name)
|
||||||
project.tasks.getByName(interopStubs.getTaskName("compile", "Kotlin")) {
|
project.tasks.getByName(interopStubs.getTaskName("compile", "Kotlin")) {
|
||||||
dependsOn genTask
|
|
||||||
kotlinOptions.freeCompilerArgs = ["-Xskip-prerelease-check"]
|
kotlinOptions.freeCompilerArgs = ["-Xskip-prerelease-check"]
|
||||||
}
|
}
|
||||||
|
|
||||||
interopStubs.kotlin.srcDirs generatedSrcDir
|
interopStubs.kotlin.srcDir(project.tasks.named(genTask.name).map { generatedSrcDir })
|
||||||
|
|
||||||
project.dependencies {
|
project.dependencies {
|
||||||
add interopStubs.getApiConfigurationName(), project(path: ':kotlin-native:Interop:Runtime')
|
add interopStubs.getApiConfigurationName(), project(path: ':kotlin-native:Interop:Runtime')
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
|
|
||||||
|
|
||||||
description = "Kotlin Mock Runtime for Tests"
|
description = "Kotlin Mock Runtime for Tests"
|
||||||
|
|
||||||
plugins {
|
plugins {
|
||||||
@@ -22,15 +20,6 @@ dependencies {
|
|||||||
builtins(project(":core:builtins"))
|
builtins(project(":core:builtins"))
|
||||||
}
|
}
|
||||||
|
|
||||||
sourceSets {
|
|
||||||
"main" {
|
|
||||||
java.apply {
|
|
||||||
srcDir(layout.buildDirectory.dir("src"))
|
|
||||||
}
|
|
||||||
}
|
|
||||||
"test" {}
|
|
||||||
}
|
|
||||||
|
|
||||||
val copySources by task<Sync> {
|
val copySources by task<Sync> {
|
||||||
val stdlibProjectDir = file("$rootDir/libraries/stdlib/jvm")
|
val stdlibProjectDir = file("$rootDir/libraries/stdlib/jvm")
|
||||||
|
|
||||||
@@ -53,7 +42,12 @@ val copySources by task<Sync> {
|
|||||||
into(layout.buildDirectory.dir("src"))
|
into(layout.buildDirectory.dir("src"))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sourceSets {
|
||||||
|
"main" {
|
||||||
|
java.srcDir(copySources)
|
||||||
|
}
|
||||||
|
"test" {}
|
||||||
|
}
|
||||||
|
|
||||||
tasks.compileKotlin {
|
tasks.compileKotlin {
|
||||||
dependsOn(copySources)
|
dependsOn(copySources)
|
||||||
|
|||||||
@@ -4,18 +4,17 @@ plugins {
|
|||||||
|
|
||||||
val copyrightDirectory = project.layout.buildDirectory.dir("copyright")
|
val copyrightDirectory = project.layout.buildDirectory.dir("copyright")
|
||||||
|
|
||||||
sourceSets {
|
|
||||||
"main" {
|
|
||||||
kotlin.srcDir("src")
|
|
||||||
resources.srcDir(copyrightDirectory)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
api("org.jetbrains.kotlin:kotlin-stdlib:$bootstrapKotlinVersion")
|
api("org.jetbrains.kotlin:kotlin-stdlib:$bootstrapKotlinVersion")
|
||||||
api("org.jetbrains.kotlin:kotlin-reflect:$bootstrapKotlinVersion")
|
api("org.jetbrains.kotlin:kotlin-reflect:$bootstrapKotlinVersion")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
val copyCopyrightProfile by tasks.registering(Copy::class) {
|
||||||
|
from("$rootDir/.idea/copyright")
|
||||||
|
into(copyrightDirectory)
|
||||||
|
include("apache.xml")
|
||||||
|
}
|
||||||
|
|
||||||
tasks {
|
tasks {
|
||||||
compileKotlin {
|
compileKotlin {
|
||||||
compilerOptions {
|
compilerOptions {
|
||||||
@@ -23,16 +22,6 @@ tasks {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
val copyCopyrightProfile by registering(Copy::class) {
|
|
||||||
from("$rootDir/.idea/copyright")
|
|
||||||
into(copyrightDirectory)
|
|
||||||
include("apache.xml")
|
|
||||||
}
|
|
||||||
|
|
||||||
processResources {
|
|
||||||
dependsOn(copyCopyrightProfile)
|
|
||||||
}
|
|
||||||
|
|
||||||
register<JavaExec>("run") {
|
register<JavaExec>("run") {
|
||||||
group = "application"
|
group = "application"
|
||||||
mainClass = "generators.GenerateStandardLibKt"
|
mainClass = "generators.GenerateStandardLibKt"
|
||||||
@@ -55,4 +44,11 @@ tasks {
|
|||||||
classpath = sourceSets.main.get().runtimeClasspath
|
classpath = sourceSets.main.get().runtimeClasspath
|
||||||
args = listOf("$rootDir")
|
args = listOf("$rootDir")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sourceSets {
|
||||||
|
"main" {
|
||||||
|
kotlin.srcDir("src")
|
||||||
|
resources.srcDir(copyCopyrightProfile)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -19,14 +19,6 @@ dependencies {
|
|||||||
testRuntimeOnly(libs.junit.jupiter.engine)
|
testRuntimeOnly(libs.junit.jupiter.engine)
|
||||||
}
|
}
|
||||||
|
|
||||||
sourceSets {
|
|
||||||
"main" {
|
|
||||||
projectDefault()
|
|
||||||
generatedDir()
|
|
||||||
}
|
|
||||||
"test" { projectDefault() }
|
|
||||||
}
|
|
||||||
|
|
||||||
testsJar()
|
testsJar()
|
||||||
|
|
||||||
projectTest(jUnitMode = JUnitMode.JUnit5) {
|
projectTest(jUnitMode = JUnitMode.JUnit5) {
|
||||||
@@ -60,8 +52,12 @@ val generateTree by tasks.registering(NoDebugJavaExec::class) {
|
|||||||
systemProperties["line.separator"] = "\n"
|
systemProperties["line.separator"] = "\n"
|
||||||
}
|
}
|
||||||
|
|
||||||
tasks.named("compileKotlin") {
|
sourceSets {
|
||||||
dependsOn(generateTree)
|
"main" {
|
||||||
|
projectDefault()
|
||||||
|
java.srcDir(generateTree)
|
||||||
|
}
|
||||||
|
"test" { projectDefault() }
|
||||||
}
|
}
|
||||||
|
|
||||||
if (kotlinBuildProperties.isInJpsBuildIdeaSync) {
|
if (kotlinBuildProperties.isInJpsBuildIdeaSync) {
|
||||||
|
|||||||
Reference in New Issue
Block a user