Skip to content

Commit 31c4d0c

Browse files
committed
update
1 parent 1dd5635 commit 31c4d0c

9 files changed

Lines changed: 127 additions & 93 deletions

File tree

.github/workflows/linux-build.yml

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -57,16 +57,14 @@ jobs:
5757
- name: Restore NuGet Packages for NuGet Tests
5858
run: dotnet restore Rubjerg.Graphviz.NugetTests.sln
5959

60-
# FIXNOW
61-
# - name: Build NuGet Test Solution
62-
# run: dotnet build Rubjerg.Graphviz.NugetTests.sln --configuration Release --no-restore
60+
- name: Build NuGet Test Solution
61+
run: dotnet build Rubjerg.Graphviz.NugetTests.sln --configuration Release --no-restore
6362

64-
# - name: Run NuGet Tests
65-
# run: bash run-tests-netcore.sh Rubjerg.Graphviz.NugetTest/Rubjerg.Graphviz.NugetTest.csproj
66-
67-
# - name: Run Transitive NuGet Tests
68-
# run: bash run-tests-netcore.sh Rubjerg.Graphviz.TransitiveNugetTest/Rubjerg.Graphviz.TransitiveNugetTest.csproj
63+
- name: Run NuGet Tests
64+
run: bash run-tests-netcore.sh Rubjerg.Graphviz.NugetTest/Rubjerg.Graphviz.NugetTest.csproj
6965

66+
- name: Run Transitive NuGet Tests
67+
run: bash run-tests-netcore.sh Rubjerg.Graphviz.TransitiveNugetTest/Rubjerg.Graphviz.TransitiveNugetTest.csproj
7068

7169
- name: Locate nupkg
7270
id: pkg

.github/workflows/win-build.yml

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -69,25 +69,24 @@ jobs:
6969
- name: Restore NuGet Packages for Nuget Tests (from local package source)
7070
run: nuget restore Rubjerg.Graphviz.NugetTests.sln
7171

72-
# FIXNOW
73-
# - name: Build Nuget Test Solution
74-
# run: msbuild Rubjerg.Graphviz.NugetTests.sln /p:Configuration=Release
72+
- name: Build Nuget Test Solution
73+
run: msbuild Rubjerg.Graphviz.NugetTests.sln /p:Configuration=Release
7574

76-
# - name: Run Nuget Tests (.NET 8)
77-
# run: bash run-tests-netcore.sh Rubjerg.Graphviz.NugetTest\Rubjerg.Graphviz.NugetTest.csproj
75+
- name: Run Nuget Tests (.NET 8)
76+
run: bash run-tests-netcore.sh Rubjerg.Graphviz.NugetTest\Rubjerg.Graphviz.NugetTest.csproj
7877

79-
# - name: Run Nuget Tests (.NET 4.8)
80-
# run: bash nunit-console.sh Rubjerg.Graphviz.NugetTest\bin\x64\Release\net48\Rubjerg.Graphviz.NugetTest.dll
78+
- name: Run Nuget Tests (.NET 4.8)
79+
run: bash nunit-console.sh Rubjerg.Graphviz.NugetTest\bin\x64\Release\net48\Rubjerg.Graphviz.NugetTest.dll
8180

82-
# - name: Run Transitive Nuget Tests (.NET 4.8)
83-
# run: bash nunit-console.sh Rubjerg.Graphviz.TransitiveNugetTest\bin\x64\Release\net48\Rubjerg.Graphviz.TransitiveNugetTest.dll
81+
- name: Run Transitive Nuget Tests (.NET 4.8)
82+
run: bash nunit-console.sh Rubjerg.Graphviz.TransitiveNugetTest\bin\x64\Release\net48\Rubjerg.Graphviz.TransitiveNugetTest.dll
8483

85-
# - name: Run Transitive Nuget Tests (.NET 8)
86-
# run: bash nunit-console.sh Rubjerg.Graphviz.TransitiveNugetTest\bin\x64\Release\net8.0\Rubjerg.Graphviz.TransitiveNugetTest.dll
84+
- name: Run Transitive Nuget Tests (.NET 8)
85+
run: bash nunit-console.sh Rubjerg.Graphviz.TransitiveNugetTest\bin\x64\Release\net8.0\Rubjerg.Graphviz.TransitiveNugetTest.dll
8786

88-
# - name: Check for loose ends
89-
# run: |
90-
# bash -c "! git grep 'FIX''NOW'"
87+
- name: Check for loose ends
88+
run: |
89+
bash -c "! git grep 'FIX''NOW'"
9190
9291
9392
# Locate the package that GeneratePackageOnBuild just produced

