@echo off

echo Building dependencies...

if exist lib (rd lib /q /s)
md lib
cd lib
md Debug
md Release
cd ../
REM ######################################################################################################
echo Building protobuf...

if exist protobuf (rd protobuf /q /s)
git clone -b 2.7.0 https://github.com/google/protobuf.git

cd protobuf/cmake
md build
cd build
cmake -G "Visual Studio 14 Win64" -Dprotobuf_BUILD_SHARED_LIBS=ON -Dprotobuf_BUILD_TESTS=OFF ..
"%VS140COMNTOOLS%..\IDE\Devenv" protobuf.sln /build "Debug|x64"
"%VS140COMNTOOLS%..\IDE\Devenv" protobuf.sln /build "Release|x64"
copy Debug\*.dll ..\..\..\lib\Debug /Y
copy Debug\*.lib ..\..\..\lib\Debug /Y
copy Release\*.dll ..\..\..\lib\Release /Y
copy Release\*.lib ..\..\..\lib\Release /Y
cd ..\..\..\
REM ######################################################################################################
echo Building libevent...

if exist libevent (rd libevent /q /s)
git clone -b master https://github.com/libevent/libevent.git

cd libevent
md build
cd build
cmake -G "Visual Studio 14 Win64" -DEVENT__DISABLE_OPENSSL=ON ..
"%VS140COMNTOOLS%..\IDE\Devenv" libevent.sln /build "Debug|x64" /project event_core_static.vcxproj
"%VS140COMNTOOLS%..\IDE\Devenv" libevent.sln /build "Release|x64" /project event_core_static.vcxproj
"%VS140COMNTOOLS%..\IDE\Devenv" libevent.sln /build "Debug|x64" /project event_static.vcxproj
"%VS140COMNTOOLS%..\IDE\Devenv" libevent.sln /build "Release|x64" /project event_static.vcxproj
"%VS140COMNTOOLS%..\IDE\Devenv" libevent.sln /build "Debug|x64" /project event_extra_static.vcxproj
"%VS140COMNTOOLS%..\IDE\Devenv" libevent.sln /build "Release|x64" /project event_extra_static.vcxproj
copy lib\Debug\*.lib ..\..\lib\Debug /Y
copy lib\Release\*.lib ..\..\lib\Release /Y
cd ..\..\
REM ######################################################################################################
echo Building glog...
if exist glog (rd glog /q /s)
git clone -b v035 https://github.com/google/glog.git

cd glog
md build
cd build
cmake -G "Visual Studio 14 Win64" ..
"%VS140COMNTOOLS%..\IDE\Devenv" google-glog.sln /build "Debug|x64"
"%VS140COMNTOOLS%..\IDE\Devenv" google-glog.sln /build "Release|x64"
copy Debug\*.lib ..\..\lib\Debug /Y
copy Release\*.lib ..\..\lib\Release /Y
cd ..\..\
REM ######################################################################################################
echo Building evpp...

REM close vcpkg setup task
tarkkill /IM /F /T Microsoft.VisualStudio.Setup.Configuration.Console.exe
if exist evpp (rd evpp /q /s)
git clone -b master https://github.com/Qihoo360/evpp.git

cd evpp
md build
cd build
git clone https://github.com/Microsoft/vcpkg.git
cd vcpkg
call bootstrap-vcpkg.bat
vcpkg install evpp:x64-windows

copy packages\evpp_x64-windows\debug\lib\evpp*.lib ..\..\..\lib\Debug /Y
copy packages\evpp_x64-windows\lib\evpp*.lib ..\..\..\lib\Release /Y
cd ..\..\..\
REM ####################################################################################################
REM back to root dir
cd ../

@echo off

echo Building dependencies...

if exist lib (rd lib /q /s)
md lib
cd lib
md Debug
md Release
cd ../
REM ######################################################################################################
echo Building protobuf...

if exist protobuf (rd protobuf /q /s)
git clone -b 2.7.0 https://github.com/google/protobuf.git

cd protobuf/cmake
md build
cd build
cmake -G "Visual Studio 14 Win64" -Dprotobuf_BUILD_SHARED_LIBS=ON -Dprotobuf_BUILD_TESTS=OFF ..
"%VS140COMNTOOLS%..\IDE\Devenv" protobuf.sln /build "Debug|x64"
"%VS140COMNTOOLS%..\IDE\Devenv" protobuf.sln /build "Release|x64"
copy Debug\*.dll ..\..\..\lib\Debug /Y
copy Debug\*.lib ..\..\..\lib\Debug /Y
copy Release\*.dll ..\..\..\lib\Release /Y
copy Release\*.lib ..\..\..\lib\Release /Y
cd ..\..\..\
REM ######################################################################################################
echo Building libevent...

if exist libevent (rd libevent /q /s)
git clone -b master https://github.com/libevent/libevent.git

cd libevent
md build
cd build
cmake -G "Visual Studio 14 Win64" -DEVENT__DISABLE_OPENSSL=ON ..
"%VS140COMNTOOLS%..\IDE\Devenv" libevent.sln /build "Debug|x64" /project event_core_static.vcxproj
"%VS140COMNTOOLS%..\IDE\Devenv" libevent.sln /build "Release|x64" /project event_core_static.vcxproj
"%VS140COMNTOOLS%..\IDE\Devenv" libevent.sln /build "Debug|x64" /project event_static.vcxproj
"%VS140COMNTOOLS%..\IDE\Devenv" libevent.sln /build "Release|x64" /project event_static.vcxproj
"%VS140COMNTOOLS%..\IDE\Devenv" libevent.sln /build "Debug|x64" /project event_extra_static.vcxproj
"%VS140COMNTOOLS%..\IDE\Devenv" libevent.sln /build "Release|x64" /project event_extra_static.vcxproj
copy lib\Debug\*.lib ..\..\lib\Debug /Y
copy lib\Release\*.lib ..\..\lib\Release /Y
cd ..\..\
REM ######################################################################################################
echo Building glog...
if exist glog (rd glog /q /s)
git clone -b v035 https://github.com/google/glog.git

cd glog
md build
cd build
cmake -G "Visual Studio 14 Win64" ..
"%VS140COMNTOOLS%..\IDE\Devenv" google-glog.sln /build "Debug|x64"
"%VS140COMNTOOLS%..\IDE\Devenv" google-glog.sln /build "Release|x64"
copy Debug\*.lib ..\..\lib\Debug /Y
copy Release\*.lib ..\..\lib\Release /Y
cd ..\..\
REM ######################################################################################################
echo Building evpp...

if exist evpp (rd evpp /q /s)
git clone -b master https://github.com/ArkGame/evpp.git

cd evpp
cd vsprojects
"%VS140COMNTOOLS%..\IDE\Devenv" libevpp.sln /build "Debug|x64" /project evpp_static.vcxproj
"%VS140COMNTOOLS%..\IDE\Devenv" libevpp.sln /build "Release|x64" /project evpp_static.vcxproj
cd ..\..\
REM ####################################################################################################
REM back to root dir
cd ../

modify evpp use a clone

modify evpp use a clone

Former-commit-id: 9e4ec17fa8552f293412ef4dc61e8ae85d34603c
Former-commit-id: 9b4f2edb594b0a60d45ebd86510d9c6dea722395
Former-commit-id: 89ec420ad4c791e20c7dd08cc7eafb2a4edfeb91


mkdir build
cd build

set CONFIGURATION=Release

rem cmake .. -G "%CMAKE_GENERATOR%" ^
rem          -DCMAKE_BUILD_TYPE:STRING=%CONFIGURATION% ^
rem          -DCMAKE_PREFIX_PATH:PATH="%PREFIX%" ^
rem          -DCMAKE_INSTALL_PREFIX:PATH="%LIBRARY_PREFIX" ^
rem          -DBOOST_ROOT:PATH="%LIBRARY_PREFIX%" ^
rem          -DWITH_BLOSC:BOOL=ON ^
rem          -DWITH_ZLIB:BOOL=ON ^
rem          -DWITH_BZIP2:BOOL=ON ^
rem          -DWITH_XZ:BOOL=ON ^
rem          -DPYTHON_EXECUTABLE:PATH="%PYTHON%"

cmake .. -G "%CMAKE_GENERATOR%" ^
         -DCMAKE_BUILD_TYPE=%CONFIGURATION% ^
         -DCMAKE_PREFIX_PATH="%PREFIX%" ^
         -DCMAKE_INSTALL_PREFIX="%LIBRARY_PREFIX" ^
         -DBOOST_ROOT="%LIBRARY_PREFIX%" ^
         -DWITH_BLOSC=ON ^
         -DWITH_ZLIB=ON ^
         -DWITH_BZIP2=ON ^
         -DWITH_XZ=ON ^
         -DWITHIN_TRAVIS=OFF ^
         -DPYTHON_EXECUTABLE=:PATH"%PYTHON%"

cmake --build . --config %CONFIGURATION%

rem set PY_VER=(python -c "import sys; print('{}.{}'.format(*sys.version_info[:2]))")
xcopy %SRC_DIR%/build/python/z5py %LIBRARY%/lib/python%PY_VER%/site-packages/ /E

mkdir build
cd build

set CONFIGURATION=Release

rem cmake .. -G "%CMAKE_GENERATOR%" ^
rem          -DCMAKE_BUILD_TYPE:STRING=%CONFIGURATION% ^
rem          -DCMAKE_PREFIX_PATH:PATH="%PREFIX%" ^
rem          -DCMAKE_INSTALL_PREFIX:PATH="%LIBRARY_PREFIX" ^
rem          -DBOOST_ROOT:PATH="%LIBRARY_PREFIX%" ^
rem          -DWITH_BLOSC:BOOL=ON ^
rem          -DWITH_ZLIB:BOOL=ON ^
rem          -DWITH_BZIP2:BOOL=ON ^
rem          -DWITH_XZ:BOOL=ON ^
rem          -DPYTHON_EXECUTABLE:PATH="%PYTHON%"

cmake .. -G "%CMAKE_GENERATOR%" ^
         -DCMAKE_BUILD_TYPE=%CONFIGURATION% ^
         -DCMAKE_PREFIX_PATH="%PREFIX%" ^
         -DCMAKE_INSTALL_PREFIX="%LIBRARY_PREFIX" ^
         -DBOOST_ROOT="%LIBRARY_PREFIX%" ^
         -DWITH_BLOSC=ON ^
         -DWITH_ZLIB=ON ^
         -DWITH_BZIP2=ON ^
         -DWITH_XZ=ON ^
         -DWITHIN_TRAVIS=OFF ^
         -DPYTHON_EXECUTABLE="%PYTHON%"

cmake --build . --config %CONFIGURATION%

rem set PY_VER=(python -c "import sys; print('{}.{}'.format(*sys.version_info[:2]))")
xcopy %SRC_DIR%/build/python/z5py %LIBRARY%/lib/python%PY_VER%/site-packages/ /E

Fix typo in bld.bat

Fix typo in bld.bat


call "%VS140COMNTOOLS%\..\..\VC\vcvarsall.bat" x64
set DISTUTILS_USE_SDK=1
set MSSdk=1
"%PYTHON%" setup.py install
if errorlevel 1 exit 1

if "%ARCH%" == "32" (set PLATFORM=x86) else (set PLATFORM=x64)
call "%VS140COMNTOOLS%\..\..\VC\vcvarsall.bat" %PLATFORM%
set DISTUTILS_USE_SDK=1
set MSSdk=1
"%PYTHON%" setup.py install
if errorlevel 1 exit 1

Fix conda build on 32-bit Windows

Fix conda build on 32-bit Windows


REM work in progress
REM Setup a non-production BigFix Eval Server with SQL Developer Edition.

REM http://software.bigfix.com/download/bes/95/BigFix-BES-9.5.9.62.exe
REM http://download.microsoft.com/download/2/5/0/2508F7B4-6DDE-4C3E-B1FA-E1EB66F2F79F/SQLServer2016-SSEI-Dev.exe

SET BASEFOLDER=C:\tmp

REM Make folder if not existing:  https://stackoverflow.com/questions/4165387/create-folder-with-batch-but-only-if-it-doesnt-already-exist
if not exist "%BASEFOLDER%" mkdir %BASEFOLDER%

REM Open folder:
start "" %BASEFOLDER%

REM https://github.com/jgstew/bigfix-content/blob/master/fixlet/Install%20SQL%20Server%20Management%20Studio%2016.5.1%20-%20Windows.bes
REM Download SQL Server Management Studio:
start "" powershell -command "& { (New-Object Net.WebClient).DownloadFile('https://download.microsoft.com/download/f/e/b/feb0e6be-21ce-4f98-abee-d74065e32d0a/SSMS-Setup-ENU.exe', '%BASEFOLDER%\SSMS-Setup-ENU.exe') }" -ExecutionPolicy Bypass

REM Download BigFix Root Server:
start "" powershell -command "& { (New-Object Net.WebClient).DownloadFile('http://software.bigfix.com/download/bes/100/BigFix-BES-10.0.0.133.exe', '%BASEFOLDER%\BigFix-BES.exe') }" -ExecutionPolicy Bypass

REM Download BigFix Fixlet Debugger:
REM http://software.bigfix.com/download/bes/100/util/QNA10.0.0.133.zip
start "" powershell -command "& { (New-Object Net.WebClient).DownloadFile('http://software.bigfix.com/download/bes/100/util/QNA10.0.0.133.zip', '%BASEFOLDER%\BigFix-FixletDebugger.zip') }" -ExecutionPolicy Bypass

REM Download SQLServer Developer Edition:
powershell -command "& { (New-Object Net.WebClient).DownloadFile('https://download.microsoft.com/download/5/A/7/5A7065A2-C81C-4A31-9972-8A31AC9388C1/SQLServer2017-SSEI-Dev.exe', '%BASEFOLDER%\SQLServer-SSEI-Dev.exe') }" -ExecutionPolicy Bypass
REM Install SQLServer Developer Edition:
REM https://docs.microsoft.com/en-us/sql/database-engine/install-windows/install-sql-server-from-the-command-prompt?view=sql-server-2017
REM Download Commnad:
%BASEFOLDER%\SQLServer-SSEI-Dev.exe /MEDIAPATH="%BASEFOLDER%" /ACTION=Download /LANGUAGE=en-US /MEDIATYPE=CAB /QUIET

REM Install Command: (interactive)
%BASEFOLDER%\SQLServer-SSEI-Dev.exe /ACTION=Install /MEDIAPATH=C:\tmp /IACCEPTSQLSERVERLICENSETERMS /LANGUAGE=en-US

REM https://download.microsoft.com/download/0/5/B/05B2AF8F-906F-4C57-A58E-5780F64F9D62/SSMS-Setup-ENU.exe
REM Install SQL Server Management Studio:
%BASEFOLDER%\SSMS-Setup-ENU.exe /install /quiet /norestart

REM press any key to continue....
pause

REM  TODO: configure SQL SA account?
REM  TODO: configure SQL login from AD account / local win admin account?
REM  TODO: open firewall for MSSQL to local subnet ?
REM  TODO: open firewall for BigFix to local subnet+ ?
REM  TODO: create local MO account
REM  TODO: BES Admin: create BES Admin Password
REM  TODO: BES Admin: set recommended BES Admin Settings
REM  TODO: BES Admin: create encryption keys for client encryption in BES Admin
REM  TODO: BES Admin: schedule BES Property ID Mapper
REM  TODO: configure REST API creds - Web Reports - etc
REM  TODO: create custom site(s) `Shared` `Dashboards` `Private`
REM  TODO: create roles
REM  TODO: enable sites, subscribe computers
REM  TODO: install adobe flash for IE for root or console systems (DISM)
REM  TODO: setup download plugins (enable analyses, deploy Enable Encryption for Clients for root/relays)
REM  TODO:

REM work in progress
REM Setup a non-production BigFix Eval Server with SQL Developer Edition.

REM http://software.bigfix.com/download/bes/95/BigFix-BES-9.5.9.62.exe
REM http://download.microsoft.com/download/2/5/0/2508F7B4-6DDE-4C3E-B1FA-E1EB66F2F79F/SQLServer2016-SSEI-Dev.exe

SET BASEFOLDER=C:\tmp

REM Make folder if not existing:  https://stackoverflow.com/questions/4165387/create-folder-with-batch-but-only-if-it-doesnt-already-exist
if not exist "%BASEFOLDER%" mkdir %BASEFOLDER%

REM Open folder:
start "" %BASEFOLDER%

