C#: Store output assembly in compilation_assembly relation

This commit is contained in:
Tamas Vajk
2021-01-08 09:35:57 +01:00
parent 983c4d06d4
commit fb13126676
10 changed files with 42 additions and 2 deletions

View File

@@ -14,6 +14,7 @@
import File
private import Attribute
private import semmle.code.csharp.commons.Compilation
/**
* A location of a program element.
@@ -171,6 +172,9 @@ class Assembly extends Location, Attributable, @assembly {
/** Gets the version of this assembly. */
Version getVersion() { assemblies(this, _, _, _, result) }
/** Gets the compilation producing this assembly if any. */
Compilation getCompilation() { compilation_assembly(result, this) }
override File getFile() { assemblies(this, result, _, _, _) }
override string toString() { result = this.getFullName() }

View File

@@ -9,6 +9,9 @@ class Compilation extends @compilation {
/** Gets the directory in which this compilation was run, as a string. */
string getDirectoryString() { compilations(this, result) }
/** Gets the output assembly. */
Assembly getOutputAssembly() { compilation_assembly(this, result) }
/** Gets the folder in which this compilation was run. */
Folder getFolder() { result.getAbsolutePath() = getDirectoryString() }

View File

@@ -151,6 +151,11 @@ compilation_finished(
float elapsed_seconds : float ref
);
compilation_assembly(
unique int id : @compilation ref,
int assembly: @assembly ref
)
/*
* External artifacts
*/