Kotlin: Fix build with 2.0.0-Beta1

This commit is contained in:
Ian Lynagh
2023-11-17 10:48:33 +00:00
parent 72bafd86df
commit 95de7495d1
2 changed files with 11 additions and 4 deletions

View File

@@ -90,10 +90,14 @@ def write_arg_file(arg_file, args):
def compile_to_dir(build_dir, srcs, version, classpath, java_classpath, output):
# Use kotlinc to compile .kt files:
kotlin_arg_file = build_dir + '/kotlin.args'
kotlin_args = ['-Werror',
'-opt-in=kotlin.RequiresOptIn',
'-opt-in=org.jetbrains.kotlin.ir.symbols.IrSymbolInternals',
'-d', output,
opt_in_args = ['-opt-in=kotlin.RequiresOptIn']
if version.lessThan(kotlin_plugin_versions.Version(2, 0, 0, "")):
opt_in_args.append('-opt-in=org.jetbrains.kotlin.ir.symbols.IrSymbolInternals')
else:
opt_in_args.append('-opt-in=org.jetbrains.kotlin.ir.symbols.UnsafeDuringIrConstructionAPI')
kotlin_args = ['-Werror'] \
+ opt_in_args \
+ ['-d', output,
'-module-name', 'codeql-kotlin-extractor',
'-Xsuppress-version-warnings',
'-language-version', version.toLanguageVersionString(),

View File

@@ -27,6 +27,9 @@ class Version:
def toTupleNoTag(self):
return [self.major, self.minor, self.patch]
def lessThan(self, other):
return self.toTupleNoTag() < other.toTupleNoTag()
def lessThanOrEqual(self, other):
return self.toTupleNoTag() <= other.toTupleNoTag()