Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
PDFsharp-Team committed Aug 13, 2024
1 parent 1956cbf commit 5fbf6ed
Show file tree
Hide file tree
Showing 480 changed files with 10,368 additions and 7,210 deletions.
47 changes: 47 additions & 0 deletions PdfSharp.sln
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "docs", "docs", "{18E75E2F-2
ProjectSection(SolutionItems) = preProject
src\foundation\src\PDFsharp\docs\AboutFonts.md = src\foundation\src\PDFsharp\docs\AboutFonts.md
src\foundation\src\PDFsharp\docs\AboutImages.md = src\foundation\src\PDFsharp\docs\AboutImages.md
src\foundation\src\PDFsharp\docs\Coding-Issues.md = src\foundation\src\PDFsharp\docs\Coding-Issues.md
src\foundation\src\PDFsharp\docs\GlobalStuff.md = src\foundation\src\PDFsharp\docs\GlobalStuff.md
src\foundation\src\PDFsharp\docs\Notebook.md = src\foundation\src\PDFsharp\docs\Notebook.md
src\foundation\src\PDFsharp\docs\PortingNotes.md = src\foundation\src\PDFsharp\docs\PortingNotes.md
Expand All @@ -59,6 +60,9 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tests", "tests", "{D564E33D
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "docs", "docs", "{9EB8E8CC-3BA3-4B0F-B853-5B2443C40015}"
ProjectSection(SolutionItems) = preProject
AboutLineSpacing.md = AboutLineSpacing.md
EndProjectSection
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MigraDoc.Tests", "src\foundation\src\MigraDoc\tests\MigraDoc.Tests\MigraDoc.Tests.csproj", "{CA022FCC-7A23-4759-8789-9FC86C805557}"
EndProject
Expand Down Expand Up @@ -191,6 +195,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "PDFsharp.NuGet-wpf", "src\f
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "docs", "docs", "{76BA9372-65AE-479C-AEF7-D50E6B486CEF}"
ProjectSection(SolutionItems) = preProject
docs\BeforeReleases.md = docs\BeforeReleases.md
docs\BoilerplateText.md = docs\BoilerplateText.md
docs\DevNotes.md = docs\DevNotes.md
docs\MakeNewReleaseNotes.md = docs\MakeNewReleaseNotes.md
Expand Down Expand Up @@ -252,6 +257,29 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "PdfSharp.Testing-gdi", "src
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "PdfSharp.Testing-wpf", "src\foundation\src\shared\src\PdfSharp.Testing-wpf\PdfSharp.Testing-wpf.csproj", "{1F9EE0B3-4BA1-4CE4-9301-1735732B61B6}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "psf", "psf", "{D2B0EC1F-CF81-4756-B20C-9BB786A151E0}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "PdfSharp.Cryptography", "src\foundation\src\shared\src\PdfSharp.Crytography\PdfSharp.Cryptography.csproj", "{2BA35CF7-9851-4B19-A170-0B66BE87ACE5}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Signatures", "Signatures", "{8CE97B3D-BECA-436D-86EC-E053A99E3A81}"
ProjectSection(SolutionItems) = preProject
docs\Signatures\CertificateCreation.md = docs\Signatures\CertificateCreation.md
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "changes", "changes", "{C39DF31C-2938-4EC3-B50D-52FFA8453866}"
ProjectSection(SolutionItems) = preProject
docs\changes\v6.2.0-log.md = docs\changes\v6.2.0-log.md
EndProjectSection
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CopyAsLink", "src\tools\src\CopyAsLink\CopyAsLink.csproj", "{60D307AC-D7D6-4AA4-BF9F-DDC6809CBCC7}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "PdfSharp.Shared", "src\foundation\src\shared\src\PdfSharp.Shared\PdfSharp.Shared.csproj", "{8C20115B-AA17-41A7-837D-F5CFD286DFC9}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "MigraDoc", "MigraDoc", "{08BB5B79-D6B5-4EEF-8D37-77FBD0F04AA6}"
ProjectSection(SolutionItems) = preProject
docs\MigraDoc\AboutLineSpacing.md = docs\MigraDoc\AboutLineSpacing.md
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -518,6 +546,18 @@ Global
{1F9EE0B3-4BA1-4CE4-9301-1735732B61B6}.Debug|Any CPU.Build.0 = Debug|Any CPU
{1F9EE0B3-4BA1-4CE4-9301-1735732B61B6}.Release|Any CPU.ActiveCfg = Release|Any CPU
{1F9EE0B3-4BA1-4CE4-9301-1735732B61B6}.Release|Any CPU.Build.0 = Release|Any CPU
{2BA35CF7-9851-4B19-A170-0B66BE87ACE5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{2BA35CF7-9851-4B19-A170-0B66BE87ACE5}.Debug|Any CPU.Build.0 = Debug|Any CPU
{2BA35CF7-9851-4B19-A170-0B66BE87ACE5}.Release|Any CPU.ActiveCfg = Release|Any CPU
{2BA35CF7-9851-4B19-A170-0B66BE87ACE5}.Release|Any CPU.Build.0 = Release|Any CPU
{60D307AC-D7D6-4AA4-BF9F-DDC6809CBCC7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{60D307AC-D7D6-4AA4-BF9F-DDC6809CBCC7}.Debug|Any CPU.Build.0 = Debug|Any CPU
{60D307AC-D7D6-4AA4-BF9F-DDC6809CBCC7}.Release|Any CPU.ActiveCfg = Release|Any CPU
{60D307AC-D7D6-4AA4-BF9F-DDC6809CBCC7}.Release|Any CPU.Build.0 = Release|Any CPU
{8C20115B-AA17-41A7-837D-F5CFD286DFC9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{8C20115B-AA17-41A7-837D-F5CFD286DFC9}.Debug|Any CPU.Build.0 = Debug|Any CPU
{8C20115B-AA17-41A7-837D-F5CFD286DFC9}.Release|Any CPU.ActiveCfg = Release|Any CPU
{8C20115B-AA17-41A7-837D-F5CFD286DFC9}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down Expand Up @@ -617,6 +657,13 @@ Global
{BA039CC9-132E-4103-BB47-87C3E3398F82} = {31FE507C-F342-4DA4-9BE5-B3D2ED93E9CC}
{C7CCB288-8372-41AD-9F65-6224CE0D6358} = {DE458BB2-5942-4588-A74A-AE9CA86F284C}
{1F9EE0B3-4BA1-4CE4-9301-1735732B61B6} = {DE458BB2-5942-4588-A74A-AE9CA86F284C}
{D2B0EC1F-CF81-4756-B20C-9BB786A151E0} = {18E75E2F-2A27-408C-BC02-9B68D7F0817F}
{2BA35CF7-9851-4B19-A170-0B66BE87ACE5} = {DE458BB2-5942-4588-A74A-AE9CA86F284C}
{8CE97B3D-BECA-436D-86EC-E053A99E3A81} = {76BA9372-65AE-479C-AEF7-D50E6B486CEF}
{C39DF31C-2938-4EC3-B50D-52FFA8453866} = {76BA9372-65AE-479C-AEF7-D50E6B486CEF}
{60D307AC-D7D6-4AA4-BF9F-DDC6809CBCC7} = {CC13B431-6963-480F-8C21-1F78A220A399}
{8C20115B-AA17-41A7-837D-F5CFD286DFC9} = {DE458BB2-5942-4588-A74A-AE9CA86F284C}
{08BB5B79-D6B5-4EEF-8D37-77FBD0F04AA6} = {76BA9372-65AE-479C-AEF7-D50E6B486CEF}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {D5FF5562-3C79-434B-B951-B84542D01625}
Expand Down
3 changes: 3 additions & 0 deletions PdfSharp.sln.DotSettings
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=IO/@EntryIndexedValue">IO</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=IV/@EntryIndexedValue">IV</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=SASL/@EntryIndexedValue">SASL</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=TSA/@EntryIndexedValue">TSA</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=URI/@EntryIndexedValue">URI</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=URL/@EntryIndexedValue">URL</s:String>
<s:Boolean x:Key="/Default/UserDictionary/Words/=AESV/@EntryIndexedValue">True</s:Boolean>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=ID/@EntryIndexedValue">ID</s:String>
<s:Boolean x:Key="/Default/UserDictionary/Words/=ARGB/@EntryIndexedValue">True</s:Boolean>
Expand Down
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# PDFsharp & MigraDoc 6
# PDFsharp & MigraDoc 6

Version **6.1.1**
Published **2024-07-01**
Version **6.2.0 Preview 1**
Published **2024-08-12**

This is a version of the **PDFsharp** project, the main project of PDFsharp & MigraDoc 6 with updates for C# 12 and .NET 6.
This is a preview version of the **PDFsharp** project, the main project of PDFsharp & MigraDoc 6 with updates for C# 12 and .NET 6.

PDFsharp: Copyright (c) 2005-2024 empira Software GmbH, Troisdorf (Cologne Area), Germany
MigraDoc: Copyright (c) 2001-2024 empira Software GmbH, Troisdorf (Cologne Area), Germany
Expand Down Expand Up @@ -35,7 +35,7 @@ Execute
* You need the latest .NET SDK version installed
* Please note that you need a git repository with at least one commit in order to build the PDFsharp solution.
Without a git repo with at least one commit, you will get an error message from `GitVersion.MsBuild` while building the solution.
You can set a tag to define a valid version, e.g.: `git tag v6.1.0` to make it build with a specific version number. Without tag, version 0.1.0 will be used.
You can set a tag to define a valid version, e.g.: `git tag v6.2.0` to make it build with a specific version number. Without tag, version 0.1.0 will be used.

### Central package management

Expand Down
88 changes: 66 additions & 22 deletions dev/run-tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,16 @@
.DESCRIPTION
The script builds the solution located in the script’s root parent folder and runs 'dotnet test' for all libraries to test, that are found via its projects.
These tests are run in the following environment, as far as available: Windows with net6, Windows with net472 and Linux/WSL (net6).
For each environment libraries not to be run (like WPF in Linux or Linux-targeting DLLs in Windows) are excluded from testing.
These tests are run in the following environment, as far as available: Windows with NET8 or NET6, Windows with NET462 and Linux/WSL (NET8 or NET6).
For each environment, libraries not to be run (like WPF in Linux or Linux-targeting DLLs in Windows) are excluded from testing.
The test results are displayed in tables per library / code base comparing the test results in the different environments.
.PARAMETER Config
Specifies the configuration to build and test the solution ("Debug" or "Release"). "Debug" is the default.
.PARAMETER Net6
Specifies whether NET6 shall be tested instead of NET8. $False is the default.
.PARAMETER SkipBuild
Specifies whether the build of the solution shall be skipped. $False is the default.
Expand All @@ -28,7 +31,7 @@
Not implemented: The test result was only found for other environments. Maybe the project is not targeting or the test is not implemented for this environment.
Not Applicable: The test library was not expected to be executed, as it is not intended to be run in this environment or as this environment is not available.
Not applicable: The test library was not expected to be executed, as it is not intended to be run in this environment or as this environment is not available.
No trx file: The test library was expected to be executed, but no trx file was found. Maybe an error occurred in this script or in the 'dotnet test' call.
Expand Down Expand Up @@ -64,15 +67,17 @@ BUG: Allow to run all tests, including GBE.

param (
[Parameter(Mandatory = $false)] [string]$Config = 'Debug',
[Parameter(Mandatory = $false)] [bool]$Net6 = $false,
[Parameter(Mandatory = $false)] [bool]$SkipBuild = $false,
[Parameter(Mandatory = $false)] [bool]$RunAllTests = $false
)

$script:SystemNameWindows = "Windows"
$script:SystemNameLinux = "Linux"
$script:SystemNameWsl = "WSL"
$script:NetName472 = "net472"
$script:NetName462 = "net462"
$script:NetName6 = "net6"
$script:NetName8 = "net8"


$script:Solution
Expand Down Expand Up @@ -173,6 +178,12 @@ function InitializeScript()
}
Write-Host

if ($script:Net6)
{
Write-Host "NET6 Tests will be run instead of NET8."
Write-Host
}

if ($script:SkipBuild)
{
Write-Host "Building solution in $script:Config build will be skipped."
Expand Down Expand Up @@ -232,6 +243,23 @@ function LoadTestDllInfos()

$testDllInfos = $dllInfos | Where-Object { $_.IsTestDll }

# If Net6 parameter is true, remove net8 DLLs.
if ($script:Net6)
{
$testDllInfos = $testDllInfos | Where-Object `
{
$_.TargetFramework.Contains("net8") -eq $false
}
}
# If Net6 parameter is false, remove net6 DLLs.
else
{
$testDllInfos = $testDllInfos | Where-Object `
{
$_.TargetFramework.Contains("net6") -eq $false
}
}

# Test-HACK: Only include explicit projects.
#$testDllInfos = $testDllInfos | Where-Object {$_.DllFileName.EndsWith("PdfSharp.Tests.dll", "OrdinalIgnoreCase") -or $_.DllFileName.EndsWith("Shared.Tests.dll", "OrdinalIgnoreCase")}

Expand All @@ -252,12 +280,12 @@ function LoadTestDllInfos()
# Set $script:TestDllInfosLinux list if running on Linux host or if tests will run in hosted WSL.
if ($script:RunOnLinuxHost -or $script:RunOnHostedWsl)
{
# Exclude WPF and GDI projects and net472 and Windows target frameworks for Linux.
# Exclude WPF and GDI projects and net462 and Windows target frameworks for Linux.
$script:TestDllInfosLinux = $testDllInfos | Where-Object `
{
$_.DllFileName.EndsWith("-gdi.dll", "OrdinalIgnoreCase") -eq $false -and `
$_.DllFileName.EndsWith("-wpf.dll", "OrdinalIgnoreCase") -eq $false -and `
$_.TargetFramework.Contains("net472") -eq $false -and `
$_.TargetFramework.Contains("net462") -eq $false -and `
$_.TargetFramework.Contains("windows") -eq $false
} | ForEach-Object { $_.PSObject.Copy() }

Expand Down Expand Up @@ -527,14 +555,17 @@ function RunTestsForSystem($testDllInfos, $systemName, $isHostedWsl)
# Gets the name of the environment for the given system and framework.
function GetEnvironmentName($systemName, $targetFramework)
{
# HACK: Some projects use net7.0 instead of net6.0, but we don’t want to differentiate this in the environment names which define the test result columns.
if ($targetFramework.Contains("net6") -or $targetFramework.Contains("net7"))
if ($script:Net6 -and $targetFramework.Contains("net6"))
{
$frameworkName = $script:NetName6
}
elseif ($targetFramework.Contains("net472"))
elseif ($script:Net6 -eq $false -and $targetFramework.Contains("net8"))
{
$frameworkName = $script:NetName8
}
elseif ($targetFramework.Contains("net462"))
{
$frameworkName = $script:NetName472
$frameworkName = $script:NetName462
}
else
{
Expand All @@ -544,9 +575,13 @@ function GetEnvironmentName($systemName, $targetFramework)
# HACK: For Linux the frameworkName shall not be shown.
if ($systemName -eq $script:SystemNameCurrentLinux)
{
if ($frameworkName -ne "net6")
if ($script:Net6 -and $frameworkName -ne "net6")
{
Write-Error ("For Linux there’s only one column supported (net6) by test script with Net6 parameter set to true.")
}
elseif ($script:Net6 -eq $false -and $frameworkName -ne "net8")
{
Write-Error ("For Linux there’s only one column supported for net6 by test script.")
Write-Error ("For Linux there’s only one column supported (net8) by test script with Net6 parameter set to false.")
}
return "$systemName"
}
Expand Down Expand Up @@ -590,12 +625,21 @@ function LoadAndShowTestResults()
Write-Host "TestResults" -ForegroundColor Green # Green color is used to make it the same conspicuity like the given green Format-Table header output.
Write-Host "==================================================" -ForegroundColor Green

if ($script:Net6)
{
$netNameX = $script:NetName6
}
else
{
$netNameX = $script:NetName8
}

# Environment names to be displayed in separate columns.
$environmentNameWindowsNet6 = GetEnvironmentName $script:SystemNameWindows $script:NetName6
$environmentNameWindowsNet472 = GetEnvironmentName $script:SystemNameWindows $script:NetName472
$environmentNameLinuxNet6 = GetEnvironmentName $script:SystemNameCurrentLinux $script:NetName6
$environmentNameWindowsNetX = GetEnvironmentName $script:SystemNameWindows $netNameX
$environmentNameWindowsNet462 = GetEnvironmentName $script:SystemNameWindows $script:NetName462
$environmentNameLinuxNetX = GetEnvironmentName $script:SystemNameCurrentLinux $netNameX

$environmentNames = @($environmentNameWindowsNet6, $environmentNameWindowsNet472, $environmentNameLinuxNet6)
$environmentNames = @($environmentNameWindowsNetX, $environmentNameWindowsNet462, $environmentNameLinuxNetX)

# Get unique GenericCodeBaseinformation for all Windows and Linux test DLLs.
$genericCodeBaseInfos = ($script:TestDllInfosWindows + $script:TestDllInfosLinux) | Select-Object -Property GenericCodeBase, GenericCodeBaseExtension, ProjectFolder -Unique
Expand All @@ -621,18 +665,18 @@ function LoadAndShowTestResults()
Width = $testColumnWidth
},
@{
Label = $firstResultColumnLeftPaddingStr + "$environmentNameWindowsNet6"
Expression = { ColorizedCellFormatExpressionResult($firstResultColumnLeftPaddingStr + $_.($environmentNameWindowsNet6)) }
Label = $firstResultColumnLeftPaddingStr + "$environmentNameWindowsNetX"
Expression = { ColorizedCellFormatExpressionResult($firstResultColumnLeftPaddingStr + $_.($environmentNameWindowsNetX)) }
Width = $firstResultColumnLeftPadding + $resultColumnWidth
},
@{
Label = "$environmentNameWindowsNet472"
Expression = { ColorizedCellFormatExpressionResult($_.($environmentNameWindowsNet472)) }
Label = "$environmentNameWindowsNet462"
Expression = { ColorizedCellFormatExpressionResult($_.($environmentNameWindowsNet462)) }
Width = $resultColumnWidth
},
@{
Label = "$environmentNameLinuxNet6"
Expression = { ColorizedCellFormatExpressionResult($_.($environmentNameLinuxNet6)) }
Label = "$environmentNameLinuxNetX"
Expression = { ColorizedCellFormatExpressionResult($_.($environmentNameLinuxNetX)) }
Width = $resultColumnWidth
}
)
Expand Down
75 changes: 75 additions & 0 deletions docs/BeforeReleases.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
# Before released

Before you follow the instructions from the Azure DevOps wiki how to publish PDFsharp
complete the following tasks.

## General todos

### Update the assembly build version

Set the assembly build version in file in `gitversion.yml` to the number of days from
January 1st 2005 to the release day. **This is essential for users that use intaller tools.**
```
assembly-file-versioning-format: '{Major}.{Minor}.{Patch}.{env:PDFSHARP_BUILD_VERSION ?? 9999}'
```

### Check specific files

* Search for **`CHECK_BEFORE_RELEASE`** and verify the code at this places.
* Check `Directory.Build.targets`
* `USE_LONG_SIZE` must be defined.
* `TEST_CODE_xxx` must be 'undefined' by the suffix `_xxx`.

### Run all test

* Run all tests in both RELEASE and DEBUG configuration.
UnitTest with `RunTests` including all skipped tests.
* Run all text under WSL2

## Update files and configurations

### Update .md files

* Check and update [README.md](../README.md)

### Update NuGet configuration

* ???
* Check packages with NuGet Package Explorer

## Test other repositories

Rebuild both DEBUG and RELEASE and update local NuGet packages.

### GBE test

* Use ComparePdf with GBE

### PDFsharp.Samples

* Build solution
* Run the script that executes all samples

### PDFsharp.Tests

* Build solution
* Run the tests

### PDFsharp.Lab

* Build solution
* Run the script that executes all samples

### PDFsharp.MAUI

* Build solution
* Run the script that executes all samples

### PDFsharp.Blazor

* Build solution
* Run the script that executes all samples

### Test with QBX

* Test with QBX
Loading

0 comments on commit 5fbf6ed

Please sign in to comment.