From c1ff4a856d4aaa4400f376cc159d4517f124beb1 Mon Sep 17 00:00:00 2001 From: yifeizhuang Date: Fri, 17 Mar 2023 15:09:58 -0700 Subject: [PATCH] buildscript: iterate all example folder and build (#9961) --- buildscripts/kokoro/unix.sh | 31 +++++++++------------------ examples/example-servlet/build.gradle | 2 +- 2 files changed, 11 insertions(+), 22 deletions(-) diff --git a/buildscripts/kokoro/unix.sh b/buildscripts/kokoro/unix.sh index 828a599ff7..d5a85c7404 100755 --- a/buildscripts/kokoro/unix.sh +++ b/buildscripts/kokoro/unix.sh @@ -64,28 +64,17 @@ if [[ -z "${SKIP_TESTS:-}" ]]; then # --batch-mode reduces log spam mvn verify --batch-mode popd - pushd examples/example-alts - ../gradlew build $GRADLE_FLAGS - popd - pushd examples/example-hostname - ../gradlew build $GRADLE_FLAGS - mvn verify --batch-mode - popd - pushd examples/example-tls - ../gradlew build $GRADLE_FLAGS - mvn verify --batch-mode - popd - pushd examples/example-jwt-auth - ../gradlew build $GRADLE_FLAGS - mvn verify --batch-mode - popd - pushd examples/example-xds - ../gradlew build $GRADLE_FLAGS - popd + for f in examples/example-* + do + pushd "$f" + ../gradlew build $GRADLE_FLAGS + if [ -f "pom.xml" ]; then + # --batch-mode reduces log spam + mvn verify --batch-mode + fi + popd + done # TODO(zpencer): also build the GAE examples - pushd examples/example-orca - ../gradlew build $GRADLE_FLAGS - popd fi LOCAL_MVN_TEMP=$(mktemp -d) diff --git a/examples/example-servlet/build.gradle b/examples/example-servlet/build.gradle index 64b0a8eac1..f6772cda51 100644 --- a/examples/example-servlet/build.gradle +++ b/examples/example-servlet/build.gradle @@ -23,7 +23,7 @@ dependencies { "io.grpc:grpc-servlet:${grpcVersion}", "io.grpc:grpc-stub:${grpcVersion}" - providedImplementation "javax.servlet:javax.servlet-api:4.0.1", + compileOnly "javax.servlet:javax.servlet-api:4.0.1", "org.apache.tomcat:annotations-api:6.0.53" }