Skip to content

Commit f5c7d04

Browse files
committed
#154 Improve packaging, debugging, and validation processes
- Set `<IsPackable>false</IsPackable>` in `CryptoNet.ExtShared.csproj` and `CryptoNet.Models.csproj` to prevent standalone NuGet packing. - Added `<DebugType>portable</DebugType>` and `<Deterministic>true</Deterministic>` for portable PDBs and deterministic builds. - Downgraded `Microsoft.CodeAnalysis.NetAnalyzers` to 9.0.0 and `System.Text.Json` to 9.0.8 in `CryptoNet.ExtShared.csproj` for compatibility. - Included `.pdb` and `.xml` files for `CryptoNet.ExtShared` and `CryptoNet.Models` in the NuGet package if they exist. - Added NuGet validation script in `run_nuget_validation.ps1` to ensure package quality using `dotnet-validate`.
1 parent f0502a3 commit f5c7d04

File tree

4 files changed

+36
-2
lines changed

4 files changed

+36
-2
lines changed

CryptoNet.ExtShared/CryptoNet.ExtShared.csproj

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,21 @@
44
<TargetFramework>netstandard2.0</TargetFramework>
55
<LangVersion>10.0</LangVersion>
66
<Nullable>enable</Nullable>
7+
<!-- Prevent this project from being packed as its own NuGet package.
8+
That ensures its compiled DLL will be embedded into CryptoNet when
9+
packing the top-level project. -->
710
<IsPackable>false</IsPackable>
811
<_SkipUpgradeNetAnalyzersNuGetWarning>true</_SkipUpgradeNetAnalyzersNuGetWarning>
12+
13+
<!-- Produce portable PDBs and deterministic outputs for symbol/SourceLink validation -->
14+
<DebugType>portable</DebugType>
15+
<Deterministic>true</Deterministic>
916
</PropertyGroup>
1017

1118
<ItemGroup>
1219
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="8.0.0" PrivateAssets="All" />
13-
<PackageReference Include="Microsoft.CodeAnalysis.NetAnalyzers" Version="10.0.100" PrivateAssets="All" />
14-
<PackageReference Include="System.Text.Json" Version="10.0.0" />
20+
<PackageReference Include="Microsoft.CodeAnalysis.NetAnalyzers" Version="9.0.0" PrivateAssets="All" />
21+
<PackageReference Include="System.Text.Json" Version="9.0.8" />
1522
</ItemGroup>
1623

1724
<ItemGroup>

CryptoNet.Models/CryptoNet.Models.csproj

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,12 @@
44
<TargetFramework>netstandard2.0</TargetFramework>
55
<LangVersion>10.0</LangVersion>
66
<Nullable>enable</Nullable>
7+
<!-- Prevent this project from being packed as its own NuGet package. -->
78
<IsPackable>false</IsPackable>
9+
10+
<!-- Produce portable PDBs and deterministic outputs for symbol/SourceLink validation -->
11+
<DebugType>portable</DebugType>
12+
<Deterministic>true</Deterministic>
813
</PropertyGroup>
914

1015
<ItemGroup>

CryptoNet/CryptoNet.csproj

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,10 +70,27 @@
7070
<Pack>true</Pack>
7171
<PackagePath>lib\netstandard2.0\</PackagePath>
7272
</None>
73+
<None Include="$(OutputPath)CryptoNet.ExtShared.pdb" Condition="Exists('$(OutputPath)CryptoNet.ExtShared.pdb')">
74+
<Pack>true</Pack>
75+
<PackagePath>lib\netstandard2.0\</PackagePath>
76+
</None>
77+
<None Include="$(OutputPath)CryptoNet.ExtShared.xml" Condition="Exists('$(OutputPath)CryptoNet.ExtShared.xml')">
78+
<Pack>true</Pack>
79+
<PackagePath>lib\netstandard2.0\</PackagePath>
80+
</None>
81+
7382
<None Include="$(OutputPath)CryptoNet.Models.dll">
7483
<Pack>true</Pack>
7584
<PackagePath>lib\netstandard2.0\</PackagePath>
7685
</None>
86+
<None Include="$(OutputPath)CryptoNet.Models.pdb" Condition="Exists('$(OutputPath)CryptoNet.Models.pdb')">
87+
<Pack>true</Pack>
88+
<PackagePath>lib\netstandard2.0\</PackagePath>
89+
</None>
90+
<None Include="$(OutputPath)CryptoNet.Models.xml" Condition="Exists('$(OutputPath)CryptoNet.Models.xml')">
91+
<Pack>true</Pack>
92+
<PackagePath>lib\netstandard2.0\</PackagePath>
93+
</None>
7794
</ItemGroup>
7895
</Target>
7996

run_nuget_validation.ps1

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Install if not installed
2+
# dotnet tool install --global dotnet-validate --prerelease
3+
# from solution root run:
4+
dotnet pack -c Release
5+
dotnet-validate package local .\CryptoNet\bin\Release\*.nupkg

0 commit comments

Comments
 (0)