[KAPT4] Create basic infrastructure for KAPT4
This commit is contained in:
committed by
Space Team
parent
fc57f48c8f
commit
083f54aceb
@@ -0,0 +1,59 @@
|
||||
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
|
||||
|
||||
description = "Annotation Processor for Kotlin"
|
||||
|
||||
plugins {
|
||||
kotlin("jvm")
|
||||
id("jps-compatible")
|
||||
}
|
||||
|
||||
dependencies {
|
||||
compileOnly(project(":compiler:frontend.java"))
|
||||
compileOnly(project(":compiler:plugin-api"))
|
||||
|
||||
implementation(project(":kotlin-annotation-processing-compiler"))
|
||||
embedded(project(":kotlin-annotation-processing-compiler")) { isTransitive = false }
|
||||
}
|
||||
|
||||
optInToExperimentalCompilerApi()
|
||||
|
||||
sourceSets {
|
||||
"main" { projectDefault() }
|
||||
"test" {
|
||||
projectDefault()
|
||||
generatedTestDir()
|
||||
}
|
||||
}
|
||||
|
||||
testsJar {}
|
||||
|
||||
kaptTestTask("test", JavaLanguageVersion.of(8))
|
||||
kaptTestTask("testJdk11", JavaLanguageVersion.of(11))
|
||||
kaptTestTask("testJdk17", JavaLanguageVersion.of(17))
|
||||
|
||||
fun Project.kaptTestTask(name: String, javaLanguageVersion: JavaLanguageVersion) {
|
||||
val service = extensions.getByType<JavaToolchainService>()
|
||||
|
||||
projectTest(taskName = name, parallel = true) {
|
||||
useJUnitPlatform {
|
||||
excludeTags = setOf("IgnoreJDK11")
|
||||
}
|
||||
workingDir = rootDir
|
||||
dependsOn(":dist")
|
||||
javaLauncher.set(service.launcherFor { languageVersion.set(javaLanguageVersion) })
|
||||
}
|
||||
}
|
||||
|
||||
publish()
|
||||
runtimeJar()
|
||||
sourcesJar()
|
||||
javadocJar()
|
||||
|
||||
|
||||
allprojects {
|
||||
tasks.withType(KotlinCompile::class).all {
|
||||
kotlinOptions {
|
||||
freeCompilerArgs += "-Xcontext-receivers"
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user