mirror of
https://github.com/github/codeql.git
synced 2025-12-17 01:03:14 +01:00
C#: Add an integration test for setting the dependency directory in BMN.
This commit is contained in:
@@ -0,0 +1 @@
|
|||||||
|
| dependencies/packages/newtonsoft.json/13.0.1/lib/netstandard2.0/Newtonsoft.Json.dll:0:0:0:0 | Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed |
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
import csharp
|
||||||
|
|
||||||
|
from Assembly a
|
||||||
|
where
|
||||||
|
not a.getCompilation().getOutputAssembly() = a and
|
||||||
|
a.getName().matches("%Newtonsoft%")
|
||||||
|
select a
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
class Program
|
||||||
|
{
|
||||||
|
static void Main(string[] args)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
{
|
||||||
|
"sdk": {
|
||||||
|
"version": "9.0.304"
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
|
||||||
|
<PropertyGroup>
|
||||||
|
<OutputType>Exe</OutputType>
|
||||||
|
<TargetFrameworks>net9.0</TargetFrameworks>
|
||||||
|
</PropertyGroup>
|
||||||
|
|
||||||
|
<Target Name="DeleteBinObjFolders" BeforeTargets="Clean">
|
||||||
|
<RemoveDir Directories=".\bin" />
|
||||||
|
<RemoveDir Directories=".\obj" />
|
||||||
|
</Target>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
|
||||||
|
</ItemGroup>
|
||||||
|
</Project>
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
import os
|
||||||
|
|
||||||
|
def test(codeql, csharp, cwd):
|
||||||
|
path = os.path.join(cwd, "dependencies")
|
||||||
|
os.environ["CODEQL_EXTRACTOR_CSHARP_OPTION_BUILDLESS_DEPENDENCY_DIR"] = path
|
||||||
|
# The Assemblies.ql query shows that the Newtonsoft assembly is found in the
|
||||||
|
# dependency directory set above.
|
||||||
|
codeql.database.create(source_root="proj", build_mode="none")
|
||||||
Reference in New Issue
Block a user