REM https://github.com/jgstew/bigfix-content/blob/master/fixlet/Install%20SQL%20Server%20Management%20Studio%2016.5.1%20-%20Windows.bes
REM Download SQL Server Management Studio:
start "" powershell -command "& { (New-Object Net.WebClient).DownloadFile('https://download.microsoft.com/download/f/e/b/feb0e6be-21ce-4f98-abee-d74065e32d0a/SSMS-Setup-ENU.exe', '%BASEFOLDER%\SSMS-Setup-ENU.exe') }" -ExecutionPolicy Bypass

REM Download BigFix Root Server:
start "" powershell -command "& { (New-Object Net.WebClient).DownloadFile('http://software.bigfix.com/download/bes/100/BigFix-BES-10.0.0.133.exe', '%BASEFOLDER%\BigFix-BES.exe') }" -ExecutionPolicy Bypass

REM Download BigFix Fixlet Debugger:
REM http://software.bigfix.com/download/bes/100/util/QNA10.0.0.133.zip
start "" powershell -command "& { (New-Object Net.WebClient).DownloadFile('http://software.bigfix.com/download/bes/100/util/QNA10.0.0.133.zip', '%BASEFOLDER%\BigFix-FixletDebugger.zip') }" -ExecutionPolicy Bypass

REM Download SQLServer Developer Edition:
powershell -command "& { (New-Object Net.WebClient).DownloadFile('https://download.microsoft.com/download/5/A/7/5A7065A2-C81C-4A31-9972-8A31AC9388C1/SQLServer2017-SSEI-Dev.exe', '%BASEFOLDER%\SQLServer-SSEI-Dev.exe') }" -ExecutionPolicy Bypass
REM Install SQLServer Developer Edition:
REM https://docs.microsoft.com/en-us/sql/database-engine/install-windows/install-sql-server-from-the-command-prompt?view=sql-server-2017
REM Download Commnad:
%BASEFOLDER%\SQLServer-SSEI-Dev.exe /MEDIAPATH="%BASEFOLDER%" /ACTION=Download /LANGUAGE=en-US /MEDIATYPE=CAB /QUIET

REM Install Command: (interactive)
%BASEFOLDER%\SQLServer-SSEI-Dev.exe /ACTION=Install /MEDIAPATH=C:\tmp /IACCEPTSQLSERVERLICENSETERMS /LANGUAGE=en-US

REM https://download.microsoft.com/download/0/5/B/05B2AF8F-906F-4C57-A58E-5780F64F9D62/SSMS-Setup-ENU.exe
REM Install SQL Server Management Studio:
%BASEFOLDER%\SSMS-Setup-ENU.exe /install /quiet /norestart

REM press any key to continue....
pause

REM  TODO: configure SQL SA account?
REM  TODO: configure SQL login from AD account / local win admin account?
REM  TODO: open firewall for MSSQL to local subnet ?
REM  TODO: open firewall for BigFix to local subnet+ ?
REM  TODO: create local MO account
REM  TODO: BES Admin: create BES Admin Password
REM  TODO: BES Admin: set recommended BES Admin Settings
REM  TODO: BES Admin: create encryption keys for client encryption in BES Admin
REM  TODO: BES Admin: schedule BES Property ID Mapper
REM  TODO: configure REST API creds - Web Reports - etc
REM  TODO: enable sites, subscribe computers
REM  TODO: setup download plugins (deploy Enable Encryption for Clients for root/relays, enable analyses)
REM  TODO: deploy actions to configure default client settings
REM  TODO: Activate Analyses: Wake-on-LAN Analysis, Download Plug-in Versions, BES Health Checks Analysis, BES Relay Status
REM  TODO: create custom site(s) `Shared` `Dashboards` `Private`
REM  TODO: create roles
REM  TODO: install adobe flash for IE for root or console systems (DISM)
REM  TODO:

Update bigfix_setup_root_eval.bat

Update bigfix_setup_root_eval.bat


Add shortcut script for running IronPython tests.


@rem Used by the buildbot "buildmsi" step.

cmd /c Tools\buildbot\external.bat
@rem build release versions of things
call "%VS90COMNTOOLS%vsvars32.bat"
if not exist ..\db-4.4.20\build_win32\release\libdb44s.lib (
  vcbuild db-4.4.20\build_win32\Berkeley_DB.sln /build Release /project db_static
)

@rem build Python
cmd /q/c Tools\buildbot\kill_python.bat
vcbuild /useenv PCbuild\pcbuild.sln "Release|Win32"

@rem build the documentation
bash.exe -c 'cd Doc;make PYTHON=python2.5 update htmlhelp'
"%ProgramFiles%\HTML Help Workshop\hhc.exe" Doc\build\htmlhelp\pydoc.hhp

@rem buold the MSI file
cd PC
nmake /f icons.mak
cd ..\Tools\msi
del *.msi
nmake /f msisupport.mak
%HOST_PYTHON% msi.py

@rem Used by the buildbot "buildmsi" step.

cmd /c Tools\buildbot\external.bat
@rem build release versions of things
call "%VS90COMNTOOLS%vsvars32.bat"

@rem build Python
cmd /q/c Tools\buildbot\kill_python.bat
vcbuild /useenv PCbuild\pcbuild.sln "Release|Win32"

@rem build the documentation
bash.exe -c 'cd Doc;make PYTHON=python2.5 update htmlhelp'
"%ProgramFiles%\HTML Help Workshop\hhc.exe" Doc\build\htmlhelp\pydoc.hhp

@rem buold the MSI file
cd PC
nmake /f icons.mak
cd ..\Tools\msi
del *.msi
nmake /f msisupport.mak
%HOST_PYTHON% msi.py

Remove the building of Berkeley DB step; _bsddb44.vcproj takes care of this for us now.


REM http://webcache.googleusercontent.com/search?q=cache:SjoPPpuQxuoJ:www.tcm.phy.cam.ac.uk/~mr349/cygwin_install.html+install+cygwin+ssh+commandline&cd=2&hl=nl&ct=clnk&gl=be&source=www.google.be

REM create the cygwin directory
cmd /c mkdir %SystemDrive%\cygwin

cmd /c bitsadmin /transfer CygwinSetupExe /download /priority normal http://www.cygwin.com/setup.exe %SystemDrive%\cygwin\cygwin-setup.exe

REM goto a temp directory
cd %SystemDrive%\windows\temp

REM run the installation
cmd /c %SystemDrive%\cygwin\cygwin-setup.exe -q -R %SystemDrive%\cygwin -P openssh,openssl,curl,cygrunsrv,wget,rebase,vim -s http://cygwin.mirrors.pair.com

%SystemDrive%\cygwin\bin\bash -c 'PATH=/usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin cygrunsrv -R sshd'

REM /bin/ash is the right shell for this command
cmd /c %SystemDrive%\cygwin\bin\ash -c /bin/rebaseall

cmd /c %SystemDrive%\cygwin\bin\bash -c 'PATH=/usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin mkgroup -l'>%SystemDrive%\cygwin\etc\group

cmd /c %SystemDrive%\cygwin\bin\bash -c 'PATH=/usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin mkpasswd -l'>%SystemDrive%\cygwin\etc\passwd

%SystemDrive%\cygwin\usr\bin\sleep 1

%SystemDrive%\cygwin\bin\bash -c 'PATH=/usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin /usr/bin/ssh-host-config -y -c "ntsecbinmode tty" -w "abc&&123!!" '

%SystemDrive%\cygwin\usr\bin\sleep 2

cmd /c if exist %Systemroot%\system32\netsh.exe netsh advfirewall firewall add rule name="SSHD" dir=in action=allow program="c:\cygwin\usr\sbin\sshd.exe" SSHD enable=yes

cmd /c if exist %Systemroot%\system32\netsh.exe netsh advfirewall firewall add rule name="ssh" dir=in action=allow protocol=TCP localport=22

%SystemDrive%\cygwin\usr\bin\sleep 2

net start sshd

# Fix corrupt recycle bin
# http://www.winhelponline.com/blog/fix-corrupted-recycle-bin-windows-7-vista/
cmd /c rd /s /q c:\$Recycle.bin

REM http://webcache.googleusercontent.com/search?q=cache:SjoPPpuQxuoJ:www.tcm.phy.cam.ac.uk/~mr349/cygwin_install.html+install+cygwin+ssh+commandline&cd=2&hl=nl&ct=clnk&gl=be&source=www.google.be

REM create the cygwin directory
cmd /c mkdir %SystemDrive%\cygwin

cmd /c bitsadmin /transfer CygwinSetupExe /download /priority normal http://www.cygwin.com/setup.exe %SystemDrive%\cygwin\cygwin-setup.exe

REM goto a temp directory
cd %SystemDrive%\windows\temp

REM run the installation
cmd /c %SystemDrive%\cygwin\cygwin-setup.exe -q -R %SystemDrive%\cygwin -P openssh,openssl,curl,cygrunsrv,wget,rebase,vim -s http://cygwin.mirrors.pair.com

%SystemDrive%\cygwin\bin\bash -c 'PATH=/usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin cygrunsrv -R sshd'

REM /bin/ash is the right shell for this command
cmd /c %SystemDrive%\cygwin\bin\ash -c /bin/rebaseall

cmd /c %SystemDrive%\cygwin\bin\bash -c 'PATH=/usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin mkgroup -l'>%SystemDrive%\cygwin\etc\group

cmd /c %SystemDrive%\cygwin\bin\bash -c 'PATH=/usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin mkpasswd -l'>%SystemDrive%\cygwin\etc\passwd

%SystemDrive%\cygwin\usr\bin\sleep 1

%SystemDrive%\cygwin\bin\bash -c 'PATH=/usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin /usr/bin/ssh-host-config -y -c "ntsecbinmode" -w "abc&&123!!" '

%SystemDrive%\cygwin\usr\bin\sleep 2

cmd /c if exist %Systemroot%\system32\netsh.exe netsh advfirewall firewall add rule name="SSHD" dir=in action=allow program="c:\cygwin\usr\sbin\sshd.exe" SSHD enable=yes

cmd /c if exist %Systemroot%\system32\netsh.exe netsh advfirewall firewall add rule name="ssh" dir=in action=allow protocol=TCP localport=22

%SystemDrive%\cygwin\usr\bin\sleep 2

net start sshd

# Fix corrupt recycle bin
# http://www.winhelponline.com/blog/fix-corrupted-recycle-bin-windows-7-vista/
cmd /c rd /s /q c:\$Recycle.bin

Remove CYGWIN=tty for Windows 7 SP1

Remove CYGWIN=tty for Windows 7 SP1


@echo off
REM Update source for glslang, spirv-tools, and shaderc

REM
REM Copyright 2016 The Android Open Source Project
REM Copyright (C) 2015 Valve Corporation
REM
REM Licensed under the Apache License, Version 2.0 (the "License");
REM you may not use this file except in compliance with the License.
REM You may obtain a copy of the License at
REM
REM      http://www.apache.org/licenses/LICENSE-2.0
REM
REM Unless required by applicable law or agreed to in writing, software
REM distributed under the License is distributed on an "AS IS" BASIS,
REM WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
REM See the License for the specific language governing permissions and
REM limitations under the License.
REM

setlocal EnableDelayedExpansion
set errorCode=0
set ANDROID_BUILD_DIR=%~dp0
set BUILD_DIR=%ANDROID_BUILD_DIR%..
set BASE_DIR=%BUILD_DIR%\external
set GLSLANG_DIR=%BASE_DIR%\glslang
set SPIRV_TOOLS_DIR=%BASE_DIR%\spirv-tools
set SHADERC_DIR=%BASE_DIR%\shaderc

for %%X in (where.exe) do (set FOUND=%%~$PATH:X)
if not defined FOUND (
   echo Dependency check failed:
   echo   where.exe not found
   echo   This script requires Windows Vista or later, which includes where.exe.
   set errorCode=1
)

where /q git.exe
if %ERRORLEVEL% equ 1 (
   echo Dependency check failed:
   echo   git.exe not found
   echo   Git for Windows can be downloaded here:  https://git-scm.com/download/win
   echo   Install and ensure git.exe makes it into your PATH
   set errorCode=1
)

where /q ndk-build.cmd
if %ERRORLEVEL% equ 1 (
   echo Dependency check failed:
   echo   ndk-build.cmd not found
   echo   Android NDK can be downloaded here:  http://developer.android.com/ndk/guides/setup.html
   echo   Install and ensure ndk-build.cmd makes it into your PATH
   set errorCode=1
)

REM ensure where is working with below false test
REM where /q foo
REM if %ERRORLEVEL% equ 1 (
REM echo foo
REM )

:main

if %errorCode% neq 0 (goto:error)

REM Read the target versions from external file, which is shared with Linux script

if not exist %ANDROID_BUILD_DIR%\glslang_revision_android (
   echo.
   echo Missing glslang_revision_android file. Place it in %ANDROID_BUILD_DIR%
   goto:error
)

if not exist %ANDROID_BUILD_DIR%\spirv-tools_revision_android (
   echo.
   echo Missing spirv-tools_revision_android file. Place it in %ANDROID_BUILD_DIR%
   set errorCode=1
   goto:error
)

if not exist %ANDROID_BUILD_DIR%\shaderc_revision_android (
   echo.
   echo Missing shaderc_revision_android file. Place it in %ANDROID_BUILD_DIR%
   set errorCode=1
   goto:error
)

set /p GLSLANG_REVISION= < glslang_revision_android
set /p SPIRV_TOOLS_REVISION= < spirv-tools_revision_android
set /p SHADERC_REVISION= < shaderc_revision_android
echo GLSLANG_REVISION=%GLSLANG_REVISION%
echo SPIRV_TOOLS_REVISION=%SPIRV_TOOLS_REVISION%
echo SHADERC_REVISION=%SHADERC_REVISION%

echo Creating and/or updating glslang, spirv-tools, shaderc in %BASE_DIR%

set sync-glslang=1
set sync-spirv-tools=1
set sync-shaderc=1
set build-shaderc=1

if %sync-glslang% equ 1 (
   if exist %GLSLANG_DIR% (
      rd /S /Q %GLSLANG_DIR%
   )
   if not exist %GLSLANG_DIR% (
      call:create_glslang
   )
   if %errorCode% neq 0 (goto:error)
   call:update_glslang
   if %errorCode% neq 0 (goto:error)
)

if %sync-spirv-tools% equ 1 (
   if exist %SPIRV_TOOLS_DIR% (
      rd /S /Q %SPIRV_TOOLS_DIR%
   )
   if %ERRORLEVEL% neq 0 (goto:error)
   if not exist %SPIRV_TOOLS_DIR% (
      call:create_spirv-tools
   )
   if %errorCode% neq 0 (goto:error)
   call:update_spirv-tools
   if %errorCode% neq 0 (goto:error)
)

if %sync-shaderc% equ 1 (
   if exist %SHADERC_DIR% (
      rd /S /Q %SHADERC_DIR%
   )
   if not exist %SHADERC_DIR% (
      call:create_shaderc
   )
   if %errorCode% neq 0 (goto:error)
   call:update_shaderc
   if %errorCode% neq 0 (goto:error)
)

if %build-shaderc% equ 1 (
   call:build_shaderc
   if %errorCode% neq 0 (goto:error)
)

echo.
echo Exiting
goto:finish

:error
echo.
echo Halting due to error
goto:finish

:finish
if not "%cd%\" == "%BUILD_DIR%" ( cd %BUILD_DIR% )
endlocal
goto:eof

REM // ======== Functions ======== //

:create_glslang
   echo.
   echo Creating local glslang repository %GLSLANG_DIR%
   mkdir %GLSLANG_DIR%
   cd %GLSLANG_DIR%
   git clone https://github.com/KhronosGroup/glslang.git .
   git checkout %GLSLANG_REVISION%
   if not exist %GLSLANG_DIR%\SPIRV (
      echo glslang source download failed!
      set errorCode=1
   )
goto:eof

:update_glslang
   echo.
   echo Updating %GLSLANG_DIR%
   cd %GLSLANG_DIR%
   git fetch --all
   git checkout %GLSLANG_REVISION%
   if not exist %GLSLANG_DIR%\SPIRV (
      echo glslang source update failed!
      set errorCode=1
   )
goto:eof

:create_spirv-tools
   echo.
   echo Creating local spirv-tools repository %SPIRV_TOOLS_DIR%
   mkdir %SPIRV_TOOLS_DIR%
   cd %SPIRV_TOOLS_DIR%
   git clone https://github.com/KhronosGroup/SPIRV-Tools.git .
   git checkout %SPIRV_TOOLS_REVISION%
   if not exist %SPIRV_TOOLS_DIR%\source (
      echo spirv-tools source download failed!
      set errorCode=1
   )
goto:eof

