f0cb9cdb95
* [bazel] Move Java runtime/toolchains into //java This change moves `java_library` targets from the top-level BUILD file into `//java/{core,lite,util}` and declares `alias` targets to point to their new locations (hence, this is not a breaking change). This will allow users that don't use Java to stop depending on `@rules_java` (e.g. as requested in https://github.com/bazelbuild/rules_scala/pull/989#issuecomment-583405161). Note that there is no intention to deprecate + remove the top-level targets in the foreseeable future. * Add BUILD files in //java to java_EXTRA_DIST
35 lines
748 B
Bash
Executable File
35 lines
748 B
Bash
Executable File
#!/bin/bash
|
|
#
|
|
# Build file to set up and run tests
|
|
set -ex
|
|
|
|
# Install the latest Bazel version available
|
|
use_bazel.sh latest
|
|
bazel version
|
|
|
|
# Print bazel testlogs to stdout when tests failed.
|
|
function print_test_logs {
|
|
# TODO(yannic): Only print logs of failing tests.
|
|
testlogs_dir=$(bazel info bazel-testlogs)
|
|
testlogs=$(find "${testlogs_dir}" -name "*.log")
|
|
for log in $testlogs; do
|
|
cat "${log}"
|
|
done
|
|
}
|
|
|
|
# Change to repo root
|
|
cd $(dirname $0)/../../..
|
|
|
|
git submodule update --init --recursive
|
|
|
|
trap print_test_logs EXIT
|
|
bazel test --copt=-Werror --host_copt=-Werror \
|
|
//:build_files_updated_unittest \
|
|
//java/... \
|
|
//:protobuf_test \
|
|
@com_google_protobuf//:cc_proto_blacklist_test
|
|
trap - EXIT
|
|
|
|
cd examples
|
|
bazel build //...
|