[Gradle] Add plugin variant for Gradle 8.5
^KT-64355 In Progress
This commit is contained in:
committed by
Space Team
parent
166c88b87c
commit
2a195062a8
+1
-1
@@ -224,7 +224,7 @@ class SimpleKotlinGradleIT : KGPBaseTest() {
|
|||||||
project("kotlinProject", gradleVersion) {
|
project("kotlinProject", gradleVersion) {
|
||||||
build("help") {
|
build("help") {
|
||||||
val expectedVariant = when (gradleVersion) {
|
val expectedVariant = when (gradleVersion) {
|
||||||
GradleVersion.version(TestVersions.Gradle.G_8_5) -> "gradle82"
|
GradleVersion.version(TestVersions.Gradle.G_8_5) -> "gradle85"
|
||||||
GradleVersion.version(TestVersions.Gradle.G_8_4) -> "gradle82"
|
GradleVersion.version(TestVersions.Gradle.G_8_4) -> "gradle82"
|
||||||
GradleVersion.version(TestVersions.Gradle.G_8_3) -> "gradle82"
|
GradleVersion.version(TestVersions.Gradle.G_8_3) -> "gradle82"
|
||||||
GradleVersion.version(TestVersions.Gradle.G_8_2) -> "gradle82"
|
GradleVersion.version(TestVersions.Gradle.G_8_2) -> "gradle82"
|
||||||
|
|||||||
+137
@@ -0,0 +1,137 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2010-2022 JetBrains s.r.o. and Kotlin Programming Language contributors.
|
||||||
|
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package org.jetbrains.kotlin.gradle.plugin
|
||||||
|
|
||||||
|
import com.android.build.gradle.BaseExtension
|
||||||
|
import org.gradle.api.Named
|
||||||
|
import org.gradle.api.NamedDomainObjectContainer
|
||||||
|
import org.gradle.api.Project
|
||||||
|
import org.gradle.api.file.SourceDirectorySet
|
||||||
|
import org.gradle.tooling.provider.model.ToolingModelBuilderRegistry
|
||||||
|
import javax.inject.Inject
|
||||||
|
|
||||||
|
private const val PLUGIN_VARIANT_NAME = "gradle85"
|
||||||
|
|
||||||
|
open class KotlinPluginWrapper @Inject constructor(
|
||||||
|
registry: ToolingModelBuilderRegistry
|
||||||
|
) : AbstractKotlinPluginWrapper(registry) {
|
||||||
|
|
||||||
|
override val pluginVariant: String = PLUGIN_VARIANT_NAME
|
||||||
|
|
||||||
|
override fun apply(project: Project) {
|
||||||
|
project.registerVariantImplementations()
|
||||||
|
super.apply(project)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
open class KotlinCommonPluginWrapper @Inject constructor(
|
||||||
|
registry: ToolingModelBuilderRegistry
|
||||||
|
) : AbstractKotlinCommonPluginWrapper(registry) {
|
||||||
|
|
||||||
|
override val pluginVariant: String = PLUGIN_VARIANT_NAME
|
||||||
|
|
||||||
|
override fun apply(project: Project) {
|
||||||
|
project.registerVariantImplementations()
|
||||||
|
super.apply(project)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
open class KotlinAndroidPluginWrapper @Inject constructor(
|
||||||
|
registry: ToolingModelBuilderRegistry
|
||||||
|
) : AbstractKotlinAndroidPluginWrapper(registry) {
|
||||||
|
|
||||||
|
override val pluginVariant: String = PLUGIN_VARIANT_NAME
|
||||||
|
|
||||||
|
override fun apply(project: Project) {
|
||||||
|
project.registerVariantImplementations()
|
||||||
|
super.apply(project)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Suppress("DEPRECATION_ERROR")
|
||||||
|
open class Kotlin2JsPluginWrapper @Inject constructor(
|
||||||
|
registry: ToolingModelBuilderRegistry
|
||||||
|
) : AbstractKotlin2JsPluginWrapper(registry) {
|
||||||
|
|
||||||
|
override val pluginVariant: String = PLUGIN_VARIANT_NAME
|
||||||
|
|
||||||
|
override fun apply(project: Project) {
|
||||||
|
project.registerVariantImplementations()
|
||||||
|
super.apply(project)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
open class KotlinMultiplatformPluginWrapper : AbstractKotlinMultiplatformPluginWrapper() {
|
||||||
|
|
||||||
|
override val pluginVariant: String = PLUGIN_VARIANT_NAME
|
||||||
|
|
||||||
|
override fun apply(project: Project) {
|
||||||
|
project.registerVariantImplementations()
|
||||||
|
super.apply(project)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
open class KotlinJsPluginWrapper : AbstractKotlinJsPluginWrapper() {
|
||||||
|
|
||||||
|
override val pluginVariant: String = PLUGIN_VARIANT_NAME
|
||||||
|
|
||||||
|
override fun apply(project: Project) {
|
||||||
|
project.registerVariantImplementations()
|
||||||
|
super.apply(project)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
open class KotlinPlatformJvmPlugin : KotlinPlatformImplementationPluginBase("jvm") {
|
||||||
|
override fun apply(project: Project) {
|
||||||
|
project.applyPlugin<KotlinPluginWrapper>()
|
||||||
|
super.apply(project)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
open class KotlinPlatformJsPlugin : KotlinPlatformImplementationPluginBase("js") {
|
||||||
|
override fun apply(project: Project) {
|
||||||
|
@Suppress("DEPRECATION_ERROR")
|
||||||
|
project.applyPlugin<Kotlin2JsPluginWrapper>()
|
||||||
|
super.apply(project)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
open class KotlinPlatformAndroidPlugin : KotlinPlatformImplementationPluginBase("android") {
|
||||||
|
override fun apply(project: Project) {
|
||||||
|
project.applyPlugin<KotlinAndroidPluginWrapper>()
|
||||||
|
super.apply(project)
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun namedSourceSetsContainer(project: Project): NamedDomainObjectContainer<*> =
|
||||||
|
(project.extensions.getByName("android") as BaseExtension).sourceSets
|
||||||
|
|
||||||
|
override fun addCommonSourceSetToPlatformSourceSet(commonSourceSet: Named, platformProject: Project) {
|
||||||
|
val androidExtension = platformProject.extensions.getByName("android") as BaseExtension
|
||||||
|
val androidSourceSet = androidExtension.sourceSets.findByName(commonSourceSet.name) ?: return
|
||||||
|
val kotlinSourceSet = androidSourceSet.getExtension<SourceDirectorySet>(KOTLIN_DSL_NAME)
|
||||||
|
?: return
|
||||||
|
kotlinSourceSet.source(getKotlinSourceDirectorySetSafe(commonSourceSet)!!)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
open class KotlinPlatformCommonPlugin : KotlinPlatformPluginBase("common") {
|
||||||
|
override fun apply(project: Project) {
|
||||||
|
project.applyPlugin<KotlinCommonPluginWrapper>()
|
||||||
|
warnAboutKotlin12xMppDeprecation(project)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
open class KotlinApiPlugin : KotlinBaseApiPlugin() {
|
||||||
|
override fun apply(project: Project) {
|
||||||
|
project.registerVariantImplementations()
|
||||||
|
super.apply(project)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Suppress("UnusedReceiverParameter")
|
||||||
|
private fun Project.registerVariantImplementations() {
|
||||||
|
|
||||||
|
}
|
||||||
@@ -338,5 +338,38 @@
|
|||||||
</exclusions>
|
</exclusions>
|
||||||
<optional>true</optional>
|
<optional>true</optional>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.jetbrains.kotlin</groupId>
|
||||||
|
<artifactId>kotlin-gradle-plugin-api</artifactId>
|
||||||
|
<version>ArtifactsTest.version</version>
|
||||||
|
<scope>compile</scope>
|
||||||
|
<exclusions>
|
||||||
|
<exclusion>
|
||||||
|
<groupId>org.jetbrains.kotlin</groupId>
|
||||||
|
<artifactId>kotlin-reflect</artifactId>
|
||||||
|
</exclusion>
|
||||||
|
<exclusion>
|
||||||
|
<groupId>org.jetbrains.kotlin</groupId>
|
||||||
|
<artifactId>kotlin-stdlib-jdk8</artifactId>
|
||||||
|
</exclusion>
|
||||||
|
<exclusion>
|
||||||
|
<groupId>org.jetbrains.kotlin</groupId>
|
||||||
|
<artifactId>kotlin-stdlib-jdk7</artifactId>
|
||||||
|
</exclusion>
|
||||||
|
<exclusion>
|
||||||
|
<groupId>org.jetbrains.kotlin</groupId>
|
||||||
|
<artifactId>kotlin-stdlib</artifactId>
|
||||||
|
</exclusion>
|
||||||
|
<exclusion>
|
||||||
|
<groupId>org.jetbrains.kotlin</groupId>
|
||||||
|
<artifactId>kotlin-script-runtime</artifactId>
|
||||||
|
</exclusion>
|
||||||
|
<exclusion>
|
||||||
|
<groupId>org.jetbrains.kotlin</groupId>
|
||||||
|
<artifactId>kotlin-stdlib-common</artifactId>
|
||||||
|
</exclusion>
|
||||||
|
</exclusions>
|
||||||
|
<optional>true</optional>
|
||||||
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
</project>
|
</project>
|
||||||
|
|||||||
+33
@@ -338,5 +338,38 @@
|
|||||||
</exclusions>
|
</exclusions>
|
||||||
<optional>true</optional>
|
<optional>true</optional>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.jetbrains.kotlin</groupId>
|
||||||
|
<artifactId>kotlin-gradle-plugin-api</artifactId>
|
||||||
|
<version>ArtifactsTest.version</version>
|
||||||
|
<scope>compile</scope>
|
||||||
|
<exclusions>
|
||||||
|
<exclusion>
|
||||||
|
<groupId>org.jetbrains.kotlin</groupId>
|
||||||
|
<artifactId>kotlin-reflect</artifactId>
|
||||||
|
</exclusion>
|
||||||
|
<exclusion>
|
||||||
|
<groupId>org.jetbrains.kotlin</groupId>
|
||||||
|
<artifactId>kotlin-stdlib-jdk8</artifactId>
|
||||||
|
</exclusion>
|
||||||
|
<exclusion>
|
||||||
|
<groupId>org.jetbrains.kotlin</groupId>
|
||||||
|
<artifactId>kotlin-stdlib-jdk7</artifactId>
|
||||||
|
</exclusion>
|
||||||
|
<exclusion>
|
||||||
|
<groupId>org.jetbrains.kotlin</groupId>
|
||||||
|
<artifactId>kotlin-stdlib</artifactId>
|
||||||
|
</exclusion>
|
||||||
|
<exclusion>
|
||||||
|
<groupId>org.jetbrains.kotlin</groupId>
|
||||||
|
<artifactId>kotlin-script-runtime</artifactId>
|
||||||
|
</exclusion>
|
||||||
|
<exclusion>
|
||||||
|
<groupId>org.jetbrains.kotlin</groupId>
|
||||||
|
<artifactId>kotlin-stdlib-common</artifactId>
|
||||||
|
</exclusion>
|
||||||
|
</exclusions>
|
||||||
|
<optional>true</optional>
|
||||||
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
</project>
|
</project>
|
||||||
|
|||||||
+33
@@ -370,5 +370,38 @@
|
|||||||
</exclusions>
|
</exclusions>
|
||||||
<optional>true</optional>
|
<optional>true</optional>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.jetbrains.kotlin</groupId>
|
||||||
|
<artifactId>kotlin-gradle-plugin-api</artifactId>
|
||||||
|
<version>ArtifactsTest.version</version>
|
||||||
|
<scope>compile</scope>
|
||||||
|
<exclusions>
|
||||||
|
<exclusion>
|
||||||
|
<groupId>org.jetbrains.kotlin</groupId>
|
||||||
|
<artifactId>kotlin-reflect</artifactId>
|
||||||
|
</exclusion>
|
||||||
|
<exclusion>
|
||||||
|
<groupId>org.jetbrains.kotlin</groupId>
|
||||||
|
<artifactId>kotlin-stdlib-jdk8</artifactId>
|
||||||
|
</exclusion>
|
||||||
|
<exclusion>
|
||||||
|
<groupId>org.jetbrains.kotlin</groupId>
|
||||||
|
<artifactId>kotlin-stdlib-jdk7</artifactId>
|
||||||
|
</exclusion>
|
||||||
|
<exclusion>
|
||||||
|
<groupId>org.jetbrains.kotlin</groupId>
|
||||||
|
<artifactId>kotlin-stdlib</artifactId>
|
||||||
|
</exclusion>
|
||||||
|
<exclusion>
|
||||||
|
<groupId>org.jetbrains.kotlin</groupId>
|
||||||
|
<artifactId>kotlin-script-runtime</artifactId>
|
||||||
|
</exclusion>
|
||||||
|
<exclusion>
|
||||||
|
<groupId>org.jetbrains.kotlin</groupId>
|
||||||
|
<artifactId>kotlin-stdlib-common</artifactId>
|
||||||
|
</exclusion>
|
||||||
|
</exclusions>
|
||||||
|
<optional>true</optional>
|
||||||
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
</project>
|
</project>
|
||||||
|
|||||||
+33
@@ -370,5 +370,38 @@
|
|||||||
</exclusions>
|
</exclusions>
|
||||||
<optional>true</optional>
|
<optional>true</optional>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.jetbrains.kotlin</groupId>
|
||||||
|
<artifactId>kotlin-gradle-plugin-api</artifactId>
|
||||||
|
<version>ArtifactsTest.version</version>
|
||||||
|
<scope>compile</scope>
|
||||||
|
<exclusions>
|
||||||
|
<exclusion>
|
||||||
|
<groupId>org.jetbrains.kotlin</groupId>
|
||||||
|
<artifactId>kotlin-reflect</artifactId>
|
||||||
|
</exclusion>
|
||||||
|
<exclusion>
|
||||||
|
<groupId>org.jetbrains.kotlin</groupId>
|
||||||
|
<artifactId>kotlin-stdlib-jdk8</artifactId>
|
||||||
|
</exclusion>
|
||||||
|
<exclusion>
|
||||||
|
<groupId>org.jetbrains.kotlin</groupId>
|
||||||
|
<artifactId>kotlin-stdlib-jdk7</artifactId>
|
||||||
|
</exclusion>
|
||||||
|
<exclusion>
|
||||||
|
<groupId>org.jetbrains.kotlin</groupId>
|
||||||
|
<artifactId>kotlin-stdlib</artifactId>
|
||||||
|
</exclusion>
|
||||||
|
<exclusion>
|
||||||
|
<groupId>org.jetbrains.kotlin</groupId>
|
||||||
|
<artifactId>kotlin-script-runtime</artifactId>
|
||||||
|
</exclusion>
|
||||||
|
<exclusion>
|
||||||
|
<groupId>org.jetbrains.kotlin</groupId>
|
||||||
|
<artifactId>kotlin-stdlib-common</artifactId>
|
||||||
|
</exclusion>
|
||||||
|
</exclusions>
|
||||||
|
<optional>true</optional>
|
||||||
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
</project>
|
</project>
|
||||||
|
|||||||
+33
@@ -338,5 +338,38 @@
|
|||||||
</exclusions>
|
</exclusions>
|
||||||
<optional>true</optional>
|
<optional>true</optional>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.jetbrains.kotlin</groupId>
|
||||||
|
<artifactId>kotlin-gradle-plugin-api</artifactId>
|
||||||
|
<version>ArtifactsTest.version</version>
|
||||||
|
<scope>compile</scope>
|
||||||
|
<exclusions>
|
||||||
|
<exclusion>
|
||||||
|
<groupId>org.jetbrains.kotlin</groupId>
|
||||||
|
<artifactId>kotlin-reflect</artifactId>
|
||||||
|
</exclusion>
|
||||||
|
<exclusion>
|
||||||
|
<groupId>org.jetbrains.kotlin</groupId>
|
||||||
|
<artifactId>kotlin-stdlib-jdk8</artifactId>
|
||||||
|
</exclusion>
|
||||||
|
<exclusion>
|
||||||
|
<groupId>org.jetbrains.kotlin</groupId>
|
||||||
|
<artifactId>kotlin-stdlib-jdk7</artifactId>
|
||||||
|
</exclusion>
|
||||||
|
<exclusion>
|
||||||
|
<groupId>org.jetbrains.kotlin</groupId>
|
||||||
|
<artifactId>kotlin-stdlib</artifactId>
|
||||||
|
</exclusion>
|
||||||
|
<exclusion>
|
||||||
|
<groupId>org.jetbrains.kotlin</groupId>
|
||||||
|
<artifactId>kotlin-script-runtime</artifactId>
|
||||||
|
</exclusion>
|
||||||
|
<exclusion>
|
||||||
|
<groupId>org.jetbrains.kotlin</groupId>
|
||||||
|
<artifactId>kotlin-stdlib-common</artifactId>
|
||||||
|
</exclusion>
|
||||||
|
</exclusions>
|
||||||
|
<optional>true</optional>
|
||||||
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
</project>
|
</project>
|
||||||
|
|||||||
+33
@@ -370,5 +370,38 @@
|
|||||||
</exclusions>
|
</exclusions>
|
||||||
<optional>true</optional>
|
<optional>true</optional>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.jetbrains.kotlin</groupId>
|
||||||
|
<artifactId>kotlin-gradle-plugin-api</artifactId>
|
||||||
|
<version>ArtifactsTest.version</version>
|
||||||
|
<scope>compile</scope>
|
||||||
|
<exclusions>
|
||||||
|
<exclusion>
|
||||||
|
<groupId>org.jetbrains.kotlin</groupId>
|
||||||
|
<artifactId>kotlin-reflect</artifactId>
|
||||||
|
</exclusion>
|
||||||
|
<exclusion>
|
||||||
|
<groupId>org.jetbrains.kotlin</groupId>
|
||||||
|
<artifactId>kotlin-stdlib-jdk8</artifactId>
|
||||||
|
</exclusion>
|
||||||
|
<exclusion>
|
||||||
|
<groupId>org.jetbrains.kotlin</groupId>
|
||||||
|
<artifactId>kotlin-stdlib-jdk7</artifactId>
|
||||||
|
</exclusion>
|
||||||
|
<exclusion>
|
||||||
|
<groupId>org.jetbrains.kotlin</groupId>
|
||||||
|
<artifactId>kotlin-stdlib</artifactId>
|
||||||
|
</exclusion>
|
||||||
|
<exclusion>
|
||||||
|
<groupId>org.jetbrains.kotlin</groupId>
|
||||||
|
<artifactId>kotlin-script-runtime</artifactId>
|
||||||
|
</exclusion>
|
||||||
|
<exclusion>
|
||||||
|
<groupId>org.jetbrains.kotlin</groupId>
|
||||||
|
<artifactId>kotlin-stdlib-common</artifactId>
|
||||||
|
</exclusion>
|
||||||
|
</exclusions>
|
||||||
|
<optional>true</optional>
|
||||||
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
</project>
|
</project>
|
||||||
|
|||||||
+33
@@ -370,5 +370,38 @@
|
|||||||
</exclusions>
|
</exclusions>
|
||||||
<optional>true</optional>
|
<optional>true</optional>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.jetbrains.kotlin</groupId>
|
||||||
|
<artifactId>kotlin-gradle-plugin-api</artifactId>
|
||||||
|
<version>ArtifactsTest.version</version>
|
||||||
|
<scope>compile</scope>
|
||||||
|
<exclusions>
|
||||||
|
<exclusion>
|
||||||
|
<groupId>org.jetbrains.kotlin</groupId>
|
||||||
|
<artifactId>kotlin-reflect</artifactId>
|
||||||
|
</exclusion>
|
||||||
|
<exclusion>
|
||||||
|
<groupId>org.jetbrains.kotlin</groupId>
|
||||||
|
<artifactId>kotlin-stdlib-jdk8</artifactId>
|
||||||
|
</exclusion>
|
||||||
|
<exclusion>
|
||||||
|
<groupId>org.jetbrains.kotlin</groupId>
|
||||||
|
<artifactId>kotlin-stdlib-jdk7</artifactId>
|
||||||
|
</exclusion>
|
||||||
|
<exclusion>
|
||||||
|
<groupId>org.jetbrains.kotlin</groupId>
|
||||||
|
<artifactId>kotlin-stdlib</artifactId>
|
||||||
|
</exclusion>
|
||||||
|
<exclusion>
|
||||||
|
<groupId>org.jetbrains.kotlin</groupId>
|
||||||
|
<artifactId>kotlin-script-runtime</artifactId>
|
||||||
|
</exclusion>
|
||||||
|
<exclusion>
|
||||||
|
<groupId>org.jetbrains.kotlin</groupId>
|
||||||
|
<artifactId>kotlin-stdlib-common</artifactId>
|
||||||
|
</exclusion>
|
||||||
|
</exclusions>
|
||||||
|
<optional>true</optional>
|
||||||
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
</project>
|
</project>
|
||||||
|
|||||||
+33
@@ -370,5 +370,38 @@
|
|||||||
</exclusions>
|
</exclusions>
|
||||||
<optional>true</optional>
|
<optional>true</optional>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.jetbrains.kotlin</groupId>
|
||||||
|
<artifactId>kotlin-gradle-plugin-api</artifactId>
|
||||||
|
<version>ArtifactsTest.version</version>
|
||||||
|
<scope>compile</scope>
|
||||||
|
<exclusions>
|
||||||
|
<exclusion>
|
||||||
|
<groupId>org.jetbrains.kotlin</groupId>
|
||||||
|
<artifactId>kotlin-reflect</artifactId>
|
||||||
|
</exclusion>
|
||||||
|
<exclusion>
|
||||||
|
<groupId>org.jetbrains.kotlin</groupId>
|
||||||
|
<artifactId>kotlin-stdlib-jdk8</artifactId>
|
||||||
|
</exclusion>
|
||||||
|
<exclusion>
|
||||||
|
<groupId>org.jetbrains.kotlin</groupId>
|
||||||
|
<artifactId>kotlin-stdlib-jdk7</artifactId>
|
||||||
|
</exclusion>
|
||||||
|
<exclusion>
|
||||||
|
<groupId>org.jetbrains.kotlin</groupId>
|
||||||
|
<artifactId>kotlin-stdlib</artifactId>
|
||||||
|
</exclusion>
|
||||||
|
<exclusion>
|
||||||
|
<groupId>org.jetbrains.kotlin</groupId>
|
||||||
|
<artifactId>kotlin-script-runtime</artifactId>
|
||||||
|
</exclusion>
|
||||||
|
<exclusion>
|
||||||
|
<groupId>org.jetbrains.kotlin</groupId>
|
||||||
|
<artifactId>kotlin-stdlib-common</artifactId>
|
||||||
|
</exclusion>
|
||||||
|
</exclusions>
|
||||||
|
<optional>true</optional>
|
||||||
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
</project>
|
</project>
|
||||||
|
|||||||
+33
@@ -370,5 +370,38 @@
|
|||||||
</exclusions>
|
</exclusions>
|
||||||
<optional>true</optional>
|
<optional>true</optional>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.jetbrains.kotlin</groupId>
|
||||||
|
<artifactId>kotlin-gradle-plugin-api</artifactId>
|
||||||
|
<version>ArtifactsTest.version</version>
|
||||||
|
<scope>compile</scope>
|
||||||
|
<exclusions>
|
||||||
|
<exclusion>
|
||||||
|
<groupId>org.jetbrains.kotlin</groupId>
|
||||||
|
<artifactId>kotlin-reflect</artifactId>
|
||||||
|
</exclusion>
|
||||||
|
<exclusion>
|
||||||
|
<groupId>org.jetbrains.kotlin</groupId>
|
||||||
|
<artifactId>kotlin-stdlib-jdk8</artifactId>
|
||||||
|
</exclusion>
|
||||||
|
<exclusion>
|
||||||
|
<groupId>org.jetbrains.kotlin</groupId>
|
||||||
|
<artifactId>kotlin-stdlib-jdk7</artifactId>
|
||||||
|
</exclusion>
|
||||||
|
<exclusion>
|
||||||
|
<groupId>org.jetbrains.kotlin</groupId>
|
||||||
|
<artifactId>kotlin-stdlib</artifactId>
|
||||||
|
</exclusion>
|
||||||
|
<exclusion>
|
||||||
|
<groupId>org.jetbrains.kotlin</groupId>
|
||||||
|
<artifactId>kotlin-script-runtime</artifactId>
|
||||||
|
</exclusion>
|
||||||
|
<exclusion>
|
||||||
|
<groupId>org.jetbrains.kotlin</groupId>
|
||||||
|
<artifactId>kotlin-stdlib-common</artifactId>
|
||||||
|
</exclusion>
|
||||||
|
</exclusions>
|
||||||
|
<optional>true</optional>
|
||||||
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
</project>
|
</project>
|
||||||
|
|||||||
+33
@@ -338,5 +338,38 @@
|
|||||||
</exclusions>
|
</exclusions>
|
||||||
<optional>true</optional>
|
<optional>true</optional>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.jetbrains.kotlin</groupId>
|
||||||
|
<artifactId>kotlin-gradle-plugin-api</artifactId>
|
||||||
|
<version>ArtifactsTest.version</version>
|
||||||
|
<scope>compile</scope>
|
||||||
|
<exclusions>
|
||||||
|
<exclusion>
|
||||||
|
<groupId>org.jetbrains.kotlin</groupId>
|
||||||
|
<artifactId>kotlin-reflect</artifactId>
|
||||||
|
</exclusion>
|
||||||
|
<exclusion>
|
||||||
|
<groupId>org.jetbrains.kotlin</groupId>
|
||||||
|
<artifactId>kotlin-stdlib-jdk8</artifactId>
|
||||||
|
</exclusion>
|
||||||
|
<exclusion>
|
||||||
|
<groupId>org.jetbrains.kotlin</groupId>
|
||||||
|
<artifactId>kotlin-stdlib-jdk7</artifactId>
|
||||||
|
</exclusion>
|
||||||
|
<exclusion>
|
||||||
|
<groupId>org.jetbrains.kotlin</groupId>
|
||||||
|
<artifactId>kotlin-stdlib</artifactId>
|
||||||
|
</exclusion>
|
||||||
|
<exclusion>
|
||||||
|
<groupId>org.jetbrains.kotlin</groupId>
|
||||||
|
<artifactId>kotlin-script-runtime</artifactId>
|
||||||
|
</exclusion>
|
||||||
|
<exclusion>
|
||||||
|
<groupId>org.jetbrains.kotlin</groupId>
|
||||||
|
<artifactId>kotlin-stdlib-common</artifactId>
|
||||||
|
</exclusion>
|
||||||
|
</exclusions>
|
||||||
|
<optional>true</optional>
|
||||||
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
</project>
|
</project>
|
||||||
|
|||||||
@@ -120,6 +120,17 @@ dependencies {
|
|||||||
implementation("org.jetbrains.kotlin:kotlin-reflect:${project.bootstrapKotlinVersion}")
|
implementation("org.jetbrains.kotlin:kotlin-reflect:${project.bootstrapKotlinVersion}")
|
||||||
implementation(libs.gson)
|
implementation(libs.gson)
|
||||||
implementation(libs.kotlinx.metadataJvm)
|
implementation(libs.kotlinx.metadataJvm)
|
||||||
|
|
||||||
|
testImplementation(libs.junit.jupiter.api)
|
||||||
|
testRuntimeOnly(libs.junit.platform.launcher)
|
||||||
|
testRuntimeOnly(libs.junit.jupiter.engine)
|
||||||
|
}
|
||||||
|
|
||||||
|
tasks.withType<Test>().configureEach {
|
||||||
|
useJUnitPlatform()
|
||||||
|
}
|
||||||
|
|
||||||
|
tasks.register("checkBuild") {
|
||||||
|
dependsOn("test")
|
||||||
}
|
}
|
||||||
|
|
||||||
tasks.register("checkBuild")
|
|
||||||
|
|||||||
@@ -45,6 +45,7 @@ import java.net.URL
|
|||||||
*
|
*
|
||||||
* [minimalSupportedGradleVersion] - minimal Gradle version that is supported in this variant
|
* [minimalSupportedGradleVersion] - minimal Gradle version that is supported in this variant
|
||||||
* [gradleApiVersion] - Gradle API dependency version. Usually should be the same as [minimalSupportedGradleVersion].
|
* [gradleApiVersion] - Gradle API dependency version. Usually should be the same as [minimalSupportedGradleVersion].
|
||||||
|
* [gradleApiJavadocUrl] - Gradle URL for the given API. Last enum entry should always point to 'current'.
|
||||||
*/
|
*/
|
||||||
enum class GradlePluginVariant(
|
enum class GradlePluginVariant(
|
||||||
val sourceSetName: String,
|
val sourceSetName: String,
|
||||||
@@ -61,6 +62,7 @@ enum class GradlePluginVariant(
|
|||||||
GRADLE_80("gradle80", "8.0", "8.0", "https://docs.gradle.org/8.0.2/javadoc/"),
|
GRADLE_80("gradle80", "8.0", "8.0", "https://docs.gradle.org/8.0.2/javadoc/"),
|
||||||
GRADLE_81("gradle81", "8.1", "8.1", "https://docs.gradle.org/8.1.1/javadoc/"),
|
GRADLE_81("gradle81", "8.1", "8.1", "https://docs.gradle.org/8.1.1/javadoc/"),
|
||||||
GRADLE_82("gradle82", "8.2", "8.2", "https://docs.gradle.org/8.2.1/javadoc/"),
|
GRADLE_82("gradle82", "8.2", "8.2", "https://docs.gradle.org/8.2.1/javadoc/"),
|
||||||
|
GRADLE_85("gradle85", "8.5", "8.5", "https://docs.gradle.org/current/javadoc/"),
|
||||||
}
|
}
|
||||||
|
|
||||||
val commonSourceSetName = "common"
|
val commonSourceSetName = "common"
|
||||||
|
|||||||
+7
@@ -117,4 +117,11 @@ if (!kotlinBuildProperties.isInJpsBuildIdeaSync) {
|
|||||||
commonSourceSet = commonSourceSet
|
commonSourceSet = commonSourceSet
|
||||||
)
|
)
|
||||||
publishShadowedJar(gradle82SourceSet, commonSourceSet)
|
publishShadowedJar(gradle82SourceSet, commonSourceSet)
|
||||||
|
|
||||||
|
// Used for Gradle 8.5+ versions
|
||||||
|
val gradle85SourceSet = createGradlePluginVariant(
|
||||||
|
GradlePluginVariant.GRADLE_85,
|
||||||
|
commonSourceSet = commonSourceSet
|
||||||
|
)
|
||||||
|
publishShadowedJar(gradle85SourceSet, commonSourceSet)
|
||||||
}
|
}
|
||||||
|
|||||||
+7
@@ -76,6 +76,13 @@ createGradlePluginVariant(
|
|||||||
isGradlePlugin = false
|
isGradlePlugin = false
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// Used for Gradle 8.5+ versions
|
||||||
|
createGradlePluginVariant(
|
||||||
|
GradlePluginVariant.GRADLE_85,
|
||||||
|
commonSourceSet = commonSourceSet,
|
||||||
|
isGradlePlugin = false
|
||||||
|
)
|
||||||
|
|
||||||
publishing {
|
publishing {
|
||||||
publications {
|
publications {
|
||||||
register<MavenPublication>(DEFAULT_MAIN_PUBLICATION_NAME) {
|
register<MavenPublication>(DEFAULT_MAIN_PUBLICATION_NAME) {
|
||||||
|
|||||||
+25
@@ -0,0 +1,25 @@
|
|||||||
|
import org.junit.jupiter.api.Assertions.*
|
||||||
|
import org.junit.jupiter.api.Test
|
||||||
|
|
||||||
|
class GradlePluginVariantTest {
|
||||||
|
|
||||||
|
@Test
|
||||||
|
fun testLatestGradleVariantUsesCurrentDocs() {
|
||||||
|
val lastVariant = GradlePluginVariant.values().last()
|
||||||
|
|
||||||
|
assertEquals(
|
||||||
|
"https://docs.gradle.org/current/javadoc/",
|
||||||
|
lastVariant.gradleApiJavadocUrl
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
fun testNonLatestGradleVariantDoesNotUseCurrentDocs() {
|
||||||
|
GradlePluginVariant.values().dropLast(1).forEach {
|
||||||
|
assertNotEquals(
|
||||||
|
"https://docs.gradle.org/current/javadoc/",
|
||||||
|
it.gradleApiJavadocUrl
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user