From ecdcfdc8130c16fb8543f6a30d8ff7966d58cd9d Mon Sep 17 00:00:00 2001 From: Douglas Moore Date: Thu, 21 Jul 2016 08:07:31 -0400 Subject: [PATCH] Change line endings; improve package generation CreateFromDirectory fails if there is already a zip file, so we remove it before hand. We generate the archive with the `inform-*.*.*` root directory (before only its contents were included), and we make sure to copy the LICENSE and README.md files into the directory before zipping. --- dist/package.ps1 | 38 ++++++++++++++++++++------------------ 1 file changed, 20 insertions(+), 18 deletions(-) diff --git a/dist/package.ps1 b/dist/package.ps1 index 7812d4f..529c2b6 100644 --- a/dist/package.ps1 +++ b/dist/package.ps1 @@ -1,18 +1,20 @@ -$version = (cmake . -Bbuild/production -DCMAKE_BUILD_TYPE=Release -G "NMake Makefiles" | Select-String '-- inform version: ') -$version = $version.ToString().Split(' ')[3] - -$prefix = "inform-$version" -$target = "dist/$prefix" -$archive = "$($target)_win-amd64.zip" - -cmake . -Bbuild/production -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX="$target" | Out-Null -cd build/production -nmake -test/inform_unittest.exe -nmake install -cd ../.. - - -Add-Type -Assembly System.IO.Compression.FileSystem -$compressionLevel = [System.IO.Compression.CompressionLevel]::Optimal -[System.IO.Compression.ZipFile]::CreateFromDirectory($target, $archive, $compressionLevel, $false) +$version = (cmake . -Bbuild/production -DCMAKE_BUILD_TYPE=Release -G "NMake Makefiles" | Select-String '-- inform version: ') +$version = $version.ToString().Split(' ')[3] + +$prefix = "inform-$version" +$target = "dist/$prefix" +$archive = "$($target)_win-amd64.zip" + +cmake . -Bbuild/production -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX="$target" | Out-Null +cd build/production +nmake +test/inform_unittest.exe +nmake install +cd ../.. +Copy-Item LICENSE $target +Copy-Item README.md $target + +Remove-Item -force $archive +Add-Type -Assembly System.IO.Compression.FileSystem +$compressionLevel = [System.IO.Compression.CompressionLevel]::Optimal +[System.IO.Compression.ZipFile]::CreateFromDirectory($target, $archive, $compressionLevel, $true)