Skip to content

Commit

Permalink
Bumped Gradle, AGP and JDK versions (#1087)
Browse files Browse the repository at this point in the history
  • Loading branch information
gmazzo authored May 4, 2023
1 parent 6cc056c commit 4831050
Show file tree
Hide file tree
Showing 24 changed files with 55 additions and 38 deletions.
10 changes: 5 additions & 5 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -63,24 +63,24 @@ allprojects {
group = "com.github.triplet.gradle"

afterEvaluate {
convention.findByType<JavaPluginExtension>()?.apply {
sourceCompatibility = JavaVersion.VERSION_1_8
extensions.findByType<JavaPluginExtension>()?.apply {
toolchain.languageVersion.convention(JavaLanguageVersion.of(11))
withJavadocJar()
withSourcesJar()
}

convention.findByType<KotlinProjectExtension>()?.apply {
extensions.findByType<KotlinProjectExtension>()?.apply {
sourceSets.configureEach {
languageSettings.progressiveMode = true
languageSettings.enableLanguageFeature("NewInference")
}
}

convention.findByType<PublishingExtension>()?.apply {
extensions.findByType<PublishingExtension>()?.apply {
configureMaven(repositories)
}

convention.findByType<SigningExtension>()?.apply {
extensions.findByType<SigningExtension>()?.apply {
isRequired = false

useInMemoryPgpKeys(System.getenv("SIGNING_KEY"), System.getenv("SIGNING_PASSWORD"))
Expand Down
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-7.6-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-all.zip
networkTimeout=10000
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
20 changes: 9 additions & 11 deletions play/plugin/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,11 @@ afterEvaluate {
tasks.withType<Test> {
inputs.files(fileTree("src/test/fixtures"))

// AGP 8 requires JDK 17 and we want to to be compatible with previous JDKs
javaLauncher.set(javaToolchains.launcherFor {
languageVersion.set(JavaLanguageVersion.of(17))
})

// Our integration tests need a fully compiled jar
dependsOn("assemble")

Expand All @@ -59,23 +64,16 @@ tasks.withType<Test> {
}

gradlePlugin {
website.set("https://github.com/Triple-T/gradle-play-publisher")
vcsUrl.set("https://github.com/Triple-T/gradle-play-publisher")

plugins.create("play") {
id = "com.github.triplet.play"
displayName = "Gradle Play Publisher"
description = "Gradle Play Publisher allows you to upload your App Bundle or APK " +
"and other app details to the Google Play Store."
implementationClass = "com.github.triplet.gradle.play.PlayPublisherPlugin"
}
}

pluginBundle {
website = "https://github.com/Triple-T/gradle-play-publisher"
vcsUrl = "https://github.com/Triple-T/gradle-play-publisher"
tags = listOf("android", "google-play", "publishing", "deployment", "apps", "mobile")

mavenCoordinates {
groupId = project.group as String
artifactId = "play-publisher"
tags.addAll(listOf("android", "google-play", "publishing", "deployment", "apps", "mobile"))
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ internal class PlayPublisherPlugin : Plugin<Project> {
(android as ExtensionAware).extensions.add(PLAY_CONFIGS_PATH, extensionContainer)

val androidExtension = project.extensions.getByType<ApplicationAndroidComponentsExtension>()
androidExtension.onVariants v@{ variant ->
androidExtension.onVariants(androidExtension.selector().all()) v@{ variant ->
val taskVariantName = variant.name.capitalize()
val extensionStore = variant.buildExtension(
project,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import org.gradle.api.file.FileType
import org.gradle.api.file.ProjectLayout
import org.gradle.api.provider.ListProperty
import org.gradle.api.tasks.CacheableTask
import org.gradle.api.tasks.IgnoreEmptyDirectories
import org.gradle.api.tasks.InputFiles
import org.gradle.api.tasks.Internal
import org.gradle.api.tasks.OutputDirectory
Expand Down Expand Up @@ -52,6 +53,7 @@ internal abstract class GenerateResources @Inject constructor(
abstract val resSrcDirs: ListProperty<Directory>

@get:SkipWhenEmpty
@get:IgnoreEmptyDirectories
@get:PathSensitive(PathSensitivity.RELATIVE)
@get:InputFiles
abstract val resSrcTree: ConfigurableFileCollection
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import org.gradle.api.file.FileCollection
import org.gradle.api.file.FileType
import org.gradle.api.provider.ListProperty
import org.gradle.api.provider.Property
import org.gradle.api.tasks.IgnoreEmptyDirectories
import org.gradle.api.tasks.InputFiles
import org.gradle.api.tasks.Internal
import org.gradle.api.tasks.Optional
Expand Down Expand Up @@ -84,6 +85,7 @@ internal abstract class PublishListings @Inject constructor(
@Suppress("MemberVisibilityCanBePrivate", "unused")
@get:PathSensitive(PathSensitivity.RELATIVE)
@get:SkipWhenEmpty
@get:IgnoreEmptyDirectories
@get:InputFiles
protected val targetFiles: FileCollection by lazy { detailFiles + listingFiles + mediaFiles }

Expand Down
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest package="com.example.publisher" />
<manifest />
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest package="com.example.publisher" />
<manifest />
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest package="com.example.publisher" />
<manifest />
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest
xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.publisher">
>

<application>
<activity android:name=".MainActivity" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest package="com.example.publisher" />
<manifest />
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest package="com.example.publisher" />
<manifest />
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest
xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.publisher">
>

<application>
<activity android:name=".MainActivity" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest
xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.publisher">
>

<application>
<activity android:name=".MainActivity" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest package="com.example.publisher" />
<manifest />
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest package="com.example.publisher" />
<manifest />
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ class PlayPublisherPluginIntegrationTest : IntegrationTestBase() {
android {
compileSdk = 31
namespace = "com.example.publisher"
defaultConfig {
applicationId = "com.example.publisher"
Expand Down Expand Up @@ -193,6 +194,7 @@ class PlayPublisherPluginIntegrationTest : IntegrationTestBase() {
android {
compileSdk 31
namespace = "com.example.publisher"
defaultConfig {
applicationId "com.example.publisher"
Expand Down Expand Up @@ -636,6 +638,7 @@ class PlayPublisherPluginIntegrationTest : IntegrationTestBase() {
android {
compileSdk 31
namespace = "com.example.publisher"
defaultConfig {
applicationId "com.supercilex.test"
Expand Down Expand Up @@ -713,6 +716,7 @@ class PlayPublisherPluginIntegrationTest : IntegrationTestBase() {
android {
compileSdk 31
namespace = "com.example.publisher"
defaultConfig {
applicationId "com.supercilex.test"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ abstract class IntegrationTestBase : IntegrationTest {
android {
compileSdk 31
namespace = "com.example.publisher"
defaultConfig {
applicationId "com.example.publisher"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ class ProcessArtifactVersionCodesIntegrationTest : IntegrationTestBase(), Shared
android {
compileSdk 31
namespace = "com.example.publisher"
defaultConfig {
applicationId "com.example.publisher"
Expand Down Expand Up @@ -167,6 +168,7 @@ class ProcessArtifactVersionCodesIntegrationTest : IntegrationTestBase(), Shared
android {
compileSdk 31
namespace = "com.example.publisher"
defaultConfig {
applicationId "com.example.publisher"
Expand Down Expand Up @@ -236,6 +238,7 @@ class ProcessArtifactVersionCodesIntegrationTest : IntegrationTestBase(), Shared
android {
compileSdk 31
namespace = "com.example.publisher"
defaultConfig {
applicationId "com.example.publisher"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ interface ArtifactIntegrationTests : SharedIntegrationTest {
android {
compileSdk 31
namespace = "com.example.publisher"
defaultConfig {
applicationId "com.supercilex.test"
Expand Down
9 changes: 6 additions & 3 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ include(
":play:plugin", ":play:android-publisher"
)

// sets name explicitly to make sure it uses the in intended `artifactId` in the plugin POM
project(":play:plugin").name = "play-publisher"

dependencyResolutionManagement {
repositories {
google().content {
Expand All @@ -23,7 +26,7 @@ dependencyResolutionManagement {
versionCatalogs {
create("libs") {
version("depUpdates", "0.39.0")
version("gradlePublish", "0.17.0")
version("gradlePublish", "1.1.0")
version("nexusPublish", "1.1.0")

plugin("depUpdates", "com.github.ben-manes.versions")
Expand All @@ -33,8 +36,8 @@ dependencyResolutionManagement {
plugin("nexusPublish", "io.github.gradle-nexus.publish-plugin")
.versionRef("nexusPublish")

version("agp", "7.3.0")
version("agp-tools", "30.3.1")
version("agp", "8.0.1")
version("agp-tools", "31.0.1")
version("android-publisher", "v3-rev20211021-1.32.1")
version("api-client", "1.32.2")
version("http-client", "1.40.1")
Expand Down
4 changes: 3 additions & 1 deletion testapp/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ apply(plugin = "kotlin-android")
apply(plugin = "com.supercilex.gradle.versions")
apply(plugin = "com.github.triplet.play")

the<JavaPluginExtension>().toolchain.languageVersion.convention(JavaLanguageVersion.of(8))

configure<BaseAppModuleExtension> {
namespace = "com.supercilex.test"
compileSdk = 31
Expand Down Expand Up @@ -154,6 +156,6 @@ abstract class BuildReadinessValidator : DefaultTask() {

val ready = tasks.register<BuildReadinessValidator>("validateBuildReadiness") {
dependsOn(gradle.includedBuild("gradle-play-publisher")
.task(":play:plugin:publishToMavenLocal"))
.task(":play:play-publisher:publishToMavenLocal"))
}
tasks.matching { it.name != "validateBuildReadiness" }.configureEach { dependsOn(ready) }
2 changes: 1 addition & 1 deletion testapp/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-7.6-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-all.zip
networkTimeout=10000
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
11 changes: 6 additions & 5 deletions testapp/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 @@ -144,15 +141,15 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
case $MAX_FD in #(
max*)
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC3045
# shellcheck disable=SC3045
MAX_FD=$( ulimit -H -n ) ||
warn "Could not query maximum file descriptor limit"
esac
case $MAX_FD in #(
'' | soft) :;; #(
*)
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC3045
# shellcheck disable=SC3045
ulimit -n "$MAX_FD" ||
warn "Could not set maximum file descriptor limit to $MAX_FD"
esac
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

0 comments on commit 4831050

Please sign in to comment.