| 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 |
where /q nuget.exe |
| 25 |
if not !errorlevel! == 0 ( |
| 26 |
@Echo Azure Shared Utility needs to download nuget.exe from https://www.nuget.org/nuget.exe |
| 27 |
@Echo https://www.nuget.org |
| 28 |
choice /C yn /M "Do you want to download and run nuget.exe?" |
| 29 |
if not !errorlevel!==1 goto :eof |
| 30 |
rem if nuget.exe is not found, then ask user |
| 31 |
Powershell.exe wget -outf nuget.exe https://nuget.org/nuget.exe |
| 32 |
if not exist .\nuget.exe ( |
| 33 |
echo nuget does not exist |
| 34 |
exit /b 1 |
| 35 |
) |
| 36 |
) |
| 37 |
|
| 38 |
set build-path=%build-root%\cmake |
| 39 |
|
| 40 |
echo Build root is %build-root% |
| 41 |
echo Build path is %build-path% |
| 42 |
echo Client root is %client-root% |
| 43 |
|
| 44 |
if exist %build-path%\shared-util_output ( |
| 45 |
rmdir /s/q %build-path%\shared-util_output |
| 46 |
rem no error checking |
| 47 |
) |
| 48 |
|
| 49 |
echo checking for nupkg |
| 50 |
if exist %build-root%\build_all\packaging\windows\*.nupkg ( |
| 51 |
echo deleting nupkg |
| 52 |
del %build-root%\build_all\packaging\windows\*.nupkg |
| 53 |
) |
| 54 |
|
| 55 |
rem ----------------------------------------------------------------------------- |
| 56 |
rem -- build binaries |
| 57 |
rem ----------------------------------------------------------------------------- |
| 58 |
|
| 59 |
mkdir %build-path%\shared-util_output |
| 60 |
rem no error checking |
| 61 |
|
| 62 |
call %build-root%\build_all\windows\build.cmd --make_nuget yes |
| 63 |
if not !ERRORLEVEL!==0 exit /b !ERRORLEVEL! |
| 64 |
|
| 65 |
rem ----------------------------------------------------------------------------- |
| 66 |
rem -- Copy Win32 binaries |
| 67 |
rem ----------------------------------------------------------------------------- |
| 68 |
|
| 69 |
rem -- Copy all Win32 files from cmake build directory to the repo directory |
| 70 |
xcopy /q /y /R %build-path%\shared-util_Win32\Debug\*.* %build-path%\shared-util_output\win32\debug\*.* |
| 71 |
if !ERRORLEVEL! neq 0 exit /b !ERRORLEVEL! |
| 72 |
|
| 73 |
rem -- Copy all Win32 Release files from cmake build directory to the repo directory |
| 74 |
xcopy /q /y /R %build-path%\shared-util_Win32\Release\*.* %build-path%\shared-util_output\win32\Release\*.* |
| 75 |
if !ERRORLEVEL! neq 0 exit /b !ERRORLEVEL! |
| 76 |
|
| 77 |
rem ----------------------------------------------------------------------------- |
| 78 |
rem -- Copy x64 binaries |
| 79 |
rem ----------------------------------------------------------------------------- |
| 80 |
|
| 81 |
rem -- Copy all x64 files from cmake build directory to the repo directory |
| 82 |
xcopy /q /y /R %build-path%\shared-util_x64\Debug\*.* %build-path%\shared-util_output\x64\debug\*.* |
| 83 |
if !ERRORLEVEL! neq 0 exit /b !ERRORLEVEL! |
| 84 |
|
| 85 |
rem -- Copy all x64 Release files from cmake build directory to the repo directory |
| 86 |
xcopy /q /y /R %build-path%\shared-util_x64\Release\*.* %build-path%\shared-util_output\x64\Release\*.* |
| 87 |
if !ERRORLEVEL! neq 0 exit /b !ERRORLEVEL! |
| 88 |
|
| 89 |
rem ----------------------------------------------------------------------------- |
| 90 |
rem -- Copy x64 binaries |
| 91 |
rem ----------------------------------------------------------------------------- |
| 92 |
|
| 93 |
rem -- Copy all x64 files from cmake build directory to the repo directory |
| 94 |
xcopy /q /y /R %build-path%\shared-util_arm\Debug\*.* %build-path%\shared-util_output\arm\debug\*.* |
| 95 |
if !ERRORLEVEL! neq 0 exit /b !ERRORLEVEL! |
| 96 |
|
| 97 |
rem -- Copy all x64 Release files from cmake build directory to the repo directory |
| 98 |
xcopy /q /y /R %build-path%\shared-util_arm\Release\*.* %build-path%\shared-util_output\arm\Release\*.* |
| 99 |
if !ERRORLEVEL! neq 0 exit /b !ERRORLEVEL! |
| 100 |
|
| 101 |
rem -- Package Nuget |
| 102 |
nuget pack %build-root%\build_all\packaging\windows\Microsoft.Azure.C.SharedUtility.nuspec -OutputDirectory %build-root%\build_all\packaging\windows |
| 103 |
|
| 104 |
rmdir %build-path%\shared-util_output /S /Q |
| 105 |
|
| 106 |
echo done |