cd /var/local/git/grpc
bazel build :all //test/... //examples/...
+
+# TODO(jtattersmusch): Adding a build here for --define=grpc_no_xds is not ideal
+# and we should find a better place for this. Refer
+# https://github.com/grpc/grpc/pull/24536#pullrequestreview-517466531 for more
+# details.
+# Test that builds with --define=grpc_no_xds=true work.
+bazel build //test/cpp/end2end:end2end_test --define=grpc_no_xds=true
+# Test that builds that need xDS do not build with --define=grpc_no_xds=true
+EXIT_CODE=0
+bazel build //test/cpp/end2end:xds_end2end_test --define=grpc_no_xds=true || EXIT_CODE=$?
+if [ $EXIT_CODE -eq 0 ]
+then
+ echo "Building xds_end2end_test succeeded even with --define=grpc_no_xds=true"
+ exit 1
+fi