Skip to content

Commit 9fb23e6

Browse files
cpovirkGoogle Java Core Libraries
authored and
Google Java Core Libraries
committed
Modify our internal release script to run Gradle integration tests during 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
1 parent 3576cd4 commit 9fb23e6

File tree

1 file changed

+31
-6
lines changed

1 file changed

+31
-6
lines changed

util/gradle_integration_tests.sh

+31-6
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,35 @@
22

33
set -eu
44

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

8-
integration-tests/gradle/gradlew -p integration-tests/gradle wrapper --gradle-version=5.6.4
9-
integration-tests/gradle/gradlew -p integration-tests/gradle testClasspath
10-
integration-tests/gradle/gradlew -p integration-tests/gradle wrapper --gradle-version=7.0.2
11-
integration-tests/gradle/gradlew -p integration-tests/gradle testClasspath
8+
# Gradle Wrapper overwrites some files when it runs.
9+
# To avoid modifying the Git client, we copy everything we need to another directory.
10+
# That provides general hygiene, including avoiding release errors:
11+
#
12+
# Preparing to update Javadoc and JDiff for the release...
13+
# error: Your local changes to the following files would be overwritten by checkout:
14+
# integration-tests/gradle/gradle/wrapper/gradle-wrapper.jar
15+
# integration-tests/gradle/gradle/wrapper/gradle-wrapper.properties
16+
# integration-tests/gradle/gradlew
17+
# integration-tests/gradle/gradlew.bat
18+
# Please commit your changes or stash them before you switch branches.
19+
20+
GRADLE_TEMP="$(mktemp -d)"
21+
trap 'rm -rf "${GRADLE_TEMP}"' EXIT
22+
23+
# The Gradle tests need the pom.xml only to read its version number.
24+
# (And the file needs to be two directory levels up from the Gradle build file.)
25+
# TODO(cpovirk): Find a better way to give them that information.
26+
cp pom.xml "${GRADLE_TEMP}"
27+
28+
for version in 5.6.4 7.0.2; do
29+
# Enter a subshell so that we return to the current directory afterward.
30+
(
31+
cp -r integration-tests "${GRADLE_TEMP}/${version}"
32+
cd "${GRADLE_TEMP}/${version}/gradle"
33+
./gradlew wrapper --gradle-version="${version}"
34+
./gradlew testClasspath
35+
)
36+
done

0 commit comments

Comments
 (0)