Skip to content

Commit

Permalink
Created release packer project.
Browse files Browse the repository at this point in the history
  • Loading branch information
dmester committed Jul 28, 2021
1 parent 29d4612 commit 75eb74a
Show file tree
Hide file tree
Showing 4 changed files with 79 additions and 2 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ Thumbs.db
[Bb]in
obj/
.vs/
releases/

#Nuget packages folder
packages/
14 changes: 12 additions & 2 deletions PdfToSvg.sln
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,17 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
src\Directory.Build.props = src\Directory.Build.props
EndProjectSection
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ApproximateCmyk", "tools\ApproximateCmyk\ApproximateCmyk.csproj", "{F84FBE74-2436-4EF5-A70A-A115EA28A604}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ApproximateCmyk", "tools\ApproximateCmyk\ApproximateCmyk.csproj", "{F84FBE74-2436-4EF5-A70A-A115EA28A604}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "PdfToSvg.Cli", "src\PdfToSvg.Cli\PdfToSvg.Cli.csproj", "{CAACAF0A-B183-4CFB-A3C1-90DD18E56328}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PdfToSvg.RealLifeTests", "tests\PdfToSvg.RealLifeTests\PdfToSvg.RealLifeTests.csproj", "{8732CD16-810E-406E-A962-BAEB6E8AE3A7}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "PdfToSvg.RealLifeTests", "tests\PdfToSvg.RealLifeTests\PdfToSvg.RealLifeTests.csproj", "{8732CD16-810E-406E-A962-BAEB6E8AE3A7}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PdfToSvg.Packer", "src\PdfToSvg.Packer\PdfToSvg.Packer.csproj", "{899BB00E-2396-499D-8934-FE1965DBD0B9}"
ProjectSection(ProjectDependencies) = postProject
{CAACAF0A-B183-4CFB-A3C1-90DD18E56328} = {CAACAF0A-B183-4CFB-A3C1-90DD18E56328}
{B2F05434-2A26-43A3-B016-52BFDEE736D0} = {B2F05434-2A26-43A3-B016-52BFDEE736D0}
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand Down Expand Up @@ -59,6 +65,10 @@ Global
{8732CD16-810E-406E-A962-BAEB6E8AE3A7}.Debug|Any CPU.Build.0 = Debug|Any CPU
{8732CD16-810E-406E-A962-BAEB6E8AE3A7}.Release|Any CPU.ActiveCfg = Release|Any CPU
{8732CD16-810E-406E-A962-BAEB6E8AE3A7}.Release|Any CPU.Build.0 = Release|Any CPU
{899BB00E-2396-499D-8934-FE1965DBD0B9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{899BB00E-2396-499D-8934-FE1965DBD0B9}.Debug|Any CPU.Build.0 = Debug|Any CPU
{899BB00E-2396-499D-8934-FE1965DBD0B9}.Release|Any CPU.ActiveCfg = Release|Any CPU
{899BB00E-2396-499D-8934-FE1965DBD0B9}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
57 changes: 57 additions & 0 deletions src/PdfToSvg.Packer/PdfToSvg.Packer.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net5.0</TargetFramework>
<ReleaseDir>$(SolutionDir)releases/</ReleaseDir>
<NuGetDownloadUrl>https://dist.nuget.org/win-x86-commandline/latest/nuget.exe</NuGetDownloadUrl>
</PropertyGroup>

<Target Name="CopyReleaseFiles" AfterTargets="Build" Condition=" $(Configuration) == 'Release' And $(PdfToSvgKeyFile) != '' ">
<PropertyGroup>
<_ZipContentDir>$(IntermediateOutputPath)ZipContent/</_ZipContentDir>
<_ReleaseDir>$(ReleaseDir)$(VersionPrefix)/</_ReleaseDir>
<_NuGetExePath>$(IntermediateOutputPath)nuget.exe</_NuGetExePath>
<_LibOutDir>$(SolutionDir)src/PdfToSvg/bin/$(Configuration)/</_LibOutDir>
<_CliOutDir>$(SolutionDir)src/PdfToSvg.Cli/bin/$(Configuration)/net40/</_CliOutDir>
<_PublishScript>
<![CDATA[
@echo off
cd /D %~dp0
echo You will now publish version $(VersionPrefix) to NuGet
pause
"$([System.IO.Path]::GetFullPath('$(_NuGetExePath)'))" push "PdfToSvg.NET.$(VersionPrefix).nupkg" -Source https://api.nuget.org/v3/index.json
]]>
</_PublishScript>
</PropertyGroup>

<ItemGroup>
<_FilesToDelete Include="$(_ReleaseDir)/*" />
<_FilesToDelete Include="$(_ZipContentDir)**/*" />

<_ZipContent Include="$(_LibOutDir)**/*.dll" />
<_ZipContent Include="$(_LibOutDir)**/*.xml" />
<_ZipContent Include="$(_LibOutDir)**/*.pdb" />
<_ZipContent Include="$(_CliOutDir)*.exe" />

<_ReleaseContent Include="$(_CliOutDir)*.exe" />

<_NuGetPackages Include="$(_LibOutDir)PdfToSvg.NET.$(Version).nupkg" />
<_NuGetPackages Include="$(_LibOutDir)PdfToSvg.NET.$(Version).snupkg" />
</ItemGroup>

<DownloadFile Condition="!Exists('$(_NuGetExePath)')" SourceUrl="$(NuGetDownloadUrl)" DestinationFolder="$(IntermediateOutputPath)" />

<Delete Files="@(_FilesToDelete)" />

<Copy SourceFiles="@(_NuGetPackages)" DestinationFolder="$(_ReleaseDir)" />
<Copy SourceFiles="@(_ZipContent)" DestinationFolder="$(_ZipContentDir)%(RecursiveDir)" />
<Copy SourceFiles="@(_ReleaseContent)" DestinationFolder="$(_ReleaseDir)" />

<ZipDirectory SourceDirectory="$(_ZipContentDir)" DestinationFile="$(_ReleaseDir)PdfToSvg.NET.$(VersionPrefix).zip" />

<WriteLinesToFile File="$(_ReleaseDir)PublishNuGet.bat" Lines="$(_PublishScript)" Overwrite="true" />

<Message Importance="high" Text="Release package created in file:///$([System.IO.Path]::GetFullPath('$(_ReleaseDir)'))" />
</Target>

</Project>
9 changes: 9 additions & 0 deletions src/PdfToSvg.Packer/Readme.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
using System;

namespace PdfToSvg.Packer
{
public class Readme
{
// This project is used to prepare release packages.
}
}

0 comments on commit 75eb74a

Please sign in to comment.