Rubjerg.Graphviz.NugetTest/TestNugetPackage.cs renamed to Rubjerg.Graphviz.NugetTest/Test.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,10 @@ digraph test {
2525
var B = root.GetNode("B");
2626
_ = root.GetOrAddEdge(A, B, "");
2727
Assert.AreEqual(4, A.EdgesOut().Count());
28+
29+
root.ToSvgFile(TestContext.CurrentContext.TestDirectory + "/dot_out.svg");
30+
31+
root.ToSvgFile(TestContext.CurrentContext.TestDirectory + "/neato_out.svg", LayoutEngines.Neato);
2832
}
2933
}
3034
}

Rubjerg.Graphviz.TransitiveNugetTest/TestNugetPackage.cs renamed to Rubjerg.Graphviz.TransitiveNugetTest/Test.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,10 @@ digraph test {
2525
var B = root.GetNode("B");
2626
_ = root.GetOrAddEdge(A, B, "");
2727
Assert.AreEqual(4, A.EdgesOut().Count());
28+
29+
root.ToSvgFile(TestContext.CurrentContext.TestDirectory + "/dot_out.svg");
30+
31+
root.ToSvgFile(TestContext.CurrentContext.TestDirectory + "/neato_out.svg", LayoutEngines.Neato);
2832
}
2933
}
3034
}
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
using System.Linq;
2+
using NUnit.Framework;
3+
4+
namespace Rubjerg.Graphviz.NugetTest
5+
{
6+
[TestFixture()]
7+
public class TestNugetPackage
8+
{
9+
[Test()]
10+
public void TestReadDotFile()
11+
{
12+
RootGraph root = RootGraph.FromDotString(@"
13+
digraph test {
14+
A;
15+
B;
16+
B -> B;
17+
A -> B[name = edgename];
18+
A -> B[name = edgename];
19+
A -> B[name = edgename];
20+
}
21+
");
22+
var A = root.GetNode("A");
23+
Assert.AreEqual(3, A.EdgesOut().Count());
24+
25+
var B = root.GetNode("B");
26+
_ = root.GetOrAddEdge(A, B, "");
27+
Assert.AreEqual(4, A.EdgesOut().Count());
28+
29+
root.ToSvgFile(TestContext.CurrentContext.TestDirectory + "/dot_out.svg");
30+
31+
root.ToSvgFile(TestContext.CurrentContext.TestDirectory + "/neato_out.svg", LayoutEngines.Neato);
32+
}
33+
}
34+
}

Rubjerg.Graphviz.TransitiveTest/TestReference.cs

Lines changed: 0 additions & 29 deletions
This file was deleted.

Rubjerg.Graphviz/Rubjerg.Graphviz.csproj

Lines changed: 30 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,40 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4+
<!-- Library targets -->
45
<OutputType>Library</OutputType>
56
<TargetFramework>netstandard2.0</TargetFramework>
7+
8+
<!-- Build & pack for these RIDs; the build matrix selects one per job -->
9+
<RuntimeIdentifiers>win-x64;linux-x64</RuntimeIdentifiers>
10+
11+
<!-- Misc project metadata -->
612
<Platforms>x64</Platforms>
713
<PlatformTarget>x64</PlatformTarget>
814
<LangVersion>latest</LangVersion>
915
<AnalysisMode>AllEnabledByDefault</AnalysisMode>
1016
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
11-
<Nullable>Enable</Nullable>
17+
<Nullable>enable</Nullable>
1218
<NoWarn>1701;1702;NU5100</NoWarn>
19+
20+
<!-- NuGet info -->
1321
<Version>2.0.2</Version>
1422
<Authors>Chiel ten Brinke</Authors>
1523
<Company>Rubjerg</Company>
1624
<Description>Lean wrapper around Graphviz for building graphs, reading/writing dot files, exporting images, or reading out layout parameters.</Description>
17-
<Copyright>Copyright 2020</Copyright>
25+
<Copyright>Copyright 2020</Copyright>
1826
<PackageTags>graphviz dotnet graphdrawing</PackageTags>
1927
<RepositoryUrl>https://github.com/Rubjerg/Graphviz.NetWrapper</RepositoryUrl>
2028
<PackageProjectUrl>https://github.com/Rubjerg/Graphviz.NetWrapper</PackageProjectUrl>
21-
<PackageLicenseExpression></PackageLicenseExpression>
2229
<PackageLicenseFile>LICENSE</PackageLicenseFile>
2330
</PropertyGroup>
24-
31+
32+
<!-- Platform‑specific compilation constant for Windows code paths -->
2533
<PropertyGroup Condition=" '$(OS)' == 'Windows_NT' ">
2634
<DefineConstants>_WINDOWS</DefineConstants>
2735
</PropertyGroup>
2836

29-
<PropertyGroup Condition="'$(Configuration)'=='Release'">
37+
<PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
3038
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
3139
</PropertyGroup>
3240

@@ -36,23 +44,30 @@
3644
</ProjectReference>
3745
</ItemGroup>
3846

47+
<!--
48+
***** Native assets *****
49+
All files under Resources/ are copied to bin/ at build time *and* packed into
50+
runtimes/<rid>/native so consumers only get the bits for their platform.
51+
-->
52+
3953
<ItemGroup>
40-
<!-- Include all files in the Resources folder but copy them directly to the output directory -->
41-
<None Update="Resources/*">
42-
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
43-
<Link>%(RecursiveDir)/../%(Filename)%(Extension)</Link>
54+
<!-- Top‑level executables / libraries -->
55+
<None Include="Resources/*" Exclude="Resources/graphviz/**">
56+
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
57+
<Link>%(RecursiveDir)/%(Filename)%(Extension)</Link>
4458
<Pack>true</Pack>
45-
<PackageCopyToOutput>true</PackageCopyToOutput>
59+
<PackagePath>runtimes/linux-x64/native/</PackagePath>
4660
</None>
47-
<!-- The graphviz subfolder is only present and relevant on linux -->
48-
<None Update="Resources/graphviz/*">
49-
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
50-
<Link>%(RecursiveDir)/../../graphviz/%(Filename)%(Extension)</Link>
61+
<!-- Graphviz plug‑ins & sub‑folder -->
62+
<None Include="Resources/graphviz/**">
63+
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
64+
<Link>%(RecursiveDir)/graphviz/%(Filename)%(Extension)</Link>
5165
<Pack>true</Pack>
52-
<PackageCopyToOutput>true</PackageCopyToOutput>
66+
<PackagePath>runtimes/linux-x64/native/graphviz/%(RecursiveDir)</PackagePath>
5367
</None>
5468
</ItemGroup>
5569

70+
<!-- Shared assets such as the licence file -->
5671
<ItemGroup>
5772
<None Include="..\LICENSE">
5873
<Pack>true</Pack>

nuget.config

Lines changed: 28 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,28 @@
1-
<?xml version="1.0" encoding="utf-8"?>
2-
<configuration>
3-
<!-- NOTE: IF YOU UPDATE THIS FILE, MAKE SURE THAT THE INSTRUCTIONS IN THE README REMAIN UP-TO-DATE -->
4-
5-
<packageSources>
6-
<!-- `clear` ensures no additional sources are inherited from another config file. -->
7-
<clear />
8-
<!-- `key` can be any identifier for your source. -->
9-
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" />
10-
<!-- <add key="Test Source" value="Rubjerg.Graphviz\bin\x64\Release" /> -->
11-
</packageSources>
12-
13-
<!-- Define mappings by adding package patterns beneath the target source. -->
14-
<packageSourceMapping>
15-
16-
<!-- key value for <packageSource> should match key values from <packageSources> element -->
17-
<packageSource key="nuget.org">
18-
<package pattern="*" />
19-
</packageSource>
20-
21-
<!-- <packageSource key="Test Source"> -->
22-
<!-- <package pattern="Rubjerg.Graphviz*" /> -->
23-
<!-- </packageSource> -->
24-
25-
</packageSourceMapping>
26-
27-
</configuration>
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<configuration>
3+
<!-- NOTE: IF YOU UPDATE THIS FILE, MAKE SURE THAT THE INSTRUCTIONS IN THE README REMAIN UP-TO-DATE -->
4+
5+
<packageSources>
6+
<!-- `clear` ensures no additional sources are inherited from another config file. -->
7+
<clear />
8+
<!-- `key` can be any identifier for your source. -->
9+
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" />
10+
<add key="Test Source" value="Rubjerg.Graphviz/bin/x64/Release" />
11+
12+
</packageSources>
13+
14+
<!-- Define mappings by adding package patterns beneath the target source. -->
15+
<packageSourceMapping>
16+
17+
<!-- key value for <packageSource> should match key values from <packageSources> element -->
18+
<packageSource key="nuget.org">
19+
<package pattern="*" />
20+
</packageSource>
21+
22+
<packageSource key="Test Source">
23+
<package pattern="Rubjerg.Graphviz*" />
24+
</packageSource>
25+
26+
</packageSourceMapping>
27+
28+
</configuration>

test-nuget.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
bash clean-build.sh
2+
dotnet restore Rubjerg.Graphviz.NugetTests.sln
3+
dotnet build Rubjerg.Graphviz.NugetTests.sln --configuration Release --no-restore
4+
5+
shopt -s globstar
6+
ls Rubjerg.Graphviz.NugetTest/bin/**/*
7+
8+
dotnet test --no-build -p:OutputPath=bin/x64/Release/net8.0 -c Release -f net8.0 Rubjerg.Graphviz.NugetTest/Rubjerg.Graphviz.NugetTest.csproj

0 commit comments

Comments
 (0)