Skip to content

Commit 7e9430f

Browse files
committed
Bump version to 3.0.3
1 parent c3fe5bb commit 7e9430f

File tree

1 file changed

+42
-1
lines changed

1 file changed

+42
-1
lines changed

CreatePdf.NET/CreatePdf.NET.csproj

Lines changed: 42 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
<PackageId>CreatePdf.NET</PackageId>
99
<Title>CreatePdf.NET - Simple PDF Creation Library</Title>
10-
<Version>3.0.2</Version>
10+
<Version>3.0.3</Version>
1111
<Authors>Alexander Nachtmann</Authors>
1212
<Summary>Lightweight PDF generation library for .NET 10/9/8 with text rendering, bitmap graphics, and OCR</Summary>
1313
<Description>CreatePdf.NET is a simple, fast PDF creation library for .NET applications. Generate PDF documents with text rendering, bitmap graphics, and optional OCR text extraction. Lightweight, dependency-free, 100% test coverage. Perfect for creating reports, invoices, receipts, labels, and documents. Supports .NET 10, .NET 9, and .NET 8 with fluent C# API.</Description>
@@ -54,4 +54,45 @@
5454
</PackageReference>
5555
</ItemGroup>
5656

57+
<Target Name="ReorderNuspecDependencies" AfterTargets="GenerateNuspec">
58+
<PropertyGroup>
59+
<NuspecFileName>$(NuspecOutputPath)$(PackageId).$(Version).nuspec</NuspecFileName>
60+
<PyScriptPath>$(NuspecOutputPath)reorder.py</PyScriptPath>
61+
<ReorderScript>
62+
<![CDATA[
63+
import sys
64+
import re
65+
66+
file_path = sys.argv[1]
67+
with open(file_path, 'r') as f:
68+
content = f.read()
69+
70+
match = re.search(r'<dependencies>(.*?)</dependencies>', content, re.DOTALL)
71+
if match:
72+
block = match.group(1)
73+
groups = re.findall(r'<group targetFramework="([^"]+)" />', block)
74+
75+
def score(fw):
76+
if 'net10' in fw: return 3
77+
if 'net9' in fw: return 2
78+
if 'net8' in fw: return 1
79+
return 0
80+
81+
groups.sort(key=score, reverse=True)
82+
83+
new_lines = [f' <group targetFramework="{g}" />' for g in groups]
84+
new_block = '\n' + '\n'.join(new_lines) + '\n '
85+
86+
new_content = content.replace(match.group(0), f'<dependencies>{new_block}</dependencies>')
87+
88+
with open(file_path, 'w') as f:
89+
f.write(new_content)
90+
print(f"Reordered dependencies in {file_path}")
91+
]]>
92+
</ReorderScript>
93+
</PropertyGroup>
94+
95+
<WriteLinesToFile File="$(PyScriptPath)" Lines="$(ReorderScript)" Overwrite="true" />
96+
<Exec Command="python3 &quot;$(PyScriptPath)&quot; &quot;$(NuspecFileName)&quot;" />
97+
</Target>
5798
</Project>

0 commit comments

Comments
 (0)