Skip to content

Commit e189ee0

Browse files
bump min Gradle version to 8.13 (#1095)
* bump min Gradle version to 8.13 * ktlint * add min jdk
1 parent 02b7ad8 commit e189ee0

File tree

9 files changed

+23
-99
lines changed

9 files changed

+23
-99
lines changed

CHANGELOG.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,24 +3,26 @@
33
## [UNRELEASED](https://github.com/vanniktech/gradle-maven-publish-plugin/compare/0.34.0...HEAD) *(2025-xx-xx)*
44

55
- Add support for publishing Kotlin Multiplatform libraries that use `com.android.kotlin.multiplatform.library`.
6+
- Raise minimum Gradle version to 8.13
7+
68

79
#### Minimum supported versions
810
- JDK 11
9-
- Gradle 8.5
11+
- Gradle 8.13
1012
- Android Gradle Plugin 8.0.0
1113
- Kotlin Gradle Plugin 1.9.20
1214

1315
#### Compatibility tested up to
1416
- JDK 24
1517
- Gradle 8.14.3
16-
- Gradle 9.0.0-rc2
18+
- Gradle 9.0.0-rc3
1719
- Android Gradle Plugin 8.11.1
18-
- Android Gradle Plugin 8.12.0-alpha08
20+
- Android Gradle Plugin 8.12.0-rc01
1921
- Kotlin Gradle Plugin 2.2.0
2022
- Kotlin Gradle Plugin 2.2.20-Beta1
2123

2224

23-
## [0.34.0.](https://github.com/vanniktech/gradle-maven-publish-plugin/releases/tag/0.34.0) *(2025-07-13)*
25+
## [0.34.0](https://github.com/vanniktech/gradle-maven-publish-plugin/releases/tag/0.34.0) *(2025-07-13)*
2426

2527
- Added configuration cache support for publishing.
2628
- Removed support for publishing through Sonatype OSSRH since it has been shut down. See the

plugin/src/integrationTest/kotlin/com/vanniktech/maven/publish/JavaPluginTest.kt

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -60,14 +60,7 @@ class JavaPluginTest : BasePluginTest() {
6060
assertThat(result).artifact("jar").isSigned()
6161
assertThat(result).pom().exists()
6262
assertThat(result).pom().isSigned()
63-
if (gradleVersion < GradleVersion.GRADLE_8_12) {
64-
assertThat(result).pom().matchesExpectedPom(
65-
// TODO: Gradle currently adds a self dependency when test fixtures are published https://github.com/gradle/gradle/issues/14936
66-
PomDependency("com.example", "test-artifact", "1.0.0", "compile", true),
67-
)
68-
} else {
69-
assertThat(result).pom().matchesExpectedPom()
70-
}
63+
assertThat(result).pom().matchesExpectedPom()
7164
assertThat(result).module().exists()
7265
assertThat(result).module().isSigned()
7366
assertThat(result).sourcesJar().exists()

plugin/src/integrationTest/kotlin/com/vanniktech/maven/publish/KotlinPluginTest.kt

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -51,15 +51,7 @@ class KotlinPluginTest : BasePluginTest() {
5151
assertThat(result).artifact("jar").isSigned()
5252
assertThat(result).pom().exists()
5353
assertThat(result).pom().isSigned()
54-
if (gradleVersion < GradleVersion.GRADLE_8_12) {
55-
assertThat(result).pom().matchesExpectedPom(
56-
kotlinStdlibJdk(kotlinVersion),
57-
// TODO: Gradle currently adds a self dependency when test fixtures are published https://github.com/gradle/gradle/issues/14936
58-
PomDependency("com.example", "test-artifact", "1.0.0", "compile", true),
59-
)
60-
} else {
61-
assertThat(result).pom().matchesExpectedPom(kotlinStdlibJdk(kotlinVersion))
62-
}
54+
assertThat(result).pom().matchesExpectedPom(kotlinStdlibJdk(kotlinVersion))
6355
assertThat(result).module().exists()
6456
assertThat(result).module().isSigned()
6557
assertThat(result).sourcesJar().exists()

plugin/src/integrationTest/kotlin/com/vanniktech/maven/publish/TestOptions.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,8 @@ enum class GradleVersion(
6767
) {
6868
// minimum supported
6969
GRADLE_MIN(
70-
value = "8.5",
71-
firstUnsupportedJdkVersion = JavaVersion.VERSION_22,
70+
value = "8.13",
71+
firstUnsupportedJdkVersion = JavaVersion.VERSION_24,
7272
),
7373

7474
// latest versions of each type

plugin/src/main/kotlin/com/vanniktech/maven/publish/MavenPublishBaseExtension.kt

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import com.vanniktech.maven.publish.central.EnableAutomaticMavenCentralPublishin
55
import com.vanniktech.maven.publish.central.MavenCentralBuildService.Companion.registerMavenCentralBuildService
66
import com.vanniktech.maven.publish.central.PrepareMavenCentralPublishingTask.Companion.registerPrepareMavenCentralPublishingTask
77
import com.vanniktech.maven.publish.tasks.WorkaroundSignatureType
8-
import com.vanniktech.maven.publish.workaround.rootProjectBuildDir
98
import javax.inject.Inject
109
import org.gradle.api.Action
1110
import org.gradle.api.Incubating
@@ -21,7 +20,6 @@ import org.gradle.external.javadoc.StandardJavadocDocletOptions
2120
import org.gradle.plugins.signing.Sign
2221
import org.gradle.plugins.signing.SigningPlugin
2322
import org.gradle.plugins.signing.type.pgp.ArmoredSignatureType
24-
import org.gradle.util.GradleVersion
2523
import org.jetbrains.dokka.gradle.DokkaTask
2624

2725
public abstract class MavenPublishBaseExtension @Inject constructor(
@@ -84,7 +82,7 @@ public abstract class MavenPublishBaseExtension @Inject constructor(
8482
val buildService = project.registerMavenCentralBuildService(
8583
repositoryUsername = project.providers.gradleProperty("mavenCentralUsername"),
8684
repositoryPassword = project.providers.gradleProperty("mavenCentralPassword"),
87-
rootBuildDirectory = project.rootProjectBuildDir(),
85+
rootBuildDirectory = @Suppress("UnstableApiUsage") project.layout.settingsDirectory.dir("build"),
8886
buildEventsListenerRegistry = buildEventsListenerRegistry,
8987
)
9088

@@ -244,13 +242,7 @@ public abstract class MavenPublishBaseExtension @Inject constructor(
244242
*/
245243
public fun pom(configure: Action<in MavenPom>) {
246244
project.mavenPublications { publication ->
247-
if (GradleVersion.current() >= GradleVersion.version("8.8-rc-1")) {
248-
publication.pom(configure)
249-
} else {
250-
project.afterEvaluate {
251-
publication.pom(configure)
252-
}
253-
}
245+
publication.pom(configure)
254246
}
255247
}
256248

plugin/src/main/kotlin/com/vanniktech/maven/publish/MavenPublishBasePlugin.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public abstract class MavenPublishBasePlugin : Plugin<Project> {
4141
}
4242

4343
private companion object {
44-
val MIN_GRADLE_VERSION: GradleVersion = GradleVersion.version("8.5")
44+
val MIN_GRADLE_VERSION: GradleVersion = GradleVersion.version("8.13")
4545
val KOTLIN_PLUGIN_IDS = listOf(
4646
"org.jetbrains.kotlin.jvm",
4747
"org.jetbrains.kotlin.multiplatform",

plugin/src/main/kotlin/com/vanniktech/maven/publish/central/MavenCentralBuildService.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ internal abstract class MavenCentralBuildService :
165165
fun Project.registerMavenCentralBuildService(
166166
repositoryUsername: Provider<String>,
167167
repositoryPassword: Provider<String>,
168-
rootBuildDirectory: Provider<Directory>,
168+
rootBuildDirectory: Directory,
169169
buildEventsListenerRegistry: BuildEventsListenerRegistry,
170170
): Provider<MavenCentralBuildService> {
171171
val okhttpTimeout = project.providers

plugin/src/main/kotlin/com/vanniktech/maven/publish/workaround/IsolatedProjects.kt

Lines changed: 0 additions & 31 deletions
This file was deleted.

plugin/src/main/kotlin/com/vanniktech/maven/publish/workaround/TestFixtures.kt

Lines changed: 9 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ package com.vanniktech.maven.publish.workaround
44

55
import com.vanniktech.maven.publish.baseExtension
66
import org.gradle.api.Project
7-
import org.gradle.api.artifacts.Configuration
87
import org.gradle.api.attributes.DocsType
98
import org.gradle.api.internal.project.ProjectInternal
109
import org.gradle.api.plugins.JavaPluginExtension
@@ -33,38 +32,15 @@ internal fun addTestFixturesSourcesJar(project: Project) {
3332
ProjectDerivedCapability::class.java.getConstructor(Project::class.java, String::class.java)
3433
}.newInstance(projectInternal, "testFixtures")
3534

36-
val sourceElements = if (GradleVersion.current() >= GradleVersion.version("8.6-rc-1")) {
37-
JvmPluginsHelper.createDocumentationVariantWithArtifact(
38-
testFixturesSourceSet.sourcesElementsConfigurationName,
39-
testFixtureSourceSetName,
40-
DocsType.SOURCES,
41-
setOf(projectDerivedCapability),
42-
testFixturesSourceSet.sourcesJarTaskName,
43-
testFixturesSourceSet.allSource,
44-
projectInternal,
45-
)
46-
} else {
47-
JvmPluginsHelper::class.java
48-
.getMethod(
49-
"createDocumentationVariantWithArtifact",
50-
String::class.java,
51-
String::class.java,
52-
String::class.java,
53-
List::class.java,
54-
String::class.java,
55-
Object::class.java,
56-
ProjectInternal::class.java,
57-
).invoke(
58-
null,
59-
testFixturesSourceSet.sourcesElementsConfigurationName,
60-
testFixtureSourceSetName,
61-
DocsType.SOURCES,
62-
listOf(projectDerivedCapability),
63-
testFixturesSourceSet.sourcesJarTaskName,
64-
testFixturesSourceSet.allSource,
65-
projectInternal,
66-
) as Configuration
67-
}
35+
val sourceElements = JvmPluginsHelper.createDocumentationVariantWithArtifact(
36+
testFixturesSourceSet.sourcesElementsConfigurationName,
37+
testFixtureSourceSetName,
38+
DocsType.SOURCES,
39+
setOf(projectDerivedCapability),
40+
testFixturesSourceSet.sourcesJarTaskName,
41+
testFixturesSourceSet.allSource,
42+
projectInternal,
43+
)
6844

6945
val component = JavaPluginHelper.getJavaComponent(project) as DefaultJvmSoftwareComponent
7046
component.addVariantsFromConfiguration(sourceElements, JavaConfigurationVariantMapping("compile", true))

0 commit comments

Comments
 (0)