:update_spirv-tools
   echo.
   echo Updating %SPIRV_TOOLS_DIR%
   cd %SPIRV_TOOLS_DIR%
   git fetch --all
   git checkout %SPIRV_TOOLS_REVISION%
   if not exist %SPIRV_TOOLS_DIR%\source (
      echo spirv-tools source update failed!
      set errorCode=1
   )
goto:eof

:create_shaderc
   echo.
   echo Creating local shaderc repository %SHADERC_DIR%
   mkdir %SHADERC_DIR%
   cd %SHADERC_DIR%
   git clone git@github.com:google/shaderc.git .
   git checkout %SHADERC_REVISION%
   if not exist %SHADERC_DIR%\libshaderc (
      echo shaderc source download failed!
      set errorCode=1
   )
goto:eof

:update_shaderc
   echo.
   echo Updating %SHADERC_DIR%
   cd %SHADERC_DIR%
   git fetch --all
   git checkout %SHADERC_REVISION%
   if not exist %SHADERC_DIR%\libshaderc (
      echo shaderc source update failed!
      set errorCode=1
   )
goto:eof

:build_shaderc
   echo.
   echo Building %SHADERC_DIR%
   cd %SHADERC_DIR%\android_test
   echo Building shaderc with Android NDK
   call ndk-build THIRD_PARTY_PATH=../.. -j 4
   REM Check for existence of one lib, even though we should check for all results
   if not exist %SHADERC_DIR%\android_test\obj\local\x86\libshaderc.a (
      echo.
      echo shaderc build failed!
      set errorCode=1
   )
goto:eof

@echo off
REM Update source for glslang, spirv-tools, and shaderc

REM
REM Copyright 2016 The Android Open Source Project
REM Copyright (C) 2015 Valve Corporation
REM
REM Licensed under the Apache License, Version 2.0 (the "License");
REM you may not use this file except in compliance with the License.
REM You may obtain a copy of the License at
REM
REM      http://www.apache.org/licenses/LICENSE-2.0
REM
REM Unless required by applicable law or agreed to in writing, software
REM distributed under the License is distributed on an "AS IS" BASIS,
REM WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
REM See the License for the specific language governing permissions and
REM limitations under the License.
REM

setlocal EnableDelayedExpansion
set errorCode=0
set ANDROID_BUILD_DIR=%~dp0
set BUILD_DIR=%ANDROID_BUILD_DIR%..
set BASE_DIR=%BUILD_DIR%\external
set GLSLANG_DIR=%BASE_DIR%\glslang
set SPIRV_TOOLS_DIR=%BASE_DIR%\spirv-tools
set SHADERC_DIR=%BASE_DIR%\shaderc

for %%X in (where.exe) do (set FOUND=%%~$PATH:X)
if not defined FOUND (
   echo Dependency check failed:
   echo   where.exe not found
   echo   This script requires Windows Vista or later, which includes where.exe.
   set errorCode=1
)

where /q git.exe
if %ERRORLEVEL% equ 1 (
   echo Dependency check failed:
   echo   git.exe not found
   echo   Git for Windows can be downloaded here:  https://git-scm.com/download/win
   echo   Install and ensure git.exe makes it into your PATH
   set errorCode=1
)

where /q ndk-build.cmd
if %ERRORLEVEL% equ 1 (
   echo Dependency check failed:
   echo   ndk-build.cmd not found
   echo   Android NDK can be downloaded here:  http://developer.android.com/ndk/guides/setup.html
   echo   Install and ensure ndk-build.cmd makes it into your PATH
   set errorCode=1
)

REM ensure where is working with below false test
REM where /q foo
REM if %ERRORLEVEL% equ 1 (
REM echo foo
REM )

:main

if %errorCode% neq 0 (goto:error)

REM Read the target versions from external file, which is shared with Linux script

if not exist %ANDROID_BUILD_DIR%\glslang_revision_android (
   echo.
   echo Missing glslang_revision_android file. Place it in %ANDROID_BUILD_DIR%
   goto:error
)

if not exist %ANDROID_BUILD_DIR%\spirv-tools_revision_android (
   echo.
   echo Missing spirv-tools_revision_android file. Place it in %ANDROID_BUILD_DIR%
   set errorCode=1
   goto:error
)

if not exist %ANDROID_BUILD_DIR%\shaderc_revision_android (
   echo.
   echo Missing shaderc_revision_android file. Place it in %ANDROID_BUILD_DIR%
   set errorCode=1
   goto:error
)

set /p GLSLANG_REVISION= < glslang_revision_android
set /p SPIRV_TOOLS_REVISION= < spirv-tools_revision_android
set /p SHADERC_REVISION= < shaderc_revision_android
echo GLSLANG_REVISION=%GLSLANG_REVISION%
echo SPIRV_TOOLS_REVISION=%SPIRV_TOOLS_REVISION%
echo SHADERC_REVISION=%SHADERC_REVISION%

echo Creating and/or updating glslang, spirv-tools, shaderc in %BASE_DIR%

set sync-glslang=1
set sync-spirv-tools=1
set sync-shaderc=1
set build-shaderc=1

if %sync-glslang% equ 1 (
   if exist %GLSLANG_DIR% (
      rd /S /Q %GLSLANG_DIR%
   )
   if not exist %GLSLANG_DIR% (
      call:create_glslang
   )
   if %errorCode% neq 0 (goto:error)
   call:update_glslang
   if %errorCode% neq 0 (goto:error)
)

if %sync-spirv-tools% equ 1 (
   if exist %SPIRV_TOOLS_DIR% (
      rd /S /Q %SPIRV_TOOLS_DIR%
   )
   if %ERRORLEVEL% neq 0 (goto:error)
   if not exist %SPIRV_TOOLS_DIR% (
      call:create_spirv-tools
   )
   if %errorCode% neq 0 (goto:error)
   call:update_spirv-tools
   if %errorCode% neq 0 (goto:error)
)

if %sync-shaderc% equ 1 (
   if exist %SHADERC_DIR% (
      rd /S /Q %SHADERC_DIR%
   )
   if not exist %SHADERC_DIR% (
      call:create_shaderc
   )
   if %errorCode% neq 0 (goto:error)
   call:update_shaderc
   if %errorCode% neq 0 (goto:error)
)

if %build-shaderc% equ 1 (
   call:build_shaderc
   if %errorCode% neq 0 (goto:error)
)

echo.
echo Exiting
goto:finish

:error
echo.
echo Halting due to error
goto:finish

:finish
if not "%cd%\" == "%BUILD_DIR%" ( cd %BUILD_DIR% )
endlocal
goto:eof

REM // ======== Functions ======== //

:create_glslang
   echo.
   echo Creating local glslang repository %GLSLANG_DIR%
   mkdir %GLSLANG_DIR%
   cd %GLSLANG_DIR%
   git clone https://github.com/KhronosGroup/glslang.git .
   git checkout %GLSLANG_REVISION%
   if not exist %GLSLANG_DIR%\SPIRV (
      echo glslang source download failed!
      set errorCode=1
   )
goto:eof

:update_glslang
   echo.
   echo Updating %GLSLANG_DIR%
   cd %GLSLANG_DIR%
   git fetch --all
   git checkout %GLSLANG_REVISION%
   if not exist %GLSLANG_DIR%\SPIRV (
      echo glslang source update failed!
      set errorCode=1
   )
goto:eof

:create_spirv-tools
   echo.
   echo Creating local spirv-tools repository %SPIRV_TOOLS_DIR%
   mkdir %SPIRV_TOOLS_DIR%
   cd %SPIRV_TOOLS_DIR%
   git clone https://github.com/KhronosGroup/SPIRV-Tools.git .
   git checkout %SPIRV_TOOLS_REVISION%
   if not exist %SPIRV_TOOLS_DIR%\source (
      echo spirv-tools source download failed!
      set errorCode=1
   )
goto:eof

:update_spirv-tools
   echo.
   echo Updating %SPIRV_TOOLS_DIR%
   cd %SPIRV_TOOLS_DIR%
   git fetch --all
   git checkout %SPIRV_TOOLS_REVISION%
   if not exist %SPIRV_TOOLS_DIR%\source (
      echo spirv-tools source update failed!
      set errorCode=1
   )
goto:eof

:create_shaderc
   echo.
   echo Creating local shaderc repository %SHADERC_DIR%
   mkdir %SHADERC_DIR%
   cd %SHADERC_DIR%
   git clone https://github.com/google/shaderc.git .
   git checkout %SHADERC_REVISION%
   if not exist %SHADERC_DIR%\libshaderc (
      echo shaderc source download failed!
      set errorCode=1
   )
goto:eof

:update_shaderc
   echo.
   echo Updating %SHADERC_DIR%
   cd %SHADERC_DIR%
   git fetch --all
   git checkout %SHADERC_REVISION%
   if not exist %SHADERC_DIR%\libshaderc (
      echo shaderc source update failed!
      set errorCode=1
   )
goto:eof

:build_shaderc
   echo.
   echo Building %SHADERC_DIR%
   cd %SHADERC_DIR%\android_test
   echo Building shaderc with Android NDK
   call ndk-build THIRD_PARTY_PATH=../.. -j 4
   REM Check for existence of one lib, even though we should check for all results
   if not exist %SHADERC_DIR%\android_test\obj\local\x86\libshaderc.a (
      echo.
      echo shaderc build failed!
      set errorCode=1
   )
goto:eof

toolchain: Simplify shaderc setup for Windows too, per dc0ac6bc


