Skip to content

Commit

Permalink
Merge pull request square#4028 from square/jw.bumps.2024-01-02
Browse files Browse the repository at this point in the history
Bump Gradle, AGP, and the build JDK
  • Loading branch information
JakeWharton authored Jan 25, 2024
2 parents b648e2d + 4010646 commit 9d5dc9f
Show file tree
Hide file tree
Showing 9 changed files with 47 additions and 39 deletions.
16 changes: 8 additions & 8 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ jobs:
- uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: 19
java-version: 21

- uses: gradle/gradle-build-action@v2

- name: Test
run: ./gradlew build
run: ./gradlew build --stacktrace

android:
runs-on: ubuntu-latest
Expand All @@ -46,15 +46,15 @@ jobs:
- uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: 11
java-version: 21

- uses: gradle/gradle-build-action@v2

- name: Run Tests
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: ${{ matrix.api-level }}
script: ./gradlew connectedCheck
script: ./gradlew connectedCheck --stacktrace
env:
API_LEVEL: ${{ matrix.api-level }}

Expand All @@ -67,12 +67,12 @@ jobs:
- uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: 11
java-version: 21

- uses: gradle/gradle-build-action@v2

- name: Run Tests
run: ./gradlew retrofit:robovm-test:robovmTest
run: ./gradlew retrofit:robovm-test:robovmTest --stacktrace

publish:
runs-on: ubuntu-latest
Expand All @@ -88,12 +88,12 @@ jobs:
- uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: 19
java-version: 21

- uses: gradle/gradle-build-action@v2

- name: Upload Artifacts
run: ./gradlew publish
run: ./gradlew publish --stacktrace
env:
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.SONATYPE_NEXUS_USERNAME }}
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.SONATYPE_NEXUS_PASSWORD }}
9 changes: 0 additions & 9 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import org.gradle.internal.jvm.Jvm
buildscript {
dependencies {
classpath libs.androidPlugin
classpath libs.robovmPlugin
classpath libs.kotlin.gradlePlugin
classpath libs.kotlin.serializationPlugin
classpath libs.dokkaPlugin
Expand Down Expand Up @@ -99,14 +98,6 @@ subprojects {
}
}

plugins.withType(com.android.build.gradle.BasePlugin).configureEach { plugin ->
// Can remove this once https://issuetracker.google.com/issues/260059413 is fixed.
plugin.extension.compileOptions {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
}

pluginManager.withPlugin("com.vanniktech.maven.publish") {
mavenPublish {
sonatypeHost = "S01"
Expand Down
2 changes: 1 addition & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ robovm = "2.3.14"
kotlinx-serialization = "1.6.2"

[libraries]
androidPlugin = { module = "com.android.tools.build:gradle", version = "4.2.2" }
androidPlugin = { module = "com.android.tools.build:gradle", version = "8.2.0" }
robovmPlugin = { module = "com.mobidevelop.robovm:robovm-gradle-plugin", version.ref = "robovm" }
dokkaPlugin = "org.jetbrains.dokka:dokka-gradle-plugin:1.9.10"
gradleMavenPublishPlugin = "com.vanniktech:gradle-maven-publish-plugin:0.18.0"
Expand Down
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
3 changes: 2 additions & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.3-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
29 changes: 17 additions & 12 deletions gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -133,26 +131,29 @@ 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.
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
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=SC2039,SC3045
ulimit -n "$MAX_FD" ||
warn "Could not set maximum file descriptor limit to $MAX_FD"
esac
Expand Down Expand Up @@ -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" \
Expand Down
9 changes: 5 additions & 4 deletions retrofit/android-test/build.gradle
Original file line number Diff line number Diff line change
@@ -1,23 +1,24 @@
apply plugin: 'com.android.library'

android {
compileSdkVersion 29
compileSdk 34
namespace 'retrofit2.android'

defaultConfig {
minSdkVersion 21
minSdk 21

// We need to disable D8 desugaring of default methods for the default method tests to work
// correctly. This works in Android Studio because it sets the minSdk automatically based on
// your deployment target. This environment variable is set by the GitHub Action.
def emulatorApiLevel = System.getenv("API_LEVEL")
if (emulatorApiLevel != null) {
try {
minSdkVersion Integer.parseInt(emulatorApiLevel)
minSdk Integer.parseInt(emulatorApiLevel)
} catch (NumberFormatException ignored) {
}
}

targetSdkVersion 29
targetSdk 34
testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
}

Expand Down
5 changes: 1 addition & 4 deletions retrofit/android-test/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
<manifest
xmlns:android="http://schemas.android.com/apk/res/android"
package="retrofit2.android"
>
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<uses-permission android:name="android.permission.INTERNET" />
<application android:usesCleartextTraffic="true"/>
</manifest>
13 changes: 13 additions & 0 deletions retrofit/robovm-test/build.gradle
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
// Normally we want all buildscript classpath dependencies to be at the root so that they
// participate in a single round of dependency resolution. However, the RoboVM plugin
// bundles outdated dependencies like BouncyCastle that are essential to other plugins (namely, AGP)
// without shading them into a new package. Moving it to this project works around this problem.
buildscript {
dependencies {
classpath libs.robovmPlugin
}
repositories {
mavenCentral()
}
}

apply plugin: 'java'
apply plugin: 'robovm'

Expand Down

0 comments on commit 9d5dc9f

Please sign in to comment.