mirror of
https://github.com/github/codeql.git
synced 2025-12-16 16:53:25 +01:00
C#: Port the existing compiler-tracing.spec files to Lua.
This commit is contained in:
committed by
GitHub
parent
b8ec2254e8
commit
bf0e32ae82
55
csharp/tools/tracing-config.lua
Normal file
55
csharp/tools/tracing-config.lua
Normal file
@@ -0,0 +1,55 @@
|
||||
function RegisterExtractorPack()
|
||||
local extractor = GetPlatformToolsDirectory() ..
|
||||
'Semmle.Extraction.CSharp.Driver'
|
||||
if OperatingSystem == 'windows' then
|
||||
extractor = GetPlatformToolsDirectory() ..
|
||||
'Semmle.Extraction.CSharp.Driver.exe'
|
||||
end
|
||||
local windowsMatchers = {
|
||||
CreatePatternMatcher({'^dotnet%.exe$'}, MatchCompilerName, extractor,
|
||||
{prepend = {'--dotnetexec', '--cil'}}),
|
||||
CreatePatternMatcher({'^csc.*%.exe$'}, MatchCompilerName, extractor, {
|
||||
prepend = {'--compiler', '"${compiler}"', '--cil'}
|
||||
}),
|
||||
CreatePatternMatcher({'^fakes.*%.exe$', 'moles.*%.exe'},
|
||||
MatchCompilerName, nil, {trace = false})
|
||||
}
|
||||
local posixMatchers = {
|
||||
CreatePatternMatcher({'^mcs%.exe$', '^csc%.exe$'}, MatchCompilerName,
|
||||
extractor, {
|
||||
prepend = {'--compiler', '"${compiler}"', '--cil'}
|
||||
}),
|
||||
CreatePatternMatcher({'^mono', '^dotnet$'}, MatchCompilerName,
|
||||
extractor, {prepend = {'--dotnetexec', '--cil'}}),
|
||||
function(compilerName, compilerPath, compilerArguments, _languageId)
|
||||
if MatchCompilerName('^msbuild$', compilerName, compilerPath,
|
||||
compilerArguments) or
|
||||
MatchCompilerName('^xbuild$', compilerName, compilerPath,
|
||||
compilerArguments) then
|
||||
return {
|
||||
replace = true,
|
||||
invocations = {
|
||||
{
|
||||
path = compilerPath,
|
||||
transformedArguments = {
|
||||
nativeArgumentPointer = compilerArguments['nativeArgumentPointer'],
|
||||
append = {'/p:UseSharedCompilation=false'},
|
||||
prepend = {}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
end
|
||||
end
|
||||
}
|
||||
if OperatingSystem == 'windows' then
|
||||
return windowsMatchers
|
||||
else
|
||||
return posixMatchers
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
-- Return a list of minimum supported versions of the configuration file format
|
||||
-- return one entry per supported major version.
|
||||
function GetCompatibleVersions() return {'1.0.0'} end
|
||||
Reference in New Issue
Block a user