Skip to content

Commit cb7699c

Browse files
chore(deps): update dependency gradle to v9.0-milestone-6 (#951)
* chore(deps): update dependency gradle to v9.0-milestone-6 * fix Gradle 9 compatibility for test fixtures * ktlint --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Gabriel Ittner <[email protected]>
1 parent e103b07 commit cb7699c

File tree

4 files changed

+17
-10
lines changed

4 files changed

+17
-10
lines changed

CHANGELOG.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,10 @@
1818
- Kotlin Gradle Plugin 1.9.20
1919

2020
#### Compatibility tested up to
21-
- JDK 23
22-
- Gradle 8.13
23-
- Android Gradle Plugin 8.9.0
21+
- JDK 24
22+
- Gradle 8.14
23+
- Gradle 9.0-milestone-6
24+
- Android Gradle Plugin 8.10.0
2425
- Android Gradle Plugin 8.10.0-alpha07
2526
- Kotlin Gradle Plugin 2.1.10
2627
- Kotlin Gradle Plugin 2.1.20-RC

gradle/alpha.versions.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[versions]
2-
gradle = "9.0-milestone-3"
2+
gradle = "9.0-milestone-6"
33

44
kotlin = "2.2.0-Beta2"
55

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,8 @@ enum class KotlinVersion(
5656
// latest versions of each type
5757
KOTLIN_STABLE(Versions.KOTLIN_STABLE, firstUnsupportedGradleVersion = GradleVersion.GRADLE_ALPHA),
5858
KOTLIN_RC(Versions.KOTLIN_RC, firstUnsupportedGradleVersion = GradleVersion.GRADLE_ALPHA),
59-
KOTLIN_BETA(Versions.KOTLIN_BETA, firstUnsupportedGradleVersion = GradleVersion.GRADLE_ALPHA),
60-
KOTLIN_ALPHA(Versions.KOTLIN_ALPHA, firstUnsupportedGradleVersion = GradleVersion.GRADLE_ALPHA),
59+
KOTLIN_BETA(Versions.KOTLIN_BETA),
60+
KOTLIN_ALPHA(Versions.KOTLIN_ALPHA),
6161
}
6262

6363
enum class GradleVersion(

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

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -492,15 +492,21 @@ private fun setupTestFixtures(project: Project, sourcesJar: Boolean) {
492492
val extension = project.extensions.getByType(JavaPluginExtension::class.java)
493493
val testFixturesSourceSet = extension.sourceSets.maybeCreate(testFixtureSourceSetName)
494494

495+
val projectInternal = project as ProjectInternal
496+
val projectDerivedCapability = if (GradleVersion.current() >= GradleVersion.version("9.0-milestone-6")) {
497+
ProjectDerivedCapability::class.java.getConstructor(ProjectInternal::class.java, String::class.java)
498+
} else {
499+
ProjectDerivedCapability::class.java.getConstructor(Project::class.java, String::class.java)
500+
}.newInstance(projectInternal, "testFixtures")
495501
val sourceElements = if (GradleVersion.current() >= GradleVersion.version("8.6-rc-1")) {
496502
JvmPluginsHelper.createDocumentationVariantWithArtifact(
497503
testFixturesSourceSet.sourcesElementsConfigurationName,
498504
testFixtureSourceSetName,
499505
DocsType.SOURCES,
500-
setOf(ProjectDerivedCapability(project, "testFixtures")),
506+
setOf(projectDerivedCapability),
501507
testFixturesSourceSet.sourcesJarTaskName,
502508
testFixturesSourceSet.allSource,
503-
project as ProjectInternal,
509+
projectInternal,
504510
)
505511
} else {
506512
JvmPluginsHelper::class.java.getMethod(
@@ -517,10 +523,10 @@ private fun setupTestFixtures(project: Project, sourcesJar: Boolean) {
517523
testFixturesSourceSet.sourcesElementsConfigurationName,
518524
testFixtureSourceSetName,
519525
DocsType.SOURCES,
520-
listOf(ProjectDerivedCapability(project, "testFixtures")),
526+
listOf(projectDerivedCapability),
521527
testFixturesSourceSet.sourcesJarTaskName,
522528
testFixturesSourceSet.allSource,
523-
project as ProjectInternal,
529+
projectInternal,
524530
) as Configuration
525531
}
526532

0 commit comments

Comments
 (0)