mirror of
https://github.com/wassname/ray.git
synced 2026-06-27 19:00:36 +08:00
[Java] Format ray java code (#13056)
This commit is contained in:
+9
-8
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user