-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update the project to run tests without the useK2Plugin property (#156)
- Loading branch information
Showing
11 changed files
with
59 additions
and
61 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 0 additions & 13 deletions
13
gradle-conventions/latest-only/src/main/kotlin/conventions-kotlin-version-jvm.gradle.kts
This file was deleted.
Oops, something went wrong.
15 changes: 0 additions & 15 deletions
15
gradle-conventions/latest-only/src/main/kotlin/conventions-kotlin-version-kmp.gradle.kts
This file was deleted.
Oops, something went wrong.
45 changes: 45 additions & 0 deletions
45
gradle-conventions/latest-only/src/main/kotlin/conventions-kotlin-version.gradle.kts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
/* | ||
* Copyright 2023-2024 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license. | ||
*/ | ||
|
||
import org.jetbrains.kotlin.gradle.dsl.KotlinCommonCompilerOptions | ||
import org.jetbrains.kotlin.gradle.dsl.KotlinVersion | ||
import org.jetbrains.kotlin.gradle.plugin.KotlinCompilation | ||
import util.lowercase | ||
import util.withKotlinJvmExtension | ||
import util.withKotlinKmpExtension | ||
|
||
/** | ||
* Set the compatibility mode to the lower supported language version. | ||
* | ||
* This should be lined up with the minimal supported compiler plugin version. | ||
* | ||
* We update the language version only for the 'main' sources sets. | ||
* This makes our tests execute against the latest compiler plugin version (for example, with K2 instead of K1). | ||
*/ | ||
fun KotlinCommonCompilerOptions.setProjectLanguageVersion() { | ||
languageVersion.set(KotlinVersion.KOTLIN_1_7) | ||
apiVersion.set(KotlinVersion.KOTLIN_1_7) | ||
} | ||
|
||
withKotlinJvmExtension { | ||
target.compilations | ||
.filter { it.isMain } | ||
.forEach { compilation -> | ||
compilation.compileJavaTaskProvider.configure { | ||
compilerOptions.setProjectLanguageVersion() | ||
} | ||
} | ||
} | ||
|
||
withKotlinKmpExtension { | ||
targets.flatMap { it.compilations } | ||
.filter { it.isMain } | ||
.forEach { compilation -> | ||
compilation.compileTaskProvider.configure { | ||
compilerOptions.setProjectLanguageVersion() | ||
} | ||
} | ||
} | ||
|
||
val KotlinCompilation<*>.isMain get() = name.lowercase().contains("main") |
23 changes: 0 additions & 23 deletions
23
gradle-conventions/latest-only/src/main/kotlin/util/CompilerOptions.kt
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3267,6 +3267,11 @@ type-is@~1.6.18: | |
media-typer "0.3.0" | ||
mime-types "~2.1.24" | ||
|
||
[email protected]: | ||
version "4.7.4" | ||
resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.7.4.tgz#1a88596d1cf47d59507a1bcdfb5b9dfe4d488235" | ||
integrity sha512-C0WQT0gezHuw6AdY1M2jxUO83Rjf0HP7Sk1DtXj6j1EwkQNZrHAg2XPWlq62oqEhYvONq5pkC2Y9oPljWToLmQ== | ||
|
||
[email protected]: | ||
version "5.4.3" | ||
resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.4.3.tgz#5c6fedd4c87bee01cd7a528a30145521f8e0feff" | ||
|