diff options
author | Pete Gillin <peteg@google.com> | 2019-06-24 16:07:45 +0100 |
---|---|---|
committer | Pete Gillin <peteg@google.com> | 2019-06-24 16:16:00 +0100 |
commit | 2fcc0753c98a72ec211192fb08c12198ca8fa7bf (patch) | |
tree | 55a19319df65b91d5d79c01ab6efb51ba7b01a8e | |
parent | 1fe150086e5e73af02b26ae0da9966408437499d (diff) | |
download | devtools-2fcc0753c98a72ec211192fb08c12198ca8fa7bf.tar.gz |
Make the linter use a JAXB jar instead of the deprecated module.
The linter loads JAXB classes (in the javax.xml.bind package) at
runtime. Prior to this change, it was getting them by using
--add-modules=java.xml-bind. This works with an OpenJDK 9 toolchain,
but that module is deprecated, and it is removed in OpenJDK 11, so
this approach doesn't work with an upgraded toolchain. This change
drops the --add-modules option, and instead adds a JAR containing the
JAXB classes. This works on all toolchain versions.
Test: prebuilts/devtools/tools/lint packages/apps/Contacts
Bug: 135179316
Change-Id: I8ee090152e75a6d0f7fd89bdb95a70539cd556a0
-rwxr-xr-x | tools/lint | 11 |
1 files changed, 2 insertions, 9 deletions
@@ -63,19 +63,12 @@ fi javaCmd="java" -jarpath="$frameworkdir/$jarfile" - -is_java_version_9=$(java -version 2>&1| grep 'version [ "]9.*[ "]') -if [ "${is_java_version_9}" = "" ]; then - modules_arg="" -else - modules_arg="--add-modules=java.xml.bind" -fi +jaxbJar="$ANDROID_BUILD_TOP/prebuilts/tools/common/m2/repository/javax/xml/bind/jaxb-api/2.2.12-b140109.1041/jaxb-api-2.2.12-b140109.1041.jar" +jarpath="$frameworkdir/$jarfile:$jaxbJar" exec "$javaCmd" \ -Xmx512m $os_opts $java_debug \ -Dcom.android.tools.lint.bindir="$progdir" \ -Djava.awt.headless=true \ -classpath "$jarpath" \ - ${modules_arg} \ com.android.tools.lint.Main "$@" |