mirror of
https://github.com/github/codeql.git
synced 2025-12-16 16:53:25 +01:00
C#: Add CodeQL extractor pack files
This commit is contained in:
18
csharp/codeql-extractor.yml
Normal file
18
csharp/codeql-extractor.yml
Normal file
@@ -0,0 +1,18 @@
|
||||
name: "csharp"
|
||||
display_name: "C#"
|
||||
version: 1.22.1
|
||||
column_kind: "utf16"
|
||||
extra_env_vars:
|
||||
DOTNET_GENERATE_ASPNET_CERTIFICATE: "false"
|
||||
COR_ENABLE_PROFILING: "1"
|
||||
COR_PROFILER: "{A3C70A64-7D41-4A94-A3F6-FD47D9259997}"
|
||||
COR_PROFILER_PATH_64: "${env.CODEQL_EXTRACTOR_CSHARP_ROOT}/tools/${env.CODEQL_PLATFORM}/clrtracer64${env.CODEQL_PLATFORM_DLL_EXTENSION}"
|
||||
CORECLR_ENABLE_PROFILING: "1"
|
||||
CORECLR_PROFILER: "{A3C70A64-7D41-4A94-A3F6-FD47D9259997}"
|
||||
CORECLR_PROFILER_PATH_64: "${env.CODEQL_EXTRACTOR_CSHARP_ROOT}/tools/${env.CODEQL_PLATFORM}/clrtracer64${env.CODEQL_PLATFORM_DLL_EXTENSION}"
|
||||
file_types:
|
||||
- name: cs
|
||||
display_name: C# sources
|
||||
extensions:
|
||||
- .cs
|
||||
legacy_qltest_extraction: true
|
||||
9
csharp/tools/autobuild.cmd
Normal file
9
csharp/tools/autobuild.cmd
Normal file
@@ -0,0 +1,9 @@
|
||||
@echo off
|
||||
SETLOCAL EnableDelayedExpansion
|
||||
|
||||
rem The autobuilder is already being traced
|
||||
set CODEQL_AUTOBUILDER_CSHARP_NO_INDEXING=true
|
||||
|
||||
type NUL && "%CODEQL_EXTRACTOR_CSHARP_ROOT%/tools/%CODEQL_PLATFORM%/Semmle.Autobuild.CSharp.exe" || exit /b %ERRORLEVEL%
|
||||
|
||||
ENDLOCAL
|
||||
14
csharp/tools/autobuild.sh
Executable file
14
csharp/tools/autobuild.sh
Executable file
@@ -0,0 +1,14 @@
|
||||
#!/bin/sh
|
||||
|
||||
set -eu
|
||||
|
||||
if [ "$CODEQL_PLATFORM" != "linux64" ] && [ "$CODEQL_PLATFORM" != "osx64" ] ; then
|
||||
echo "Automatic build detection for $CODEQL_PLATFORM is not implemented."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# The autobuilder is already being traced
|
||||
CODEQL_AUTOBUILDER_CSHARP_NO_INDEXING="true"
|
||||
export CODEQL_AUTOBUILDER_CSHARP_NO_INDEXING
|
||||
|
||||
"$CODEQL_EXTRACTOR_CSHARP_ROOT/tools/$CODEQL_PLATFORM/Semmle.Autobuild.CSharp" || exit $?
|
||||
9
csharp/tools/linux64/compiler-tracing.spec
Normal file
9
csharp/tools/linux64/compiler-tracing.spec
Normal file
@@ -0,0 +1,9 @@
|
||||
**/mcs.exe:
|
||||
**/csc.exe:
|
||||
invoke ${config_dir}/Semmle.Extraction.CSharp.Driver
|
||||
prepend --compiler
|
||||
prepend "${compiler}"
|
||||
prepend --cil
|
||||
**/mono*:
|
||||
**/dotnet:
|
||||
invoke ${config_dir}/extract-csharp.sh
|
||||
16
csharp/tools/linux64/extract-csharp.sh
Executable file
16
csharp/tools/linux64/extract-csharp.sh
Executable file
@@ -0,0 +1,16 @@
|
||||
#!/bin/bash
|
||||
echo extract-csharp.sh: Called with arguments: "$@"
|
||||
|
||||
extractor="$CODEQL_EXTRACTOR_CSHARP_ROOT/tools/$CODEQL_PLATFORM/Semmle.Extraction.CSharp.Driver"
|
||||
|
||||
for i in "$@"
|
||||
do
|
||||
shift
|
||||
if [[ `basename -- "$i"` =~ csc.exe|mcs.exe|csc.dll ]]
|
||||
then
|
||||
echo extract-csharp.sh: exec $extractor --cil $@
|
||||
exec "$extractor" --compiler $i --cil $@
|
||||
fi
|
||||
done
|
||||
|
||||
echo extract-csharp.sh: Not a compiler invocation
|
||||
14
csharp/tools/osx64/compiler-tracing.spec
Normal file
14
csharp/tools/osx64/compiler-tracing.spec
Normal file
@@ -0,0 +1,14 @@
|
||||
**/mcs.exe:
|
||||
**/csc.exe:
|
||||
invoke ${config_dir}/Semmle.Extraction.CSharp.Driver
|
||||
prepend --compiler
|
||||
prepend "${compiler}"
|
||||
prepend --cil
|
||||
**/mono*:
|
||||
**/dotnet:
|
||||
invoke ${config_dir}/extract-csharp.sh
|
||||
/usr/bin/codesign:
|
||||
replace yes
|
||||
invoke /usr/bin/env
|
||||
prepend /usr/bin/codesign
|
||||
trace no
|
||||
16
csharp/tools/osx64/extract-csharp.sh
Executable file
16
csharp/tools/osx64/extract-csharp.sh
Executable file
@@ -0,0 +1,16 @@
|
||||
#!/bin/bash
|
||||
echo extract-csharp.sh: Called with arguments: "$@"
|
||||
|
||||
extractor="$CODEQL_EXTRACTOR_CSHARP_ROOT/tools/$CODEQL_PLATFORM/Semmle.Extraction.CSharp.Driver"
|
||||
|
||||
for i in "$@"
|
||||
do
|
||||
shift
|
||||
if [[ `basename -- "$i"` =~ csc.exe|mcs.exe|csc.dll ]]
|
||||
then
|
||||
echo extract-csharp.sh: exec $extractor --cil $@
|
||||
exec "$extractor" --compiler $i --cil $@
|
||||
fi
|
||||
done
|
||||
|
||||
echo extract-csharp.sh: Not a compiler invocation
|
||||
14
csharp/tools/pre-finalize.cmd
Normal file
14
csharp/tools/pre-finalize.cmd
Normal file
@@ -0,0 +1,14 @@
|
||||
@echo off
|
||||
SETLOCAL EnableDelayedExpansion
|
||||
|
||||
type NUL && "%CODEQL_DIST%\codeql" database index-files ^
|
||||
--include-extension=.config ^
|
||||
--include-extension=.csproj ^
|
||||
--include-extension=.props ^
|
||||
--include-extension=.xml ^
|
||||
--size-limit 10m ^
|
||||
--language xml ^
|
||||
-- ^
|
||||
"%CODEQL_EXTRACTOR_CSHARP_WIP_DATABASE%"
|
||||
|
||||
ENDLOCAL
|
||||
13
csharp/tools/pre-finalize.sh
Executable file
13
csharp/tools/pre-finalize.sh
Executable file
@@ -0,0 +1,13 @@
|
||||
#!/bin/sh
|
||||
|
||||
set -eu
|
||||
|
||||
"$CODEQL_DIST/codeql" database index-files \
|
||||
--include-extension=.config \
|
||||
--include-extension=.csproj \
|
||||
--include-extension=.props \
|
||||
--include-extension=.xml \
|
||||
--size-limit 10m \
|
||||
--language xml \
|
||||
-- \
|
||||
"$CODEQL_EXTRACTOR_CSHARP_WIP_DATABASE"
|
||||
9
csharp/tools/win64/compiler-tracing.spec
Normal file
9
csharp/tools/win64/compiler-tracing.spec
Normal file
@@ -0,0 +1,9 @@
|
||||
**\fakes*.exe:
|
||||
**\moles*.exe:
|
||||
order compiler
|
||||
trace no
|
||||
**\csc*.exe:
|
||||
invoke ${config_dir}\Semmle.Extraction.CSharp.Driver.exe
|
||||
prepend --compiler
|
||||
prepend "${compiler}"
|
||||
prepend --cil
|
||||
Reference in New Issue
Block a user