mirror of
https://github.com/github/codeql.git
synced 2026-04-28 10:15:14 +02:00
Add query to select all public declarations from target assemblies
This commit is contained in:
23
csharp/ql/src/Stubs/AllStubsFromReference.ql
Normal file
23
csharp/ql/src/Stubs/AllStubsFromReference.ql
Normal file
@@ -0,0 +1,23 @@
|
||||
/**
|
||||
* Tool to generate C# stubs from a qltest snapshot.
|
||||
*/
|
||||
|
||||
import csharp
|
||||
import Stubs
|
||||
|
||||
/** All public declarations from assemblies. */
|
||||
class AllExternalPublicDeclarations extends GeneratedDeclaration {
|
||||
AllExternalPublicDeclarations() {
|
||||
this.fromLibrary() and
|
||||
this.(Modifiable).isEffectivelyPublic()
|
||||
}
|
||||
}
|
||||
|
||||
/** All framework assemblies. */
|
||||
class NonTargetAssembly extends ExcludedAssembly {
|
||||
NonTargetAssembly() {
|
||||
exists(this.getFile().getAbsolutePath().indexOf("Microsoft.NETCore.App.Ref"))
|
||||
}
|
||||
}
|
||||
|
||||
select generatedCode()
|
||||
@@ -46,7 +46,7 @@ if not os.path.isdir(dbDir):
|
||||
|
||||
print("\nRunning query")
|
||||
helpers.run_cmd(['codeql', 'query', 'run', os.path.join(
|
||||
thisDir, 'MinimalStubsFromSource.ql'), '--database', dbDir, '--output', bqrsFile])
|
||||
thisDir, 'AllStubsFromReference.ql'), '--database', dbDir, '--output', bqrsFile])
|
||||
|
||||
helpers.run_cmd(['codeql', 'bqrs', 'decode', bqrsFile, '--output',
|
||||
outputFile, '--format=text', '--no-titles'])
|
||||
|
||||
Reference in New Issue
Block a user