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 {
|
plugins {
|
||||||
id 'org.jetbrains.kotlin.jvm' version 'KOTLIN_VERSION'
|
id 'org.jetbrains.kotlin.jvm' version 'KOTLIN_VERSION'
|
||||||
}
|
}
|
||||||
@@ -17,6 +15,6 @@ dependencies {
|
|||||||
implementation project(':c')
|
implementation project(':c')
|
||||||
testImplementation 'org.jetbrains.kotlin:kotlin-test-junit'
|
testImplementation 'org.jetbrains.kotlin:kotlin-test-junit'
|
||||||
}
|
}
|
||||||
tasks.withType(KotlinCompile) {
|
compileKotlin {
|
||||||
kotlinOptions.jvmTarget = '1.8'
|
kotlinOptions.jvmTarget = '1.8'
|
||||||
}
|
}
|
||||||
+1
-3
@@ -1,5 +1,3 @@
|
|||||||
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
|
|
||||||
|
|
||||||
plugins {
|
plugins {
|
||||||
id 'org.jetbrains.kotlin.jvm' version 'KOTLIN_VERSION'
|
id 'org.jetbrains.kotlin.jvm' version 'KOTLIN_VERSION'
|
||||||
}
|
}
|
||||||
@@ -17,6 +15,6 @@ dependencies {
|
|||||||
implementation project(':d')
|
implementation project(':d')
|
||||||
testImplementation 'org.jetbrains.kotlin:kotlin-test-junit'
|
testImplementation 'org.jetbrains.kotlin:kotlin-test-junit'
|
||||||
}
|
}
|
||||||
tasks.withType(KotlinCompile) {
|
compileKotlin {
|
||||||
kotlinOptions.jvmTarget = '1.8'
|
kotlinOptions.jvmTarget = '1.8'
|
||||||
}
|
}
|
||||||
+1
-3
@@ -1,5 +1,3 @@
|
|||||||
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
|
|
||||||
|
|
||||||
plugins {
|
plugins {
|
||||||
id 'org.jetbrains.kotlin.jvm' version 'KOTLIN_VERSION'
|
id 'org.jetbrains.kotlin.jvm' version 'KOTLIN_VERSION'
|
||||||
}
|
}
|
||||||
@@ -15,6 +13,6 @@ repositories {
|
|||||||
dependencies {
|
dependencies {
|
||||||
testImplementation 'org.jetbrains.kotlin:kotlin-test-junit'
|
testImplementation 'org.jetbrains.kotlin:kotlin-test-junit'
|
||||||
}
|
}
|
||||||
tasks.withType(KotlinCompile) {
|
compileKotlin {
|
||||||
kotlinOptions.jvmTarget = '1.8'
|
kotlinOptions.jvmTarget = '1.8'
|
||||||
}
|
}
|
||||||
+1
-3
@@ -1,5 +1,3 @@
|
|||||||
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
|
|
||||||
|
|
||||||
plugins {
|
plugins {
|
||||||
id 'org.jetbrains.kotlin.jvm' version 'KOTLIN_VERSION'
|
id 'org.jetbrains.kotlin.jvm' version 'KOTLIN_VERSION'
|
||||||
}
|
}
|
||||||
@@ -16,6 +14,6 @@ dependencies {
|
|||||||
implementation project(':a')
|
implementation project(':a')
|
||||||
testImplementation 'org.jetbrains.kotlin:kotlin-test-junit'
|
testImplementation 'org.jetbrains.kotlin:kotlin-test-junit'
|
||||||
}
|
}
|
||||||
tasks.withType(KotlinCompile) {
|
compileKotlin {
|
||||||
kotlinOptions.jvmTarget = '1.8'
|
kotlinOptions.jvmTarget = '1.8'
|
||||||
}
|
}
|
||||||
+1
-3
@@ -1,5 +1,3 @@
|
|||||||
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
|
|
||||||
|
|
||||||
plugins {
|
plugins {
|
||||||
id 'org.jetbrains.kotlin.jvm'
|
id 'org.jetbrains.kotlin.jvm'
|
||||||
}
|
}
|
||||||
@@ -16,6 +14,6 @@ dependencies {
|
|||||||
rootProject
|
rootProject
|
||||||
testImplementation 'org.jetbrains.kotlin:kotlin-test-junit'
|
testImplementation 'org.jetbrains.kotlin:kotlin-test-junit'
|
||||||
}
|
}
|
||||||
tasks.withType(KotlinCompile) {
|
compileKotlin {
|
||||||
kotlinOptions.jvmTarget = '1.8'
|
kotlinOptions.jvmTarget = '1.8'
|
||||||
}
|
}
|
||||||
+1
-3
@@ -1,5 +1,3 @@
|
|||||||
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
|
|
||||||
|
|
||||||
plugins {
|
plugins {
|
||||||
id 'org.jetbrains.kotlin.jvm'
|
id 'org.jetbrains.kotlin.jvm'
|
||||||
}
|
}
|
||||||
@@ -16,6 +14,6 @@ dependencies {
|
|||||||
implementation project(':b')
|
implementation project(':b')
|
||||||
testImplementation 'org.jetbrains.kotlin:kotlin-test-junit'
|
testImplementation 'org.jetbrains.kotlin:kotlin-test-junit'
|
||||||
}
|
}
|
||||||
tasks.withType(KotlinCompile) {
|
compileKotlin {
|
||||||
kotlinOptions.jvmTarget = '1.8'
|
kotlinOptions.jvmTarget = '1.8'
|
||||||
}
|
}
|
||||||
+1
-3
@@ -1,5 +1,3 @@
|
|||||||
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
|
|
||||||
|
|
||||||
plugins {
|
plugins {
|
||||||
id 'org.jetbrains.kotlin.jvm' version 'KOTLIN_VERSION'
|
id 'org.jetbrains.kotlin.jvm' version 'KOTLIN_VERSION'
|
||||||
}
|
}
|
||||||
@@ -15,6 +13,6 @@ repositories {
|
|||||||
dependencies {
|
dependencies {
|
||||||
testImplementation 'org.jetbrains.kotlin:kotlin-test-junit'
|
testImplementation 'org.jetbrains.kotlin:kotlin-test-junit'
|
||||||
}
|
}
|
||||||
tasks.withType(KotlinCompile) {
|
compileKotlin {
|
||||||
kotlinOptions.jvmTarget = '1.8'
|
kotlinOptions.jvmTarget = '1.8'
|
||||||
}
|
}
|
||||||
+1
-3
@@ -1,5 +1,3 @@
|
|||||||
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
|
|
||||||
|
|
||||||
plugins {
|
plugins {
|
||||||
id 'org.jetbrains.kotlin.jvm' version 'KOTLIN_VERSION'
|
id 'org.jetbrains.kotlin.jvm' version 'KOTLIN_VERSION'
|
||||||
}
|
}
|
||||||
@@ -15,6 +13,6 @@ repositories {
|
|||||||
dependencies {
|
dependencies {
|
||||||
testImplementation 'org.jetbrains.kotlin:kotlin-test-junit'
|
testImplementation 'org.jetbrains.kotlin:kotlin-test-junit'
|
||||||
}
|
}
|
||||||
tasks.withType(KotlinCompile) {
|
compileKotlin {
|
||||||
kotlinOptions.jvmTarget = '1.6'
|
kotlinOptions.jvmTarget = '1.6'
|
||||||
}
|
}
|
||||||
+1
-3
@@ -1,5 +1,3 @@
|
|||||||
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
|
|
||||||
|
|
||||||
plugins {
|
plugins {
|
||||||
id 'org.jetbrains.kotlin.jvm' version 'KOTLIN_VERSION'
|
id 'org.jetbrains.kotlin.jvm' version 'KOTLIN_VERSION'
|
||||||
}
|
}
|
||||||
@@ -15,6 +13,6 @@ repositories {
|
|||||||
dependencies {
|
dependencies {
|
||||||
testImplementation 'org.jetbrains.kotlin:kotlin-test-junit'
|
testImplementation 'org.jetbrains.kotlin:kotlin-test-junit'
|
||||||
}
|
}
|
||||||
tasks.withType(KotlinCompile) {
|
compileKotlin {
|
||||||
kotlinOptions.jvmTarget = '1.8'
|
kotlinOptions.jvmTarget = '1.8'
|
||||||
}
|
}
|
||||||
+1
-3
@@ -1,5 +1,3 @@
|
|||||||
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
|
|
||||||
|
|
||||||
plugins {
|
plugins {
|
||||||
id 'org.jetbrains.kotlin.jvm' version 'KOTLIN_VERSION'
|
id 'org.jetbrains.kotlin.jvm' version 'KOTLIN_VERSION'
|
||||||
id 'application'
|
id 'application'
|
||||||
@@ -16,7 +14,7 @@ repositories {
|
|||||||
dependencies {
|
dependencies {
|
||||||
testImplementation 'org.jetbrains.kotlin:kotlin-test-junit'
|
testImplementation 'org.jetbrains.kotlin:kotlin-test-junit'
|
||||||
}
|
}
|
||||||
tasks.withType(KotlinCompile) {
|
compileKotlin {
|
||||||
kotlinOptions.jvmTarget = '1.8'
|
kotlinOptions.jvmTarget = '1.8'
|
||||||
}
|
}
|
||||||
application {
|
application {
|
||||||
|
|||||||
+14
-4
@@ -90,15 +90,17 @@ object JvmSinglePlatformModuleConfigurator : JvmModuleConfigurator,
|
|||||||
module: Module
|
module: Module
|
||||||
): List<BuildSystemIR> =
|
): List<BuildSystemIR> =
|
||||||
buildList {
|
buildList {
|
||||||
+GradleImportIR("org.jetbrains.kotlin.gradle.tasks.KotlinCompile")
|
if (configurationData.buildSystemType == BuildSystemType.GradleKotlinDsl) {
|
||||||
|
+GradleImportIR("org.jetbrains.kotlin.gradle.tasks.KotlinCompile")
|
||||||
|
}
|
||||||
|
|
||||||
val targetVersionValue = inContextOfModuleConfigurator(module) {
|
val targetVersionValue = inContextOfModuleConfigurator(module) {
|
||||||
reader {
|
reader {
|
||||||
JvmModuleConfigurator.targetJvmVersion.reference.settingValue.value
|
JvmModuleConfigurator.targetJvmVersion.reference.settingValue.value
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
when {
|
when (configurationData.buildSystemType) {
|
||||||
configurationData.buildSystemType.isGradle -> {
|
BuildSystemType.GradleKotlinDsl -> {
|
||||||
+GradleConfigureTaskIR(
|
+GradleConfigureTaskIR(
|
||||||
GradleByClassTasksAccessIR("KotlinCompile"),
|
GradleByClassTasksAccessIR("KotlinCompile"),
|
||||||
irs = listOf(
|
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)
|
+MavenPropertyIR("kotlin.compiler.jvmTarget", targetVersionValue)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user