6b19b8b9d0
^KT-63419 In Progress
68 lines
1.6 KiB
Kotlin
68 lines
1.6 KiB
Kotlin
import org.jetbrains.kotlin.gradle.tasks.KotlinJvmCompile
|
|
import org.jetbrains.kotlin.ideaExt.idea
|
|
|
|
plugins {
|
|
kotlin("jvm")
|
|
id("jps-compatible")
|
|
}
|
|
|
|
dependencies {
|
|
api(project(":core:descriptors"))
|
|
api(project(":core:deserialization"))
|
|
api(project(":compiler:frontend.common"))
|
|
implementation(project(":compiler:util"))
|
|
implementation(project(":compiler:config"))
|
|
|
|
if (kotlinBuildProperties.isInIdeaSync) {
|
|
compileOnly(project("tree-generator")) // Provided, so that IDEA can recognize references to this module in KDoc.
|
|
}
|
|
compileOnly(intellijCore())
|
|
}
|
|
|
|
optInToUnsafeDuringIrConstructionAPI()
|
|
|
|
val generatorClasspath by configurations.creating
|
|
|
|
dependencies {
|
|
generatorClasspath(project("tree-generator"))
|
|
}
|
|
|
|
val generationRoot = projectDir.resolve("gen")
|
|
|
|
val generateTree by tasks.registering(NoDebugJavaExec::class) {
|
|
|
|
val generatorRoot = "$projectDir/tree-generator/src/"
|
|
|
|
val generatorConfigurationFiles = fileTree(generatorRoot) {
|
|
include("**/*.kt")
|
|
}
|
|
|
|
inputs.files(generatorConfigurationFiles)
|
|
outputs.dirs(generationRoot)
|
|
|
|
args(generationRoot)
|
|
workingDir = rootDir
|
|
classpath = generatorClasspath
|
|
mainClass.set("org.jetbrains.kotlin.ir.generator.MainKt")
|
|
systemProperties["line.separator"] = "\n"
|
|
}
|
|
|
|
sourceSets {
|
|
"main" {
|
|
projectDefault()
|
|
java.srcDirs(generateTree)
|
|
}
|
|
"test" {}
|
|
}
|
|
|
|
tasks.withType<KotlinJvmCompile> {
|
|
compilerOptions.freeCompilerArgs.add("-Xinline-classes")
|
|
}
|
|
|
|
if (kotlinBuildProperties.isInJpsBuildIdeaSync) {
|
|
apply(plugin = "idea")
|
|
idea {
|
|
this.module.generatedSourceDirs.add(generationRoot)
|
|
}
|
|
}
|