Debian Codegraph @

src/vendor/azure-uamqp-c/build_all/packaging/windows/rebuild_nugets.cmd

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