Skip to content

Commit fcbf170

Browse files
committed
ci: Use 4.27.4
1 parent 569963a commit fcbf170

File tree

1 file changed

+1
-75
lines changed

1 file changed

+1
-75
lines changed

.kokoro/build.sh

Lines changed: 1 addition & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -27,81 +27,6 @@ source ${scriptDir}/common.sh
2727
java -version
2828
echo ${JOB_TYPE}
2929

30-
# Store the current Java version since the version may change when installing sdk-platform-java
31-
current_java_home=$JAVA_HOME
32-
33-
# Get the current proto runtime version used in this repo
34-
CURRENT_PROTO_VERSION=$(mvn -ntp help:effective-pom |
35-
sed -n "/<artifactId>protobuf-java<\/artifactId>/,/<\/dependency>/ {
36-
/<version>/{
37-
s/<version>\(.*\)<\/version>/\1/p
38-
q
39-
}
40-
}" | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//')
41-
echo "The current proto version is: ${CURRENT_PROTO_VERSION}"
42-
43-
# Find the latest proto runtime version available
44-
LATEST_PROTO_VERSION="4.28.2"
45-
echo "The latest proto version is: ${LATEST_PROTO_VERSION}"
46-
47-
# Only reinstall shared-deps again to test for a newer proto version
48-
if [[ "${CURRENT_PROTO_VERSION}" != "${LATEST_PROTO_VERSION}" ]]; then
49-
# testing-infra-docker has Java 11 installed in java8 docker container. Use this as sdk-platform-java
50-
# needs Java 11+ to run with GraalVM. For GH actions, JAVA11_HOME does not exist and would skip this.
51-
if [ ! -z "${JAVA11_HOME}" ]; then
52-
export JAVA_HOME="${JAVA11_HOME}"
53-
export PATH=${JAVA_HOME}/bin:$PATH
54-
fi
55-
56-
pushd /tmp
57-
git clone https://github.com/googleapis/sdk-platform-java.git
58-
pushd sdk-platform-java
59-
pushd gapic-generator-java-pom-parent
60-
sed -i "/<protobuf.version>.*<\/protobuf.version>/s/\(.*<protobuf.version>\).*\(<\/protobuf.version>\)/\1${LATEST_PROTO_VERSION}\2/" pom.xml
61-
# sdk-platform-java
62-
popd
63-
64-
pushd sdk-platform-java-config
65-
# Get current Shared-Deps version in sdk-platform-java
66-
SHARED_DEPS_VERSION=$(mvn -ntp help:effective-pom |
67-
sed -n "/<artifactId>sdk-platform-java-config<\/artifactId>/,/<\/dependency>/ {
68-
/<version>/{
69-
s/<version>\(.*\)<\/version>/\1/p
70-
q
71-
}
72-
}" | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//')
73-
echo "Shared-Deps Version: ${SHARED_DEPS_VERSION}"
74-
# sdk-platform-java
75-
popd
76-
77-
mvn clean install -q -ntp \
78-
-DskipTests=true \
79-
-Dclirr.skip=true \
80-
-Denforcer.skip=true \
81-
-T 1C
82-
# /tmp
83-
popd
84-
85-
# Back to the original directory of the repo
86-
popd
87-
# Find all the poms with a reference to shared-deps and update to the new local version
88-
poms=($(find . -name pom.xml))
89-
for pom in "${poms[@]}"; do
90-
if grep -q "sdk-platform-java-config" "${pom}"; then
91-
echo "Updating the pom: ${pom} to use shared-deps version: ${SHARED_DEPS_VERSION}"
92-
sed -i "/<artifactId>sdk-platform-java-config<\/artifactId>/,/<\/parent>/ s/<version>.*<\/version>/<version>$SHARED_DEPS_VERSION<\/version>/" "${pom}"
93-
# xmlstarlet ed --inplace -N x="http://maven.apache.org/POM/4.0.0" \
94-
# -u "//x:project/x:parent[x:artifactId='sdk-platform-java-config']/x:version" \
95-
# -v "${SHARED_DEPS_VERSION}" \
96-
# "${pom}"
97-
fi
98-
done
99-
100-
# Reset back to the original Java version if changed
101-
export JAVA_HOME="${current_java_home}"
102-
export PATH=${JAVA_HOME}/bin:$PATH
103-
fi
104-
10530
# attempt to install 3 times with exponential backoff (starting with 10 seconds)
10631
retry_with_backoff 3 10 \
10732
mvn install -B -V -U \
@@ -143,6 +68,7 @@ integration)
14368
-Dit.test=!ITBigQueryWrite*RetryTest \
14469
-Dsurefire.failIfNoSpecifiedTests=false \
14570
-Dfailsafe.failIfNoSpecifiedTests=false \
71+
-Dprotobuf.version="4.27.4" \
14672
-fae \
14773
verify
14874
RETURN_CODE=$?

0 commit comments

Comments
 (0)