Skip to content

Commit 27a516a

Browse files
authored
Fix compilation for standalone k2 module (#350)
1 parent 700fad1 commit 27a516a

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

compiler-plugin/compiler-plugin-k2/build.gradle.kts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import org.jetbrains.kotlin.gradle.dsl.ExplicitApiMode
77
import util.enableContextParameters
88
import util.otherwise
99
import util.whenForIde
10-
import util.whenKotlinIsAtLeast
10+
import util.whenKotlinCompilerIsAtLeast
1111

1212
plugins {
1313
alias(libs.plugins.conventions.jvm)
@@ -69,7 +69,7 @@ tasks.jar {
6969
kotlin {
7070
explicitApi = ExplicitApiMode.Disabled
7171

72-
rootProject.whenKotlinIsAtLeast(2, 2, 0) {
72+
rootProject.whenKotlinCompilerIsAtLeast(2, 2, 0) {
7373
enableContextParameters()
7474
}
7575
}

gradle-conventions-settings/src/main/kotlin/util/KotlinVersionActions.kt

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,15 @@ enum class ActionApplied {
1414
}
1515

1616
@Suppress("unused")
17-
inline fun ExtensionAware.whenKotlinIsAtLeast(
17+
inline fun ExtensionAware.whenKotlinCompilerIsAtLeast(
1818
major: Int,
1919
minor: Int,
2020
patch: Int = 0,
2121
action: () -> Unit = {},
2222
): ActionApplied {
23-
val kotlinVersion: KotlinVersion by extra
23+
val kotlinCompilerVersion: KotlinVersion by extra
2424

25-
if (kotlinVersion.isAtLeast(major, minor, patch)) {
25+
if (kotlinCompilerVersion.isAtLeast(major, minor, patch)) {
2626
action()
2727

2828
return ActionApplied.Applied
@@ -31,6 +31,7 @@ inline fun ExtensionAware.whenKotlinIsAtLeast(
3131
return ActionApplied.NotApplied
3232
}
3333

34+
@Suppress("unused")
3435
inline fun ExtensionAware.whenKotlinLatest(action: () -> Unit): ActionApplied {
3536
val isLatestKotlinVersion: Boolean by extra
3637

0 commit comments

Comments
 (0)