Skip to content

Commit

Permalink
Publishing VeraPdf Update 1.16.1
Browse files Browse the repository at this point in the history
Publishing VeraPdf Update 1.16.1
Fresh nuget api key
  • Loading branch information
seeste committed Mar 15, 2021
1 parent 3ddc21a commit 2e7f016
Show file tree
Hide file tree
Showing 12 changed files with 131 additions and 84 deletions.
5 changes: 5 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"recommendations": [
"ms-dotnettools.csharp"
]
}
52 changes: 26 additions & 26 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
{
// Use IntelliSense to find out which attributes exist for C# debugging
// Use hover for the description of the existing attributes
// For further information visit https://github.com/OmniSharp/omnisharp-vscode/blob/master/debugger-launchjson.md
"version": "0.2.0",
"configurations": [
{
"name": ".NET Core Launch (console)",
"type": "coreclr",
"request": "launch",
"preLaunchTask": "build",
// If you have changed target frameworks, make sure to update the program path.
"program": "${workspaceFolder}/PDfAValidatorTest/bin/Debug/netcoreapp2.1/PDfAValidatorTest.dll",
"args": [],
"cwd": "${workspaceFolder}/PDfAValidatorTest",
// For more information about the 'console' field, see https://github.com/OmniSharp/omnisharp-vscode/blob/master/debugger-launchjson.md#console-terminal-window
"console": "internalConsole",
"stopAtEntry": false
},
{
"name": ".NET Core Attach",
"type": "coreclr",
"request": "attach",
"processId": "${command:pickProcess}"
}
]
}
// Use IntelliSense to find out which attributes exist for C# debugging
// Use hover for the description of the existing attributes
// For further information visit https://github.com/OmniSharp/omnisharp-vscode/blob/master/debugger-launchjson.md
"version": "0.2.0",
"configurations": [
{
"name": ".NET Core Launch (console)",
"type": "coreclr",
"request": "launch",
"preLaunchTask": "build",
// If you have changed target frameworks, make sure to update the program path.
"program": "${workspaceFolder}/PdfAValidatorTest/bin/Debug/netcoreapp3.1/PdfAValidatorTest.dll",
"args": [],
"cwd": "${workspaceFolder}/PdfAValidatorTest",
// For more information about the 'console' field, see https://aka.ms/VSCode-CS-LaunchJson-Console
"console": "internalConsole",
"stopAtEntry": false
},
{
"name": ".NET Core Attach",
"type": "coreclr",
"request": "attach",
"processId": "${command:pickProcess}"
}
]
}
13 changes: 8 additions & 5 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
{
"cSpell.language": "en",
"cSpell.words": [
"AGPL",
"chmod",
"pdfa"
]
"Codacy",
"Codeuctivity",
"Nuget",
"Nunit",
"nupkg",
"snupkg"
],
"editor.formatOnSave": true
}
86 changes: 51 additions & 35 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -1,36 +1,52 @@
{
"version": "2.0.0",
"tasks": [
{
"label": "build",
"command": "dotnet",
"type": "process",
"args": [
"build",
"${workspaceFolder}/PDfAValidatorTest/PDfAValidatorTest.csproj"
],
"problemMatcher": "$tsc"
},
{
"label": "publish",
"command": "dotnet",
"type": "process",
"args": [
"publish",
"${workspaceFolder}/PDfAValidatorTest/PDfAValidatorTest.csproj"
],
"problemMatcher": "$tsc"
},
{
"label": "watch",
"command": "dotnet",
"type": "process",
"args": [
"watch",
"run",
"${workspaceFolder}/PDfAValidatorTest/PDfAValidatorTest.csproj"
],
"problemMatcher": "$tsc"
}
]
}
"version": "2.0.0",
"tasks": [
{
"label": "build",
"command": "dotnet",
"type": "process",
"args": [
"build",
"${workspaceFolder}/PdfAValidatorTest/PdfAValidatorTest.csproj",
"/property:GenerateFullPaths=true",
"/consoleloggerparameters:NoSummary"
],
"problemMatcher": "$msCompile"
},
{
"label": "publish",
"command": "dotnet",
"type": "process",
"args": [
"publish",
"${workspaceFolder}/PdfAValidatorTest/PdfAValidatorTest.csproj",
"/property:GenerateFullPaths=true",
"/consoleloggerparameters:NoSummary"
],
"problemMatcher": "$msCompile"
},
{
"label": "watch",
"command": "dotnet",
"type": "process",
"args": [
"watch",
"run",
"${workspaceFolder}/PdfAValidatorTest/PdfAValidatorTest.csproj",
"/property:GenerateFullPaths=true",
"/consoleloggerparameters:NoSummary"
],
"problemMatcher": "$msCompile"
},
{
"label": "update nuget",
"command": "${workspaceFolder}/.vscode/updateNuget.sh",
"args": [],
"group": "build",
"presentation": {
"reveal": "always"
},
"problemMatcher": "$msCompile"
}
]
}
13 changes: 13 additions & 0 deletions .vscode/updateNuget.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/bash
regex='PackageReference Include="([^"]*)" Version="([^"]*)"'
find . -name "*.*proj" | while read proj; do
while read line; do
if [[ $line =~ $regex ]]; then
name="${BASH_REMATCH[1]}"
version="${BASH_REMATCH[2]}"
if [[ $version != *-* ]]; then
dotnet add "$proj" package "$name"
fi
fi
done <"$proj"
done
20 changes: 20 additions & 0 deletions PdfAValidatorTest/PdfAValidatorTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,16 @@ public static async Task ShouldDetectNonCompliantPdfA()
Assert.False(result);
}

