Wizard: use compileKotlin for groovy instead of direct KotlinCompile task access
#KT-38921 fixed
This commit is contained in:
+1
-3
@@ -1,5 +1,3 @@
|
||||
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
|
||||
|
||||
plugins {
|
||||
id 'org.jetbrains.kotlin.jvm' version 'KOTLIN_VERSION'
|
||||
}
|
||||
@@ -17,6 +15,6 @@ dependencies {
|
||||
implementation project(':c')
|
||||
testImplementation 'org.jetbrains.kotlin:kotlin-test-junit'
|
||||
}
|
||||
tasks.withType(KotlinCompile) {
|
||||
compileKotlin {
|
||||
kotlinOptions.jvmTarget = '1.8'
|
||||
}
|
||||
+1
-3
@@ -1,5 +1,3 @@
|
||||
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
|
||||
|
||||
plugins {
|
||||
id 'org.jetbrains.kotlin.jvm' version 'KOTLIN_VERSION'
|
||||
}
|
||||
@@ -17,6 +15,6 @@ dependencies {
|
||||
implementation project(':d')
|
||||
testImplementation 'org.jetbrains.kotlin:kotlin-test-junit'
|
||||
}
|
||||
tasks.withType(KotlinCompile) {
|
||||
compileKotlin {
|
||||
kotlinOptions.jvmTarget = '1.8'
|
||||
}
|
||||
+1
-3
@@ -1,5 +1,3 @@
|
||||
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
|
||||
|
||||
plugins {
|
||||
id 'org.jetbrains.kotlin.jvm' version 'KOTLIN_VERSION'
|
||||
}
|
||||
@@ -15,6 +13,6 @@ repositories {
|
||||
dependencies {
|
||||
testImplementation 'org.jetbrains.kotlin:kotlin-test-junit'
|
||||
}
|
||||
tasks.withType(KotlinCompile) {
|
||||
compileKotlin {
|
||||
kotlinOptions.jvmTarget = '1.8'
|
||||
}
|
||||
+1
-3
@@ -1,5 +1,3 @@
|
||||
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
|
||||
|
||||
plugins {
|
||||
id 'org.jetbrains.kotlin.jvm' version 'KOTLIN_VERSION'
|
||||
}
|
||||
@@ -16,6 +14,6 @@ dependencies {
|
||||
implementation project(':a')
|
||||
testImplementation 'org.jetbrains.kotlin:kotlin-test-junit'
|
||||
}
|
||||
tasks.withType(KotlinCompile) {
|
||||
compileKotlin {
|
||||
kotlinOptions.jvmTarget = '1.8'
|
||||
}
|
||||
+1
-3
@@ -1,5 +1,3 @@
|
||||
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
|
||||
|
||||
plugins {
|
||||
id 'org.jetbrains.kotlin.jvm'
|
||||
}
|
||||
@@ -16,6 +14,6 @@ dependencies {
|
||||
rootProject
|
||||
testImplementation 'org.jetbrains.kotlin:kotlin-test-junit'
|
||||
}
|
||||
tasks.withType(KotlinCompile) {
|
||||
compileKotlin {
|
||||
kotlinOptions.jvmTarget = '1.8'
|
||||
}
|
||||
+1
-3
@@ -1,5 +1,3 @@
|
||||
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
|
||||
|
||||
plugins {
|
||||
id 'org.jetbrains.kotlin.jvm'
|
||||
}
|
||||
@@ -16,6 +14,6 @@ dependencies {
|
||||
implementation project(':b')
|
||||
testImplementation 'org.jetbrains.kotlin:kotlin-test-junit'
|
||||
}
|
||||
tasks.withType(KotlinCompile) {
|
||||
compileKotlin {
|
||||
kotlinOptions.jvmTarget = '1.8'
|
||||
}
|
||||
+1
-3
@@ -1,5 +1,3 @@
|
||||
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
|
||||
|
||||
plugins {
|
||||
id 'org.jetbrains.kotlin.jvm' version 'KOTLIN_VERSION'
|
||||
}
|
||||
@@ -15,6 +13,6 @@ repositories {
|
||||
dependencies {
|
||||
testImplementation 'org.jetbrains.kotlin:kotlin-test-junit'
|
||||
}
|
||||
tasks.withType(KotlinCompile) {
|
||||
compileKotlin {
|
||||
kotlinOptions.jvmTarget = '1.8'
|
||||
}
|
||||
+1
-3
@@ -1,5 +1,3 @@
|
||||
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
|
||||
|
||||
plugins {
|
||||
id 'org.jetbrains.kotlin.jvm' version 'KOTLIN_VERSION'
|
||||
}
|
||||
@@ -15,6 +13,6 @@ repositories {
|
||||
dependencies {
|
||||
testImplementation 'org.jetbrains.kotlin:kotlin-test-junit'
|
||||
}
|
||||
tasks.withType(KotlinCompile) {
|
||||
compileKotlin {
|
||||
kotlinOptions.jvmTarget = '1.6'
|
||||
}
|
||||
+1
-3
@@ -1,5 +1,3 @@
|
||||
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
|
||||
|
||||
plugins {
|
||||
id 'org.jetbrains.kotlin.jvm' version 'KOTLIN_VERSION'
|
||||
}
|
||||
@@ -15,6 +13,6 @@ repositories {
|
||||
dependencies {
|
||||
testImplementation 'org.jetbrains.kotlin:kotlin-test-junit'
|
||||
}
|
||||
tasks.withType(KotlinCompile) {
|
||||
compileKotlin {
|
||||
kotlinOptions.jvmTarget = '1.8'
|
||||
}
|
||||
+1
-3
@@ -1,5 +1,3 @@
|
||||
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
|
||||
|
||||
plugins {
|
||||
id 'org.jetbrains.kotlin.jvm' version 'KOTLIN_VERSION'
|
||||
id 'application'
|
||||
@@ -16,7 +14,7 @@ repositories {
|
||||
dependencies {
|
||||
testImplementation 'org.jetbrains.kotlin:kotlin-test-junit'
|
||||
}
|
||||
tasks.withType(KotlinCompile) {
|
||||
compileKotlin {
|
||||
kotlinOptions.jvmTarget = '1.8'
|
||||
}
|
||||
application {
|
||||
|
||||
+14
-4
@@ -90,15 +90,17 @@ object JvmSinglePlatformModuleConfigurator : JvmModuleConfigurator,
|
||||
module: Module
|
||||
): List<BuildSystemIR> =
|
||||
buildList {
|
||||
+GradleImportIR("org.jetbrains.kotlin.gradle.tasks.KotlinCompile")
|
||||
if (configurationData.buildSystemType == BuildSystemType.GradleKotlinDsl) {
|
||||
+GradleImportIR("org.jetbrains.kotlin.gradle.tasks.KotlinCompile")
|
||||
}
|
||||
|
||||
val targetVersionValue = inContextOfModuleConfigurator(module) {
|
||||
reader {
|
||||
JvmModuleConfigurator.targetJvmVersion.reference.settingValue.value
|
||||
}
|
||||
}
|
||||
when {
|
||||
configurationData.buildSystemType.isGradle -> {
|
||||
when (configurationData.buildSystemType) {
|
||||
BuildSystemType.GradleKotlinDsl -> {
|
||||
+GradleConfigureTaskIR(
|
||||
GradleByClassTasksAccessIR("KotlinCompile"),
|
||||
irs = listOf(
|
||||
@@ -106,7 +108,15 @@ object JvmSinglePlatformModuleConfigurator : JvmModuleConfigurator,
|
||||
)
|
||||
)
|
||||
}
|
||||
configurationData.buildSystemType == BuildSystemType.Maven -> {
|
||||
BuildSystemType.GradleGroovyDsl -> {
|
||||
+GradleSectionIR(
|
||||
"compileKotlin",
|
||||
irs = listOf(
|
||||
GradleAssignmentIR("kotlinOptions.jvmTarget", GradleStringConstIR(targetVersionValue))
|
||||
)
|
||||
)
|
||||
}
|
||||
BuildSystemType.Maven -> {
|
||||
+MavenPropertyIR("kotlin.compiler.jvmTarget", targetVersionValue)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user