-
Notifications
You must be signed in to change notification settings - Fork 61
/
rebuild_nugets.cmd
106 lines (79 loc) · 4 KB
/
rebuild_nugets.cmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
@REM Copyright (c) Microsoft. All rights reserved.
@REM Licensed under the MIT license. See LICENSE file in the project root for full license information.
@setlocal EnableExtensions EnableDelayedExpansion
@echo off
rem -----------------------------------------------------------------------------
rem -- setup path information
rem -----------------------------------------------------------------------------
set current-path=%~dp0
rem // remove trailing slash
set current-path=%current-path:~0,-1%
echo Current Path: %current-path%
set build-root=%current-path%\..\..\..
rem // resolve to fully qualified path
for %%i in ("%build-root%") do set build-root=%%~fi
set client-root=%current-path%\..\..\..
for %%i in ("%client-root%") do set client-root=%%~fi
rem -----------------------------------------------------------------------------
rem -- check prerequisites and clean directories
rem -----------------------------------------------------------------------------
where /q nuget.exe
if not !errorlevel! == 0 (
@Echo Azure Amqp needs to download nuget.exe from https://www.nuget.org/nuget.exe
@Echo https://www.nuget.org
choice /C yn /M "Do you want to download and run nuget.exe?"
if not !errorlevel!==1 goto :eof
rem if nuget.exe is not found, then ask user
Powershell.exe wget -outf nuget.exe https://nuget.org/nuget.exe
if not exist .\nuget.exe (
echo nuget does not exist
exit /b 1
)
)
set build-path=%build-root%\cmake
if exist %build-path%\azure_amqp_output (
rmdir /s/q %build-path%\azure_amqp_output
rem no error checking
)
rem -----------------------------------------------------------------------------
rem -- build project
rem -----------------------------------------------------------------------------
call %build-root%\build_all\windows\build.cmd --make_nuget yes
rem -----------------------------------------------------------------------------
rem -- Copy Win32 binaries
rem -----------------------------------------------------------------------------
rem -- Copy all Win32 files from cmake build directory to the repo directory
echo copying %build-path%\uamqp_win32\win32\debug
rem -- Copy all Win32 files from cmake build directory to the repo directory
xcopy /q /y /R %build-path%\uamqp_win32\Debug\*.* %build-path%\azure_amqp_output\win32\debug\*.*
if !ERRORLEVEL! neq 0 exit /b !ERRORLEVEL!
rem -- Copy all Win32 Release files from cmake build directory to the repo directory
xcopy /q /y /R %build-path%\uamqp_win32\Release\*.* %build-path%\azure_amqp_output\win32\Release\*.*
if !ERRORLEVEL! neq 0 exit /b !ERRORLEVEL!
rem -----------------------------------------------------------------------------
rem -- build with CMAKE x64
rem -----------------------------------------------------------------------------
rem -- Copy all x64 files from cmake build directory to the repo directory
xcopy /q /y /R %build-path%\uamqp_x64\Debug\*.* %build-path%\azure_amqp_output\x64\debug\*.*
if !ERRORLEVEL! neq 0 exit /b !ERRORLEVEL!
rem -- Copy all x64 Release files from cmake build directory to the repo directory
xcopy /q /y /R %build-path%\uamqp_x64\Release\*.* %build-path%\azure_amqp_output\x64\Release\*.*
if !ERRORLEVEL! neq 0 exit /b !ERRORLEVEL!
rem -----------------------------------------------------------------------------
rem -- build with CMAKE ARM
rem -----------------------------------------------------------------------------
rem -- Copy all ARM files from cmake build directory to the repo directory
xcopy /q /y /R %build-path%\uamqp_arm\Debug\*.* %build-path%\azure_amqp_output\arm\debug\*.*
if !ERRORLEVEL! neq 0 exit /b !ERRORLEVEL!
rem -- Copy all x64 Release files from cmake build directory to the repo directory
xcopy /q /y /R %build-path%\uamqp_arm\Release\*.* %build-path%\azure_amqp_output\arm\Release\*.*
if !ERRORLEVEL! neq 0 exit /b !ERRORLEVEL!
if exist *.nupkg (
del *.nupkg
)
rem -- Package Nuget
nuget pack %build-root%\build_all\packaging\windows\Microsoft.Azure.uamqp.nuspec -OutputDirectory %build-root%\build_all\packaging\windows
rmdir /s/q %build-path%\azure_amqp_output
popd
goto :eof
echo done