[Java] Format ray java code (#13056)

This commit is contained in:
chaokunyang
2020-12-29 10:36:16 +08:00
committed by GitHub
parent cc1c2c3dc9
commit d1dd3410c8
422 changed files with 4384 additions and 5035 deletions
+9 -8
View File
@@ -8,6 +8,14 @@ set -x
ROOT_DIR=$(cd "$(dirname "${BASH_SOURCE:-$0}")"; pwd)
java -version
pushd "$ROOT_DIR"
echo "Check java code format."
# check google java style
mvn -T16 spotless:check
# check naming and others
mvn -T16 checkstyle:check
popd
run_testng() {
local exit_code
if "$@"; then
@@ -27,11 +35,6 @@ run_testng() {
}
pushd "$ROOT_DIR"/..
echo "Linting Java code with checkstyle."
# NOTE(hchen): The `test_tag_filters` option causes bazel to ignore caches.
# Thus, we add the `build_tests_only` option to avoid re-building everything.
bazel test //java:all --test_tag_filters="checkstyle" --build_tests_only
echo "Build java maven deps."
bazel build //java:gen_maven_deps
@@ -70,13 +73,11 @@ for file in "$docdemo_path"*.java; do
echo "Running $class"
java -cp bazel-bin/java/all_tests_deploy.jar "io.ray.docdemo.$class"
done
popd
pushd "$ROOT_DIR"
echo "Testing maven install."
mvn -Dorg.slf4j.simpleLogger.defaultLogLevel=WARN clean install -DskipTests
mvn -Dorg.slf4j.simpleLogger.defaultLogLevel=WARN clean install -DskipTests -Dcheckstyle.skip
# Ensure mvn test works
mvn test -pl test -Dtest="io.ray.test.HelloWorldTest"
popd