Skip to content

Commit

Permalink
Gradle 8.1 (#554)
Browse files Browse the repository at this point in the history
  • Loading branch information
gabrielittner authored Apr 12, 2023
1 parent 8cc89da commit 5acae8c
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 25 deletions.
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0.2-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.1-bin.zip
networkTimeout=10000
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
7 changes: 4 additions & 3 deletions gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,6 @@ done
APP_BASE_NAME=${0##*/}
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit

# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'

# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD=maximum

Expand Down Expand Up @@ -197,6 +194,10 @@ if "$cygwin" || "$msys" ; then
done
fi


# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'

# Collect all arguments for the java command;
# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
# shell script including quotes and variable substitutions, so put them in
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ class MavenPublishPluginPlatformTest {
assertThat(result).module().isSigned()
assertThat(result).sourcesJar().exists()
assertThat(result).sourcesJar().isSigned()
if (kotlinVersion < KotlinVersion.KT_1_8_BETA) {
if (kotlinVersion < KotlinVersion.KT_1_8_20) {
assertThat(result).sourcesJar().containsAllSourceFiles()
} else {
assertThat(result).sourcesJar().containsSourceSetFiles("commonMain")
Expand Down Expand Up @@ -402,7 +402,7 @@ class MavenPublishPluginPlatformTest {
assertThat(result).module().isSigned()
assertThat(result).sourcesJar().exists()
assertThat(result).sourcesJar().isSigned()
if (kotlinVersion < KotlinVersion.KT_1_8_BETA) {
if (kotlinVersion < KotlinVersion.KT_1_8_20) {
assertThat(result).sourcesJar().containsAllSourceFiles()
} else {
assertThat(result).sourcesJar().containsSourceSetFiles("commonMain")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class MavenPublishPluginSpecialCaseTest {
)
assertThat(result).module().exists()
assertThat(result).sourcesJar().exists()
if (kotlinVersion < KotlinVersion.KT_1_8_BETA) {
if (kotlinVersion < KotlinVersion.KT_1_8_20) {
assertThat(result).sourcesJar().containsAllSourceFiles()
} else {
assertThat(result).sourcesJar().containsSourceSetFiles("commonMain")
Expand Down Expand Up @@ -105,7 +105,7 @@ class MavenPublishPluginSpecialCaseTest {
)
assertThat(result).module().exists()
assertThat(result).sourcesJar().exists()
if (kotlinVersion < KotlinVersion.KT_1_8_BETA) {
if (kotlinVersion < KotlinVersion.KT_1_8_20) {
assertThat(result).sourcesJar().containsAllSourceFiles()
} else {
assertThat(result).sourcesJar().containsSourceSetFiles("commonMain")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,30 +54,25 @@ enum class AgpVersion(

enum class KotlinVersion(val value: String) {
// minimum supported
KT_1_7("1.7.0"),
KT_1_7_0("1.7.0"),

// stable
KT_1_8("1.8.10"),

// preview
KT_1_8_BETA("1.8.20"),
KT_1_8_20("1.8.20"),
}

enum class GradleVersion(val value: String) {
// minimum supported
GRADLE_7_4("7.4"),

// stable
GRADLE_8_0("8.0.2"),

// preview
GRADLE_8_1("8.1-rc-2"),
GRADLE_8_1("8.1"),
;

companion object {
// aliases for the skipped version to be able to reference the correct one in AgpVersion
val GRADLE_7_5 = GRADLE_8_0
val GRADLE_7_6 = GRADLE_8_0
val GRADLE_7_5 = GRADLE_8_1
val GRADLE_7_6 = GRADLE_8_1
val GRADLE_8_0 = GRADLE_8_1
}
}

Expand All @@ -86,5 +81,5 @@ enum class GradlePluginPublish(val version: String) {
GRADLE_PLUGIN_PUBLISH_1_0("1.0.0"),

// stable
GRADLE_PLUGIN_PUBLISH_1_1("1.1.0"),
GRADLE_PLUGIN_PUBLISH_1_2("1.2.0"),
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import org.gradle.api.plugins.jvm.internal.JvmModelingServices
import org.gradle.api.plugins.jvm.internal.JvmVariantBuilder
import org.gradle.api.provider.Provider
import org.gradle.api.publish.maven.MavenPublication
import org.gradle.api.tasks.SourceSet
import org.gradle.api.tasks.TaskProvider
import org.gradle.configurationcache.extensions.serviceOf
import org.gradle.jvm.tasks.Jar
Expand Down Expand Up @@ -493,13 +492,13 @@ private fun setupTestFixtures(project: Project, sourcesJar: Boolean) {
val action = Action<JvmVariantBuilder> {
it.withSourcesJar().published()
}
if (GradleVersion.current() >= GradleVersion.version("8.1-rc-1")) {
if (GradleVersion.current() >= GradleVersion.version("8.1")) {
val extension = project.extensions.getByType(JavaPluginExtension::class.java)
val testFixturesSourceSet = extension.sourceSets.maybeCreate(variant)
val method = services.javaClass.getMethod("createJvmVariant", String::class.java, SourceSet::class.java, Action::class.java)
method.invoke(services, variant, testFixturesSourceSet, action)
services.createJvmVariant(variant, testFixturesSourceSet, action)
} else {
project.serviceOf<JvmModelingServices>().createJvmVariant(variant, action)
val method = services.javaClass.getMethod("createJvmVariant", String::class.java, Action::class.java)
method.invoke(services, variant, action)
}
}

Expand Down

0 comments on commit 5acae8c

Please sign in to comment.