Skip to content

Commit b6f418c

Browse files
Update Gradle to v9.2.0-rc-1 (#1163)
* Update Gradle to v9.2.0-rc-1 * changes for rc 1 * ktlint --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Gabriel Ittner <gabriel.ittner@gmail.com>
1 parent fed29f4 commit b6f418c

File tree

5 files changed

+14
-44
lines changed

5 files changed

+14
-44
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@
1818

1919
#### Compatibility tested up to
2020
- JDK 24
21-
- Gradle 8.14.3
2221
- Gradle 9.1.0
22+
- Gradle 9.2.0-rc-1
2323
- Android Gradle Plugin 8.13.0
2424
- Android Gradle Plugin 9.0.0-alpha08
2525
- Kotlin Gradle Plugin 2.2.20

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.2.0-milestone-2"
2+
gradle = "9.2.0-rc-1"
33

44
kotlin = "2.2.20"
55

gradle/beta.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.1.0"
2+
gradle = "9.2.0-rc-1"
33

44
kotlin = "2.2.20"
55

gradle/rc.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.1.0"
2+
gradle = "9.2.0-rc-1"
33

44
kotlin = "2.2.20"
55

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

Lines changed: 10 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,13 @@
33
package com.vanniktech.maven.publish.workaround
44

55
import com.vanniktech.maven.publish.baseExtension
6-
import org.gradle.api.Action
76
import org.gradle.api.Project
8-
import org.gradle.api.artifacts.Configuration
97
import org.gradle.api.attributes.DocsType
108
import org.gradle.api.component.AdhocComponentWithVariants
119
import org.gradle.api.internal.project.ProjectInternal
1210
import org.gradle.api.plugins.JavaPluginExtension
1311
import org.gradle.api.plugins.internal.JavaConfigurationVariantMapping
1412
import org.gradle.api.plugins.internal.JvmPluginsHelper
15-
import org.gradle.api.provider.Provider
1613
import org.gradle.internal.component.external.model.ProjectDerivedCapability
1714
import org.gradle.util.GradleVersion
1815

@@ -35,46 +32,19 @@ internal fun addTestFixturesSourcesJar(project: Project) {
3532
}.newInstance(projectInternal, "testFixtures")
3633

3734
// use reflection because return type changed in Gradle 9.2.0-milestone-1
38-
val sourceElements = JvmPluginsHelper::class.java
39-
.getMethod(
40-
"createDocumentationVariantWithArtifact",
41-
String::class.java,
42-
String::class.java,
43-
String::class.java,
44-
Set::class.java,
45-
String::class.java,
46-
Object::class.java,
47-
ProjectInternal::class.java,
48-
).invoke(
49-
null,
50-
testFixturesSourceSet.sourcesElementsConfigurationName,
51-
testFixtureSourceSetName,
52-
DocsType.SOURCES,
53-
setOf(projectDerivedCapability),
54-
testFixturesSourceSet.sourcesJarTaskName,
55-
testFixturesSourceSet.allSource,
56-
projectInternal,
57-
)
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+
)
5844

5945
// the following is not using private APIs just needs to adapt to the API change in the method above
6046
val component = project.components.findByName("java") as AdhocComponentWithVariants
61-
if (GradleVersion.current() >= GradleVersion.version("9.2.0-milestone-1")) {
62-
AdhocComponentWithVariants::class.java.getMethod(
63-
"addVariantsFromConfiguration",
64-
Provider::class.java,
65-
Action::class.java,
66-
)
67-
} else {
68-
AdhocComponentWithVariants::class.java.getMethod(
69-
"addVariantsFromConfiguration",
70-
Configuration::class.java,
71-
Action::class.java,
72-
)
73-
}.invoke(
74-
component,
75-
sourceElements,
76-
JavaConfigurationVariantMapping("compile", true),
77-
)
47+
component.addVariantsFromConfiguration(sourceElements, JavaConfigurationVariantMapping("compile", true))
7848
}
7949

8050
/**

0 commit comments

Comments
 (0)