diff --git a/.github/workflows/cid.yml b/.github/workflows/cid.yml index d00605a7a..6cd08d1a3 100644 --- a/.github/workflows/cid.yml +++ b/.github/workflows/cid.yml @@ -11,21 +11,14 @@ jobs: is_snapshot: ${{ steps.setup.outputs.is_snapshot }} steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Install JDK - uses: actions/setup-java@v1 + uses: actions/setup-java@v4 with: - java-version: 11 + distribution: 'zulu' + java-version: 17 - name: Gradle Cache - uses: actions/cache@v2 - with: - path: | - ~/.gradle/caches - ~/.gradle/wrapper - key: ${{ runner.os }}-v2-gradle-build-${{ hashFiles('**/*') }} - restore-keys: | - ${{ runner.os }}-v2-gradle-build- - ${{ runner.os }}-v2-gradle- + uses: gradle/gradle-build-action@v2 - name: Validate Gradle integrity uses: gradle/wrapper-validation-action@v1 - name: Setup environment @@ -40,21 +33,14 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Install JDK - uses: actions/setup-java@v1 + uses: actions/setup-java@v4 with: - java-version: 11 + distribution: 'zulu' + java-version: 17 - name: Gradle Cache - uses: actions/cache@v2 - with: - path: | - ~/.gradle/caches - ~/.gradle/wrapper - key: ${{ runner.os }}-v2-gradle-test-${{ hashFiles('**/*') }} - restore-keys: | - ${{ runner.os }}-v2-gradle-test- - ${{ runner.os }}-v2-gradle- + uses: gradle/gradle-build-action@v2 - name: Setup environment run: ./gradlew publishToMavenLocal - name: Run tests @@ -63,25 +49,17 @@ jobs: deploy_snapshot: needs: [build, test] runs-on: ubuntu-latest - if: github.ref == 'refs/heads/master' && needs.build.outputs.is_snapshot == 'true' + if: github.repository == 'Triple-T/gradle-play-publisher' && github.ref == 'refs/heads/master' && needs.build.outputs.is_snapshot == 'true' steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Install JDK - uses: actions/setup-java@v1 + uses: actions/setup-java@v4 with: - java-version: 11 + distribution: 'zulu' + java-version: 17 - name: Gradle Cache - uses: actions/cache@v2 - with: - path: | - ~/.gradle/caches - ~/.gradle/wrapper - key: ${{ runner.os }}-v2-gradle-deploy-snapshot-${{ hashFiles('**/*') }} - restore-keys: | - ${{ runner.os }}-v2-gradle-deploy-snapshot- - ${{ runner.os }}-v2-gradle-deploy- - ${{ runner.os }}-v2-gradle- + uses: gradle/gradle-build-action@v2 - name: Build project run: ./gradlew assemble - name: Publish snapshot @@ -93,25 +71,17 @@ jobs: deploy_release: needs: [build, test] runs-on: ubuntu-latest - if: startsWith(github.ref, 'refs/tags/') + if: github.repository == 'Triple-T/gradle-play-publisher' && startsWith(github.ref, 'refs/tags/') steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Install JDK - uses: actions/setup-java@v1 + uses: actions/setup-java@v4 with: - java-version: 11 + distribution: 'zulu' + java-version: 17 - name: Gradle Cache - uses: actions/cache@v2 - with: - path: | - ~/.gradle/caches - ~/.gradle/wrapper - key: ${{ runner.os }}-v2-gradle-deploy-release-${{ hashFiles('**/*') }} - restore-keys: | - ${{ runner.os }}-v2-gradle-deploy-release- - ${{ runner.os }}-v2-gradle-deploy- - ${{ runner.os }}-v2-gradle- + uses: gradle/gradle-build-action@v2 - name: Build project run: ./gradlew assemble - name: Publish release diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml index 2a6f83347..2654d6886 100644 --- a/.github/workflows/stale.yml +++ b/.github/workflows/stale.yml @@ -7,7 +7,7 @@ jobs: stale: runs-on: ubuntu-latest steps: - - uses: actions/stale@v3 + - uses: actions/stale@v9 with: days-before-stale: 7 stale-issue-label: waiting-for-reply diff --git a/build.gradle.kts b/build.gradle.kts index 4a71b7295..2a61b8194 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -24,10 +24,6 @@ buildScan { publishAlways() } -tasks.wrapper { - distributionType = Wrapper.DistributionType.ALL -} - tasks.register("configureGithubActions") { doLast { println("::set-output name=is_snapshot::$isSnapshotBuild") diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index 943f0cbfa..d64cd4917 100644 Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 8707e8b50..1af9e0930 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,7 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip networkTimeout=10000 +validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/gradlew b/gradlew index 65dcd68d6..1aa94a426 100755 --- a/gradlew +++ b/gradlew @@ -83,10 +83,8 @@ done # This is normally unused # shellcheck disable=SC2034 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"' +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum @@ -133,10 +131,13 @@ location of your Java installation." fi else JAVACMD=java - which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + if ! command -v java >/dev/null 2>&1 + then + die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. Please set the JAVA_HOME variable in your environment to match the location of your Java installation." + fi fi # Increase the maximum file descriptors if we can. @@ -144,7 +145,7 @@ 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=SC2039,SC3045 MAX_FD=$( ulimit -H -n ) || warn "Could not query maximum file descriptor limit" esac @@ -152,7 +153,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then '' | 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=SC2039,SC3045 ulimit -n "$MAX_FD" || warn "Could not set maximum file descriptor limit to $MAX_FD" esac @@ -197,11 +198,15 @@ if "$cygwin" || "$msys" ; then done fi -# 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 -# double quotes to make sure that they get re-expanded; and -# * put everything else in single quotes, so that it's not re-expanded. + +# 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, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. set -- \ "-Dorg.gradle.appname=$APP_BASE_NAME" \ diff --git a/play/plugin/src/test/kotlin/com/github/triplet/gradle/play/PlayPublisherPluginIntegrationTest.kt b/play/plugin/src/test/kotlin/com/github/triplet/gradle/play/PlayPublisherPluginIntegrationTest.kt index 0fb795f9d..f27d63fdb 100644 --- a/play/plugin/src/test/kotlin/com/github/triplet/gradle/play/PlayPublisherPluginIntegrationTest.kt +++ b/play/plugin/src/test/kotlin/com/github/triplet/gradle/play/PlayPublisherPluginIntegrationTest.kt @@ -193,13 +193,13 @@ class PlayPublisherPluginIntegrationTest : IntegrationTestBase() { } android { - compileSdk 31 + compileSdk 34 namespace = "com.example.publisher" defaultConfig { applicationId "com.example.publisher" minSdk 31 - targetSdk 31 + targetSdk 33 versionCode 1 versionName "1.0" } @@ -637,13 +637,13 @@ class PlayPublisherPluginIntegrationTest : IntegrationTestBase() { apply plugin: 'com.google.firebase.crashlytics' android { - compileSdk 31 + compileSdk 34 namespace = "com.example.publisher" defaultConfig { applicationId "com.supercilex.test" minSdk 31 - targetSdk 31 + targetSdk 33 versionCode 1 versionName "1.0" } @@ -715,13 +715,13 @@ class PlayPublisherPluginIntegrationTest : IntegrationTestBase() { apply plugin: 'com.bugsnag.android.gradle' android { - compileSdk 31 + compileSdk 34 namespace = "com.example.publisher" defaultConfig { applicationId "com.supercilex.test" minSdk 31 - targetSdk 31 + targetSdk 33 versionCode 1 versionName "1.0" } diff --git a/play/plugin/src/test/kotlin/com/github/triplet/gradle/play/helpers/IntegrationTestBase.kt b/play/plugin/src/test/kotlin/com/github/triplet/gradle/play/helpers/IntegrationTestBase.kt index 8afbcdbd1..841fa02e5 100644 --- a/play/plugin/src/test/kotlin/com/github/triplet/gradle/play/helpers/IntegrationTestBase.kt +++ b/play/plugin/src/test/kotlin/com/github/triplet/gradle/play/helpers/IntegrationTestBase.kt @@ -115,13 +115,13 @@ abstract class IntegrationTestBase( } android { - compileSdk 31 + compileSdk 34 namespace = "com.example.publisher" defaultConfig { applicationId "com.example.publisher" minSdk 31 - targetSdk 31 + targetSdk 33 versionCode 1 versionName "1.0" } diff --git a/play/plugin/src/test/kotlin/com/github/triplet/gradle/play/tasks/ProcessArtifactVersionCodesIntegrationTest.kt b/play/plugin/src/test/kotlin/com/github/triplet/gradle/play/tasks/ProcessArtifactVersionCodesIntegrationTest.kt index 1fa5da8c0..a031b0419 100644 --- a/play/plugin/src/test/kotlin/com/github/triplet/gradle/play/tasks/ProcessArtifactVersionCodesIntegrationTest.kt +++ b/play/plugin/src/test/kotlin/com/github/triplet/gradle/play/tasks/ProcessArtifactVersionCodesIntegrationTest.kt @@ -99,13 +99,13 @@ class ProcessArtifactVersionCodesIntegrationTest : IntegrationTestBase(), Shared } android { - compileSdk 31 + compileSdk 34 namespace = "com.example.publisher" defaultConfig { applicationId "com.example.publisher" minSdk 31 - targetSdk 31 + targetSdk 33 versionCode 1 versionName "1.0" } @@ -167,13 +167,13 @@ class ProcessArtifactVersionCodesIntegrationTest : IntegrationTestBase(), Shared } android { - compileSdk 31 + compileSdk 34 namespace = "com.example.publisher" defaultConfig { applicationId "com.example.publisher" minSdk 31 - targetSdk 31 + targetSdk 33 versionCode 1 versionName "1.0" } @@ -237,13 +237,13 @@ class ProcessArtifactVersionCodesIntegrationTest : IntegrationTestBase(), Shared } android { - compileSdk 31 + compileSdk 34 namespace = "com.example.publisher" defaultConfig { applicationId "com.example.publisher" minSdk 31 - targetSdk 31 + targetSdk 33 versionCode 1 versionName "1.0" } diff --git a/play/plugin/src/test/kotlin/com/github/triplet/gradle/play/tasks/shared/ArtifactIntegrationTests.kt b/play/plugin/src/test/kotlin/com/github/triplet/gradle/play/tasks/shared/ArtifactIntegrationTests.kt index 4ade5f19c..9eab28d4a 100644 --- a/play/plugin/src/test/kotlin/com/github/triplet/gradle/play/tasks/shared/ArtifactIntegrationTests.kt +++ b/play/plugin/src/test/kotlin/com/github/triplet/gradle/play/tasks/shared/ArtifactIntegrationTests.kt @@ -111,13 +111,13 @@ interface ArtifactIntegrationTests : SharedIntegrationTest { apply plugin: 'com.google.firebase.crashlytics' android { - compileSdk 31 + compileSdk 34 namespace = "com.example.publisher" defaultConfig { applicationId "com.supercilex.test" minSdk 31 - targetSdk 31 + targetSdk 33 versionCode 1 versionName "1.0" } diff --git a/settings.gradle.kts b/settings.gradle.kts index cc3533436..069af7110 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -25,9 +25,9 @@ dependencyResolutionManagement { versionCatalogs { create("libs") { - version("depUpdates", "0.39.0") - version("gradlePublish", "1.1.0") - version("nexusPublish", "1.1.0") + version("depUpdates", "0.50.0") + version("gradlePublish", "1.2.1") + version("nexusPublish", "1.3.0") plugin("depUpdates", "com.github.ben-manes.versions") .versionRef("depUpdates") @@ -36,13 +36,13 @@ dependencyResolutionManagement { plugin("nexusPublish", "io.github.gradle-nexus.publish-plugin") .versionRef("nexusPublish") - version("agp", "8.0.1") - version("agp-tools", "31.0.1") - version("android-publisher", "v3-rev20230615-2.0.0") + version("agp", "8.2.0") + version("agp-tools", "31.2.0") + version("android-publisher", "v3-rev20231115-2.0.0") version("api-client", "2.2.0") - version("http-client", "1.40.1") - version("http-auth", "1.2.2") - version("guava", "31.0.1-jre") + version("http-client", "1.43.3") + version("http-auth", "1.20.0") + version("guava", "32.1.3-jre") library("agp", "com.android.tools.build", "gradle").versionRef("agp") library("agp-test", "com.android.tools.build", "builder-test-api").versionRef("agp") @@ -62,9 +62,9 @@ dependencyResolutionManagement { } create("testLibs") { - version("junit", "5.8.1") - version("truth", "1.1.3") - version("mockito", "4.0.0") + version("junit", "5.10.1") + version("truth", "1.1.5") + version("mockito", "5.8.0") library("junit", "org.junit.jupiter", "junit-jupiter-api").versionRef("junit") library("junit-engine", "org.junit.jupiter", "junit-jupiter-engine") diff --git a/testapp/build.gradle.kts b/testapp/build.gradle.kts index 8d69a89cd..56cc0c733 100644 --- a/testapp/build.gradle.kts +++ b/testapp/build.gradle.kts @@ -21,7 +21,7 @@ buildscript { dependencies { classpath(kotlin("gradle-plugin", embeddedKotlinVersion)) - classpath("com.android.tools.build:gradle:7.3.0") + classpath("com.android.tools.build:gradle:8.2.0") classpath("com.supercilex.gradle:version-orchestrator:0.10.0") classpath( "com.github.triplet.gradle:play-publisher:" + @@ -35,10 +35,6 @@ buildScan { termsOfServiceAgree = "yes" } -tasks.wrapper { - distributionType = Wrapper.DistributionType.ALL -} - allprojects { repositories { google() @@ -127,9 +123,9 @@ configure { dependencies { "implementation"(kotlin("stdlib-jdk8", embeddedKotlinVersion)) - "implementation"("androidx.appcompat:appcompat:1.3.1") + "implementation"("androidx.appcompat:appcompat:1.6.1") "implementation"("androidx.multidex:multidex:2.0.1") - "implementation"("androidx.constraintlayout:constraintlayout:2.1.1") + "implementation"("androidx.constraintlayout:constraintlayout:2.1.4") } abstract class BuildReadinessValidator : DefaultTask() { diff --git a/testapp/gradle/wrapper/gradle-wrapper.jar b/testapp/gradle/wrapper/gradle-wrapper.jar index 943f0cbfa..d64cd4917 100644 Binary files a/testapp/gradle/wrapper/gradle-wrapper.jar and b/testapp/gradle/wrapper/gradle-wrapper.jar differ diff --git a/testapp/gradle/wrapper/gradle-wrapper.properties b/testapp/gradle/wrapper/gradle-wrapper.properties index 8707e8b50..3499ded5c 100644 --- a/testapp/gradle/wrapper/gradle-wrapper.properties +++ b/testapp/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip networkTimeout=10000 zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/testapp/gradlew b/testapp/gradlew index aeb74cbb4..1aa94a426 100755 --- a/testapp/gradlew +++ b/testapp/gradlew @@ -83,7 +83,8 @@ done # This is normally unused # shellcheck disable=SC2034 APP_BASE_NAME=${0##*/} -APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum @@ -130,10 +131,13 @@ location of your Java installation." fi else JAVACMD=java - which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + if ! command -v java >/dev/null 2>&1 + then + die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. Please set the JAVA_HOME variable in your environment to match the location of your Java installation." + fi fi # Increase the maximum file descriptors if we can. @@ -141,7 +145,7 @@ 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=SC2039,SC3045 MAX_FD=$( ulimit -H -n ) || warn "Could not query maximum file descriptor limit" esac @@ -149,7 +153,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then '' | 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=SC2039,SC3045 ulimit -n "$MAX_FD" || warn "Could not set maximum file descriptor limit to $MAX_FD" esac @@ -198,11 +202,11 @@ 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 -# double quotes to make sure that they get re-expanded; and -# * put everything else in single quotes, so that it's not re-expanded. +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. set -- \ "-Dorg.gradle.appname=$APP_BASE_NAME" \