mirror of
https://github.com/github/codeql.git
synced 2025-12-22 19:56:32 +01:00
Kotlin/Bazel: port custom_plugin test to use bazel
This commit is contained in:
@@ -1,6 +1,25 @@
|
||||
from create_database_utils import *
|
||||
import subprocess
|
||||
|
||||
subprocess.call("./build_plugin", shell=True)
|
||||
import pathlib
|
||||
import shutil
|
||||
|
||||
this_dir = pathlib.Path(__file__).resolve().parent
|
||||
cwd = pathlib.Path.cwd()
|
||||
builddir = cwd / 'build'
|
||||
|
||||
builddir.mkdir(exist_ok=True)
|
||||
|
||||
try:
|
||||
runSuccessfully(['bazel', f'--output_user_root={builddir}', '--max_idle_secs=1', 'build',
|
||||
'//java/ql/integration-tests/linux-only/kotlin/custom_plugin/plugin', '--spawn_strategy=local',
|
||||
'--nouse_action_cache', '--noremote_accept_cached', '--noremote_upload_local_results',
|
||||
f'--symlink_prefix={cwd / "bazel-"}'], cwd=this_dir)
|
||||
finally:
|
||||
# rules_python creates a read-only directory in bazel's output, this allows cleanup to succeed
|
||||
runSuccessfully(['chmod', '-R', '+w', builddir])
|
||||
|
||||
shutil.copy(
|
||||
'bazel-bin/java/ql/integration-tests/linux-only/kotlin/custom_plugin/plugin/plugin.jar', 'plugin.jar')
|
||||
|
||||
run_codeql_database_create(
|
||||
["kotlinc -J-Xmx2G -Xplugin=plugin.jar a.kt b.kt c.kt d.kt e.kt"], lang="java")
|
||||
|
||||
Reference in New Issue
Block a user