Enable Java 11 features (#737)

* Enable Java 11 features

As of this commit Java 11 must be used to build. The generated bytecode
is still at Java 8 due to App Engine task queue limit.

Also fixed a bug where the included google-java-format jar file is not
used, requiring the user to install it separately.

See: https://cloud.google.com/appengine/docs/standard/java/taskqueue/push
This commit is contained in:
Lai Jiang 2020-08-03 16:08:29 -04:00 committed by GitHub
parent 94d91d1663
commit f6749ad663
39 changed files with 2662 additions and 31 deletions

Binary file not shown.

View file

@ -40,14 +40,16 @@ where:
show show the effect of the formatting as unified diff"
SCRIPT_DIR="$(realpath $(dirname $0))"
JAR_NAME="google-java-format-1.8-all-deps.jar"
function showNoncompliantFiles() {
local forkPoint="$1"
local message="$2"
git diff -U0 ${forkPoint} | \
${SCRIPT_DIR}/google-java-format-diff.py -p1 | \
awk -v "message=$message" \
${SCRIPT_DIR}/google-java-format-diff.py \
--google-java-format-jar "${SCRIPT_DIR}/${JAR_NAME}" \
-p1 | awk -v "message=$message" \
'/\+\+\+ ([^ ]*)/ { print message $2 }' 1>&2
}
@ -60,16 +62,22 @@ function callGoogleJavaFormatDiff() {
"check")
showNoncompliantFiles "$forkPoint" "\033[1mNeeds formatting: "
callResult=$(git diff -U0 ${forkPoint} | \
${SCRIPT_DIR}/google-java-format-diff.py -p1 | wc -l)
${SCRIPT_DIR}/google-java-format-diff.py \
--google-java-format-jar "${SCRIPT_DIR}/${JAR_NAME}" \
-p1 | wc -l)
;;
"format")
showNoncompliantFiles "$forkPoint" "\033[1mReformatting: "
callResult=$(git diff -U0 ${forkPoint} | \
${SCRIPT_DIR}/google-java-format-diff.py -p1 -i)
${SCRIPT_DIR}/google-java-format-diff.py \
--google-java-format-jar "${SCRIPT_DIR}/${JAR_NAME}" \
-p1 -i)
;;
"show")
callResult=$(git diff -U0 ${forkPoint} | \
${SCRIPT_DIR}/google-java-format-diff.py -p1)
${SCRIPT_DIR}/google-java-format-diff.py \
--google-java-format-jar "${SCRIPT_DIR}/${JAR_NAME}" \
-p1)
;;
esac
echo -e "\033[0m" 1>&2