mirror of
https://github.com/github/codeql.git
synced 2025-12-24 04:36:35 +01:00
Kotlin: Write version information to the database
This commit is contained in:
@@ -185,6 +185,10 @@ def compile(jars, java_jars, dependency_folder, transform_to_embeddable, output,
|
||||
include_version_folder = tmp_src_dir + '/main/kotlin/utils/versions/to_include'
|
||||
os.makedirs(include_version_folder)
|
||||
|
||||
with open(tmp_src_dir + '/main/kotlin/utils/ExtractorName.kt', 'w') as f:
|
||||
f.write('package com.github.codeql\n')
|
||||
f.write('val extractor_name: String = "' + output + '"\n')
|
||||
|
||||
parsed_current_version = kotlin_plugin_versions.version_string_to_tuple(
|
||||
current_version)
|
||||
|
||||
|
||||
@@ -131,6 +131,8 @@ class KotlinExtractorExtension(
|
||||
// The interceptor has already defined #compilation = *
|
||||
val compilation: Label<DbCompilation> = StringLabel("compilation")
|
||||
tw.writeCompilation_started(compilation)
|
||||
tw.writeCompilation_info(compilation, "Kotlin Compiler Version", KotlinCompilerVersion.getVersion() ?: "<unknown>")
|
||||
tw.writeCompilation_info(compilation, "Kotlin Extractor Name", extractor_name)
|
||||
if (compilationStartTime != null) {
|
||||
tw.writeCompilation_compiler_times(compilation, -1.0, (System.currentTimeMillis()-compilationStartTime)/1000.0)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user