[Fact]
public static async Task ShouldThrowOnValidatingBrokenPdf()
{
using var pdfAValidator = new PdfAValidator();
Assert.True(File.Exists("./TestPdfFiles/NoPdf.pdf"));
var actualException = await Assert.ThrowsAsync<VeraPdfException>(() => pdfAValidator.ValidateAsync("./TestPdfFiles/NoPdf.pdf"));
Assert.Contains("Calling VeraPdf exited with 7 caused an error:", actualException.Message);
Assert.Contains("NoPdf.pdf doesn't appear to be a valid PDF.", actualException.Message);
}

[Fact]
public static async Task ShouldGetDetailedReportFromNonCompliantPdfA()
{
Expand All @@ -72,6 +82,16 @@ public static async Task ShouldGetDetailedReportFromNonCompliantPdfAMissingFont(
Assert.Contains(result.Jobs.Job.ValidationReport.Details.Rule, _ => _.Clause == "6.3.5");
}

[Fact]
public static async Task ShouldThrowOnGetDetailedReportFromBrokenPdf()
{
using var pdfAValidator = new PdfAValidator();
Assert.True(File.Exists("./TestPdfFiles/NoPdf.pdf"));
var actualException = await Assert.ThrowsAsync<VeraPdfException>(() => pdfAValidator.ValidateWithDetailedReportAsync("./TestPdfFiles/NoPdf.pdf"));
Assert.Contains("Calling VeraPdf exited with 7 caused an error:", actualException.Message);
Assert.Contains("NoPdf.pdf doesn't appear to be a valid PDF.", actualException.Message);
}

[Fact]
public static async Task ShouldWorkWithCustomJavaAndVeraPdfLocation()
{
Expand Down
5 changes: 5 additions & 0 deletions PdfAValidatorTest/PdfAValidatorTest.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
<IsPackable>false</IsPackable>
<Nullable>enable</Nullable>
<LangVersion>8.0</LangVersion>
<EnableNETAnalyzers>true</EnableNETAnalyzers>
</PropertyGroup>

<ItemGroup>
Expand All @@ -16,6 +17,7 @@
<None Remove="TestPdfFiles\FontsNotEmbedded.pdf" />
<None Remove="TestPdfFiles\FromLibreOffice.pdf" />
<None Remove="TestPdfFiles\FromLibreOfficeNonPdfA.pdf" />
<None Remove="TestPdfFiles\NoPdf.pdf" />
</ItemGroup>

<ItemGroup>
Expand All @@ -31,6 +33,9 @@
<Content Include="TestPdfFiles\FromLibreOfficeNonPdfA.pdf">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="TestPdfFiles\NoPdf.pdf">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="TestPdfFiles\FontsNotEmbedded.pdf">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
Expand Down
Binary file added PdfAValidatorTest/TestPdfFiles/NoPdf.pdf
Binary file not shown.
1 change: 1 addition & 0 deletions PdfAValidatorWebApi/PdfAValidatorWebApi.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<Nullable>enable</Nullable>
<LangVersion>8.0</LangVersion>
<EnableNETAnalyzers>true</EnableNETAnalyzers>
</PropertyGroup>

<ItemGroup>
Expand Down
1 change: 1 addition & 0 deletions PdfAValidatorWebApiTest/PdfAValidatorWebApiTest.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
<IsPackable>false</IsPackable>
<Nullable>enable</Nullable>
<LangVersion>8.0</LangVersion>
<EnableNETAnalyzers>true</EnableNETAnalyzers>
</PropertyGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,6 @@ deploy:
prerelease: true
- provider: NuGet
api_key:
secure: BAGacXk+5m7jd8EvWW6wkYhoVml39WAi7n2Z0odVUKUq5SeWLqixvkPA1I+KbQ1r
secure: CTISdGCfnpyC7Rh5vs1pgbuISrkWF34sot0SyVgvu0HQxhNNd+V0Gc4MS+rtJttB
on:
branch: master
17 changes: 0 additions & 17 deletions nugetUpgrade.sh

This file was deleted.

0 comments on commit 2e7f016

Please sign in to comment.