Skip to content

Commit

Permalink
Merge pull request #16310 from tamasvajk/buildless/nuget_versions
Browse files Browse the repository at this point in the history
C#: Add integration test with multiple versions of the same nuget pac…
  • Loading branch information
tamasvajk authored Apr 24, 2024
2 parents f828f8e + 53eb753 commit 84ea3a9
Show file tree
Hide file tree
Showing 7 changed files with 65 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
| [...]/newtonsoft.json/13.0.1/lib/netstandard2.0/Newtonsoft.Json.dll |
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import csharp

private string getPath(Assembly a) {
not a.getCompilation().getOutputAssembly() = a and
exists(string s | s = a.getFile().getAbsolutePath() |
exists(result.indexOf("Newtonsoft.Json")) and
result =
"[...]" +
s.substring(s.indexOf("test-db/working/") + "test-db/working/".length() + 16 +
"/packages".length(), s.length())
or
result = s and
not exists(s.indexOf("test-db/working/"))
)
}

from Assembly a
select getPath(a)
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
class Program
{
static void Main(string[] args)
{
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFrameworks>net8.0</TargetFrameworks>
</PropertyGroup>

<Target Name="DeleteBinObjFolders" BeforeTargets="Clean">
<RemoveDir Directories=".\bin" />
<RemoveDir Directories=".\obj" />
</Target>

<ItemGroup>
<PackageReference Include="Newtonsoft.Json" Version="8.0.1" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFrameworks>net8.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>
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"sdk": {
"version": "8.0.101"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from create_database_utils import *

run_codeql_database_create([], lang="csharp", extra_args=["--build-mode=none"])

0 comments on commit 84ea3a9

Please sign in to comment.