Skip to content
This repository was archived by the owner on Sep 20, 2022. It is now read-only.

Commit 49bfb33

Browse files
committed
csproj version patching
1 parent 0da455d commit 49bfb33

File tree

6 files changed

+41
-12
lines changed

6 files changed

+41
-12
lines changed

PostScriptValidator/PostScriptValidator.cs

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,11 @@ public class PostScriptValidator : IDisposable
3030
/// <value>Can give you some hints if ghostscript failes to parse the validated postscript file</value>
3131

3232
public string ErrorMessage { get; private set; }
33-
33+
/// <summary>
34+
/// Last stdout output from ghostscript
35+
/// </summary>
36+
/// <value>Contains the stdout of the last validation session of ghostscript</value>
37+
public string StandardOutput { get; private set; }
3438
private bool isInitilized;
3539
private bool customGhostscriptlocation;
3640
private bool disposed;
@@ -80,16 +84,17 @@ public bool Validate(string pathToPsFile)
8084
startInfo.Arguments = string.Concat(arguments);
8185
process.Start();
8286

83-
var outputResult = GetStreamOutput(process.StandardOutput);
84-
var errorResult = GetStreamOutput(process.StandardError);
87+
StandardOutput = GetStreamOutput(process.StandardOutput);
88+
ErrorMessage = GetStreamOutput(process.StandardError);
8589

8690
process.WaitForExit();
91+
ExitCode = process.ExitCode;
8792

88-
if (process.ExitCode == 0 && string.IsNullOrEmpty(errorResult))
93+
if (process.ExitCode == 0 && string.IsNullOrEmpty(ErrorMessage))
94+
{
8995
return true;
96+
}
9097

91-
ExitCode = process.ExitCode;
92-
ErrorMessage = errorResult;
9398
return false;
9499
}
95100
}
@@ -161,7 +166,9 @@ public void Dispose()
161166
protected virtual void Dispose(bool disposing)
162167
{
163168
if (disposed)
169+
{
164170
return;
171+
}
165172

166173
if (disposing)
167174
{

PostScriptValidator/PostScriptValidator.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
<AssemblyVersion>1.0.0.1</AssemblyVersion>
1111
<FileVersion>1.0.0.1</FileVersion>
1212
<Version>1.0.1</Version>
13+
<PackageVersion>1.0.1</PackageVersion>
1314
<PackageIconUrl>https://avatars3.githubusercontent.com/u/8453155?v=2&amp;s=200</PackageIconUrl>
1415
<PackageProjectUrl>https://github.com/Codeuctivity/PostscriptValidatorApi</PackageProjectUrl>
1516
<Description>Postscript validator does some basic validation of postscript files.</Description>

PostScriptValidator/README.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# PostscriptValidator
2+
3+
This project proofes that your postscript can be parsed by ghostscript. It wrapps call to ghostscript like proposed [here](https://stackoverflow.com/questions/258132/validating-a-postscript-without-trying-to-print-it#2981290) . The nuget package contains ghostscript windows bins and uses preinstalled ghostscript when used in linux.
4+
5+
```PowerShell
6+
Install-Package PostscriptValidator
7+
```
8+
9+
Sample call:
10+
11+
```csharp
12+
using (var postscriptValidator = new PostScriptValidator.PostScriptValidator())
13+
{
14+
var result = postscriptValidator.Validate(@"./TestData/valid.ps");
15+
Assert.True(result);
16+
}
17+
```

PostScriptValidatorTest/PostScriptValidator.cs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,6 @@ namespace Tests
55
{
66
public class Tests
77
{
8-
[SetUp]
9-
public void Setup()
10-
{
11-
}
12-
138
[Test]
149
public void ShouldDetectCompliantPostscript()
1510
{

PostScriptValidatorTest/PostScriptValidatorTest.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFramework>netcoreapp2.2</TargetFramework>
4+
<TargetFramework>netcoreapp3.0</TargetFramework>
55

66
<IsPackable>false</IsPackable>
77
</PropertyGroup>

appveyor.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,15 @@ before_build:
99
build:
1010
project: PostScriptValidator.sln
1111
verbosity: minimal
12+
dotnet_csproj:
13+
patch: true
14+
file: '**\*.csproj'
15+
version: '{version}'
16+
package_version: '{version}'
17+
assembly_version: '{version}'
18+
file_version: '{version}'
19+
informational_version: '{version}'
20+
1221
artifacts:
1322
- path: '**\PostScriptValidator.*.nupkg'
1423
deploy:

0 commit comments

Comments
 (0)