@@ -6,6 +6,8 @@ import org.gradle.api.plugins.JavaPlugin.RUNTIME_ELEMENTS_CONFIGURATION_NAME
66import org.gradle.api.plugins.JavaPlugin.SOURCES_ELEMENTS_CONFIGURATION_NAME
77import org.gradle.plugin.compatibility.compatibility
88import org.jetbrains.kotlin.gradle.dsl.JvmDefaultMode
9+ import org.jetbrains.kotlin.gradle.dsl.JvmTarget
10+ import org.jetbrains.kotlin.gradle.dsl.KotlinVersion
911import org.jetbrains.kotlin.gradle.dsl.abi.ExperimentalAbiValidation
1012
1113plugins {
@@ -15,7 +17,6 @@ plugins {
1517 alias(libs.plugins.mavenPublish)
1618 alias(libs.plugins.pluginPublish)
1719 alias(libs.plugins.spotless)
18- alias(libs.plugins.tapmoc)
1920}
2021
2122version = providers.gradleProperty(" VERSION_NAME" ).get()
@@ -29,9 +30,18 @@ dokka { dokkaPublications.html { outputDirectory = rootDir.resolve("docs/api") }
2930kotlin {
3031 explicitApi()
3132 @OptIn(ExperimentalAbiValidation ::class ) abiValidation { enabled = true }
33+ val jdkRelease = " 17"
3234 compilerOptions {
3335 allWarningsAsErrors = true
36+ // https://docs.gradle.org/current/userguide/compatibility.html#kotlin
37+ apiVersion = KotlinVersion .KOTLIN_2_2
38+ languageVersion = apiVersion
39+ jvmTarget = JvmTarget .fromTarget(jdkRelease)
3440 jvmDefault = JvmDefaultMode .NO_COMPATIBILITY
41+ freeCompilerArgs.add(" -Xjdk-release=$jdkRelease " )
42+ }
43+ target.compilations.configureEach {
44+ compileJavaTaskProvider { options.release = jdkRelease.toInt() }
3545 }
3646}
3747
@@ -50,13 +60,6 @@ spotless {
5060 kotlinGradle { ktfmt(libs.ktfmt.get().version).googleStyle() }
5161}
5262
53- tapmoc {
54- gradle(" 9.0.0" )
55- java(17 )
56- // https://docs.gradle.org/current/userguide/compatibility.html#kotlin
57- kotlin(" 2.2.0" )
58- }
59-
6063val testPluginClasspath by
6164 configurations.registering {
6265 isCanBeResolved = true
@@ -94,6 +97,14 @@ publishing.publications.withType<MavenPublication>().configureEach {
9497 suppressPomMetadataWarningsFor(SOURCES_ELEMENTS_CONFIGURATION_NAME )
9598}
9699
100+ configurations.named(API_ELEMENTS_CONFIGURATION_NAME ) {
101+ attributes.attribute(
102+ // TODO: https://github.com/gradle/gradle/issues/24608
103+ GradlePluginApiVersion .GRADLE_PLUGIN_API_VERSION_ATTRIBUTE ,
104+ objects.named(libs.versions.minGradle.get()),
105+ )
106+ }
107+
97108val testGradleVersion: String =
98109 providers.gradleProperty(" testGradleVersion" ).orNull.let {
99110 val value = if (it == null || it == " current" ) GradleVersion .current().version else it
0 commit comments