|
7 | 7 |
|
8 | 8 | <PackageId>CreatePdf.NET</PackageId> |
9 | 9 | <Title>CreatePdf.NET - Simple PDF Creation Library</Title> |
10 | | - <Version>3.0.2</Version> |
| 10 | + <Version>3.0.3</Version> |
11 | 11 | <Authors>Alexander Nachtmann</Authors> |
12 | 12 | <Summary>Lightweight PDF generation library for .NET 10/9/8 with text rendering, bitmap graphics, and OCR</Summary> |
13 | 13 | <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 | 54 | </PackageReference> |
55 | 55 | </ItemGroup> |
56 | 56 |
|
| 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 "$(PyScriptPath)" "$(NuspecFileName)"" /> |
| 97 | + </Target> |
57 | 98 | </Project> |
0 commit comments