set ETS_TOOLKIT=qt4
coverage run -m nose.core -v --exclude-dir=pyface/ui/wx --exclude="enaml"
if %errorlevel% neq 0 exit /b %errorlevel%
coverage run -a -m nose.core -v pyface/tasks/tests/*enaml*
if %errorlevel% neq 0 exit /b %errorlevel%
coverage report

add a batch file to run tests

add a batch file to run tests


@echo off

nmake LIBPNGDIR="%LIBRARY_PREFIX%" ZLIBDIR="%LIBRARY_PREFIX%"
if errorlevel 1 exit 1

@echo off

nmake LIBPNGDIR="%LIBRARY_PREFIX%" ZLIBDIR="%LIBRARY_PREFIX%" @msvc.mak
if errorlevel 1 exit 1

make file

make file


@echo off

@REM set %HOME% to equivalent of $HOME
if "%HOME%" == "" (set HOME=%HOMEDRIVE%%HOMEPATH%)

set ERROR_CODE=0

@REM set local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" @setlocal

@REM ==== START VALIDATION ====
if not "%JAVA_HOME%" == "" goto OkJHome

@REM Decide how to startup depending on the version of windows

@REM -- Win98ME
if NOT "%OS%"=="Windows_NT" goto Win9xArg

@REM -- 4NT shell
if "%@eval[2+2]" == "4" goto 4NTArgs

@REM -- Regular WinNT shell
set CMD_LINE_ARGS=%*
goto endInit

@REM The 4NT Shell from jp software
:4NTArgs
set CMD_LINE_ARGS=%$
goto endInit

:Win9xArg
@REM Slurp the command line arguments.  This loop allows for an unlimited number
@REM of arguments (up to the command line limit, anyway).
set CMD_LINE_ARGS=
:Win9xApp
if %1a==a goto endInit
set CMD_LINE_ARGS=%CMD_LINE_ARGS% %1
shift
goto Win9xApp

@REM Reaching here means variables are defined and arguments have been captured
:endInit

@REM Start program
:runm2
SET CMDLINE=@COMMAND@ %CMD_LINE_ARGS%
%CMDLINE%
if ERRORLEVEL 1 goto error
goto end

:error
if "%OS%"=="Windows_NT" @endlocal
set ERROR_CODE=1

:end
@REM set local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" goto endNT

@REM For old DOS remove the set variables from ENV - we assume they were not set
@REM before we started - at least we don't leave any baggage around
set CMD_LINE_ARGS=
set CMDLINE=
goto postExec

:endNT
@endlocal

:postExec
exit /B %ERROR_CODE%

@echo off

@REM set %HOME% to equivalent of $HOME
if "%HOME%" == "" (set HOME=%HOMEDRIVE%%HOMEPATH%)

set ERROR_CODE=0

@REM set local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" @setlocal

@REM Decide how to startup depending on the version of windows

@REM -- Win98ME
if NOT "%OS%"=="Windows_NT" goto Win9xArg

@REM -- 4NT shell
if "%@eval[2+2]" == "4" goto 4NTArgs

@REM -- Regular WinNT shell
set CMD_LINE_ARGS=%*
goto endInit

@REM The 4NT Shell from jp software
:4NTArgs
set CMD_LINE_ARGS=%$
goto endInit

:Win9xArg
@REM Slurp the command line arguments.  This loop allows for an unlimited number
@REM of arguments (up to the command line limit, anyway).
set CMD_LINE_ARGS=
:Win9xApp
if %1a==a goto endInit
set CMD_LINE_ARGS=%CMD_LINE_ARGS% %1
shift
goto Win9xApp

@REM Reaching here means variables are defined and arguments have been captured
:endInit

@REM Start program
:runm2
SET CMDLINE=@COMMAND@ %CMD_LINE_ARGS%
%CMDLINE%
if ERRORLEVEL 1 goto error
goto end

:error
if "%OS%"=="Windows_NT" @endlocal
set ERROR_CODE=1

:end
@REM set local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" goto endNT

@REM For old DOS remove the set variables from ENV - we assume they were not set
@REM before we started - at least we don't leave any baggage around
set CMD_LINE_ARGS=
set CMDLINE=
goto postExec

:endNT
@endlocal

:postExec
exit /B %ERROR_CODE%

Remove superfluous lines from launcher.bat


cd /d "%~dp0"
cd ..
rmdir /s /q install
rmdir /s /q build
mkdir build
cd build
cmake .. -G "Visual Studio 12" "-DCMAKE_INSTALL_PREFIX=%WORKSPACE%\install" %*
cmake --build . --config Debug
cmake --build . --config RelWithDebInfo
cmake --build . --config RelWithDebInfo --target INSTALL

cmake --build . --config RelWithDebInfo --target ogvrPluginKit -- /p:RunCodeAnalysis=True

rem bin\Debug\LoadTest.exe --gtest_output=xml:test_details.Debug.xml
rem bin\RelWithDebInfo\LoadTest.exe --gtest_output=xml:test_details.RelWithDebInfo.xml

pause

cd /d "%~dp0"
cd ..
rmdir /s /q install
rmdir /s /q build
mkdir build
cd build
cmake .. -G "Visual Studio 12" "-DCMAKE_INSTALL_PREFIX=%WORKSPACE%\install" %*
cmake --build . --config Debug
cmake --build . --config RelWithDebInfo
cmake --build . --config Debug --target INSTALL
cmake --build . --config RelWithDebInfo --target INSTALL

cmake --build . --config RelWithDebInfo --target ogvrPluginKit -- /p:RunCodeAnalysis=True

rem bin\Debug\LoadTest.exe --gtest_output=xml:test_details.Debug.xml
rem bin\RelWithDebInfo\LoadTest.exe --gtest_output=xml:test_details.RelWithDebInfo.xml

pause

Install debug build too in cibuild.

Install debug build too in cibuild.


@echo off
:: Copyright (c) 2012 The Chromium Authors. All rights reserved.
:: Use of this source code is governed by a BSD-style license that can be
:: found in the LICENSE file.

:: This script will try to find if svn and python are accessible and it not,
:: it will try to download it and 'install' it in depot_tools.

:: Sadly, we can't use SETLOCAL here otherwise it ERRORLEVEL is not correctly
:: returned.

set WIN_TOOLS_ROOT_URL=https://src.chromium.org/svn/trunk/tools
:: It used to be %~dp0 but ADODB.Stream may fail to write to this directory if
:: the directory DACL is set to elevated integrity level.
set ZIP_DIR=%TEMP%

:: Get absolute root directory (.js scripts don't handle relative paths well).
pushd %~dp0..\..
set WIN_TOOLS_ROOT_DIR=%CD%
popd

if "%1" == "force" (
  set WIN_TOOLS_FORCE=1
  shift /1
)

:PYTHON_CHECK
if not exist "%WIN_TOOLS_ROOT_DIR%\python276_bin" goto :PY27_INSTALL
if not exist "%WIN_TOOLS_ROOT_DIR%\python.bat" goto :PY27_INSTALL
set ERRORLEVEL=0
goto :GIT_CHECK

:PY27_INSTALL
echo Installing python 2.7.6...
:: Cleanup python directory if it was existing.
if exist "%WIN_TOOLS_ROOT_DIR%\python276_bin\." rd /q /s "%WIN_TOOLS_ROOT_DIR%\python276_bin"
if exist "%ZIP_DIR%\python276.zip" del "%ZIP_DIR%\python276.zip"
echo Fetching from %WIN_TOOLS_ROOT_URL%/third_party/python276_bin.zip
cscript //nologo //e:jscript "%~dp0get_file.js" %WIN_TOOLS_ROOT_URL%/third_party/python276_bin.zip "%ZIP_DIR%\python276_bin.zip"
if errorlevel 1 goto :PYTHON_FAIL
:: Will create python276_bin\...
cscript //nologo //e:jscript "%~dp0unzip.js" "%ZIP_DIR%\python276_bin.zip" "%WIN_TOOLS_ROOT_DIR%"
:: Create the batch files.
call copy /y "%~dp0python276.new.bat" "%WIN_TOOLS_ROOT_DIR%\python.bat" 1>nul
call copy /y "%~dp0pylint.new.bat" "%WIN_TOOLS_ROOT_DIR%\pylint.bat" 1>nul
del "%ZIP_DIR%\python276_bin.zip"
set ERRORLEVEL=0
goto :GIT_CHECK

:PYTHON_FAIL
echo ... Failed to checkout python automatically.
echo Please visit http://python.org to download the latest python 2.7.x client before
echo continuing.
echo You can also get the "prebacked" version used at %WIN_TOOLS_ROOT_URL%/third_party/
set ERRORLEVEL=1
goto :END

:GIT_CHECK
goto :GIT_190_CHECK

:GIT_190_CHECK
if "%DEPOT_TOOLS_GIT_190%" == "0" goto :GIT_1852_CHECK
:: Clean up a couple of known broken releases
for /l %%i in (1,1,2) do if exist "%WIN_TOOLS_ROOT_DIR%\git-1.9.0.chromium.%%i_bin" (
  rmdir /s /q "%WIN_TOOLS_ROOT_DIR%\git-1.9.0.chromium.%%i_bin"
)
set GIT_VERSION=1.9.0.chromium.3
for /f "tokens=2 delims=[]" %%i in ('ver') do set VERSTR=%%i
for /f "tokens=2,3 delims=. " %%i in ("%VERSTR%") do (set VERMAJOR=%%i & set VERMINOR=%%j)
if %VERMAJOR% lss 5 set GIT_VERSION=1.9.0.chromium.3-xp
if %VERMAJOR% equ 5 if %VERMINOR% lss 2 set GIT_VERSION=1.9.0.chromium.3-xp
set GIT_BIN_DIR=git-%GIT_VERSION%_bin
set GIT_ZIP_FILE=%GIT_BIN_DIR%.zip
set GIT_ZIP_URL=https://commondatastorage.googleapis.com/chrome-infra/%GIT_ZIP_FILE%
goto :GIT_COMMON

:GIT_1852_CHECK
if "%DEPOT_TOOLS_GIT_1852%" == "0" goto :GIT_180_CHECK
set GIT_VERSION=1.8.5.2.chromium.1
set GIT_BIN_DIR=git-%GIT_VERSION%_bin
set GIT_ZIP_FILE=%GIT_BIN_DIR%.zip
set GIT_ZIP_URL=https://commondatastorage.googleapis.com/chrome-infra/%GIT_ZIP_FILE%
:: This git uses APIs that target WINVER 0x0502, so refuse to install it on
:: anything older.
for /f "tokens=2 delims=[]" %%i in ('ver') do set VERSTR=%%i
for /f "tokens=2,3 delims=. " %%i in ("%VERSTR%") do (set VERMAJOR=%%i & set VERMINOR=%%j)
if %VERMAJOR% lss 5 goto :GIT_VER_UNSUPPORTED
if %VERMAJOR% equ 5 if %VERMINOR% lss 2 goto :GIT_VER_UNSUPPORTED
goto :GIT_COMMON

:GIT_VER_UNSUPPORTED
echo Git %GIT_VERSION% cannot be installed on:
ver
goto :GIT_180_CHECK

:GIT_180_CHECK
set GIT_VERSION=1.8.0
set GIT_BIN_DIR=git-%GIT_VERSION%_bin
set GIT_ZIP_FILE=%GIT_BIN_DIR%.zip
set GIT_ZIP_URL=%WIN_TOOLS_ROOT_URL%/third_party/%GIT_ZIP_FILE%
goto :GIT_COMMON

:GIT_COMMON
if "%WIN_TOOLS_FORCE%" == "1" goto :GIT_INSTALL
if exist "%WIN_TOOLS_ROOT_DIR%\%GIT_BIN_DIR%\cmd\git.cmd" (
  call "%WIN_TOOLS_ROOT_DIR%\%GIT_BIN_DIR%\cmd\git.cmd" --version 2>nul 1>nul
  if errorlevel 1 goto :GIT_INSTALL
  rem Several git versions can live side-by-side; check the top-level
  rem batch script to make sure it points to the desired version.
  find "%GIT_BIN_DIR%" "%WIN_TOOLS_ROOT_DIR%\git.bat" 2>nul 1>nul
  if errorlevel 1 goto :GIT_COPY_BATCH_FILES
  goto :SVN_CHECK
)
goto :GIT_INSTALL

:GIT_INSTALL
echo Installing git %GIT_VERSION% (avg 1-2 min download) ...
:: git is not accessible; check it out and create 'proxy' files.
if exist "%ZIP_DIR%\git.zip" del "%ZIP_DIR%\git.zip"
echo Fetching from %GIT_ZIP_URL%
cscript //nologo //e:jscript "%~dp0get_file.js" %GIT_ZIP_URL% "%ZIP_DIR%\git.zip"
if errorlevel 1 goto :GIT_FAIL
:: Cleanup svn directory if it was existing.
if exist "%WIN_TOOLS_ROOT_DIR%\%GIT_BIN_DIR%\." rd /q /s "%WIN_TOOLS_ROOT_DIR%\%GIT_BIN_DIR%"
:: Will create %GIT_BIN_DIR%\...
cscript //nologo //e:jscript "%~dp0unzip.js" "%ZIP_DIR%\git.zip" "%WIN_TOOLS_ROOT_DIR%"
if errorlevel 1 goto :GIT_FAIL
if not exist "%WIN_TOOLS_ROOT_DIR%\%GIT_BIN_DIR%\." goto :GIT_FAIL
del "%ZIP_DIR%\git.zip"
:: Ensure autocrlf and filemode are set correctly.
call "%WIN_TOOLS_ROOT_DIR%\git.bat" config --system core.autocrlf false
call "%WIN_TOOLS_ROOT_DIR%\git.bat" config --system core.filemode false
goto :GIT_COPY_BATCH_FILES

:GIT_COPY_BATCH_FILES
:: Create the batch files.
call copy /y "%WIN_TOOLS_ROOT_DIR%\%GIT_BIN_DIR%\git.bat" "%WIN_TOOLS_ROOT_DIR%\git.bat" 1>nul
call copy /y "%WIN_TOOLS_ROOT_DIR%\%GIT_BIN_DIR%\gitk.bat" "%WIN_TOOLS_ROOT_DIR%\gitk.bat" 1>nul
call copy /y "%WIN_TOOLS_ROOT_DIR%\%GIT_BIN_DIR%\ssh.bat" "%WIN_TOOLS_ROOT_DIR%\ssh.bat" 1>nul
call copy /y "%WIN_TOOLS_ROOT_DIR%\%GIT_BIN_DIR%\ssh-keygen.bat" "%WIN_TOOLS_ROOT_DIR%\ssh-keygen.bat" 1>nul
goto :SVN_CHECK

:GIT_FAIL
echo ... Failed to checkout git automatically.
echo Please visit http://code.google.com/p/msysgit to download the latest git
echo client before continuing.
echo You can also get the "prebaked" version used at %GIT_ZIP_URL%
set ERRORLEVEL=1
goto :END

:SVN_CHECK
:: If the batch file exists, skip the svn check.
if exist "%WIN_TOOLS_ROOT_DIR%\svn.bat" goto :END
if "%WIN_TOOLS_FORCE%" == "1" goto :SVN_INSTALL
call svn --version 2>nul 1>nul
if errorlevel 1 goto :SVN_INSTALL
goto :END

:SVN_INSTALL
echo Installing subversion ...
:: svn is not accessible; check it out and create 'proxy' files.
if exist "%ZIP_DIR%\svn.zip" del "%ZIP_DIR%\svn.zip"
echo Fetching from %WIN_TOOLS_ROOT_URL%/third_party/svn_bin.zip
cscript //nologo //e:jscript "%~dp0get_file.js" %WIN_TOOLS_ROOT_URL%/third_party/svn_bin.zip "%ZIP_DIR%\svn.zip"
if errorlevel 1 goto :SVN_FAIL
:: Cleanup svn directory if it was existing.
if exist "%WIN_TOOLS_ROOT_DIR%\svn\." rd /q /s "%WIN_TOOLS_ROOT_DIR%\svn"
if exist "%WIN_TOOLS_ROOT_DIR%\svn_bin\." rd /q /s "%WIN_TOOLS_ROOT_DIR%\svn_bin"
:: Will create svn_bin\...
cscript //nologo //e:jscript "%~dp0unzip.js" "%ZIP_DIR%\svn.zip" "%WIN_TOOLS_ROOT_DIR%"
if errorlevel 1 goto :SVN_FAIL
if not exist "%WIN_TOOLS_ROOT_DIR%\svn_bin\." goto :SVN_FAIL
del "%ZIP_DIR%\svn.zip"
:: Create the batch file.
call copy /y "%~dp0svn.new.bat" "%WIN_TOOLS_ROOT_DIR%\svn.bat" 1>nul
call copy /y "%~dp0svnversion.new.bat" "%WIN_TOOLS_ROOT_DIR%\svnversion.bat" 1>nul
goto :END

:SVN_FAIL
echo ... Failed to checkout svn automatically.
echo Please visit http://subversion.tigris.org to download the latest subversion client
echo before continuing.
echo You can also get the "prebacked" version used at %WIN_TOOLS_ROOT_URL%/third_party/
set ERRORLEVEL=1
goto :END

:returncode
set WIN_TOOLS_ROOT_URL=
set WIN_TOOLS_ROOT_DIR=
exit /b %ERRORLEVEL%

:END
call :returncode %ERRORLEVEL%

@echo off
:: Copyright (c) 2012 The Chromium Authors. All rights reserved.
:: Use of this source code is governed by a BSD-style license that can be
:: found in the LICENSE file.

:: This script will try to find if svn and python are accessible and it not,
:: it will try to download it and 'install' it in depot_tools.

:: Sadly, we can't use SETLOCAL here otherwise it ERRORLEVEL is not correctly
:: returned.

set WIN_TOOLS_ROOT_URL=https://src.chromium.org/svn/trunk/tools
:: It used to be %~dp0 but ADODB.Stream may fail to write to this directory if
:: the directory DACL is set to elevated integrity level.
set ZIP_DIR=%TEMP%

:: Get absolute root directory (.js scripts don't handle relative paths well).
pushd %~dp0..\..
set WIN_TOOLS_ROOT_DIR=%CD%
popd

if "%1" == "force" (
  set WIN_TOOLS_FORCE=1
  shift /1
)

:PYTHON_CHECK
if not exist "%WIN_TOOLS_ROOT_DIR%\python276_bin" goto :PY27_INSTALL
if not exist "%WIN_TOOLS_ROOT_DIR%\python.bat" goto :PY27_INSTALL
set ERRORLEVEL=0
goto :GIT_CHECK

:PY27_INSTALL
echo Installing python 2.7.6...
:: Cleanup python directory if it was existing.
if exist "%WIN_TOOLS_ROOT_DIR%\python276_bin\." rd /q /s "%WIN_TOOLS_ROOT_DIR%\python276_bin"
if exist "%ZIP_DIR%\python276.zip" del "%ZIP_DIR%\python276.zip"
echo Fetching from %WIN_TOOLS_ROOT_URL%/third_party/python276_bin.zip
cscript //nologo //e:jscript "%~dp0get_file.js" %WIN_TOOLS_ROOT_URL%/third_party/python276_bin.zip "%ZIP_DIR%\python276_bin.zip"
if errorlevel 1 goto :PYTHON_FAIL
:: Will create python276_bin\...
cscript //nologo //e:jscript "%~dp0unzip.js" "%ZIP_DIR%\python276_bin.zip" "%WIN_TOOLS_ROOT_DIR%"
:: Create the batch files.
call copy /y "%~dp0python276.new.bat" "%WIN_TOOLS_ROOT_DIR%\python.bat" 1>nul
call copy /y "%~dp0pylint.new.bat" "%WIN_TOOLS_ROOT_DIR%\pylint.bat" 1>nul
del "%ZIP_DIR%\python276_bin.zip"
set ERRORLEVEL=0
goto :GIT_CHECK

:PYTHON_FAIL
echo ... Failed to checkout python automatically.
echo Please visit http://python.org to download the latest python 2.7.x client before
echo continuing.
echo You can also get the "prebacked" version used at %WIN_TOOLS_ROOT_URL%/third_party/
set ERRORLEVEL=1
goto :END

:GIT_CHECK
goto :GIT_190_CHECK

:GIT_190_CHECK
set GIT_ERASE_TOP=2
set GIT_VERSION=1.9.0.chromium.3

if not "%DEPOT_TOOLS_GIT_BLEEDING%" == "1" goto :GIT_190_CHECK_REST
set GIT_ERASE_TOP=3
set GIT_VERSION=1.9.0.chromium.4

:GIT_190_CHECK_REST
if "%DEPOT_TOOLS_GIT_190%" == "0" goto :GIT_1852_CHECK
:: Clean up a couple of known broken releases
for /l %%i in (1,1,%GIT_ERASE_TOP%) do if exist "%WIN_TOOLS_ROOT_DIR%\git-1.9.0.chromium.%%i_bin" (
  rmdir /s /q "%WIN_TOOLS_ROOT_DIR%\git-1.9.0.chromium.%%i_bin"
)
for /f "tokens=2 delims=[]" %%i in ('ver') do set VERSTR=%%i
for /f "tokens=2,3 delims=. " %%i in ("%VERSTR%") do (set VERMAJOR=%%i & set VERMINOR=%%j)
if %VERMAJOR% lss 5 set GIT_VERSION=%GIT_VERSION%-xp
if %VERMAJOR% equ 5 if %VERMINOR% lss 2 set GIT_VERSION=%GIT_VERSION%-xp
set GIT_BIN_DIR=git-%GIT_VERSION%_bin
set GIT_ZIP_FILE=%GIT_BIN_DIR%.zip
set GIT_ZIP_URL=https://commondatastorage.googleapis.com/chrome-infra/%GIT_ZIP_FILE%
goto :GIT_COMMON

:GIT_1852_CHECK
if "%DEPOT_TOOLS_GIT_1852%" == "0" goto :GIT_180_CHECK
set GIT_VERSION=1.8.5.2.chromium.1
set GIT_BIN_DIR=git-%GIT_VERSION%_bin
set GIT_ZIP_FILE=%GIT_BIN_DIR%.zip
set GIT_ZIP_URL=https://commondatastorage.googleapis.com/chrome-infra/%GIT_ZIP_FILE%
:: This git uses APIs that target WINVER 0x0502, so refuse to install it on
:: anything older.
for /f "tokens=2 delims=[]" %%i in ('ver') do set VERSTR=%%i
for /f "tokens=2,3 delims=. " %%i in ("%VERSTR%") do (set VERMAJOR=%%i & set VERMINOR=%%j)
if %VERMAJOR% lss 5 goto :GIT_VER_UNSUPPORTED
if %VERMAJOR% equ 5 if %VERMINOR% lss 2 goto :GIT_VER_UNSUPPORTED
goto :GIT_COMMON

:GIT_VER_UNSUPPORTED
echo Git %GIT_VERSION% cannot be installed on:
ver
goto :GIT_180_CHECK

:GIT_180_CHECK
set GIT_VERSION=1.8.0
set GIT_BIN_DIR=git-%GIT_VERSION%_bin
set GIT_ZIP_FILE=%GIT_BIN_DIR%.zip
set GIT_ZIP_URL=%WIN_TOOLS_ROOT_URL%/third_party/%GIT_ZIP_FILE%
goto :GIT_COMMON

:GIT_COMMON
if "%WIN_TOOLS_FORCE%" == "1" goto :GIT_INSTALL
if exist "%WIN_TOOLS_ROOT_DIR%\%GIT_BIN_DIR%\cmd\git.cmd" (
  call "%WIN_TOOLS_ROOT_DIR%\%GIT_BIN_DIR%\cmd\git.cmd" --version 2>nul 1>nul
  if errorlevel 1 goto :GIT_INSTALL
  rem Several git versions can live side-by-side; check the top-level
  rem batch script to make sure it points to the desired version.
  find "%GIT_BIN_DIR%" "%WIN_TOOLS_ROOT_DIR%\git.bat" 2>nul 1>nul
  if errorlevel 1 goto :GIT_COPY_BATCH_FILES
  goto :SVN_CHECK
)
goto :GIT_INSTALL

:GIT_INSTALL
echo Installing git %GIT_VERSION% (avg 1-2 min download) ...
:: git is not accessible; check it out and create 'proxy' files.
if exist "%ZIP_DIR%\git.zip" del "%ZIP_DIR%\git.zip"
echo Fetching from %GIT_ZIP_URL%
cscript //nologo //e:jscript "%~dp0get_file.js" %GIT_ZIP_URL% "%ZIP_DIR%\git.zip"
if errorlevel 1 goto :GIT_FAIL
:: Cleanup svn directory if it was existing.
if exist "%WIN_TOOLS_ROOT_DIR%\%GIT_BIN_DIR%\." rd /q /s "%WIN_TOOLS_ROOT_DIR%\%GIT_BIN_DIR%"
:: Will create %GIT_BIN_DIR%\...
cscript //nologo //e:jscript "%~dp0unzip.js" "%ZIP_DIR%\git.zip" "%WIN_TOOLS_ROOT_DIR%"
if errorlevel 1 goto :GIT_FAIL
if not exist "%WIN_TOOLS_ROOT_DIR%\%GIT_BIN_DIR%\." goto :GIT_FAIL
del "%ZIP_DIR%\git.zip"
:: Ensure autocrlf and filemode are set correctly.
call "%WIN_TOOLS_ROOT_DIR%\git.bat" config --system core.autocrlf false
call "%WIN_TOOLS_ROOT_DIR%\git.bat" config --system core.filemode false
goto :GIT_COPY_BATCH_FILES

:GIT_COPY_BATCH_FILES
:: Create the batch files.
call copy /y "%WIN_TOOLS_ROOT_DIR%\%GIT_BIN_DIR%\git.bat" "%WIN_TOOLS_ROOT_DIR%\git.bat" 1>nul
call copy /y "%WIN_TOOLS_ROOT_DIR%\%GIT_BIN_DIR%\gitk.bat" "%WIN_TOOLS_ROOT_DIR%\gitk.bat" 1>nul
call copy /y "%WIN_TOOLS_ROOT_DIR%\%GIT_BIN_DIR%\ssh.bat" "%WIN_TOOLS_ROOT_DIR%\ssh.bat" 1>nul
call copy /y "%WIN_TOOLS_ROOT_DIR%\%GIT_BIN_DIR%\ssh-keygen.bat" "%WIN_TOOLS_ROOT_DIR%\ssh-keygen.bat" 1>nul
goto :SVN_CHECK

:GIT_FAIL
echo ... Failed to checkout git automatically.
echo Please visit http://code.google.com/p/msysgit to download the latest git
echo client before continuing.
echo You can also get the "prebaked" version used at %GIT_ZIP_URL%
set ERRORLEVEL=1
goto :END

:SVN_CHECK
:: If the batch file exists, skip the svn check.
if exist "%WIN_TOOLS_ROOT_DIR%\svn.bat" goto :END
if "%WIN_TOOLS_FORCE%" == "1" goto :SVN_INSTALL
call svn --version 2>nul 1>nul
if errorlevel 1 goto :SVN_INSTALL
goto :END

:SVN_INSTALL
echo Installing subversion ...
:: svn is not accessible; check it out and create 'proxy' files.
if exist "%ZIP_DIR%\svn.zip" del "%ZIP_DIR%\svn.zip"
echo Fetching from %WIN_TOOLS_ROOT_URL%/third_party/svn_bin.zip
cscript //nologo //e:jscript "%~dp0get_file.js" %WIN_TOOLS_ROOT_URL%/third_party/svn_bin.zip "%ZIP_DIR%\svn.zip"
if errorlevel 1 goto :SVN_FAIL
:: Cleanup svn directory if it was existing.
if exist "%WIN_TOOLS_ROOT_DIR%\svn\." rd /q /s "%WIN_TOOLS_ROOT_DIR%\svn"
if exist "%WIN_TOOLS_ROOT_DIR%\svn_bin\." rd /q /s "%WIN_TOOLS_ROOT_DIR%\svn_bin"
:: Will create svn_bin\...
cscript //nologo //e:jscript "%~dp0unzip.js" "%ZIP_DIR%\svn.zip" "%WIN_TOOLS_ROOT_DIR%"
if errorlevel 1 goto :SVN_FAIL
if not exist "%WIN_TOOLS_ROOT_DIR%\svn_bin\." goto :SVN_FAIL
del "%ZIP_DIR%\svn.zip"
:: Create the batch file.
call copy /y "%~dp0svn.new.bat" "%WIN_TOOLS_ROOT_DIR%\svn.bat" 1>nul
call copy /y "%~dp0svnversion.new.bat" "%WIN_TOOLS_ROOT_DIR%\svnversion.bat" 1>nul
goto :END

:SVN_FAIL
echo ... Failed to checkout svn automatically.
echo Please visit http://subversion.tigris.org to download the latest subversion client
echo before continuing.
echo You can also get the "prebacked" version used at %WIN_TOOLS_ROOT_URL%/third_party/
set ERRORLEVEL=1
goto :END

:returncode
set WIN_TOOLS_ROOT_URL=
set WIN_TOOLS_ROOT_DIR=
exit /b %ERRORLEVEL%

:END
call :returncode %ERRORLEVEL%

Add a bleeding-edge git version mode to depot_tools.

R=mmoss@google.com, mmoss@chromium.org
BUG=238428

Review URL: https://codereview.chromium.org/236303002

git-svn-id: bd64dd6fa6f3f0ed0c0666d1018379882b742947@263544 4ff67af0-8c30-449e-8e8b-ad334ec8d88c


@echo off

echo Building Module.
echo Dependencies: GIT, PREMAKE5, VISUAL STUDIO 2015/2013.
echo.

:: Hacky way to ensure we've got a git repository & submodules at our disposal
git init
git submodule update --init --recursive
echo.

:: Fire up a Visual Studio command-line environment and generate our solution
IF DEFINED VS140COMNTOOLS (
	echo Preparing for build with Visual Studio 2015.
	premake5 vs2015
	CALL "%VS140COMNTOOLS%VsMSBuildCmd.bat"
) ELSE IF DEFINED VS120COMNTOOLS (
	echo Preparing for build with Visual Studio 2013.
	premake5 vs2013
	CALL "%VS120COMNTOOLS%VsMSBuildCmd.bat"
) ELSE (
	echo Failed to detect Visual Studio installation.
	timeout 5
	exit /B 1
)

echo.

for /R project %%X in (*.sln) do (
	msbuild %%X
)

:: We're done!
timeout 5

exit /B %ERRORLEVEL%

@echo off

echo Building Module.
echo Dependencies: GIT, PREMAKE5, VISUAL STUDIO 2015/2013.
echo.

:: Hacky way to ensure we've got a git repository & submodules at our disposal
git init
git submodule update --init --recursive
echo.

:: Fire up a Visual Studio command-line environment and generate our solution
IF DEFINED VS140COMNTOOLS (
	echo Preparing for build with Visual Studio 2015.
	premake5 vs2015
	CALL "%VS140COMNTOOLS%VSDevCmd.bat"
) ELSE IF DEFINED VS120COMNTOOLS (
	echo Preparing for build with Visual Studio 2013.
	premake5 vs2013
	CALL "%VS120COMNTOOLS%VSDevCmd.bat"
) ELSE (
	echo Failed to detect Visual Studio installation.
	timeout 5
	exit /B 1
)

echo.

for /R project %%X in (*.sln) do (
	msbuild %%X
)

:: We're done!
timeout 5

exit /B %ERRORLEVEL%

Use VsDevCmd.Bat rather than VsMSBuildCmd.bat


SET BIN=%CD%\bin
SET PATH=%BIN%;%PATH%

del /F /Q windows_app_lifecycle.tgz
rmdir /S /Q packages
nuget restore || exit /b 1

devenv WindowsCircus.sln /build "Release" || exit /b 1
packages\nspec.0.9.68\tools\NSpecRunner.exe Builder.Tests\bin\Release\BuilderTests.dll || exit /b 1
packages\nspec.0.9.68\tools\NSpecRunner.exe Launcher.Tests\bin\Release\LauncherTests.dll || exit /b 1
packages\nspec.0.9.68\tools\NSpecRunner.exe WebAppServer.Tests\bin\Release\WebAppServer.Tests.dll || exit /b 1
bsdtar -czvf windows_app_lifecycle.tgz --exclude log -C Builder\bin . -C ..\..\Launcher\bin . -C ..\..\Healthcheck\bin . -C ..\..\WebAppServer\bin . || exit /b 1

SET BIN=%CD%\bin
SET PATH=%BIN%;%PATH%

del /F /Q windows_app_lifecycle.tgz
rmdir /S /Q packages
nuget restore || exit /b 1

MSBuild WindowsCircus.sln /t:Rebuild /p:Configuration=Release || exit /b 1
packages\nspec.0.9.68\tools\NSpecRunner.exe Builder.Tests\bin\Release\BuilderTests.dll || exit /b 1
packages\nspec.0.9.68\tools\NSpecRunner.exe Launcher.Tests\bin\Release\LauncherTests.dll || exit /b 1
packages\nspec.0.9.68\tools\NSpecRunner.exe WebAppServer.Tests\bin\Release\WebAppServer.Tests.dll || exit /b 1
bsdtar -czvf windows_app_lifecycle.tgz --exclude log -C Builder\bin . -C ..\..\Launcher\bin . -C ..\..\Healthcheck\bin . -C ..\..\WebAppServer\bin . || exit /b 1

Use MSBuild instead of devenv [#90905976]


MKDIR build\windows
CD build\windows

cmake ..\.. ^
        -G "%CMAKE_GENERATOR%" ^
        -DCMAKE_INSTALL_PREFIX="%LIBRARY_PREFIX%" ^
        -DCMAKE_PREFIX_PATH="%LIBRARY_PREFIX%" ^
        -DBUILD_STATIC_LIBS=1 ^
        -DBUILD_SHARED_LIBS=1

ECHO VS files have been generated in build\windows

dir

cmake --build . --config Release --target ALL_BUILD
cmake --build . --config Release --target ZERO_CHECK

dir

move libmetis/libmetis.a %LIBRARY_BIN%
move programs/cmpfillin %LIBRARY_LIB%
move programs/gpmetis %LIBRARY_LIB%
move programs/graphchk %LIBRARY_LIB%
move programs/m2gmetis %LIBRARY_LIB%
move programs/ndmetis %LIBRARY_LIB%
move programs/mpmetis %LIBRARY_LIB%
move include/metis.h %LIBRARY_INC%/
move include/gklib_tls.h %LIBRARY_INC%/

MKDIR build\windows
CD build\windows

cmake ..\.. ^
        -G "%CMAKE_GENERATOR%" ^
        -DCMAKE_INSTALL_PREFIX="%LIBRARY_PREFIX%" ^
        -DCMAKE_PREFIX_PATH="%LIBRARY_PREFIX%" ^
        -DBUILD_STATIC_LIBS=1 ^
        -DBUILD_SHARED_LIBS=1

ECHO VS files have been generated in build\windows

dir

cmake --build . --config Release --target ALL_BUILD
cmake --build . --config Release --target ZERO_CHECK

dir

dir programs

dir libmetis

dir include

move libmetis/libmetis.a %LIBRARY_BIN%
move programs/cmpfillin %LIBRARY_LIB%
move programs/gpmetis %LIBRARY_LIB%
move programs/graphchk %LIBRARY_LIB%
move programs/m2gmetis %LIBRARY_LIB%
move programs/ndmetis %LIBRARY_LIB%
move programs/mpmetis %LIBRARY_LIB%
move include/metis.h %LIBRARY_INC%/
move include/gklib_tls.h %LIBRARY_INC%/

add dir commands to see files

add dir commands to see files


@echo off
REM =========================================================
REM   Automated generation of all the dirs for win builds
REM    for x32/amd64, with/without Kinect support, and
REM    for MSVC{9,10,11} and MinGW
REM   To launch the build themselves and build packages,
REM    see "automated_build_msvc_binary_package.bat"
REM
REM  Copy this script to "d:\code" (in my laptop!), adjust
REM   all the paths below and execute.
REM
REM                              Jose Luis Blanco, 2011-12
REM =========================================================

REM  === THIS IS WHERE MRPT SOURCE TREE IS FROM THE CWD ===
set MRPT_BASE_DIR=mrpt-1.0.3

REM =================== SET ALL IMPORTANT PATHS ===================

set msvc9_DIR=E:\Program Files (x86)\Microsoft Visual Studio 9.0
rem set msvc10_DIR=E:\Program Files (x86)\Microsoft Visual Studio 10.0
set msvc11_DIR=E:\Archivos de programa (x86)\Microsoft Visual Studio 11.0
set msvc12_DIR=E:\Archivos de programa (x86)\Microsoft Visual Studio 12.0

set CMAKE_DIR=E:\Program Files (x86)\CMake\bin\
set LIBUSBDIR=E:\code\libusb-win32-bin-1.2.6.0
REM MinGW directories will be: %MINGW_ROOT%-32 and %MINGW_ROOT%-64
REM  (NOTE: Use "/" for paths in this one)
set MINGW_ROOT=E:/MinGW
set MINGW_ROOT_BKSLH=E:\MinGW
REM === wxWidgets directory base name will be: %WX_ROOT%-win%ARCHN%-%COMP%
set WX_ROOT=E:/code/wxWidgets-2.8.12
REM MSVC Redistributables: %MSVC_REDIST_BASE_DIR%/%COMP%/vcredist_%ARCH%.exe
set MSVC_REDIST_BASE_DIR=E:/code/MSVC_Redist

REM ==============================================================

REM msvc9 ========================
set COMP=msvc9
set ARCHN=32
set KINECT=0
call :subGen
set KINECT=1
call :subGen

set ARCHN=64
set KINECT=0
call :subGen
set KINECT=1
call :subGen

REM msvc10 ========================
rem set COMP=msvc10
rem set ARCHN=32
rem set KINECT=0
rem call :subGen
rem set KINECT=1
rem call :subGen

rem set ARCHN=64
rem set KINECT=0
rem call :subGen
rem set KINECT=1
rem call :subGen

REM msvc11 ========================
set COMP=msvc11
set ARCHN=32
set KINECT=0
call :subGen

set KINECT=1
call :subGen

set ARCHN=64
set KINECT=0
call :subGen
set KINECT=1
call :subGen

REM msvc12 ========================
set COMP=msvc12
set ARCHN=32
set KINECT=0
call :subGen

set KINECT=1
call :subGen

set COMP=msvc12

set ARCHN=64
set KINECT=0
call :subGen
set KINECT=1
call :subGen

goto End
:MINGW_PARTS
REM MinGW ========================
set COMP=mingw
set ARCHN=32
set KINECT=0
call :subGen
set KINECT=1
call :subGen

set ARCHN=64
set KINECT=0
call :subGen
set KINECT=1
call :subGen

goto End

REM ===== Subroutine: Generate project dir ============
:subGen

set ARCH=x%ARCHN%
set DIR=%MRPT_BASE_DIR%-%COMP%-%ARCH%
if %KINECT%==1 set DIR=%DIR%-kinect
if %ARCHN%==32 set ARCH_NAME=x86
if %ARCHN%==64 set ARCH_NAME=amd64

set WXDIR=%WX_ROOT%-%COMP%-%ARCH%

set MSVC_REDIST=%MSVC_REDIST_BASE_DIR%/%COMP%/vcredist_%ARCH%.exe

if %COMP%==mingw GOTO :subGen_mingw
REM Visual Studio --------------------------
if %COMP%==msvc9 set MSVC_DIR=%msvc9_DIR%
if %COMP%==msvc10 set MSVC_DIR=%msvc10_DIR%
if %COMP%==msvc11 set MSVC_DIR=%msvc11_DIR%
if %COMP%==msvc12 set MSVC_DIR=%msvc12_DIR%
if %COMP%==msvc9 set CMAKE_GEN=Visual Studio 9 2008
if %COMP%==msvc10 set CMAKE_GEN=Visual Studio 10 2010
if %COMP%==msvc11 set CMAKE_GEN=Visual Studio 11 2012
if %COMP%==msvc12 set CMAKE_GEN=Visual Studio 12 2013
if %ARCHN%==64 set CMAKE_GEN=%CMAKE_GEN% Win64

set CMAKE_EXTRA1=-DINSTALL_MSVC_REDISTRIBUTABLE=%MSVC_REDIST%
set CMAKE_EXTRA2=
set CMAKE_EXTRA3=

set FFMPEGDIR=E:/code/ffmpeg-win%ARCHN%-dev
if %ARCHN%==32 set WXLIBDIR=%WXDIR%/lib/vc_dll
if %ARCHN%==64 set WXLIBDIR=%WXDIR%/lib/vc_amd64_dll

GOTO :subGen_common

REM MinGw (32 or 64) -----------------------

:subGen_mingw
set CMAKE_GEN=MinGW Makefiles
set CMAKE_EXTRA1=-DCMAKE_C_COMPILER=%MINGW_ROOT%-%ARCHN%/bin/gcc.exe
set CMAKE_EXTRA2=-DCMAKE_CXX_COMPILER=%MINGW_ROOT%-%ARCHN%/bin/g++.exe
set CMAKE_EXTRA3=-DCMAKE_MAKE_PROGRAM=%MINGW_ROOT%-%ARCHN%/bin/mingw32-make.exe

set FFMPEGDIR=E:/code/ffmpeg-win%ARCHN%-dev
set WXLIBDIR=%WXDIR%/lib/gcc_lib

REM Common part to all compilers -----------
:subGen_common

mkdir %DIR%
cd %DIR%

REM ---------------- Create compilation script ----------------
set PATH_FIL=paths_%COMP%_%ARCH_NAME%
if %KINECT%==1 set PATH_FIL=%PATH_FIL%-kinect
set PATH_FIL=%PATH_FIL%.bat

if NOT %COMP%==mingw set EXTRA_MINGW_PATHS=
if %COMP%==mingw set EXTRA_MINGW_PATHS=;%MINGW_ROOT_BKSLH%-%ARCHN%\bin

echo SET PATH=C:\Windows\system32;C:\Windows%EXTRA_MINGW_PATHS%;C:\Program Files\TortoiseSVN\bin;E:\code\opencv-%COMP%-%ARCH%\bin\Release;E:\code\opencv-%COMP%-%ARCH%\bin\Debug;%WXLIBDIR%;%FFMPEGDIR%/bin;%LIBUSBDIR%\bin\%ARCH_NAME%;%CMAKE_DIR%;%CD%\bin\Release;%CD%\bin\Debug > %PATH_FIL%
if NOT %COMP%==mingw echo call "%MSVC_DIR%\VC\vcvarsall.bat" %ARCH_NAME% >> %PATH_FIL%

echo call %PATH_FIL% > AUTOBUILD.bat
rem ----- COMPILE -----
if NOT %COMP%==mingw echo call ..\%MRPT_BASE_DIR%\scripts\automated_build_msvc_binary_package.bat ..\%MRPT_BASE_DIR%\ >> AUTOBUILD.bat
if %COMP%==mingw echo %MINGW_ROOT_BKSLH%-%ARCHN%\bin\mingw32-make test -j4 >> AUTOBUILD.bat
if %COMP%==mingw echo %MINGW_ROOT_BKSLH%-%ARCHN%\bin\mingw32-make -j4 >> AUTOBUILD.bat
if %COMP%==mingw echo %MINGW_ROOT_BKSLH%-%ARCHN%\bin\mingw32-make package >> AUTOBUILD.bat

REM ---------------- Call CMake ----------------
call %PATH_FIL%
set ALL_PARAMS=-DDISABLE_SWISSRANGER_3DCAM_LIBS=ON -DDISABLE_PCL=ON -DDISABLE_NationalInstruments=ON -DOpenCV_DIR=E:/code/opencv-%COMP%-%ARCH% -DMRPT_HAS_FFMPEG_WIN32=ON -DFFMPEG_WIN32_ROOT_DIR=%FFMPEGDIR% -DwxWidgets_ROOT_DIR=%WXDIR% -DwxWidgets_LIB_DIR=%WXLIBDIR%

if %ARCHN%==32 set LIBUSBLIB=%LIBUSBDIR%\lib\msvc\libusb.lib
if %ARCHN%==64 set LIBUSBLIB=%LIBUSBDIR%\lib\msvc_x64\libusb.lib

if %KINECT%==1 set ALL_PARAMS=%ALL_PARAMS% -DBUILD_KINECT=ON -DBUILD_KINECT_USE_FREENECT=ON -DLIBUSB_1_INCLUDE_DIR=%LIBUSBDIR%/include -DLIBUSB_1_LIBRARY=%LIBUSBLIB%

REM Create Project:
echo on
"%CMAKE_DIR%\cmake.exe" ../%MRPT_BASE_DIR% -G "%CMAKE_GEN%" %ALL_PARAMS% -Wno-dev %CMAKE_EXTRA1% %CMAKE_EXTRA2% %CMAKE_EXTRA3%

REM and insist to make sure wxWidgets and other vars have been fixed:
"%CMAKE_DIR%\cmake.exe" . -Wno-dev %ALL_PARAMS%
echo off

rem ----- BUILD PACKAGES -----
echo move mrpt*.exe ..\%DIR%.exe >> AUTOBUILD.bat
echo rmdir /Q /S _CPack_Packages  >> AUTOBUILD.bat

cd ..

rem UPDATE THE "BUILD ALL" SCRIPT
echo cd %CD% >> BUILD_ALL_MRPT.bat
echo cd %DIR% >> BUILD_ALL_MRPT.bat
echo AUTOBUILD.bat >> BUILD_ALL_MRPT.bat

REM End of Subroutine
GOTO :EOF

REM =========== The END ===========
:End

@echo off
REM =========================================================
REM   Automated generation of all the dirs for win builds
REM    for x32/amd64, for all MSVC versions
REM   To launch the build themselves and build packages,
REM    see "automated_build_msvc_binary_package.bat"
REM
REM  Copy this script to "d:\code" (or equivalent!), adjust
REM   all the paths below and execute.
REM
REM                              Jose Luis Blanco, 2011-15
REM =========================================================

REM  === THIS IS WHERE MRPT SOURCE TREE IS FROM THE CWD ===
set MRPT_BASE_DIR=mrpt-1.3.0

REM =================== SET ALL IMPORTANT PATHS ===================

set msvc9_DIR=E:\Program Files (x86)\Microsoft Visual Studio 9.0
rem set msvc10_DIR=E:\Program Files (x86)\Microsoft Visual Studio 10.0
set msvc11_DIR=E:\Archivos de programa (x86)\Microsoft Visual Studio 11.0
set msvc12_DIR=E:\Archivos de programa (x86)\Microsoft Visual Studio 12.0

set CMAKE_DIR=E:\Program Files (x86)\CMake\bin\
set LIBUSBDIR=E:\code\libusb-win32-bin-1.2.6.0
REM MinGW directories will be: %MINGW_ROOT%-32 and %MINGW_ROOT%-64
REM  (NOTE: Use "/" for paths in this one)
set MINGW_ROOT=E:/MinGW
set MINGW_ROOT_BKSLH=E:\MinGW
REM === wxWidgets directory base name will be: %WX_ROOT%-win%ARCHN%-%COMP%
set WX_ROOT=E:/code/wxWidgets-2.8.12
REM MSVC Redistributables: %MSVC_REDIST_BASE_DIR%/%COMP%/vcredist_%ARCH%.exe
set MSVC_REDIST_BASE_DIR=E:/code/MSVC_Redist

REM Since mrpt 1.3.0 we can build against libusb (for libfreenect) and will work in all systems (even w/o drivers)
set KINECT=1

REM ==============================================================

REM msvc11 ========================
set COMP=msvc11

set ARCHN=32
call :subGen
set ARCHN=64
call :subGen

REM msvc12 ========================
set COMP=msvc12

set ARCHN=32
call :subGen
set ARCHN=64
call :subGen

goto End
:MINGW_PARTS
REM MinGW ========================
set COMP=mingw
set ARCHN=32
call :subGen
set ARCHN=64
call :subGen

goto End

REM ===== Subroutine: Generate project dir ============
:subGen

set ARCH=x%ARCHN%
set DIR=%MRPT_BASE_DIR%-%COMP%-%ARCH%
if %KINECT%==1 set DIR=%DIR%-kinect
if %ARCHN%==32 set ARCH_NAME=x86
if %ARCHN%==64 set ARCH_NAME=amd64

set WXDIR=%WX_ROOT%-%COMP%-%ARCH%

set MSVC_REDIST=%MSVC_REDIST_BASE_DIR%/%COMP%/vcredist_%ARCH%.exe

if %COMP%==mingw GOTO :subGen_mingw
REM Visual Studio --------------------------
if %COMP%==msvc9 set MSVC_DIR=%msvc9_DIR%
if %COMP%==msvc10 set MSVC_DIR=%msvc10_DIR%
if %COMP%==msvc11 set MSVC_DIR=%msvc11_DIR%
if %COMP%==msvc12 set MSVC_DIR=%msvc12_DIR%
if %COMP%==msvc9 set CMAKE_GEN=Visual Studio 9 2008
if %COMP%==msvc10 set CMAKE_GEN=Visual Studio 10 2010
if %COMP%==msvc11 set CMAKE_GEN=Visual Studio 11 2012
if %COMP%==msvc12 set CMAKE_GEN=Visual Studio 12 2013
if %ARCHN%==64 set CMAKE_GEN=%CMAKE_GEN% Win64

set CMAKE_EXTRA1=-DINSTALL_MSVC_REDISTRIBUTABLE=%MSVC_REDIST%
set CMAKE_EXTRA2=
set CMAKE_EXTRA3=

set FFMPEGDIR=E:/code/ffmpeg-win%ARCHN%-dev
if %ARCHN%==32 set WXLIBDIR=%WXDIR%/lib/vc_dll
if %ARCHN%==64 set WXLIBDIR=%WXDIR%/lib/vc_amd64_dll

GOTO :subGen_common

REM MinGw (32 or 64) -----------------------

:subGen_mingw
set CMAKE_GEN=MinGW Makefiles
set CMAKE_EXTRA1=-DCMAKE_C_COMPILER=%MINGW_ROOT%-%ARCHN%/bin/gcc.exe
set CMAKE_EXTRA2=-DCMAKE_CXX_COMPILER=%MINGW_ROOT%-%ARCHN%/bin/g++.exe
set CMAKE_EXTRA3=-DCMAKE_MAKE_PROGRAM=%MINGW_ROOT%-%ARCHN%/bin/mingw32-make.exe

set FFMPEGDIR=E:/code/ffmpeg-win%ARCHN%-dev
set WXLIBDIR=%WXDIR%/lib/gcc_lib

REM Common part to all compilers -----------
:subGen_common

mkdir %DIR%
cd %DIR%

REM ---------------- Create compilation script ----------------
set PATH_FIL=paths_%COMP%_%ARCH_NAME%
if %KINECT%==1 set PATH_FIL=%PATH_FIL%-kinect
set PATH_FIL=%PATH_FIL%.bat

if NOT %COMP%==mingw set EXTRA_MINGW_PATHS=
if %COMP%==mingw set EXTRA_MINGW_PATHS=;%MINGW_ROOT_BKSLH%-%ARCHN%\bin

echo SET PATH=C:\Windows\system32;C:\Windows%EXTRA_MINGW_PATHS%;C:\Program Files\TortoiseSVN\bin;E:\code\opencv-%COMP%-%ARCH%\bin\Release;E:\code\opencv-%COMP%-%ARCH%\bin\Debug;%WXLIBDIR%;%FFMPEGDIR%/bin;%LIBUSBDIR%\bin\%ARCH_NAME%;%CMAKE_DIR%;%CD%\bin\Release;%CD%\bin\Debug > %PATH_FIL%
if NOT %COMP%==mingw echo call "%MSVC_DIR%\VC\vcvarsall.bat" %ARCH_NAME% >> %PATH_FIL%

echo call %PATH_FIL% > AUTOBUILD.bat
rem ----- COMPILE -----
if NOT %COMP%==mingw echo call ..\%MRPT_BASE_DIR%\scripts\automated_build_msvc_binary_package.bat ..\%MRPT_BASE_DIR%\ >> AUTOBUILD.bat
if %COMP%==mingw echo %MINGW_ROOT_BKSLH%-%ARCHN%\bin\mingw32-make test -j4 >> AUTOBUILD.bat
if %COMP%==mingw echo %MINGW_ROOT_BKSLH%-%ARCHN%\bin\mingw32-make -j4 >> AUTOBUILD.bat
if %COMP%==mingw echo %MINGW_ROOT_BKSLH%-%ARCHN%\bin\mingw32-make package >> AUTOBUILD.bat

REM ---------------- Call CMake ----------------
call %PATH_FIL%
set ALL_PARAMS=-DDISABLE_SWISSRANGER_3DCAM_LIBS=ON -DDISABLE_PCL=ON -DDISABLE_NationalInstruments=ON -DOpenCV_DIR=E:/code/opencv-%COMP%-%ARCH% -DMRPT_HAS_FFMPEG_WIN32=ON -DFFMPEG_WIN32_ROOT_DIR=%FFMPEGDIR% -DwxWidgets_ROOT_DIR=%WXDIR% -DwxWidgets_LIB_DIR=%WXLIBDIR%

if %ARCHN%==32 set LIBUSBLIB=%LIBUSBDIR%\lib\msvc\libusb.lib
if %ARCHN%==64 set LIBUSBLIB=%LIBUSBDIR%\lib\msvc_x64\libusb.lib

if %KINECT%==1 set ALL_PARAMS=%ALL_PARAMS% -DBUILD_KINECT=ON -DBUILD_KINECT_USE_FREENECT=ON -DLIBUSB_1_INCLUDE_DIR=%LIBUSBDIR%/include -DLIBUSB_1_LIBRARY=%LIBUSBLIB%

REM Create Project:
echo on
"%CMAKE_DIR%\cmake.exe" ../%MRPT_BASE_DIR% -G "%CMAKE_GEN%" %ALL_PARAMS% -Wno-dev %CMAKE_EXTRA1% %CMAKE_EXTRA2% %CMAKE_EXTRA3%

REM and insist to make sure wxWidgets and other vars have been fixed:
"%CMAKE_DIR%\cmake.exe" . -Wno-dev %ALL_PARAMS%
echo off

rem ----- BUILD PACKAGES -----
echo move mrpt*.exe ..\%DIR%.exe >> AUTOBUILD.bat
echo rmdir /Q /S _CPack_Packages  >> AUTOBUILD.bat

cd ..

rem UPDATE THE "BUILD ALL" SCRIPT
echo cd %CD% >> BUILD_ALL_MRPT.bat
echo cd %DIR% >> BUILD_ALL_MRPT.bat
echo AUTOBUILD.bat >> BUILD_ALL_MRPT.bat

REM End of Subroutine
GOTO :EOF

REM =========== The END ===========
:End

Update automated Windows builds script

Update automated Windows builds script


@echo off
:: Copyright (c) 2012 The Chromium Authors. All rights reserved.
:: Use of this source code is governed by a BSD-style license that can be
:: found in the LICENSE file.

:: This script will determine if python, git, or svn binaries need updates.  It
:: returns 123 if the user's shell must restart, otherwise !0 is failure

:: Sadly, we can't use SETLOCAL here otherwise it ERRORLEVEL is not correctly
:: returned.

set WIN_TOOLS_ROOT_URL=https://src.chromium.org/svn/trunk/tools
:: It used to be %~dp0 but ADODB.Stream may fail to write to this directory if
:: the directory DACL is set to elevated integrity level.
set ZIP_DIR=%TEMP%

:: Get absolute root directory (.js scripts don't handle relative paths well).
pushd %~dp0..\..
set WIN_TOOLS_ROOT_DIR=%CD%
popd

if "%1" == "force" (
  set WIN_TOOLS_FORCE=1
  shift /1
)

:PYTHON_CHECK
if not exist "%WIN_TOOLS_ROOT_DIR%\python276_bin" goto :PY27_INSTALL
if not exist "%WIN_TOOLS_ROOT_DIR%\python.bat" goto :PY27_INSTALL
set ERRORLEVEL=0
goto :GIT_CHECK

:PY27_INSTALL
echo Installing python 2.7.6...
:: Cleanup python directory if it was existing.
if exist "%WIN_TOOLS_ROOT_DIR%\python276_bin\." rd /q /s "%WIN_TOOLS_ROOT_DIR%\python276_bin"
if exist "%ZIP_DIR%\python276.zip" del "%ZIP_DIR%\python276.zip"
echo Fetching from %WIN_TOOLS_ROOT_URL%/third_party/python276_bin.zip
cscript //nologo //e:jscript "%~dp0get_file.js" %WIN_TOOLS_ROOT_URL%/third_party/python276_bin.zip "%ZIP_DIR%\python276_bin.zip"
if errorlevel 1 goto :PYTHON_FAIL
:: Will create python276_bin\...
cscript //nologo //e:jscript "%~dp0unzip.js" "%ZIP_DIR%\python276_bin.zip" "%WIN_TOOLS_ROOT_DIR%"
:: Create the batch files.
call copy /y "%~dp0python276.new.bat" "%WIN_TOOLS_ROOT_DIR%\python.bat" 1>nul
call copy /y "%~dp0pylint.new.bat" "%WIN_TOOLS_ROOT_DIR%\pylint.bat" 1>nul
del "%ZIP_DIR%\python276_bin.zip"
set ERRORLEVEL=0
goto :GIT_CHECK

:PYTHON_FAIL
echo ... Failed to checkout python automatically.
echo You should get the "prebaked" version at %WIN_TOOLS_ROOT_URL%/third_party/
set ERRORLEVEL=1
goto :END

:GIT_CHECK

:: must explicitly use FIND_EXE to prevent this from grabbing e.g. gnuwin32 or
:: msys versions.
set FIND_EXE=%SYSTEMROOT%\System32\find.exe

:: Check to see if we're on a 32 or 64 bit system
:: (parens) are necessary, otherwise batch puts an extra space after 32.
reg Query "HKLM\Hardware\Description\System\CentralProcessor\0" | %FIND_EXE% /i "x86" > NUL && (set OS_BITS=32) || (set OS_BITS=64)

if not exist "%WIN_TOOLS_ROOT_DIR%\.git_bleeding_edge" (
  set GIT_VERSION=2.7.4
) else (
  set GIT_VERSION=2.7.4
)
set GIT_VERSION=%GIT_VERSION%-%OS_BITS%

set GIT_FETCH_URL=https://storage.googleapis.com/chrome-infra/PortableGit-%GIT_VERSION%-bit.7z.exe
set GIT_DOWNLOAD_PATH=%ZIP_DIR%\git.7z.exe
set GIT_BIN_DIR=git-%GIT_VERSION%_bin
set GIT_INST_DIR=%WIN_TOOLS_ROOT_DIR%\%GIT_BIN_DIR%
set GIT_EXE_PATH=%GIT_INST_DIR%\bin\git.exe

:: Clean up any release which doesn't match the one we want.
for /d %%i in ("%WIN_TOOLS_ROOT_DIR%\git-*_bin") do (
  if not "%%i" == "%WIN_TOOLS_ROOT_DIR%\git-%GIT_VERSION%_bin" (
    echo Cleaning old git installation %%i
    rmdir /s /q "%%i" > NUL
  )
)

if "%WIN_TOOLS_FORCE%" == "1" goto :GIT_INSTALL

if not exist "%GIT_EXE_PATH%" goto :GIT_INSTALL

call "%GIT_EXE_PATH%" --version 2>nul 1>nul
if errorlevel 1 goto :GIT_INSTALL

:: Several git versions can live side-by-side; check the top-level
:: batch script to make sure it points to the desired version.
for %%f in (git.bat gitk.bat ssh.bat ssh-keygen.bat git-bash) do (
  %FIND_EXE% "%GIT_BIN_DIR%" "%WIN_TOOLS_ROOT_DIR%\%%f" 2>nul 1>nul
  if errorlevel 1 goto :GIT_MAKE_BATCH_FILES
)
if not exist %GIT_INST_DIR%\etc\profile.d\python.sh goto :GIT_MAKE_BATCH_FILES
goto :SYNC_GIT_HELP_FILES

:GIT_INSTALL
echo Installing git %GIT_VERSION% (avg 1-2 min download) ...

if exist "%GIT_DOWNLOAD_PATH%" del "%GIT_DOWNLOAD_PATH%"
echo Fetching from %GIT_FETCH_URL%
cscript //nologo //e:jscript "%~dp0get_file.js" %GIT_FETCH_URL% "%GIT_DOWNLOAD_PATH%"
if errorlevel 1 goto :GIT_FAIL
:: Cleanup git directory if it already exists.
if exist "%GIT_INST_DIR%\." rd /q /s "%GIT_INST_DIR%"

:: run PortableGit self-extractor
:: -y : Be Quiet ("yes")
:: -sd1 : Self delete SFX archive
:: -InstallPath : Where to put the files
:: -Directory : Run the post-extract program with this current-working-directory
::
:: Path slashes must be escaped or the 7zip sfx treats e.g. path\to\dir as
::   path[tab]o\dir.
set GIT_INST_DIR_ESC=%GIT_INST_DIR:\=\\%
call "%GIT_DOWNLOAD_PATH%" -y -sd1 -InstallPath="%GIT_INST_DIR_ESC%" -Directory="%GIT_INST_DIR_ESC%"
if errorlevel 1 goto :GIT_FAIL

del "%GIT_DOWNLOAD_PATH%"
if not exist "%GIT_INST_DIR%\." goto :GIT_FAIL

set DID_UPGRADE=1

:GIT_MAKE_BATCH_FILES
:: Create the batch files.
set GIT_TEMPL=%~dp0git.template.bat
set SED=%GIT_INST_DIR%\usr\bin\sed.exe
call "%SED%" -e "s/GIT_BIN_DIR/%GIT_BIN_DIR%/g" -e "s/GIT_PROGRAM/cmd\\\\git.exe/g" < %GIT_TEMPL% > "%WIN_TOOLS_ROOT_DIR%\git.bat"
call "%SED%" -e "s/GIT_BIN_DIR/%GIT_BIN_DIR%/g" -e "s/GIT_PROGRAM/cmd\\\\gitk.exe/g" < %GIT_TEMPL% > "%WIN_TOOLS_ROOT_DIR%\gitk.bat"
call "%SED%" -e "s/GIT_BIN_DIR/%GIT_BIN_DIR%/g" -e "s/GIT_PROGRAM/usr\\\\bin\\\\ssh.exe/g" < %GIT_TEMPL% > "%WIN_TOOLS_ROOT_DIR%\ssh.bat"
call "%SED%" -e "s/GIT_BIN_DIR/%GIT_BIN_DIR%/g" -e "s/GIT_PROGRAM/usr\\\\bin\\\\ssh-keygen.exe/g" < %GIT_TEMPL% > "%WIN_TOOLS_ROOT_DIR%\ssh-keygen.bat"
call "%SED%" -e "s/GIT_BIN_DIR/%GIT_BIN_DIR%/g" -e "s/PYTHON_BIN_DIR/python276_bin/g" -e "s/SVN_BIN_DIR/svn_bin/g" < %~dp0git-bash.template.sh > "%WIN_TOOLS_ROOT_DIR%\git-bash"
copy "%~dp0profile.d.python.sh" %GIT_INST_DIR%\etc\profile.d\python.sh > NUL

:: Ensure various git configurations are set correctly at they system level.
call "%WIN_TOOLS_ROOT_DIR%\git.bat" config --system core.autocrlf false
call "%WIN_TOOLS_ROOT_DIR%\git.bat" config --system core.filemode false
call "%WIN_TOOLS_ROOT_DIR%\git.bat" config --system core.preloadindex true
call "%WIN_TOOLS_ROOT_DIR%\git.bat" config --system core.fscache true

:SYNC_GIT_HELP_FILES
:: Copy all the depot_tools docs into the mingw64 git docs root.
:: /i : Make sure xcopy knows that the destination names a folder, not a file
:: /q : Make xcopy quiet (though it still prints a `X File(s) copied` message
::      which is why we have the > NUL)
:: /d : Copy source files that are newer than the corresponding destination
::      files only. This prevents excessive copying when none of the docs
::      actually changed.
:: /y : Don't prompt for overwrites (yes)
xcopy /i /q /d /y "%WIN_TOOLS_ROOT_DIR%\man\html\*" "%GIT_INST_DIR%\mingw64\share\doc\git-doc" > NUL

:: MSYS users need to restart their shell.
if defined MSYSTEM if defined DID_UPGRADE (
  echo.
  echo.
  echo IMPORTANT:
  echo depot_tools' git distribution has been updated while inside of a MinGW
  echo shell. In order to complete the upgrade, please exit the shell and re-run
  echo `git bash` from cmd.
  exit 123
)

goto :SVN_CHECK

:GIT_FAIL
echo ... Failed to checkout git automatically.
echo You should get the "prebaked" version used at %GIT_FETCH_URL%
set ERRORLEVEL=1
goto :END

:SVN_CHECK
:: If the batch file exists, skip the svn check.
if exist "%WIN_TOOLS_ROOT_DIR%\svn.bat" goto :END
if "%WIN_TOOLS_FORCE%" == "1" goto :SVN_INSTALL
call svn --version 2>nul 1>nul
if errorlevel 1 goto :SVN_INSTALL
goto :END

:SVN_INSTALL
echo Installing subversion ...
:: svn is not accessible; check it out and create 'proxy' files.
if exist "%ZIP_DIR%\svn.zip" del "%ZIP_DIR%\svn.zip"
echo Fetching from %WIN_TOOLS_ROOT_URL%/third_party/svn_bin.zip
cscript //nologo //e:jscript "%~dp0get_file.js" %WIN_TOOLS_ROOT_URL%/third_party/svn_bin.zip "%ZIP_DIR%\svn.zip"
if errorlevel 1 goto :SVN_FAIL
:: Cleanup svn directory if it was existing.
if exist "%WIN_TOOLS_ROOT_DIR%\svn\." rd /q /s "%WIN_TOOLS_ROOT_DIR%\svn"
if exist "%WIN_TOOLS_ROOT_DIR%\svn_bin\." rd /q /s "%WIN_TOOLS_ROOT_DIR%\svn_bin"
:: Will create svn_bin\...
cscript //nologo //e:jscript "%~dp0unzip.js" "%ZIP_DIR%\svn.zip" "%WIN_TOOLS_ROOT_DIR%"
if errorlevel 1 goto :SVN_FAIL
if not exist "%WIN_TOOLS_ROOT_DIR%\svn_bin\." goto :SVN_FAIL
del "%ZIP_DIR%\svn.zip"
:: Create the batch file.
call copy /y "%~dp0svn.new.bat" "%WIN_TOOLS_ROOT_DIR%\svn.bat" 1>nul
call copy /y "%~dp0svnversion.new.bat" "%WIN_TOOLS_ROOT_DIR%\svnversion.bat" 1>nul
goto :END

:SVN_FAIL
echo ... Failed to checkout svn automatically.
echo You should get the "prebaked" version at %WIN_TOOLS_ROOT_URL%/third_party/
set ERRORLEVEL=1
goto :END

:returncode
set WIN_TOOLS_ROOT_URL=
set WIN_TOOLS_ROOT_DIR=
exit /b %ERRORLEVEL%

:END
call :returncode %ERRORLEVEL%

@echo off
:: Copyright (c) 2012 The Chromium Authors. All rights reserved.
:: Use of this source code is governed by a BSD-style license that can be
:: found in the LICENSE file.

:: This script will determine if python, git, or svn binaries need updates.  It
:: returns 123 if the user's shell must restart, otherwise !0 is failure

:: Sadly, we can't use SETLOCAL here otherwise it ERRORLEVEL is not correctly
:: returned.

set WIN_TOOLS_ROOT_URL=https://src.chromium.org/svn/trunk/tools
:: It used to be %~dp0 but ADODB.Stream may fail to write to this directory if
:: the directory DACL is set to elevated integrity level.
set ZIP_DIR=%TEMP%

:: Get absolute root directory (.js scripts don't handle relative paths well).
pushd %~dp0..\..
set WIN_TOOLS_ROOT_DIR=%CD%
popd

if "%1" == "force" (
  set WIN_TOOLS_FORCE=1
  shift /1
)

:PYTHON_CHECK
if not exist "%WIN_TOOLS_ROOT_DIR%\python276_bin" goto :PY27_INSTALL
if not exist "%WIN_TOOLS_ROOT_DIR%\python.bat" goto :PY27_INSTALL
set ERRORLEVEL=0
goto :GIT_CHECK

:PY27_INSTALL
echo Installing python 2.7.6...
:: Cleanup python directory if it was existing.
if exist "%WIN_TOOLS_ROOT_DIR%\python276_bin\." rd /q /s "%WIN_TOOLS_ROOT_DIR%\python276_bin"
if exist "%ZIP_DIR%\python276.zip" del "%ZIP_DIR%\python276.zip"
echo Fetching from %WIN_TOOLS_ROOT_URL%/third_party/python276_bin.zip
cscript //nologo //e:jscript "%~dp0get_file.js" %WIN_TOOLS_ROOT_URL%/third_party/python276_bin.zip "%ZIP_DIR%\python276_bin.zip"
if errorlevel 1 goto :PYTHON_FAIL
:: Will create python276_bin\...
cscript //nologo //e:jscript "%~dp0unzip.js" "%ZIP_DIR%\python276_bin.zip" "%WIN_TOOLS_ROOT_DIR%"
:: Create the batch files.
call copy /y "%~dp0python276.new.bat" "%WIN_TOOLS_ROOT_DIR%\python.bat" 1>nul
call copy /y "%~dp0pylint.new.bat" "%WIN_TOOLS_ROOT_DIR%\pylint.bat" 1>nul
del "%ZIP_DIR%\python276_bin.zip"
set ERRORLEVEL=0
goto :GIT_CHECK

:PYTHON_FAIL
echo ... Failed to checkout python automatically.
echo You should get the "prebaked" version at %WIN_TOOLS_ROOT_URL%/third_party/
set ERRORLEVEL=1
goto :END

:GIT_CHECK

:: must explicitly use FIND_EXE to prevent this from grabbing e.g. gnuwin32 or
:: msys versions.
set FIND_EXE=%SYSTEMROOT%\System32\find.exe

:: Check to see if we're on a 32 or 64 bit system
:: (parens) are necessary, otherwise batch puts an extra space after 32.
reg Query "HKLM\Hardware\Description\System\CentralProcessor\0" | %FIND_EXE% /i "x86" > NUL && (set OS_BITS=32) || (set OS_BITS=64)

if not exist "%WIN_TOOLS_ROOT_DIR%\.git_bleeding_edge" (
  set GIT_VERSION=2.7.4
) else (
  set GIT_VERSION=2.8.1
)
set GIT_VERSION=%GIT_VERSION%-%OS_BITS%

set GIT_FETCH_URL=https://storage.googleapis.com/chrome-infra/PortableGit-%GIT_VERSION%-bit.7z.exe
set GIT_DOWNLOAD_PATH=%ZIP_DIR%\git.7z.exe
set GIT_BIN_DIR=git-%GIT_VERSION%_bin
set GIT_INST_DIR=%WIN_TOOLS_ROOT_DIR%\%GIT_BIN_DIR%
set GIT_EXE_PATH=%GIT_INST_DIR%\bin\git.exe

:: Clean up any release which doesn't match the one we want.
for /d %%i in ("%WIN_TOOLS_ROOT_DIR%\git-*_bin") do (
  if not "%%i" == "%WIN_TOOLS_ROOT_DIR%\git-%GIT_VERSION%_bin" (
    echo Cleaning old git installation %%i
    rmdir /s /q "%%i" > NUL
  )
)

if "%WIN_TOOLS_FORCE%" == "1" goto :GIT_INSTALL

if not exist "%GIT_EXE_PATH%" goto :GIT_INSTALL

call "%GIT_EXE_PATH%" --version 2>nul 1>nul
if errorlevel 1 goto :GIT_INSTALL

:: Several git versions can live side-by-side; check the top-level
:: batch script to make sure it points to the desired version.
for %%f in (git.bat gitk.bat ssh.bat ssh-keygen.bat git-bash) do (
  %FIND_EXE% "%GIT_BIN_DIR%" "%WIN_TOOLS_ROOT_DIR%\%%f" 2>nul 1>nul
  if errorlevel 1 goto :GIT_MAKE_BATCH_FILES
)
if not exist %GIT_INST_DIR%\etc\profile.d\python.sh goto :GIT_MAKE_BATCH_FILES
goto :SYNC_GIT_HELP_FILES

:GIT_INSTALL
echo Installing git %GIT_VERSION% (avg 1-2 min download) ...

if exist "%GIT_DOWNLOAD_PATH%" del "%GIT_DOWNLOAD_PATH%"
echo Fetching from %GIT_FETCH_URL%
cscript //nologo //e:jscript "%~dp0get_file.js" %GIT_FETCH_URL% "%GIT_DOWNLOAD_PATH%"
if errorlevel 1 goto :GIT_FAIL
:: Cleanup git directory if it already exists.
if exist "%GIT_INST_DIR%\." rd /q /s "%GIT_INST_DIR%"

:: run PortableGit self-extractor
:: -y : Be Quiet ("yes")
:: -sd1 : Self delete SFX archive
:: -InstallPath : Where to put the files
:: -Directory : Run the post-extract program with this current-working-directory
::
:: Path slashes must be escaped or the 7zip sfx treats e.g. path\to\dir as
::   path[tab]o\dir.
set GIT_INST_DIR_ESC=%GIT_INST_DIR:\=\\%
call "%GIT_DOWNLOAD_PATH%" -y -sd1 -InstallPath="%GIT_INST_DIR_ESC%" -Directory="%GIT_INST_DIR_ESC%"
if errorlevel 1 goto :GIT_FAIL

del "%GIT_DOWNLOAD_PATH%"
if not exist "%GIT_INST_DIR%\." goto :GIT_FAIL

set DID_UPGRADE=1

:GIT_MAKE_BATCH_FILES
:: Create the batch files.
set GIT_TEMPL=%~dp0git.template.bat
set SED=%GIT_INST_DIR%\usr\bin\sed.exe
call "%SED%" -e "s/GIT_BIN_DIR/%GIT_BIN_DIR%/g" -e "s/GIT_PROGRAM/cmd\\\\git.exe/g" < %GIT_TEMPL% > "%WIN_TOOLS_ROOT_DIR%\git.bat"
call "%SED%" -e "s/GIT_BIN_DIR/%GIT_BIN_DIR%/g" -e "s/GIT_PROGRAM/cmd\\\\gitk.exe/g" < %GIT_TEMPL% > "%WIN_TOOLS_ROOT_DIR%\gitk.bat"
call "%SED%" -e "s/GIT_BIN_DIR/%GIT_BIN_DIR%/g" -e "s/GIT_PROGRAM/usr\\\\bin\\\\ssh.exe/g" < %GIT_TEMPL% > "%WIN_TOOLS_ROOT_DIR%\ssh.bat"
call "%SED%" -e "s/GIT_BIN_DIR/%GIT_BIN_DIR%/g" -e "s/GIT_PROGRAM/usr\\\\bin\\\\ssh-keygen.exe/g" < %GIT_TEMPL% > "%WIN_TOOLS_ROOT_DIR%\ssh-keygen.bat"
call "%SED%" -e "s/GIT_BIN_DIR/%GIT_BIN_DIR%/g" -e "s/PYTHON_BIN_DIR/python276_bin/g" -e "s/SVN_BIN_DIR/svn_bin/g" < %~dp0git-bash.template.sh > "%WIN_TOOLS_ROOT_DIR%\git-bash"
copy "%~dp0profile.d.python.sh" %GIT_INST_DIR%\etc\profile.d\python.sh > NUL

:: Ensure various git configurations are set correctly at they system level.
call "%WIN_TOOLS_ROOT_DIR%\git.bat" config --system core.autocrlf false
call "%WIN_TOOLS_ROOT_DIR%\git.bat" config --system core.filemode false
call "%WIN_TOOLS_ROOT_DIR%\git.bat" config --system core.preloadindex true
call "%WIN_TOOLS_ROOT_DIR%\git.bat" config --system core.fscache true

:SYNC_GIT_HELP_FILES
:: Copy all the depot_tools docs into the mingw64 git docs root.
:: /i : Make sure xcopy knows that the destination names a folder, not a file
:: /q : Make xcopy quiet (though it still prints a `X File(s) copied` message
::      which is why we have the > NUL)
:: /d : Copy source files that are newer than the corresponding destination
::      files only. This prevents excessive copying when none of the docs
::      actually changed.
:: /y : Don't prompt for overwrites (yes)
xcopy /i /q /d /y "%WIN_TOOLS_ROOT_DIR%\man\html\*" "%GIT_INST_DIR%\mingw64\share\doc\git-doc" > NUL

:: MSYS users need to restart their shell.
if defined MSYSTEM if defined DID_UPGRADE (
  echo.
  echo.
  echo IMPORTANT:
  echo depot_tools' git distribution has been updated while inside of a MinGW
  echo shell. In order to complete the upgrade, please exit the shell and re-run
  echo `git bash` from cmd.
  exit 123
)

goto :SVN_CHECK

:GIT_FAIL
echo ... Failed to checkout git automatically.
echo You should get the "prebaked" version used at %GIT_FETCH_URL%
set ERRORLEVEL=1
goto :END

:SVN_CHECK
:: If the batch file exists, skip the svn check.
if exist "%WIN_TOOLS_ROOT_DIR%\svn.bat" goto :END
if "%WIN_TOOLS_FORCE%" == "1" goto :SVN_INSTALL
call svn --version 2>nul 1>nul
if errorlevel 1 goto :SVN_INSTALL
goto :END

:SVN_INSTALL
echo Installing subversion ...
:: svn is not accessible; check it out and create 'proxy' files.
if exist "%ZIP_DIR%\svn.zip" del "%ZIP_DIR%\svn.zip"
echo Fetching from %WIN_TOOLS_ROOT_URL%/third_party/svn_bin.zip
cscript //nologo //e:jscript "%~dp0get_file.js" %WIN_TOOLS_ROOT_URL%/third_party/svn_bin.zip "%ZIP_DIR%\svn.zip"
if errorlevel 1 goto :SVN_FAIL
:: Cleanup svn directory if it was existing.
if exist "%WIN_TOOLS_ROOT_DIR%\svn\." rd /q /s "%WIN_TOOLS_ROOT_DIR%\svn"
if exist "%WIN_TOOLS_ROOT_DIR%\svn_bin\." rd /q /s "%WIN_TOOLS_ROOT_DIR%\svn_bin"
:: Will create svn_bin\...
cscript //nologo //e:jscript "%~dp0unzip.js" "%ZIP_DIR%\svn.zip" "%WIN_TOOLS_ROOT_DIR%"
if errorlevel 1 goto :SVN_FAIL
if not exist "%WIN_TOOLS_ROOT_DIR%\svn_bin\." goto :SVN_FAIL
del "%ZIP_DIR%\svn.zip"
:: Create the batch file.
call copy /y "%~dp0svn.new.bat" "%WIN_TOOLS_ROOT_DIR%\svn.bat" 1>nul
call copy /y "%~dp0svnversion.new.bat" "%WIN_TOOLS_ROOT_DIR%\svnversion.bat" 1>nul
goto :END

:SVN_FAIL
echo ... Failed to checkout svn automatically.
echo You should get the "prebaked" version at %WIN_TOOLS_ROOT_URL%/third_party/
set ERRORLEVEL=1
goto :END

:returncode
set WIN_TOOLS_ROOT_URL=
set WIN_TOOLS_ROOT_DIR=
exit /b %ERRORLEVEL%

:END
call :returncode %ERRORLEVEL%

Bump Windows bleeding edge git to 2.8.1

Bump Windows bleeding edge git to 2.8.1

R=dnj@chromium.org
BUG=600028

Review URL: https://codereview.chromium.org/1858083002 .

git-svn-id: fd409f4bdeea2bb50a5d34bb4d4bfc2046a5a3dd@299704 0039d316-1c4b-4281-b951-d872f2087c98


SET VERSION="%1"

ECHO "Building release of version: %VERSION%"

SET RELEASE_DIR=".\ykman-gui\release"

CALL "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC"\vcvarsall.bat x86
SET "PATH=%PATH%;C:\Program Files (x86)\NSIS"

REM Download Appveyor build
REM powershell -Command "(New-Object Net.WebClient).DownloadFile('https://yubico-builds.s3-eu-west-1.amazonaws.com/yubikey-manager-qt/yubikey-manager-qt-yubikey-manager-qt-%VERSION%-win.zip', 'C:\Users\vagrant\Downloads\yubikey-manager-qt-%VERSION%-win.zip')"
REM 7z x -o"%RELEASE_DIR%" C:\Users\vagrant\Downloads\yubikey-manager-qt-%VERSION%-win.zip

signtool sign /fd SHA256 /t http://timestamp.verisign.com/scripts/timstamp.dll "%RELEASE_DIR%"\yubikey-manager-qt.exe
makensis -D"VERSION=%VERSION%" resources\win\win-installer.nsi
signtool sign /fd SHA256 /t http://timestamp.verisign.com/scripts/timstamp.dll "yubikey-manager-qt-%VERSION%-win.exe"
gpg --detach-sign "yubikey-manager-qt-%VERSION%-win.exe"

SET VERSION="%1"

ECHO "Building release of version: %VERSION%"

SET RELEASE_DIR=".\ykman-gui\release"

CALL "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC"\vcvarsall.bat x86
SET "PATH=%PATH%;C:\Program Files (x86)\NSIS"

REM Download Appveyor build
REM powershell -Command "(New-Object Net.WebClient).DownloadFile('https://yubico-builds.s3-eu-west-1.amazonaws.com/yubikey-manager-qt/yubikey-manager-qt-yubikey-manager-qt-%VERSION%-win.zip', 'C:\Users\vagrant\Downloads\yubikey-manager-qt-%VERSION%-win.zip')"
REM 7z x -o"%RELEASE_DIR%" C:\Users\vagrant\Downloads\yubikey-manager-qt-%VERSION%-win.zip

signtool sign /fd SHA256 /t http://timestamp.verisign.com/scripts/timstamp.dll "%RELEASE_DIR%"\ykman-gui.exe
makensis -D"VERSION=%VERSION%" resources\win\win-installer.nsi
signtool sign /fd SHA256 /t http://timestamp.verisign.com/scripts/timstamp.dll "yubikey-manager-qt-%VERSION%-win.exe"
gpg --detach-sign "yubikey-manager-qt-%VERSION%-win.exe"

Fix executable file name in vagrant/windows/release.bat


C:\Python27\python.exe ..\pyinstaller-2.0\pyinstaller.py --onefile --icon icon.ico --name eve-mlp eve_mlp/main_cli.py
C:\Python27\python.exe ..\pyinstaller-2.0\pyinstaller.py --onefile --icon icon.ico --name eve-gmlp eve_mlp/main_gui.py --windowed --resource icon.ico --resource LICENSE.txt

pause

@echo off

REM For people who don't have python in their path, assume it exists in the default location as a fallback
SET PATH=%PATH%;C:\Python27

python.exe ..\pyinstaller-2.0\pyinstaller.py --onefile --icon icon.ico --name eve-mlp eve_mlp/main_cli.py
python.exe ..\pyinstaller-2.0\pyinstaller.py --onefile --icon icon.ico --name eve-gmlp eve_mlp/main_gui.py --windowed --resource icon.ico --resource LICENSE.txt

pause

make non-standard python install path work too


@if "%DEBUG%" == "" @echo off
setlocal

set SOURCE_DIR=%CD%
set BUILD_DIR=%CD%\cppbuild\Release

if EXIST %BUILD_DIR% rd /S /Q %BUILD_DIR%

md %BUILD_DIR%
pushd %BUILD_DIR%

cmake -G "Visual Studio 16 2019" -DBUILD_AERON_DRIVER=ON %SOURCE_DIR%
cmake --build . --clean-first --config Release
ctest -C Release

@if "%DEBUG%" == "" @echo off
setlocal

set SOURCE_DIR=%CD%
set BUILD_DIR=%CD%\cppbuild\Release

if EXIST %BUILD_DIR% rd /S /Q %BUILD_DIR%

md %BUILD_DIR%
pushd %BUILD_DIR%

cmake -G "Visual Studio 16 2019" -DBUILD_AERON_DRIVER=ON %SOURCE_DIR%
if %ERRORLEVEL% neq 0 exit /b %ERRORLEVEL%

cmake --build . --clean-first --config Release
if %ERRORLEVEL% neq 0 exit /b %ERRORLEVEL%

ctest -C Release
if %ERRORLEVEL% neq 0 exit /b %ERRORLEVEL%

Exit on first error (Windows)

[C] Exit on first error (Windows)


copy mpi.f.single mpi.f
copy mpif.h.single mpif.h

x86_64-w64-mingw32-gfortran -g -w -O -Wall -o genesis2 main.f check.f diagno.f esource.f field.f incoherent.f math.f partsim.f pushp.f loadbeam.f loadrad.f magfield.f tdepend.f track.f string.f rpos.f scan.f source.f stepz.f timerec.f initrun.f  input.f output.f mpi.f > output.txt 2>&1

echo "DEBUG Info..."
dir

echo "The build output was: "
type output.txt

echo "-----------------------------------------------"

echo "Copying the file to Library Bin at %LIBRARY_BIN%"
copy genesis2.exe %LIBRARY_BIN%

copy mpi.f.single mpi.f
copy mpif.h.single mpif.h

if errorlevel 1 exit 1

x86_64-w64-mingw32-gfortran -g -w -O -Wall -o genesis2 main.f check.f diagno.f esource.f field.f incoherent.f math.f partsim.f pushp.f loadbeam.f loadrad.f magfield.f tdepend.f track.f string.f rpos.f scan.f source.f stepz.f timerec.f initrun.f  input.f output.f mpi.f > output.txt 2>&1

if errorlevel 1 exit 1

echo "DEBUG Info..."
dir

echo "The build output was: "
type output.txt

echo "-----------------------------------------------"

echo "Copying the file to Library Bin at %LIBRARY_BIN%"
copy genesis2.exe %LIBRARY_BIN%

if errorlevel 1 exit 1

Add some errorlevel checks at bld.bat.

DEBUG: Add some errorlevel checks at bld.bat.


echo OFF

set DEFAULT_ANACONDA_INSTALL_RECIPES=python-pkgtk
set DEFAULT_ANACONDA_CHANNELS=statiskit conda-forge
set DEFAULT_ANACONDA_INSTALL_FLAGS=--use-local

if "%ANACONDA_CHANNELS%" == "" (
    set ANACONDA_CHANNELS=%DEFAULT_ANACONDA_CHANNELS%
) else (
    echo Channels used: %ANACONDA_CHANNELS%
)

set ANACONDA_CHANNEL_FLAGS=
for %%i in (%ANACONDA_CHANNELS%) do (
    set "ANACONDA_CHANNEL_FLAGS=%%ANACONDA_CHANNEL_FLAGS%% -c %%i"
)

if "%ANACONDA_INSTALL_RECIPES%" == "" (
    set ANACONDA_INSTALL_RECIPES=%DEFAULT_ANACONDA_INSTALL_RECIPES%
) else (
    echo Recipes to build: %ANACONDA_INSTALL_RECIPES%
)

if "%ANACONDA_INSTALL_FLAGS%" == "" (
    set ANACONDA_INSTALL_FLAGS=%DEFAULT_ANACONDA_INSTALL_FLAGS%
)

echo ON

for %%i in (%ANACONDA_INSTALL_RECIPES%) do (
    conda install %%i --use-local %%ANACONDA_CHANNEL_FLAGS%% %ANACONDA_INSTALL_FLAGS%
    if errorlevel 1 (
        exit /b 1
    )
)

ECHO OFF

Setlocal EnableDelayedExpansion
echo OFF

set DEFAULT_ANACONDA_INSTALL_RECIPES=python-pkgtk
set DEFAULT_ANACONDA_CHANNELS=statiskit conda-forge
set DEFAULT_ANACONDA_INSTALL_FLAGS=--use-local

if "%ANACONDA_CHANNELS%" == "" (
    set ANACONDA_CHANNELS=%DEFAULT_ANACONDA_CHANNELS%
) else (
    echo Channels used: %ANACONDA_CHANNELS%
)

set ANACONDA_CHANNEL_FLAGS=
for %%i in (%ANACONDA_CHANNELS%) do (
    set "ANACONDA_CHANNEL_FLAGS=%ANACONDA_CHANNEL_FLAGS% -c %%i"
)

if "%ANACONDA_INSTALL_RECIPES%" == "" (
    set ANACONDA_INSTALL_RECIPES=%DEFAULT_ANACONDA_INSTALL_RECIPES%
) else (
    echo Recipes to build: %ANACONDA_INSTALL_RECIPES%
)

if "%ANACONDA_INSTALL_FLAGS%" == "" (
    set ANACONDA_INSTALL_FLAGS=%DEFAULT_ANACONDA_INSTALL_FLAGS%
)

echo ON

for %%i in (%ANACONDA_INSTALL_RECIPES%) do (
    conda install %%i --use-local %ANACONDA_CHANNEL_FLAGS% %ANACONDA_INSTALL_FLAGS%
    if errorlevel 1 (
        exit /b 1
    )
)

ECHO OFF

Update install.bat

Update install.bat