mirror of
https://github.com/github/codeql.git
synced 2026-05-02 12:15:17 +02:00
Kotlin: This might fix building on Windows
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
import argparse
|
||||
import kotlin_plugin_versions
|
||||
import glob
|
||||
import platform
|
||||
import re
|
||||
import subprocess
|
||||
import shutil
|
||||
@@ -24,10 +25,19 @@ kotlinc = 'kotlinc'
|
||||
javac = 'javac'
|
||||
kotlin_dependency_folder = args.dependencies
|
||||
|
||||
def is_windows():
|
||||
'''Whether we appear to be running on Windows'''
|
||||
if platform.system() == 'Windows':
|
||||
return True
|
||||
if platform.system().startswith('CYGWIN'):
|
||||
return True
|
||||
return False
|
||||
|
||||
def run_process(cmd):
|
||||
try:
|
||||
# print("Running command: " + shlex.join(cmd))
|
||||
return subprocess.run(cmd, check=True, capture_output=True)
|
||||
# TODO: `shell=True` is a workaround to get CI working on Windows. It breaks the build on Linux.
|
||||
return subprocess.run(cmd, check=True, capture_output=True, shell=is_windows())
|
||||
except subprocess.CalledProcessError as e:
|
||||
print("In: " + os.getcwd(), file=sys.stderr)
|
||||
print("Command failed: " + shlex.join(cmd), file=sys.stderr)
|
||||
|
||||
@@ -13,7 +13,7 @@ def is_windows():
|
||||
many_versions = [ '1.4.32', '1.5.31', '1.6.10' ]
|
||||
|
||||
def get_single_version():
|
||||
# TODO: `shell=True` is a workaround to get CI working on Windows. It break the build on Linux.
|
||||
# TODO: `shell=True` is a workaround to get CI working on Windows. It breaks the build on Linux.
|
||||
versionOutput = subprocess.run(['kotlinc', '-version'], capture_output=True, text=True, shell=is_windows())
|
||||
m = re.match(r'.* kotlinc-jvm ([0-9]+\.[0-9]+\.)[0-9]+ .*', versionOutput.stderr)
|
||||
if m is None:
|
||||
|
||||
Reference in New Issue
Block a user