ICU-20525 Enable Windows 'distrelease.ps1' to select which architecture to package

This commit is contained in:
Daniel Ju 2019-03-28 14:57:08 -07:00 committed by Daniel Ju
parent 5e95b31ad0
commit 1935801c3a

View file

@ -13,7 +13,7 @@
# (bring up Powershell ISE)
# cd C:\icu\icu4c\
# Set-ExecutionPolicy -Scope Process Unrestricted
# .\packaging\distrelease.ps1
# .\packaging\distrelease.ps1 -arch "x64 or x86"
#
# Will emit: c:\icu4c\icu\source\dist\icu-windows.zip
#
@ -22,6 +22,9 @@
# see https://docs.microsoft.com/powershell/module/microsoft.powershell.core/about/about_execution_policies?view=powershell-5.1&viewFallbackFrom=powershell-Microsoft.PowerShell.Core
# for more about execution policies.
Param(
[string]$arch = "x64" # use x64 as default
)
$icuDir = Split-Path -Path $MyInvocation.MyCommand.Definition -Parent
$icuDir = Resolve-Path -Path '$icuDir\..'
@ -35,11 +38,25 @@ Get-ChildItem -Path $source -ErrorAction SilentlyContinue | Remove-Item -Recurse
New-Item -Path $source -ItemType "directory" -ErrorAction SilentlyContinue
# copy required stuff
Copy-Item -Path "$icuDir\lib" -Destination $source -Recurse
Copy-Item -Path "$icuDir\lib64" -Destination $source -Recurse
if ($arch -eq "x64")
{
Copy-Item -Path "$icuDir\lib64" -Destination $source -Recurse
Copy-Item -Path "$icuDir\bin64" -Destination $source -Recurse
}
elseif ($arch -eq "x86")
{
Copy-Item -Path "$icuDir\lib" -Destination $source -Recurse
Copy-Item -Path "$icuDir\bin" -Destination $source -Recurse
}
else
{
$filename = $MyInvocation.MyCommand.Name;
echo "Invalid architecture."
echo "Usage: $filename -arch `"x64 or x86`""
exit
}
Copy-Item -Path "$icuDir\include" -Destination $source -Recurse
Copy-Item -Path "$icuDir\bin" -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