зеркало из https://github.com/github/codeql.git
Merge pull request #10308 from github/rc/3.7
Merge `rc/3.7` into `main`
This commit is contained in:
Коммит
0353b3ebfc
|
@ -18,9 +18,10 @@ function RegisterExtractorPack(id)
|
||||||
-- For now, parse the command line as follows:
|
-- For now, parse the command line as follows:
|
||||||
-- Everything that starts with `-` (or `/`) will be ignored.
|
-- Everything that starts with `-` (or `/`) will be ignored.
|
||||||
-- The first non-option argument is treated as the command.
|
-- The first non-option argument is treated as the command.
|
||||||
-- if that's `build`, we append `/p:UseSharedCompilation=false` to the command line,
|
-- if that's `build`, we append `-p:UseSharedCompilation=false` to the command line,
|
||||||
-- otherwise we do nothing.
|
-- otherwise we do nothing.
|
||||||
local match = false
|
local match = false
|
||||||
|
local needsSeparator = false;
|
||||||
local argv = compilerArguments.argv
|
local argv = compilerArguments.argv
|
||||||
if OperatingSystem == 'windows' then
|
if OperatingSystem == 'windows' then
|
||||||
-- let's hope that this split matches the escaping rules `dotnet` applies to command line arguments
|
-- let's hope that this split matches the escaping rules `dotnet` applies to command line arguments
|
||||||
|
@ -33,18 +34,30 @@ function RegisterExtractorPack(id)
|
||||||
local firstCharacter = string.sub(arg, 1, 1)
|
local firstCharacter = string.sub(arg, 1, 1)
|
||||||
if not (firstCharacter == '-') and not (firstCharacter == '/') then
|
if not (firstCharacter == '-') and not (firstCharacter == '/') then
|
||||||
Log(1, 'Dotnet subcommand detected: %s', arg)
|
Log(1, 'Dotnet subcommand detected: %s', arg)
|
||||||
if arg == 'build' or arg == 'msbuild' then match = true end
|
if arg == 'build' or arg == 'msbuild' or arg == 'publish' or arg == 'pack' or arg == 'test' then
|
||||||
|
match = true
|
||||||
|
break
|
||||||
|
end
|
||||||
|
if arg == 'run' then
|
||||||
|
-- for `dotnet run`, we need to make sure that `-p:UseSharedCompilation=false` is
|
||||||
|
-- not passed in as an argument to the program that is run
|
||||||
|
match = true
|
||||||
|
needsSeparator = true
|
||||||
|
end
|
||||||
|
end
|
||||||
|
if arg == '--' then
|
||||||
|
needsSeparator = false
|
||||||
break
|
break
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
if match then
|
if match then
|
||||||
|
local injections = { '-p:UseSharedCompilation=false' }
|
||||||
|
if needsSeparator then
|
||||||
|
table.insert(injections, '--')
|
||||||
|
end
|
||||||
return {
|
return {
|
||||||
order = ORDER_REPLACE,
|
order = ORDER_REPLACE,
|
||||||
invocation = BuildExtractorInvocation(id, compilerPath,
|
invocation = BuildExtractorInvocation(id, compilerPath, compilerPath, compilerArguments, nil, injections)
|
||||||
compilerPath,
|
|
||||||
compilerArguments, nil, {
|
|
||||||
'/p:UseSharedCompilation=false'
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
return nil
|
return nil
|
||||||
|
|
Загрузка…
Ссылка в новой задаче