Skip to content

Use compat-patrouille for compatibility settings #438

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ plugins {
alias(libs.plugins.kotlinx.rpc) apply false
alias(libs.plugins.atomicfu) apply false
alias(libs.plugins.conventions.kover)
alias(libs.plugins.conventions.gradle.doctor)
alias(libs.plugins.conventions.root)
}

Expand Down
2 changes: 1 addition & 1 deletion compiler-plugin/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import util.whenForIde

plugins {
alias(libs.plugins.conventions.gradle.doctor)
id("empty") // resolve conventions classpath
}

val rpcVersion: String = libs.versions.kotlinx.rpc.get()
Expand Down
5 changes: 0 additions & 5 deletions dokka-plugin/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
*/

plugins {
alias(libs.plugins.conventions.gradle.doctor)
alias(libs.plugins.kotlin.jvm)
}

Expand All @@ -12,10 +11,6 @@ version = libs.versions.kotlinx.rpc.get()

logger.lifecycle("[Dokka Plugin] kotlinx.rpc project version: $version, Kotlin version: ${libs.versions.kotlin.lang.get()}")

kotlin {
jvmToolchain(8)
}

dependencies {
compileOnly(libs.dokka.core)
compileOnly(libs.dokka.base)
Expand Down
2 changes: 1 addition & 1 deletion gradle-conventions/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ dependencies {
implementation(libs.kotlin.gradle.plugin)
implementation(libs.detekt.gradle.plugin)
implementation(libs.dokka.gradle.plugin)
implementation(libs.gradle.doctor.gradle.plugin)
implementation(libs.gradle.publish.gradle.plugin)
implementation(libs.compat.patrouille.gradle.plugin)

implementation(libs.kover.gradle.plugin)

Expand Down

This file was deleted.

11 changes: 6 additions & 5 deletions gradle-conventions/src/main/kotlin/conventions-jvm.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
/*
* Copyright 2023-2024 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.
* Copyright 2023-2025 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.
*/

@file:OptIn(ExperimentalAbiValidation::class)

import compat.patrouille.configureJavaCompatibility
import compat.patrouille.configureKotlinCompatibility
import org.jetbrains.kotlin.gradle.dsl.abi.ExperimentalAbiValidation
import util.configureAbiFilters
import util.enableAbiValidation
Expand All @@ -18,11 +20,10 @@ java {
withSourcesJar()
}

kotlin {
jvmToolchain {
languageVersion.set(JavaLanguageVersion.of(8))
}
configureJavaCompatibility(8)
configureKotlinCompatibility("2.0.0")

kotlin {
explicitApi()

abiValidation {
Expand Down
5 changes: 5 additions & 0 deletions gradle-conventions/src/main/kotlin/conventions-kmp.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

@file:OptIn(ExperimentalAbiValidation::class)

import compat.patrouille.configureJavaCompatibility
import compat.patrouille.configureKotlinCompatibility
import org.jetbrains.kotlin.gradle.dsl.abi.ExperimentalAbiValidation
import util.*
import util.targets.configureJs
Expand Down Expand Up @@ -38,3 +40,6 @@ withKmpConfig {
}

configureJvm(isKmp = true)

configureJavaCompatibility(8)
configureKotlinCompatibility("2.0.0")
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,7 @@
* Copyright 2023-2025 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.KotlinProjectExtension
import org.jetbrains.kotlin.gradle.dsl.KotlinVersion
import org.jetbrains.kotlin.gradle.plugin.KotlinCompilation
import util.withKotlinJvmExtension
import util.withKotlinKmpExtension

Expand All @@ -16,27 +13,10 @@ fun KotlinProjectExtension.optInForRpcApi() {
}
}

/**
* 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_2_0)
apiVersion.set(KotlinVersion.KOTLIN_2_0)
}

withKotlinJvmExtension {
optInForRpcApi()

compilerOptions.setProjectLanguageVersion()
}

withKotlinKmpExtension {
optInForRpcApi()

compilerOptions.setProjectLanguageVersion()
}
6 changes: 6 additions & 0 deletions gradle-conventions/src/main/kotlin/empty.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/*
* Copyright 2023-2025 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.
*/

// DON'T DELETE.
// Resolves conventions classpath where no other convention is applied
4 changes: 0 additions & 4 deletions gradle-conventions/src/main/kotlin/util/targets/configure.kt
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,6 @@ fun KmpConfig.configureKotlinExtension(action: Action<KotlinMultiplatformExtensi

configureDetekt(includedTargets)

jvmToolchain {
languageVersion.set(JavaLanguageVersion.of(8))
}

action.execute(this)
}
}
1 change: 0 additions & 1 deletion gradle-plugin/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ plugins {
alias(libs.plugins.conventions.jvm)
alias(libs.plugins.conventions.gradle.publish)
alias(libs.plugins.gradle.plugin.publish)
alias(libs.plugins.conventions.gradle.doctor)
}

group = "org.jetbrains.kotlinx"
Expand Down
60 changes: 30 additions & 30 deletions kotlin-js-store/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading