• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 # Copyright (C) 2016 and later: Unicode, Inc. and others.
2 # License & terms of use: http://www.unicode.org/copyright.html
3 #-------------------------
4 # Script: icu\packaging\distrelease.ps1
5 # Author: Steven R. Loomis
6 # Date: 2017-04-14
7 #-------------------------
8 #
9 # This builds a zipfile containing the *64 bit* Windows binaries.
10 # (Note: The zipfile does not include the UWP binaries.)
11 #
12 # Usage: (after building ICU using MSVC)
13 #  (bring up Powershell ISE)
14 #    cd C:\icu\icu4c\
15 #    Set-ExecutionPolicy -Scope Process Unrestricted
16 #    .\packaging\distrelease.ps1
17 #
18 # Will emit: c:\icu4c\icu\source\dist\icu-windows.zip
19 #
20 #
21 # You will get warnings from the execution policy and the script itself.
22 #  see https://docs.microsoft.com/powershell/module/microsoft.powershell.core/about/about_execution_policies?view=powershell-5.1&viewFallbackFrom=powershell-Microsoft.PowerShell.Core
23 #    for more about execution policies.
24 
25 
26 $icuDir = Split-Path -Path $MyInvocation.MyCommand.Definition -Parent
27 $icuDir = Resolve-Path -Path '$icuDir\..'
28 
29 echo  $icuDir
30 
31 # ok, create some work areas
32 New-Item -Path "$icuDir\source\dist" -ErrorAction SilentlyContinue -ItemType "directory"
33 $source = "$icuDir\source\dist\icu"
34 Get-ChildItem -Path $source -ErrorAction SilentlyContinue | Remove-Item -Recurse
35 New-Item -Path $source -ItemType "directory" -ErrorAction SilentlyContinue
36 
37 # copy required stuff
38 Copy-Item -Path "$icuDir\lib64" -Destination $source -Recurse
39 Copy-Item -Path "$icuDir\include" -Destination $source -Recurse
40 Copy-Item -Path "$icuDir\bin64" -Destination $source -Recurse
41 Copy-Item -Path "$icuDir\APIChangeReport.html" -Destination $source -Recurse
42 Copy-Item -Path "$icuDir\icu4c.css" -Destination $source -Recurse
43 Copy-Item -Path "$icuDir\LICENSE" -Destination $source -Recurse
44 Copy-Item -Path "$icuDir\readme.html" -Destination $source -Recurse
45 
46 
47 $destination = "$icuDir\source\dist\icu-windows.zip"
48 Remove-Item -Path $destination -ErrorAction Continue
49 Add-Type -assembly "system.io.compression.filesystem"
50 Echo $source
51 Echo $destination
52 [io.compression.zipfile]::CreateFromDirectory($source, $destination)
53 
54 echo $destination