Skip to content

Commit

Permalink
Modify our internal release script to run Gradle integration tests du…
Browse files Browse the repository at this point in the history
…ring Guava releases.

And make that process a little faster and more hygienic.

(I see no reason to expect us to [get the Gradle setup wrong](#6612) again, but it would be quite embarrassing if we did....)

RELNOTES=n/a
PiperOrigin-RevId: 544680176
  • Loading branch information
cpovirk authored and Google Java Core Libraries committed Jun 30, 2023
1 parent 3576cd4 commit 9fb23e6
Showing 1 changed file with 31 additions and 6 deletions.
37 changes: 31 additions & 6 deletions util/gradle_integration_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,35 @@

set -eu

mvn clean install -DskipTests
mvn clean install -DskipTests -f android
mvn clean install --projects '!guava-testlib,!guava-tests,!guava-bom,!guava-gwt' -Dmaven.test.skip=true -Dmaven.javadoc.skip=true
mvn clean install --projects '!guava-testlib,!guava-tests,!guava-bom' -Dmaven.test.skip=true -Dmaven.javadoc.skip=true -f android

integration-tests/gradle/gradlew -p integration-tests/gradle wrapper --gradle-version=5.6.4
integration-tests/gradle/gradlew -p integration-tests/gradle testClasspath
integration-tests/gradle/gradlew -p integration-tests/gradle wrapper --gradle-version=7.0.2
integration-tests/gradle/gradlew -p integration-tests/gradle testClasspath
# Gradle Wrapper overwrites some files when it runs.
# To avoid modifying the Git client, we copy everything we need to another directory.
# That provides general hygiene, including avoiding release errors:
#
# Preparing to update Javadoc and JDiff for the release...
# error: Your local changes to the following files would be overwritten by checkout:
# integration-tests/gradle/gradle/wrapper/gradle-wrapper.jar
# integration-tests/gradle/gradle/wrapper/gradle-wrapper.properties
# integration-tests/gradle/gradlew
# integration-tests/gradle/gradlew.bat
# Please commit your changes or stash them before you switch branches.

GRADLE_TEMP="$(mktemp -d)"
trap 'rm -rf "${GRADLE_TEMP}"' EXIT

# The Gradle tests need the pom.xml only to read its version number.
# (And the file needs to be two directory levels up from the Gradle build file.)
# TODO(cpovirk): Find a better way to give them that information.
cp pom.xml "${GRADLE_TEMP}"

for version in 5.6.4 7.0.2; do
# Enter a subshell so that we return to the current directory afterward.
(
cp -r integration-tests "${GRADLE_TEMP}/${version}"
cd "${GRADLE_TEMP}/${version}/gradle"
./gradlew wrapper --gradle-version="${version}"
./gradlew testClasspath
)
done

0 comments on commit 9fb23e6

Please sign in to comment.