diff options
author | miroslav2 <[email protected]> | 2024-07-01 09:39:40 +0300 |
---|---|---|
committer | miroslav2 <[email protected]> | 2024-07-01 09:56:34 +0300 |
commit | 39d6b4e403f27b6adda124cc1a099f454c3db241 (patch) | |
tree | 7092b8518e206767f8e8271ae6e80eeb0897e96e /build/scripts/build_java_with_error_prone.py | |
parent | f6e158056ed38be7c4c500adbe132bc0ecf1866a (diff) |
Simplest improvements for Java build, remove chained 'execv' Python calls
* remove chained 'execv' Python calls for compiling Java with with "javac" and "ErrorProne" - replace with single "run_javac.py" script
84bc60b4e87890e6ceea1ef22a2c0936410ff6bb
Diffstat (limited to 'build/scripts/build_java_with_error_prone.py')
-rw-r--r-- | build/scripts/build_java_with_error_prone.py | 48 |
1 files changed, 0 insertions, 48 deletions
diff --git a/build/scripts/build_java_with_error_prone.py b/build/scripts/build_java_with_error_prone.py deleted file mode 100644 index 66fc7daed76..00000000000 --- a/build/scripts/build_java_with_error_prone.py +++ /dev/null @@ -1,48 +0,0 @@ -import sys -import os - -ERROR_PRONE_FLAGS = [ - '-Xep:FunctionalInterfaceMethodChanged:WARN', - '-Xep:ReturnValueIgnored:WARN', -] - -JAVA10_EXPORTS = [ - '--add-exports=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED', - '--add-exports=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED', - '--add-exports=jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED', - '--add-exports=jdk.compiler/com.sun.tools.javac.main=ALL-UNNAMED', - '--add-exports=jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED', - '--add-exports=jdk.compiler/com.sun.tools.javac.processing=ALL-UNNAMED', - '--add-exports=jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED', - '--add-exports=jdk.compiler/com.sun.tools.javac.comp=ALL-UNNAMED', -] - - -def just_do_it(argv): - java, error_prone_tool, javac_cmd = argv[0], argv[1], argv[2:] - if java.endswith('javac') or java.endswith('javac.exe'): - for f in javac_cmd: - if f.startswith('-Xep'): - ERROR_PRONE_FLAGS.append(f) - for f in ERROR_PRONE_FLAGS: - if f in javac_cmd: - javac_cmd.remove(f) - os.execv( - java, - [java] - + JAVA10_EXPORTS - + ['-processorpath', error_prone_tool, '-XDcompilePolicy=byfile'] - + [(' '.join(['-Xplugin:ErrorProne'] + ERROR_PRONE_FLAGS))] - + javac_cmd, - ) - else: - os.execv( - java, - [java, '-Xbootclasspath/p:' + error_prone_tool, 'com.google.errorprone.ErrorProneCompiler'] - + ERROR_PRONE_FLAGS - + javac_cmd, - ) - - -if __name__ == '__main__': - just_do_it(sys.argv[1:]) |