Print JAVA_HOME and PATH in the java format checker task (#997)

* Print JAVA_HOME and PATH in the java format checker task

This allows is to identify if the java version is incompatible with the
formater checker jar file.

* Show which Java binary is used

* show java version

* Fix exeInBash arguments
This commit is contained in:
Lai Jiang 2021-03-10 09:00:08 -05:00 committed by GitHub
parent 103c87ed7d
commit 76b4bd3c3a

View file

@ -401,6 +401,10 @@ def createGetBuildSrcDirectDepsTask(outputFileName) {
rootProject.ext { rootProject.ext {
invokeJavaDiffFormatScript = { action -> invokeJavaDiffFormatScript = { action ->
println("JAVA_HOME=${System.env.JAVA_HOME}")
println("PATH=${System.env.PATH}")
println(ext.execInBash("type java", "${rootDir}"))
println(ext.execInBash("java -version", "${rootDir}"))
def scriptDir = rootDir.path.endsWith('buildSrc') def scriptDir = rootDir.path.endsWith('buildSrc')
? "${rootDir}/../java-format" ? "${rootDir}/../java-format"
: "${rootDir}/java-format" : "${rootDir}/java-format"