From 96007f252d0b25ca01883e25c1dd6b8f8a5f06c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nora=20Dimitrijevi=C4=87?= Date: Tue, 30 Apr 2024 12:45:28 +0200 Subject: [PATCH] WIP: bundle aircompressor in kotlin extractor jar This is needed for the consistency queries to extract successfully, e.g. ``` codeql test run --consistency-queries=ql/java/ql/consistency-queries ql/java/ql/test/query-tests/security/CWE-749/ ``` Otherwise, we get a ClassDefNotFound error... But really this should be fixed during the bazelification of the kotlin extractor. --- java/kotlin-extractor/build.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/java/kotlin-extractor/build.py b/java/kotlin-extractor/build.py index b67037dadb02..0d3564697452 100755 --- a/java/kotlin-extractor/build.py +++ b/java/kotlin-extractor/build.py @@ -129,6 +129,13 @@ def compile_to_jar(build_dir, tmp_src_dir, srcs, version, classpath, java_classp compile_to_dir(build_dir, srcs, version, classpath, java_classpath, class_dir) + cwd = os.getcwd() + try: + os.chdir(class_dir) + run_process(['jar', 'xf', cwd + '/' + kotlin_dependency_folder + '/aircompressor-0.26.jar']) + finally: + os.chdir(cwd) + run_process(['jar', 'cf', output, '-C', class_dir, '.', '-C', tmp_src_dir + '/main/resources', 'META-INF',