Merge branch 'main' into rc/3.7

This commit is contained in:
Andrew Eisenberg
2022-09-20 08:33:58 -07:00
2309 changed files with 133758 additions and 43219 deletions

View File

@@ -1,16 +0,0 @@
**/mcs.exe:
**/csc.exe:
invoke ${config_dir}/Semmle.Extraction.CSharp.Driver
prepend --compiler
prepend "${compiler}"
prepend --cil
**/mono*:
**/dotnet:
invoke ${config_dir}/Semmle.Extraction.CSharp.Driver
prepend --dotnetexec
prepend --cil
**/msbuild:
**/xbuild:
replace yes
invoke ${compiler}
append /p:UseSharedCompilation=false

View File

@@ -1,16 +0,0 @@
**/mcs.exe:
**/csc.exe:
invoke ${config_dir}/Semmle.Extraction.CSharp.Driver
prepend --compiler
prepend "${compiler}"
prepend --cil
**/mono*:
**/dotnet:
invoke ${config_dir}/Semmle.Extraction.CSharp.Driver
prepend --dotnetexec
prepend --cil
**/msbuild:
**/xbuild:
replace yes
invoke ${compiler}
append /p:UseSharedCompilation=false

View File

@@ -1,7 +1,9 @@
function RegisterExtractorPack(id)
local extractor = GetPlatformToolsDirectory() ..
'Semmle.Extraction.CSharp.Driver'
if OperatingSystem == 'windows' then extractor = extractor .. '.exe' end
function Exify(path)
if OperatingSystem == 'windows' then return path .. '.exe' else return path end
end
local extractor = Exify(GetPlatformToolsDirectory() .. 'Semmle.Extraction.CSharp.Driver')
function DotnetMatcherBuild(compilerName, compilerPath, compilerArguments,
_languageId)
@@ -47,10 +49,30 @@ function RegisterExtractorPack(id)
return nil
end
function MsBuildMatcher(compilerName, compilerPath, compilerArguments, _languageId)
if MatchCompilerName('^' .. Exify('msbuild') .. '$', compilerName, compilerPath,
compilerArguments) or
MatchCompilerName('^' .. Exify('xbuild') .. '$', compilerName, compilerPath,
compilerArguments) then
return {
order = ORDER_REPLACE,
invocation = BuildExtractorInvocation(id, compilerPath,
compilerPath,
compilerArguments,
nil, {
'/p:UseSharedCompilation=false',
'/p:MvcBuildViews=true'
})
}
end
end
local windowsMatchers = {
DotnetMatcherBuild,
MsBuildMatcher,
CreatePatternMatcher({ '^csc.*%.exe$' }, MatchCompilerName, extractor, {
prepend = { '--cil', '--compiler', '"${compiler}"' },
prepend = { '--compiler', '"${compiler}"' },
order = ORDER_BEFORE
}),
CreatePatternMatcher({ '^fakes.*%.exe$', 'moles.*%.exe' },
@@ -63,7 +85,7 @@ function RegisterExtractorPack(id)
local seenCompilerCall = false
local argv = NativeArgumentsToArgv(compilerArguments.nativeArgumentPointer)
local extractorArgs = { '--cil', '--compiler' }
local extractorArgs = { '--compiler' }
for _, arg in ipairs(argv) do
if arg:match('csc%.dll$') then
seenCompilerCall = true
@@ -91,25 +113,11 @@ function RegisterExtractorPack(id)
DotnetMatcherBuild,
CreatePatternMatcher({ '^mcs%.exe$', '^csc%.exe$' }, MatchCompilerName,
extractor, {
prepend = { '--cil', '--compiler', '"${compiler}"' },
prepend = { '--compiler', '"${compiler}"' },
order = ORDER_BEFORE
}), function(compilerName, compilerPath, compilerArguments, _languageId)
if MatchCompilerName('^msbuild$', compilerName, compilerPath,
compilerArguments) or
MatchCompilerName('^xbuild$', compilerName, compilerPath,
compilerArguments) then
return {
order = ORDER_REPLACE,
invocation = BuildExtractorInvocation(id, compilerPath,
compilerPath,
compilerArguments,
nil, {
'/p:UseSharedCompilation=false'
})
}
end
end, function(compilerName, compilerPath, compilerArguments, _languageId)
}),
MsBuildMatcher,
function(compilerName, compilerPath, compilerArguments, _languageId)
-- handle cases like `dotnet exec csc.dll <args>` and `mono(-sgen64) csc.exe <args>`
if compilerName ~= 'dotnet' and not compilerName:match('^mono') then
return nil
@@ -117,7 +125,7 @@ function RegisterExtractorPack(id)
local seenCompilerCall = false
local argv = compilerArguments.argv
local extractorArgs = { '--cil', '--compiler' }
local extractorArgs = { '--compiler' }
for _, arg in ipairs(argv) do
if arg:match('csc%.dll$') or arg:match('csc%.exe$') or arg:match('mcs%.exe$') then
seenCompilerCall = true

View File

@@ -1,13 +0,0 @@
**\fakes*.exe:
**\moles*.exe:
order compiler
trace no
**\csc*.exe:
invoke ${config_dir}\Semmle.Extraction.CSharp.Driver.exe
prepend --compiler
prepend "${compiler}"
prepend --cil
**\dotnet.exe:
invoke ${config_dir}\Semmle.Extraction.CSharp.Driver.exe
prepend --dotnetexec
prepend --cil