Skip to content

Commit

Permalink
Gradle 8.8 support (#750)
Browse files Browse the repository at this point in the history
* Gradle 8.8

* update for 8.8 rc 1

* jdk 22

* Revert "jdk 22"

This reverts commit 339837d.

* Update CHANGELOG.md

Co-authored-by: Niklas Baudy <niklas.baudy@vanniktech.de>

---------

Co-authored-by: Niklas Baudy <niklas.baudy@vanniktech.de>
  • Loading branch information
gabrielittner and vanniktech committed Apr 27, 2024
1 parent db6263e commit eb30275
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 13 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Expand Up @@ -12,6 +12,7 @@
#### Compatibility tested up to
- JDK 21
- Gradle 8.7
- Gradle 8.8-rc-1
- Android Gradle Plugin 8.3.2
- Android Gradle Plugin 8.4.0-rc02
- Android Gradle Plugin 8.5.0-alpha05
Expand Down
Expand Up @@ -47,7 +47,7 @@ enum class AgpVersion(

// canary channel
AGP_8_5(
value = "8.5.0-alpha05",
value = "8.5.0-alpha06",
minGradleVersion = GradleVersion.GRADLE_8_6,
),
}
Expand Down Expand Up @@ -79,6 +79,11 @@ enum class GradleVersion(
GRADLE_8_7(
value = "8.7",
),

// rc
GRADLE_8_8(
value = "8.8-rc-1",
),
;

companion object {
Expand Down
@@ -1,12 +1,12 @@
package com.vanniktech.maven.publish

import com.google.common.collect.ImmutableList
import com.google.testing.junit.testparameterinjector.junit5.TestParameter.TestParameterValuesProvider
import com.google.testing.junit.testparameterinjector.junit5.TestParameterValuesProvider

private val quickTestProperty get() = System.getProperty("quickTest")

internal class TestOptionsConfigProvider : TestParameterValuesProvider {
override fun provideValues(): ImmutableList<TestOptions.Config?> {
internal class TestOptionsConfigProvider : TestParameterValuesProvider() {
override fun provideValues(context: Context?): List<*> {
val property = System.getProperty("testConfigMethod")
if (property.isNotBlank()) {
return ImmutableList.of(TestOptions.Config.valueOf(property))
Expand All @@ -18,26 +18,26 @@ internal class TestOptionsConfigProvider : TestParameterValuesProvider {
}
}

internal class GradleVersionProvider : TestParameterValuesProvider {
override fun provideValues(): ImmutableList<GradleVersion> {
internal class GradleVersionProvider : TestParameterValuesProvider() {
override fun provideValues(context: Context?): List<*> {
if (quickTestProperty.isNotBlank()) {
return ImmutableList.of(GradleVersion.entries.last())
}
return ImmutableList.copyOf(GradleVersion.entries)
}
}

internal class AgpVersionProvider : TestParameterValuesProvider {
override fun provideValues(): ImmutableList<AgpVersion> {
internal class AgpVersionProvider : TestParameterValuesProvider() {
override fun provideValues(context: Context?): List<*> {
if (quickTestProperty.isNotBlank()) {
return ImmutableList.of(AgpVersion.entries.last())
}
return ImmutableList.copyOf(AgpVersion.entries)
}
}

internal class KotlinVersionProvider : TestParameterValuesProvider {
override fun provideValues(): ImmutableList<KotlinVersion> {
internal class KotlinVersionProvider : TestParameterValuesProvider() {
override fun provideValues(context: Context?): List<*> {
if (quickTestProperty.isNotBlank()) {
return ImmutableList.of(KotlinVersion.entries.last())
}
Expand Down
Expand Up @@ -19,6 +19,7 @@ import org.gradle.external.javadoc.StandardJavadocDocletOptions
import org.gradle.plugins.signing.Sign
import org.gradle.plugins.signing.SigningPlugin
import org.gradle.plugins.signing.type.pgp.ArmoredSignatureType
import org.gradle.util.GradleVersion
import org.jetbrains.dokka.gradle.DokkaTask

abstract class MavenPublishBaseExtension(
Expand Down Expand Up @@ -152,7 +153,7 @@ abstract class MavenPublishBaseExtension(
project.gradleSigning.sign(publication)
}

// TODO: remove after https://youtrack.jetbrains.com/issue/KT-46466 is fixed
// TODO: https://youtrack.jetbrains.com/issue/KT-46466 https://github.com/gradle/gradle/issues/26091
project.tasks.withType(AbstractPublishToMaven::class.java).configureEach { publishTask ->
publishTask.dependsOn(project.tasks.withType(Sign::class.java))
}
Expand Down Expand Up @@ -237,9 +238,12 @@ abstract class MavenPublishBaseExtension(
*/
fun pom(configure: Action<in MavenPom>) {
project.mavenPublications { publication ->
// TODO without afterEvaluate https://github.com/gradle/gradle/issues/12259 will happen
project.afterEvaluate {
if (GradleVersion.current() >= GradleVersion.version("8.8-rc-1")) {
publication.pom(configure)
} else {
project.afterEvaluate {
publication.pom(configure)
}
}
}
}
Expand Down

0 comments on commit eb30275

Please sign in to comment.