Zachary Ware | 774ac37 | 2015-04-13 12:11:40 -0500 | [diff] [blame] | 1 | @setlocal
|
| 2 | @echo off
|
| 3 |
|
| 4 | set D=%~dp0
|
| 5 | set PCBUILD=%D%..\..\PCBuild\
|
| 6 |
|
| 7 | set HOST=
|
| 8 | set USER=
|
| 9 | set TARGET=
|
| 10 | set DRYRUN=false
|
| 11 |
|
| 12 | :CheckOpts
|
| 13 | if "%1" EQU "-h" goto Help
|
| 14 | if "%1" EQU "-o" (set HOST=%~2) && shift && shift && goto CheckOpts
|
| 15 | if "%1" EQU "--host" (set HOST=%~2) && shift && shift && goto CheckOpts
|
| 16 | if "%1" EQU "-u" (set USER=%~2) && shift && shift && goto CheckOpts
|
| 17 | if "%1" EQU "--user" (set USER=%~2) && shift && shift && goto CheckOpts
|
| 18 | if "%1" EQU "-t" (set TARGET=%~2) && shift && shift && goto CheckOpts
|
| 19 | if "%1" EQU "--target" (set TARGET=%~2) && shift && shift && goto CheckOpts
|
| 20 | if "%1" EQU "--dry-run" (set DRYRUN=true) && shift && goto CheckOpts
|
| 21 |
|
| 22 | if not defined PLINK where plink > "%TEMP%\plink.loc" 2> nul && set /P PLINK= < "%TEMP%\plink.loc" & del "%TEMP%\plink.loc"
|
| 23 | if not defined PLINK where /R "%ProgramFiles(x86)%\PuTTY" plink > "%TEMP%\plink.loc" 2> nul && set /P PLINK= < "%TEMP%\plink.loc" & del "%TEMP%\plink.loc"
|
| 24 | if not defined PLINK where /R "%ProgramFiles(x86)%" plink > "%TEMP%\plink.loc" 2> nul && set /P PLINK= < "%TEMP%\plink.loc" & del "%TEMP%\plink.loc"
|
| 25 | if not defined PLINK echo Cannot locate plink.exe & exit /B 1
|
| 26 | echo Found plink.exe at %PLINK%
|
| 27 |
|
| 28 | if not defined PSCP where pscp > "%TEMP%\pscp.loc" 2> nul && set /P pscp= < "%TEMP%\pscp.loc" & del "%TEMP%\pscp.loc"
|
| 29 | if not defined PSCP where /R "%ProgramFiles(x86)%\PuTTY" pscp > "%TEMP%\pscp.loc" 2> nul && set /P pscp= < "%TEMP%\pscp.loc" & del "%TEMP%\pscp.loc"
|
| 30 | if not defined PSCP where /R "%ProgramFiles(x86)%" pscp > "%TEMP%\pscp.loc" 2> nul && set /P pscp= < "%TEMP%\pscp.loc" & del "%TEMP%\pscp.loc"
|
| 31 | if not defined PSCP echo Cannot locate pscp.exe & exit /B 1
|
| 32 | echo Found pscp.exe at %PSCP%
|
| 33 |
|
| 34 | if not defined GPG where gpg2 > "%TEMP%\gpg.loc" 2> nul && set /P GPG= < "%TEMP%\gpg.loc" & del "%TEMP%\gpg.loc"
|
| 35 | if not defined GPG where /R "%PCBUILD%..\externals" gpg2 > "%TEMP%\gpg.loc" 2> nul && set /P GPG= < "%TEMP%\gpg.loc" & del "%TEMP%\gpg.loc"
|
| 36 | if not defined GPG echo Cannot locate gpg2.exe. Signatures will not be uploaded & pause
|
| 37 | echo Found gpg2.exe at %GPG%
|
| 38 |
|
| 39 | call "%PCBUILD%env.bat" > nul 2> nul
|
| 40 | pushd "%D%"
|
| 41 | msbuild /v:m /nologo uploadrelease.proj /t:Upload /p:Platform=x86
|
| 42 | msbuild /v:m /nologo uploadrelease.proj /t:Upload /p:Platform=x64 /p:IncludeDoc=false
|
| 43 | msbuild /v:m /nologo uploadrelease.proj /t:ShowHashes /p:Platform=x86
|
| 44 | msbuild /v:m /nologo uploadrelease.proj /t:ShowHashes /p:Platform=x64 /p:IncludeDoc=false
|
| 45 | popd
|
| 46 | exit /B 0
|
| 47 |
|
| 48 | :Help
|
| 49 | echo uploadrelease.bat --host HOST --user USERNAME [--target TARGET] [--dry-run] [-h]
|
| 50 | echo.
|
| 51 | echo --host (-o) Specify the upload host (required)
|
| 52 | echo --user (-u) Specify the user on the host (required)
|
| 53 | echo --target (-t) Specify the target directory on the host
|
| 54 | echo --dry-run Display commands and filenames without executing them
|
| 55 | echo -h Display this help information
|
| 56 | echo.
|