From 8d917a5a266c14b42075bc427d498b75cf55731b Mon Sep 17 00:00:00 2001 From: "Steven R. Loomis" <srl@icu-project.org> Date: Wed, 11 Oct 2017 20:47:18 +0000 Subject: [PATCH] ICU-13147 add a PowerShell script to build Windows release zips X-SVN-Rev: 40613 --- .gitattributes | 1 + icu4c/packaging/distrelease.ps1 | 53 +++++++++++++++++++++++++++++++++ 2 files changed, 54 insertions(+) create mode 100644 icu4c/packaging/distrelease.ps1 diff --git a/.gitattributes b/.gitattributes index 3426db2c882..5d860b96486 100644 --- a/.gitattributes +++ b/.gitattributes @@ -49,6 +49,7 @@ README text !eol *.tri2 -text icu4c/icu4c.css -text +icu4c/packaging/distrelease.ps1 -text icu4c/source/aclocal.m4 -text icu4c/source/config/m4/icu-conditional.m4 -text icu4c/source/data/curr/pool.res -text diff --git a/icu4c/packaging/distrelease.ps1 b/icu4c/packaging/distrelease.ps1 new file mode 100644 index 00000000000..34e54bc28bc --- /dev/null +++ b/icu4c/packaging/distrelease.ps1 @@ -0,0 +1,53 @@ +# Copyright (C) 2016 and later: Unicode, Inc. and others. +# License & terms of use: http://www.unicode.org/copyright.html +#------------------------- +# Script: icu\packaging\distrelease.ps1 +# Author: Steven R. Loomis +# Date: 2017-04-14 +#------------------------- +# +# This builds a zipfile containing the *64 bit* Windows binary +# +# Usage: (after building ICU using MSVC) +# (bring up Powershell ISE) +# cd C:\icu\icu4c\ +# Set-ExecutionPolicy -Scope Process AllSigned +# .\packaging\distrelease.ps1 +# +# Will emit: c:\icu4c\icu\source\dist\icu-windows.zip +# +# +# You will get warnings from the execution policy and the script itself. +# see https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_execution_policies?view=powershell-5.1&viewFallbackFrom=powershell-Microsoft.PowerShell.Core +# for more about execution policies. + + +$icuDir = Split-Path -Path $MyInvocation.MyCommand.Definition -Parent +$icuDir = Resolve-Path -Path '$icuDir\..' + +echo $icuDir + +# ok, create some work areas +New-Item -Path "$icuDir\source\dist" -ErrorAction SilentlyContinue -ItemType "directory" +$source = "$icuDir\source\dist\icu" +Get-ChildItem -Path $source -ErrorAction SilentlyContinue | Remove-Item -Recurse +New-Item -Path $source -ItemType "directory" -ErrorAction SilentlyContinue + +# copy required stuff +Copy-Item -Path "$icuDir\lib64" -Destination $source -Recurse +Copy-Item -Path "$icuDir\include" -Destination $source -Recurse +Copy-Item -Path "$icuDir\bin64" -Destination $source -Recurse +Copy-Item -Path "$icuDir\APIChangeReport.html" -Destination $source -Recurse +Copy-Item -Path "$icuDir\icu4c.css" -Destination $source -Recurse +Copy-Item -Path "$icuDir\LICENSE" -Destination $source -Recurse +Copy-Item -Path "$icuDir\readme.html" -Destination $source -Recurse + + +$destination = "$icuDir\source\dist\icu-windows.zip" +Remove-Item -Path $destination -ErrorAction Continue +Add-Type -assembly "system.io.compression.filesystem" +Echo $source +Echo $destination +[io.compression.zipfile]::CreateFromDirectory($source, $destination) + +echo $destination \ No newline at end of file -- 2.40.0