@echo off
echo Ensuring .NET 4.0 is installed
@powershell -NoProfile -ExecutionPolicy unrestricted -Command "iex ((new-object net.webclient).DownloadString('https://raw.github.com/StefanScherer/arduino-ide/install/InstallNet4.ps1'))"
echo Installing Chocolatey
@powershell -NoProfile -ExecutionPolicy unrestricted -Command "iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1'))" && SET PATH=%PATH%;%systemdrive%\chocolatey\bin

where cinst
if ERRORLEVEL 1 goto set_chocolatey
goto inst
:set_chocolatey
set ChocolateyInstall=%SystemDrive%\Chocolatey
set PATH=%PATH%;%ChocolateyInstall%\bin
:inst

call cinst vagrant
set PATH=%PATH%;%SystemDrive%\hashicorp\vagrant\bin
cd /D %USERPROFILE%\Documents

call cinst wget
call cinst 7zip
set PATH=%PATH%;C:\Program Files\7-Zip
call cinst vim
where gvim.exe
if ERRORLEVEL 1 call :addVimToUserPath
goto VIM_DONE
:addVimToUserPath
for /F "tokens=2* delims= " %%f IN ('reg query "HKCU\Environment" /v Path ^| findstr /i path') do set OLD_USER_PATH=%%g
reg add HKCU\Environment /v Path /d "%OLD_USER_PATH%;C:\Program Fiels (x86)\vim\vim74" /f
set PATH=%PATH%;C:\Program Files (x86)\vim\vim74
exit /b
:VIM_DONE

call cinst msysgit
set PATH=%PATH%;C:\Program Files (x86)\Git\cmd

rem install firefox and all plugins needed to access vCloud via browser
call cinst firefox
call cinst flashplayerplugin
if not exist "%TEMP%\VMware-ClientIntegrationPlugin-5.5.0.exe" (
call wget -O "%TEMP%\VMware-ClientIntegrationPlugin-5.5.0.exe" http://roecloudsrv001/vmware/clientintegrationplugin/VMware-ClientIntegrationPlugin-5.5.0.exe
)
"%TEMP%\VMware-ClientIntegrationPlugin-5.5.0.exe" /s /v/qn
del "%TEMP%\VMware-ClientIntegrationPlugin-5.5.0.exe"

set WORKDRIVE=D:

rem Install packer 0.5.1
if not exist %WORKDRIVE%\Packer\cache mkdir %WORKDRIVE%\Packer\cache
setx PACKER_CACHE_DIR %WORKDRIVE%\Packer\cache
set PACKER_CACHE_DIR=%WORKDRIVE%\Packer\cache
if not exist %WORKDRIVE%\Packer\temp mkdir %WORKDRIVE%\Packer\temp
setx PACKER_TEMP_DIR %WORKDRIVE%\Packer\temp
set PACKER_TEMP_DIR=%WORKDRIVE%\Packer\temp

rem call cinst packer
if exist C:\hashicorp\packer\packer.exe goto PACKER_INSTALLED
call wget --no-check-certificate https://dl.bintray.com/mitchellh/packer/0.5.1_windows_amd64.zip -O %TEMP%\0.5.1_windows_amd64.zip
mkdir C:\hashicorp\packer
cd /D C:\hashicorp\packer
7z x %TEMP%\0.5.1_windows_amd64.zip
cd /D %USERPROFILE%
rem :PACKER_INSTALLED
where packer
if ERRORLEVEL 1 call :addPackerToUserPath
goto PACKER_DONE
:addPackerToUserPath
for /F "tokens=2* delims= " %%f IN ('reg query "HKCU\Environment" /v Path ^| findstr /i path') do set OLD_USER_PATH=%%g
reg add HKCU\Environment /v Path /d "%OLD_USER_PATH%;C:\hashicorp\packer" /f
set PATH=%PATH%;C:\hashicorp\packer
exit /b
:PACKER_DONE

rem Install VirtualBox 4.3.6
if not exist "%USERPROFILE%\.VirtualBox\VirtualBox.xml" (
  mkdir "%USERPROFILE%\.VirtualBox"
  call wget --no-check-certificate https://github.com/StefanScherer/basebox-slave/raw/master/VirtualBox.xml -O "%USERPROFILE%\.VirtualBox\VirtualBox.xml"
)
call cinst virtualbox
if not exist %WORKDRIVE%\VirtualBox mkdir %WORKDRIVE%\VirtualBox
rem if exist "C:\program files\oracle\virtualbox\vboxmanage.exe" goto VIRTUALBOX_INSTALLED
rem wget http://download.virtualbox.org/virtualbox/4.3.6/VirtualBox-4.3.6-91406-Win.exe -O %TEMP%\VirtualBox-4.3.6-91406-Win.exe
rem %TEMP%\VirtualBox-4.3.6-91406-Win.exe -s
:VIRTUALBOX_INSTALLED
where vboxmanage
if ERRORLEVEL 1 call :addVirtualBoxToUserPath
goto VIRTUALBOX_DONE
:addVirtualBoxToUserPath
for /F "tokens=2* delims= " %%f IN ('reg query "HKCU\Environment" /v Path ^| findstr /i path') do set OLD_USER_PATH=%%g
reg add HKCU\Environment /v Path /d "%OLD_USER_PATH%;C:\program files\oracle\virtualbox" /f
set PATH=%PATH%;C:\program files\oracle\virtualbox
exit /b
:VIRTUALBOX_DONE

rem Install Jenkins
rem wget http://mirrors.jenkins-ci.org/windows/latest -O %TEMP%\jenkins.zip
rem cd /D %TEMP%
rem unzip jenkins.zip
rem setup.exe -s

if not exist %WORKDRIVE%\GitHub mkdir %WORKDRIVE%\GitHub
cd /D %WORKDRIVE%\GitHub
if not exist basebox-packer (
  git clone https://github.com/StefanScherer/basebox-packer.git
) else (
  cd basebox-packer
  git pull
  cd ..
)

if not exist packer-windows (
  git clone -b san https://github.com/StefanScherer/packer-windows.git
) else (
  cd packer-windows
  git pull
  cd ..
)

if not exist basebox-slave (
  git clone https://github.com/StefanScherer/basebox-slave.git
) else (
  cd basebox-slave
  git pull
  cd ..
)

echo Install VMware PowerCLI...
if not exist "c:\Program Files (x86)\VMware\VMware VIX" (
  if not exist "%TEMP%\VMware-PowerCLI-5.5.0-1295336.exe" (
    call wget -O "%TEMP%\VMware-PowerCLI-5.5.0-1295336.exe" http://roecloudsrv001/vmware/powercli/VMware-PowerCLI-5.5.0-1295336.exe
  )
  powershell -Command "Import-Module ServerManager; Add-WindowsFeature NET-Framework-Features"
  "%TEMP%\VMware-PowerCLI-5.5.0-1295336.exe" /s /v/qn /vADDLOCAL=ALL
  del "%TEMP%\VMware-PowerCLI-5.5.0-1295336.exe"
)

echo Install VMware Workstation...
rem Install VMware Workstation
if not exist "c:\Program Files (x86)\VMware\VMware Workstation" (
  if not exist "%TEMP%\VMware-workstation-full-10.0.0-1295980.exe" (
    call wget -O "%TEMP%\VMware-workstation-full-10.0.0-1295980.exe" http://roecloudsrv001/vmware/workstation10/VMware-workstation-full-10.0.0-1295980.exe
  )
  rem "%TEMP%\VMware-workstation-full-10.0.0-1295980.exe" /s /nsr /v EULAS_AGREED=1 SERIALNUMBER="xxxxx-xxxxx-xxxxx-xxxxx-xxxxx"
  "%TEMP%\VMware-workstation-full-10.0.0-1295980.exe" /s /nsr /v EULAS_AGREED=1
  del "%TEMP%\VMware-workstation-full-10.0.0-1295980.exe"
)

rem put ovftool into path
where ovftool
if ERRORLEVEL 1 call :addOvftoolToUserPath
goto OVFTOOL_DONE
:addOvftoolToUserPath
for /F "tokens=2* delims= " %%f IN ('reg query "HKCU\Environment" /v Path ^| findstr /i path') do set OLD_USER_PATH=%%g
reg add HKCU\Environment /v Path /d "%OLD_USER_PATH%;c:\Program Files (x86)\VMware\VMware Workstation\ovftool" /f
set PATH=%PATH%;c:\Program Files (x86)\VMware\VMware Workstation\ovftool
exit /b
:OVFTOOL_DONE

rem install addtime to measure time
call cinst strawberryperl
set PATH=%PATH%;c:\strawberry\perl\bin
wget --no-check-certificate -O c:\chocolatey\bin\addtime.bat https://github.com/StefanScherer/dotfiles-windows/raw/master/bin/addtime.bat

call cinst javaruntime
if not exist %WORKDRIVE%\jenkins mkdir %WORKDRIVE%\jenkins
if not exist %WORKDRIVE%\swarmclient mkdir %WORKDRIVE%\swarmclient
cd /D %WORKDRIVE%\swarmclient
call wget -O swarm-client.jar http://maven.jenkins-ci.org/content/repositories/releases/org/jenkins-ci/plugins/swarm-client/1.8/swarm-client-1.8-jar-with-dependencies.jar

set jenkinshost=10.115.4.8
net user swarmclient K8934jASD,x9  /ADD
net localgroup Administrators swarmclient /add
rem Due to problems with UDP broadcast, use the -master switch at the moment
rem Schedule start of swarm client at start of the machine (after next reboot)
schtasks /CREATE /SC ONSTART /RU swarmclient /RP K8934jASD,x9 /TN JenkinsSwarmClient /TR "java.exe -jar %WORKDRIVE%\swarmclient\swarm-client.jar -master http://%jenkinshost% -labels packer -fsroot %WORKDRIVE%\jenkins"

cd %WORKDRIVE%\GitHub\packer-windows
vagrant --version
packer --version
vboxmanage --version
ovftool -version

echo Extend drive C to maximum
echo select volume 2 >%TEMP%\extendC.txt
echo extend >>%TEMP%\extendC.txt
diskpart.exe /s %TEMP%\extendC.txt
set WORKDRIVE=C:

echo Ensuring .NET 4.0 is installed
@powershell -NoProfile -ExecutionPolicy unrestricted -Command "iex ((new-object net.webclient).DownloadString('https://raw.github.com/StefanScherer/arduino-ide/install/InstallNet4.ps1'))"
echo Installing Chocolatey
@powershell -NoProfile -ExecutionPolicy unrestricted -Command "iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1'))" && SET PATH=%PATH%;%systemdrive%\chocolatey\bin

where cinst
if ERRORLEVEL 1 goto set_chocolatey
goto inst
:set_chocolatey
set ChocolateyInstall=%SystemDrive%\Chocolatey
set PATH=%PATH%;%ChocolateyInstall%\bin
:inst

call cinst vagrant
set PATH=%PATH%;%SystemDrive%\hashicorp\vagrant\bin
cd /D %USERPROFILE%\Documents

call cinst wget
call cinst 7zip
set PATH=%PATH%;C:\Program Files\7-Zip
call cinst vim
where gvim.exe
if ERRORLEVEL 1 call :addVimToUserPath
goto VIM_DONE
:addVimToUserPath
for /F "tokens=2* delims= " %%f IN ('reg query "HKCU\Environment" /v Path ^| findstr /i path') do set OLD_USER_PATH=%%g
reg add HKCU\Environment /v Path /d "%OLD_USER_PATH%;C:\Program Fiels (x86)\vim\vim74" /f
set PATH=%PATH%;C:\Program Files (x86)\vim\vim74
exit /b
:VIM_DONE

call cinst msysgit
set PATH=%PATH%;C:\Program Files (x86)\Git\cmd

rem install firefox and all plugins needed to access vCloud via browser
call cinst firefox
call cinst flashplayerplugin
if not exist "%TEMP%\VMware-ClientIntegrationPlugin-5.5.0.exe" (
call wget -O "%TEMP%\VMware-ClientIntegrationPlugin-5.5.0.exe" http://roecloudsrv001/vmware/clientintegrationplugin/VMware-ClientIntegrationPlugin-5.5.0.exe
)
"%TEMP%\VMware-ClientIntegrationPlugin-5.5.0.exe" /s /v/qn
del "%TEMP%\VMware-ClientIntegrationPlugin-5.5.0.exe"

rem Install packer 0.5.1
if not exist %WORKDRIVE%\Packer\cache mkdir %WORKDRIVE%\Packer\cache
setx PACKER_CACHE_DIR %WORKDRIVE%\Packer\cache
set PACKER_CACHE_DIR=%WORKDRIVE%\Packer\cache
if not exist %WORKDRIVE%\Packer\temp mkdir %WORKDRIVE%\Packer\temp
setx PACKER_TEMP_DIR %WORKDRIVE%\Packer\temp
set PACKER_TEMP_DIR=%WORKDRIVE%\Packer\temp

rem call cinst packer
if exist C:\hashicorp\packer\packer.exe goto PACKER_INSTALLED
call wget --no-check-certificate https://dl.bintray.com/mitchellh/packer/0.5.1_windows_amd64.zip -O %TEMP%\0.5.1_windows_amd64.zip
mkdir C:\hashicorp\packer
cd /D C:\hashicorp\packer
7z x %TEMP%\0.5.1_windows_amd64.zip
cd /D %USERPROFILE%
rem :PACKER_INSTALLED
where packer
if ERRORLEVEL 1 call :addPackerToUserPath
goto PACKER_DONE
:addPackerToUserPath
for /F "tokens=2* delims= " %%f IN ('reg query "HKCU\Environment" /v Path ^| findstr /i path') do set OLD_USER_PATH=%%g
reg add HKCU\Environment /v Path /d "%OLD_USER_PATH%;C:\hashicorp\packer" /f
set PATH=%PATH%;C:\hashicorp\packer
exit /b
:PACKER_DONE

rem Install VirtualBox 4.3.6
if not exist "%USERPROFILE%\.VirtualBox\VirtualBox.xml" (
  mkdir "%USERPROFILE%\.VirtualBox"
  call wget --no-check-certificate https://github.com/StefanScherer/basebox-slave/raw/master/VirtualBox.xml -O "%USERPROFILE%\.VirtualBox\VirtualBox.xml"
)
call cinst virtualbox
if not exist %WORKDRIVE%\VirtualBox mkdir %WORKDRIVE%\VirtualBox
rem if exist "C:\program files\oracle\virtualbox\vboxmanage.exe" goto VIRTUALBOX_INSTALLED
rem wget http://download.virtualbox.org/virtualbox/4.3.6/VirtualBox-4.3.6-91406-Win.exe -O %TEMP%\VirtualBox-4.3.6-91406-Win.exe
rem %TEMP%\VirtualBox-4.3.6-91406-Win.exe -s
:VIRTUALBOX_INSTALLED
where vboxmanage
if ERRORLEVEL 1 call :addVirtualBoxToUserPath
goto VIRTUALBOX_DONE
:addVirtualBoxToUserPath
for /F "tokens=2* delims= " %%f IN ('reg query "HKCU\Environment" /v Path ^| findstr /i path') do set OLD_USER_PATH=%%g
reg add HKCU\Environment /v Path /d "%OLD_USER_PATH%;C:\program files\oracle\virtualbox" /f
set PATH=%PATH%;C:\program files\oracle\virtualbox
exit /b
:VIRTUALBOX_DONE

rem Install Jenkins
rem wget http://mirrors.jenkins-ci.org/windows/latest -O %TEMP%\jenkins.zip
rem cd /D %TEMP%
rem unzip jenkins.zip
rem setup.exe -s

if not exist %WORKDRIVE%\GitHub mkdir %WORKDRIVE%\GitHub
cd /D %WORKDRIVE%\GitHub
if not exist basebox-packer (
  git clone https://github.com/StefanScherer/basebox-packer.git
) else (
  cd basebox-packer
  git pull
  cd ..
)

if not exist packer-windows (
  git clone -b san https://github.com/StefanScherer/packer-windows.git
) else (
  cd packer-windows
  git pull
  cd ..
)

if not exist basebox-slave (
  git clone https://github.com/StefanScherer/basebox-slave.git
) else (
  cd basebox-slave
  git pull
  cd ..
)

echo Install VMware PowerCLI...
if not exist "c:\Program Files (x86)\VMware\VMware VIX" (
  if not exist "%TEMP%\VMware-PowerCLI-5.5.0-1295336.exe" (
    call wget -O "%TEMP%\VMware-PowerCLI-5.5.0-1295336.exe" http://roecloudsrv001/vmware/powercli/VMware-PowerCLI-5.5.0-1295336.exe
  )
  powershell -Command "Import-Module ServerManager; Add-WindowsFeature NET-Framework-Features"
  "%TEMP%\VMware-PowerCLI-5.5.0-1295336.exe" /s /v/qn /vADDLOCAL=ALL
  del "%TEMP%\VMware-PowerCLI-5.5.0-1295336.exe"
)

echo Install VMware Workstation...
rem Install VMware Workstation
if not exist "c:\Program Files (x86)\VMware\VMware Workstation" (
  if not exist "%TEMP%\VMware-workstation-full-10.0.0-1295980.exe" (
    call wget -O "%TEMP%\VMware-workstation-full-10.0.0-1295980.exe" http://roecloudsrv001/vmware/workstation10/VMware-workstation-full-10.0.0-1295980.exe
  )
  rem "%TEMP%\VMware-workstation-full-10.0.0-1295980.exe" /s /nsr /v EULAS_AGREED=1 SERIALNUMBER="xxxxx-xxxxx-xxxxx-xxxxx-xxxxx"
  "%TEMP%\VMware-workstation-full-10.0.0-1295980.exe" /s /nsr /v EULAS_AGREED=1
  del "%TEMP%\VMware-workstation-full-10.0.0-1295980.exe"
)

rem put ovftool into path
where ovftool
if ERRORLEVEL 1 call :addOvftoolToUserPath
goto OVFTOOL_DONE
:addOvftoolToUserPath
for /F "tokens=2* delims= " %%f IN ('reg query "HKCU\Environment" /v Path ^| findstr /i path') do set OLD_USER_PATH=%%g
reg add HKCU\Environment /v Path /d "%OLD_USER_PATH%;c:\Program Files (x86)\VMware\VMware Workstation\ovftool" /f
set PATH=%PATH%;c:\Program Files (x86)\VMware\VMware Workstation\ovftool
exit /b
:OVFTOOL_DONE

rem install addtime to measure time
call cinst strawberryperl
set PATH=%PATH%;c:\strawberry\perl\bin
wget --no-check-certificate -O c:\chocolatey\bin\addtime.bat https://github.com/StefanScherer/dotfiles-windows/raw/master/bin/addtime.bat

call cinst javaruntime
if not exist %WORKDRIVE%\jenkins mkdir %WORKDRIVE%\jenkins
if not exist %WORKDRIVE%\swarmclient mkdir %WORKDRIVE%\swarmclient
cd /D %WORKDRIVE%\swarmclient
call wget -O swarm-client.jar http://maven.jenkins-ci.org/content/repositories/releases/org/jenkins-ci/plugins/swarm-client/1.8/swarm-client-1.8-jar-with-dependencies.jar

set jenkinshost=10.115.4.8
net user swarmclient K8934jASD,x9  /ADD
net localgroup Administrators swarmclient /add
rem Due to problems with UDP broadcast, use the -master switch at the moment
rem Schedule start of swarm client at start of the machine (after next reboot)
schtasks /CREATE /SC ONSTART /RU swarmclient /RP K8934jASD,x9 /TN JenkinsSwarmClient /TR "java.exe -jar %WORKDRIVE%\swarmclient\swarm-client.jar -master http://%jenkinshost% -labels packer -fsroot %WORKDRIVE%\jenkins"

cd %WORKDRIVE%\GitHub\packer-windows
vagrant --version
packer --version
vboxmanage --version
ovftool -version

extend drive C, use WORKDRIVE C

extend drive C, use WORKDRIVE C


@echo off
setlocal

java -agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=8000 -jar  -Dlog4j.configurationFile=./conf/log4j2.xml ./lib/raildelays-batch-1.0.0-SNAPSHOT.jar
PAUSE

@echo off
setlocal

java -agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=8000 -jar  -Dlog4j.configurationFile=./conf/log4j2.xml ./lib/raildelays-batch.jar
PAUSE

Update runDebug.bat

Update runDebug.bat

Removed version from final name of raildelays-batch.jar


if not exist .git exit 1
git config core.fileMode false
if errorlevel 1 exit 1
git describe --tags --dirty
if errorlevel 1 exit 1
for /f "delims=" %%i in ('git describe') do set gitdesc=%%i
if errorlevel 1 exit 1
echo "%gitdesc%"
if not "%gitdesc%"=="1.8.1" exit 1
git status
if errorlevel 1 exit 1
git diff
if errorlevel 1 exit 1
set PYTHONPATH=.
python -c "import conda_build; assert conda_build.__version__ == '1.8.1', conda_build.__version__"
if errorlevel 1 exit 1

if not exist .git exit 1
git config core.fileMode false
if errorlevel 1 exit 1
git describe --tags --dirty
if errorlevel 1 exit 1
for /f "delims=" %%i in ('git describe') do set gitdesc=%%i
if errorlevel 1 exit 1
echo "%gitdesc%"
if not "%gitdesc%"=="1.8.1" exit 1
echo "%PKG_VERSION%"
if not "%PKG_VERSION%"="1.8.1" exit 1
git status
if errorlevel 1 exit 1
git diff
if errorlevel 1 exit 1
set PYTHONPATH=.
python -c "import conda_build; assert conda_build.__version__ == '1.8.1', conda_build.__version__"
if errorlevel 1 exit 1

tests/test-recipes/metadata/source_git_jinja2/bld.bat: Verify that `%PKG_VERSION%` is correct, as well.


@echo off
cd ../..
if not exist "temp" mkdir temp
cd temp
cmake -DCMAKE_INSTALL_PREFIX=../temp/install -G "Visual Studio 16 2019" -A x64 ..
if %errorlevel% neq 0 exit /b %errorlevel%
cd ../build/VisualStudio

@echo off
cd ../..
if not exist "temp" mkdir temp
cd temp
cmake -DCMAKE_INSTALL_PREFIX=../temp/install -G "Visual Studio 15 2017 Win64" ..
if %errorlevel% neq 0 exit /b %errorlevel%
cd ../build/VisualStudio

Rollback to Visual Studio 2017

Rollback to Visual Studio 2017


@rem Let CMake know about the LLVM install path, for find_package()
set CMAKE_PREFIX_PATH=%LIBRARY_PREFIX%

@rem Ensure there are no build leftovers (CMake can complain)
if exist ffi\build rmdir /S /Q ffi\build

python setup.py install
if errorlevel 1 exit 1

@rem Let CMake know about the LLVM install path, for find_package()
set CMAKE_PREFIX_PATH=%LIBRARY_PREFIX%

@rem Ensure there are no build leftovers (CMake can complain)
if exist ffi\build rmdir /S /Q ffi\build

python -S setup.py install
if errorlevel 1 exit 1

Revert bld.bat change

Revert bld.bat change


@echo off
reg add "HKCU\Software\Microsoft\Command Processor" /v AutoRun /d "%~dp0Profile.cmd" /f
call "%~dp0CreateShortcuts.cmd"
call "%~dp0ConsoleSetup.cmd"

@echo off
setlocal
if not defined CacheDrive set CacheDrive=%~d0

reg add "HKCU\Software\Microsoft\Command Processor" /v AutoRun /d "%~dp0Profile.cmd" /f

rem Search index: location is stored here
rem HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows Search\Databases\Windows
rem However, changing it directly & restarting service does not work

call :set_env_path NugetMachineInstallRoot %CacheDrive%\CoreXTCache
call :set_env_path ChocolateyInstall %CacheDrive%\Choco
call :set_env_path TMP %CacheDir%\OS_FILES\OS_TMP /M
call :set_env_path TMP %CacheDir%\OS_FILES\%USERNAME%_TMP
call :set_env_path TEMP %CacheDir%\OS_FILES\%USERNAME%_TMP

call :ensure_exists %CacheDrive%\symbols
setx _NT_SYMBOL_PATH cache*%CacheDrive%\symbols;SRV*http://msdl.microsoft.com/download/symbols;SRV*http://symweb

call "%~dp0CreateShortcuts.cmd"
call "%~dp0ConsoleSetup.cmd"

goto :eof

:ensure_exists
	if not exist %1 mkdir %1
	goto :eof

:set_env_path
	call :ensure_exists %2 || exit /b 1
	echo Creating env var %1=%2
	setx %1 %2 %3
	goto :eof

add cache folders

add cache folders


REM py2exe is apparently still only at Python 3.4
c:\Python34\python.exe -m venv --clear venv
venv\Scripts\pip3 install -U pip
venv\Scripts\pip3 install -U setuptools
venv\Scripts\pip3 install -r requirements.txt

use requirements.txt

use requirements.txt


@rem Makes a build of the viewer
@rem You should have a directory ..\viewerbuilddlls which has release versions of
@rem all dependency dlls, including gtkmm & the Visual Studio 9 runtime
@echo off
rmdir build /S /Q
md build
xcopy bin\*.* build /S /C
del build\data\configuration\*.xml
rmdir build\testing /S /Q
del build\*.dll
del build\viewerd.exe
del build\modules\core\*d.dll
del build\modules\test\*d.dll
del build\modules\test\TestModule*.*
del build\modules\test\non_existing_system.xml
xcopy ..\viewerbuilddlls\*.* build /S /C

@rem Makes a build of the viewer
@rem You should have a directory ..\viewerbuilddlls which has release versions of
@rem all dependency dlls, including gtkmm & the Visual Studio 9 runtime
@echo off
rmdir build /S /Q
md build
xcopy bin\*.* build /S /C
del build\data\configuration\*.xml
rmdir build\testing /S /Q
del build\*.dll
del build\viewerd.exe
del build\modules\core\*d.dll
del build\modules\test\*d.dll
del build\modules\test\TestModule*.*
del build\modules\test\non_existing_system.xml
del build\modules\core\OpenAL*.*
xcopy ..\viewerbuilddlls\*.* build /S /C

Delete OpenAL module from build from now on, because it's not yet used.

git-svn-id: 65dd0ccd495961f396d5302e5521154b071f0302@918 5b2332b8-efa3-11de-8684-7d64432d61a3


add start bat file

add start bat file


python3 --version
where python
where python3

cd runtime-testsuite
mvn -Dantlr-python3-python="C:\Python38\python.exe" -Dparallel=classes -DthreadCount=4 -Dtest=python3.** test
cd ..

python3 --version
where python
where python3

cd runtime-testsuite
mvn -Dantlr-python3-python="C:\Python38\python.exe" -Dparallel=classes -DthreadCount=4 -Dtest=python3.** test -Dantlr-python3-python="C:\Program Files\Python310\python.exe"
cd ..

Update run-tests-python3.cmd

Update run-tests-python3.cmd


REM The MIT License (MIT)
REM
REM Copyright (c) 2014 Erik Hvatum
REM
REM Permission is hereby granted, free of charge, to any person obtaining a copy
REM of this software and associated documentation files (the "Software"), to deal
REM in the Software without restriction, including without limitation the rights
REM to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
REM copies of the Software, and to permit persons to whom the Software is
REM furnished to do so, subject to the following conditions:
REM
REM The above copyright notice and this permission notice shall be included in all
REM copies or substantial portions of the Software.
REM
REM THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
REM IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
REM FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
REM AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
REM LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
REM OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
REM SOFTWARE.

del _ris_widget.lib
del _ris_widget.exp
del _ris_widget.pyd
del *.obj
del sip*.cpp
sip -c . -b ris_widget.sbf -I D:\Installs\Python\sip\PyQt5 -x VendorID -t WS_WIN -t Qt_5_2_0 -x PyQt_SSL ris_widget.sip
icl -c -nologo -Zm200 -Zc:wchar_t -FS -Od -MD -W3 -w34100 -w34189 -DNDEBUG -DUNICODE -DWIN32 -DWIN64 -DQT_DLL -DQT_NO_DEBUG -DQT_CORE_LIB -DQT_GUI_LIB -I. -ID:\Installs\Python\include -Id:\installs\qt5\mkspecs\win32-msvc2010 -I d:\installs\qt5\include\QtCore -Id:\installs\qt5\include\QtGui -Id:\installs\qt5\include\QtWidgets -Id:\installs\qt5\include\QtPrintSupport -Id:\installs\qt5\include -ID:\Installs\glm /Qstd=c++11 -ID:\Installs\qt5\include\QtOpenGL -I E:\zplrepo\ris_widget\cpp\GeneratedFiles *.cpp -ID:\Installs\boost_numpy -ID:\Installs\boost\include
link /NOLOGO /DYNAMICBASE /NXCOMPAT /DLL /SUBSYSTEM:WINDOWS /INCREMENTAL:NO /OUT:_ris_widget.pyd *.obj E:\zplrepo\ris_widget\cpp\x64\Release\RisWidget.lib /LIBPATH:D:\Installs\Python\libs Qt5Core.lib Qt5Gui.lib Qt5OpenGL.lib Qt5OpenGLExtensions.lib Qt5Widgets.lib /LIBPATH:D:\Installs\qt5\lib /LIBPATH:D:\Installs\boost_numpy\bin boost_numpy.lib /LIBPATH:D:\Installs\boost\lib /PDB:E:\zplrepo\ris_widget\_ris_widget.pdb /DEBUG

REM The MIT License (MIT)
REM
REM Copyright (c) 2014 Erik Hvatum
REM
REM Permission is hereby granted, free of charge, to any person obtaining a copy
REM of this software and associated documentation files (the "Software"), to deal
REM in the Software without restriction, including without limitation the rights
REM to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
REM copies of the Software, and to permit persons to whom the Software is
REM furnished to do so, subject to the following conditions:
REM
REM The above copyright notice and this permission notice shall be included in all
REM copies or substantial portions of the Software.
REM
REM THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
REM IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
REM FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
REM AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
REM LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
REM OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
REM SOFTWARE.

del _ris_widget.lib
del _ris_widget.exp
del _ris_widget.pyd
del *.obj
del sip*.cpp
sip -c . -b ris_widget.sbf -I D:\Installs\Python\sip\PyQt5 -x VendorID -t WS_WIN -t Qt_5_3_1 -x PyQt_SSL ris_widget.sip
icl -c -nologo -Zm200 -Zc:wchar_t -FS -Od -MD -W3 -w34100 -w34189 -DNDEBUG -DUNICODE -DWIN32 -DWIN64 -DQT_DLL -DQT_NO_DEBUG -DQT_CORE_LIB -DQT_GUI_LIB -I. -ID:\Installs\Python\include -ID:\Installs\qt\5.3\msvc2013_64_opengl\mkspecs\win32-msvc2010 -I D:\Installs\qt\5.3\msvc2013_64_opengl\include\QtCore -ID:\Installs\qt\5.3\msvc2013_64_opengl\include\QtGui -ID:\Installs\qt\5.3\msvc2013_64_opengl\include\QtWidgets -ID:\Installs\qt\5.3\msvc2013_64_opengl\include\QtPrintSupport -ID:\Installs\qt\5.3\msvc2013_64_opengl\include -ID:\Installs\glm /Qstd=c++11 -ID:\Installs\qt\5.3\msvc2013_64_opengl\include\QtOpenGL -I"c:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v6.0\include" -IE:\zplrepo\ris_widget\cpp\GeneratedFiles *.cpp -ID:\Installs\boost_numpy -ID:\Installs\boost\include
link /NOLOGO /DYNAMICBASE /NXCOMPAT /DLL /SUBSYSTEM:WINDOWS /INCREMENTAL:NO /OUT:_ris_widget.pyd *.obj E:\zplrepo\ris_widget\cpp\x64\Release\RisWidget.lib /LIBPATH:D:\Installs\Python\libs Qt5Core.lib Qt5Gui.lib Qt5OpenGL.lib Qt5OpenGLExtensions.lib Qt5Widgets.lib /LIBPATH:D:\Installs\qt\5.3\msvc2013_64_opengl\lib /LIBPATH:D:\Installs\boost\lib /LIBPATH:"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v6.0\lib\x64" OpenCL.lib opengl32.lib /PDB:E:\zplrepo\ris_widget\_ris_widget.pdb /DEBUG

Update Windows build bat file.

Update Windows build bat file.


@setlocal

@rem Add this batch file's directory to the path.
@set batchdir=%~dp0
@set path=%path%;%batchdir%

@rem Set the tracedir and temptracedir environment variables
@if not "%tracedir%" == "" goto TraceDirSet
@set tracedir=%batchdir%..\traces
:TraceDirSet
@if not "%temptracedir%" == "" goto TempTraceDirSet
@set temptracedir=%batchdir%..
:TempTraceDirSet

@rem Make sure %tracedir% and %temptracedir% exist
@if exist %tracedir% goto TraceDirExists
@mkdir %tracedir%
:TraceDirExists
@if exist %temptracedir% goto TempTraceDirExists
@mkdir %temptracedir%
:TempTraceDirExists

@call etwcommonsettings.bat
@call etwregister.bat

@rem Generate a file name based on the current date and time and put it in
@rem the parent directory of the batch file.
@rem Note: this probably fails in some locales. Sorry.
@for /F "tokens=2-4 delims=/- " %%A in ('date/T') do @set datevar=%%C-%%A-%%B
@for /f "tokens=1-2 delims=/:" %%a in ("%TIME%") do @set timevar=%%a-%%b
@set FileName=%tracedir%\%username%_%datevar%_%timevar%

@if "%1" == "" goto NoFileSpecified
@set ext=%~x1
@if "%ext%" == ".etl" goto fullFileSpecified
@rem Must be just a sub-component -- add it to the end
@set Filename=%FileName%_%1.etl
@goto FileSpecified

:fullFileSpecified
@set FileName=%1
@goto FileSpecified

:NoFileSpecified
@set FileName=%FileName%.etl
:FileSpecified
@echo Trace will be saved to %FileName%

@rem Set trace parameters. Latency is a good default group, and Power adds
@rem CPU power management details. Dispatcher allows wait classification and
@rem file IO is useful for seeing what disk reads are requested.
@rem Note that Latency is equal to PROC_THREAD+LOADER+DISK_IO+HARD_FAULTS+DPC+INTERRUPT+CSWITCH+PROFILE
@set KernelProviders=Latency+POWER+DISPATCHER+FILE_IO+FILE_IO_INIT

@set KernelStackWalk=-stackwalk PROFILE
@if "%2" == "nocswitchstacks" goto NoCSwitchStacks
@rem Recording call stacks on context switches is very powerful and useful
@rem but does make context switching more expensive.
@set KernelStackWalk=%KernelStackWalk%+CSWITCH+READYTHREAD
:NoCSwitchStacks

@rem Add recording of VirtAlloc data and stacks
@set KernelProviders=%KernelProviders%+VIRT_ALLOC
@set KernelStackWalk=%KernelStackWalk%+VirtualAlloc

@rem Modified to reduce context switching overhead
@rem @set KernelStackWalk=-stackwalk PROFILE
@rem Disable stack walking if you want to reduce the data rate.
@if "%2" == "nostacks" set KernelStackWalk=
@set SessionName=gamesession

@rem Set the buffer size to 1024 KB (default is 64-KB) and a minimum of 300 buffers.
@rem This helps to avoid losing events. Increase minbuffers if events are still lost,
@rem but be aware that the current setting locks up 300 MB of RAM.
@set KBuffers=-buffersize 1024 -minbuffers 1200

@rem Stop the circular tracing if it is enabled.
@rem @call etwcirc stop

@rem Select locations for the temporary kernel and user trace files.
@rem These locations are chosen to be on the SSD and be in the directory
@rem that is excluded from virus scanning and bit9 hashing.
@set kernelfile=%temptracedir%\kernel.etl
@set userfile=%temptracedir%\user.etl

@rem Start the kernel provider and user-mode provider
xperf -on %KernelProviders% %KernelStackWalk% %KBuffers% -f %kernelfile% -start %SessionName% -on %UserProviders%+%CustomProviders% -f %userfile%
@if not %errorlevel% equ -2147023892 goto NotInvalidFlags
@echo Trying again without the custom providers. Run ETWRegister.bat to register them.
xperf -on %KernelProviders% %KernelStackWalk% %KBuffers% -f %kernelfile%  -start %SessionName% -on %UserProviders% -f %userfile%
:NotInvalidFlags
@if not %errorlevel% equ 0 goto failure

@echo Run the test you want to profile here
@pause

@rem Record the data and stop tracing
xperf -stop %SessionName% -stop
@set FileAndCompressFlags=%FileName% -compress
@if "%NOETWCOMPRESS%" == "" goto compressTrace
@set FileAndCompressFlags=%FileName%
:compressTrace

@rem New method -- allows requesting trace compression. This is a NOP on
@rem Windows 7 but on Windows 8 creates 5-7x smaller traces (that don't load on Windows 7)

@rem Rename c:\Windows\AppCompat\Programs\amcache.hve to avoid serious merge
@rem performance problems (up to six minutes!)
@set HVEDir=c:\Windows\AppCompat\Programs
@rename %HVEDir%\Amcache.hve Amcache_temp.hve 2>nul
@set RenameErrorCode=%errorlevel%

xperf -merge %kernelfile% %userfile% %FileAndCompressFlags%

@rem Rename the file back
@if not "%RenameErrorCode%" equ "0" goto SkipRename
@rename %HVEDir%\Amcache_temp.hve Amcache.hve
:SkipRename

@if not %errorlevel% equ 0 goto FailureToRecord
@rem Delete the temporary ETL files
@del %kernelfile%
@del %userfile%
@echo Trace data is in %FileName% -- load it with wpa or xperfview or gpuview.
@dir %FileName% | find /i ".etl"
@rem Preprocessing symbols to avoid delays with Chrome's huge symbols
@pushd %batchdir%
python StripChromeSymbols.py %FileName%
@popd
start wpa %FileName%
@rem Restart circular tracing.
@rem @call etwcirc StartSilent
@exit /b

:FailureToRecord
@rem Delete the temporary ETL files
@del %kernelfile%
@del %userfile%
@echo Failed to record trace.
@rem Restart circular tracing.
@rem @call etwcirc StartSilent
@exit /b

:failure
@rem Check for Access Denied
@if %errorlevel% == %ACCESSISDENIED% goto NotAdmin
@echo Failed to start tracing. Make sure the custom providers are registered
@echo (using etwregister.bat) or remove the line that adds them to UserProviders.
@echo Make sure you are running from an elevated command prompt.
@echo Forcibly stopping the kernel and user session to correct possible
@echo "file already exists" errors.
xperf -stop %SessionName% -stop
@exit /b

:NotAdmin
@echo You must run this batch file as administrator.
@exit /b

@setlocal

@rem Add this batch file's directory to the path.
@set batchdir=%~dp0
@set path=%path%;%batchdir%

@rem Set the tracedir and temptracedir environment variables
@if not "%tracedir%" == "" goto TraceDirSet
@set tracedir=%batchdir%..\traces
:TraceDirSet
@if not "%temptracedir%" == "" goto TempTraceDirSet
@set temptracedir=%tracedir%
:TempTraceDirSet

@rem Make sure %tracedir% and %temptracedir% exist
@if exist %tracedir% goto TraceDirExists
@mkdir %tracedir%
:TraceDirExists
@if exist %temptracedir% goto TempTraceDirExists
@mkdir %temptracedir%
:TempTraceDirExists

@call etwcommonsettings.bat
@call etwregister.bat

@rem Generate a file name based on the current date and time and put it in
@rem the parent directory of the batch file.
@rem Note: this probably fails in some locales. Sorry.
@for /F "tokens=2-4 delims=/- " %%A in ('date/T') do @set datevar=%%C-%%A-%%B
@for /f "tokens=1-2 delims=/:" %%a in ("%TIME%") do @set timevar=%%a-%%b
@set FileName=%tracedir%\%username%_%datevar%_%timevar%

@if "%1" == "" goto NoFileSpecified
@set ext=%~x1
@if "%ext%" == ".etl" goto fullFileSpecified
@rem Must be just a sub-component -- add it to the end
@set Filename=%FileName%_%1.etl
@goto FileSpecified

:fullFileSpecified
@set FileName=%1
@goto FileSpecified

:NoFileSpecified
@set FileName=%FileName%.etl
:FileSpecified
@echo Trace will be saved to %FileName%

@rem Set trace parameters. Latency is a good default group, and Power adds
@rem CPU power management details. Dispatcher allows wait classification and
@rem file IO is useful for seeing what disk reads are requested.
@rem Note that Latency is equal to PROC_THREAD+LOADER+DISK_IO+HARD_FAULTS+DPC+INTERRUPT+CSWITCH+PROFILE
@set KernelProviders=Latency+POWER+DISPATCHER+FILE_IO+FILE_IO_INIT

@set KernelStackWalk=-stackwalk PROFILE
@if "%2" == "nocswitchstacks" goto NoCSwitchStacks
@rem Recording call stacks on context switches is very powerful and useful
@rem but does make context switching more expensive.
@set KernelStackWalk=%KernelStackWalk%+CSWITCH+READYTHREAD
:NoCSwitchStacks

@rem Add recording of VirtAlloc data and stacks
@set KernelProviders=%KernelProviders%+VIRT_ALLOC
@set KernelStackWalk=%KernelStackWalk%+VirtualAlloc

@rem Modified to reduce context switching overhead
@rem @set KernelStackWalk=-stackwalk PROFILE
@rem Disable stack walking if you want to reduce the data rate.
@if "%2" == "nostacks" set KernelStackWalk=
@set SessionName=gamesession

@rem Set the buffer size to 1024 KB (default is 64-KB) and a minimum of 300 buffers.
@rem This helps to avoid losing events. Increase minbuffers if events are still lost,
@rem but be aware that the current setting locks up 300 MB of RAM.
@set KBuffers=-buffersize 1024 -minbuffers 1200

@rem Stop the circular tracing if it is enabled.
@rem @call etwcirc stop

@rem Select locations for the temporary kernel and user trace files.
@rem These locations are chosen to be on the SSD and be in the directory
@rem that is excluded from virus scanning and bit9 hashing.
@set kernelfile=%temptracedir%\kernel.etl
@set userfile=%temptracedir%\user.etl

@rem Start the kernel provider and user-mode provider
xperf -on %KernelProviders% %KernelStackWalk% %KBuffers% -f %kernelfile% -start %SessionName% -on %UserProviders%+%CustomProviders% -f %userfile%
@if not %errorlevel% equ -2147023892 goto NotInvalidFlags
@echo Trying again without the custom providers. Run ETWRegister.bat to register them.
xperf -on %KernelProviders% %KernelStackWalk% %KBuffers% -f %kernelfile%  -start %SessionName% -on %UserProviders% -f %userfile%
:NotInvalidFlags
@if not %errorlevel% equ 0 goto failure

@echo Run the test you want to profile here
@pause

@rem Record the data and stop tracing
xperf -stop %SessionName% -stop
@set FileAndCompressFlags=%FileName% -compress
@if "%NOETWCOMPRESS%" == "" goto compressTrace
@set FileAndCompressFlags=%FileName%
:compressTrace

@rem New method -- allows requesting trace compression. This is a NOP on
@rem Windows 7 but on Windows 8 creates 5-7x smaller traces (that don't load on Windows 7)

@rem Rename c:\Windows\AppCompat\Programs\amcache.hve to avoid serious merge
@rem performance problems (up to six minutes!)
@set HVEDir=c:\Windows\AppCompat\Programs
@rename %HVEDir%\Amcache.hve Amcache_temp.hve 2>nul
@set RenameErrorCode=%errorlevel%

xperf -merge %kernelfile% %userfile% %FileAndCompressFlags%

@rem Rename the file back
@if not "%RenameErrorCode%" equ "0" goto SkipRename
@rename %HVEDir%\Amcache_temp.hve Amcache.hve
:SkipRename

@if not %errorlevel% equ 0 goto FailureToRecord
@rem Delete the temporary ETL files
@del %kernelfile%
@del %userfile%
@echo Trace data is in %FileName% -- load it with wpa or xperfview or gpuview.
@dir %FileName% | find /i ".etl"
@rem Preprocessing symbols to avoid delays with Chrome's huge symbols
@pushd %batchdir%
python StripChromeSymbols.py %FileName%
@popd
start wpa %FileName%
@rem Restart circular tracing.
@rem @call etwcirc StartSilent
@exit /b

:FailureToRecord
@rem Delete the temporary ETL files
@del %kernelfile%
@del %userfile%
@echo Failed to record trace.
@rem Restart circular tracing.
@rem @call etwcirc StartSilent
@exit /b

:failure
@rem Check for Access Denied
@if %errorlevel% == %ACCESSISDENIED% goto NotAdmin
@echo Failed to start tracing. Make sure the custom providers are registered
@echo (using etwregister.bat) or remove the line that adds them to UserProviders.
@echo Make sure you are running from an elevated command prompt.
@echo Forcibly stopping the kernel and user session to correct possible
@echo "file already exists" errors.
xperf -stop %SessionName% -stop
@exit /b

:NotAdmin
@echo You must run this batch file as administrator.
@exit /b

Set temptracedir to tracedir.

Set temptracedir to tracedir.


@echo off
set current=%~dp0
set root=%current%..
cd %root%
@echo ##################
@echo Compile
@echo running %root%\setup.py build_ext --inplace
@echo ##################
set pythonexe="c:\Python372_x64\python.exe"
if not exist %pythonexe% set pythonexe="c:\Python370_x64\python.exe"
if not exist %pythonexe% set pythonexe="c:\Python366_x64\python.exe"
if not exist %pythonexe% set pythonexe="c:\Python365_x64\python.exe"
if not exist %pythonexe% set pythonexe="c:\Python364_x64\python.exe"
if not exist %pythonexe% set pythonexe="c:\Python363_x64\python.exe"
if not exist %pythonexe% set pythonexe="c:\Python36_x64\python.exe"
%pythonexe% -u %root%\setup.py build_ext --inplace
if %errorlevel% neq 0 exit /b %errorlevel%
@echo Done Compile.
@echo ##################
@echo Build
@echo running %root%\setup.py bdist_wheel
@echo ##################
%pythonexe% -u %root%\setup.py bdist_wheel sdist
if %errorlevel% neq 0 exit /b %errorlevel%
@echo Done Build.
cd %current%

@echo off
set current=%~dp0
set root=%current%..
cd %root%
@echo ##################
@echo Compile
@echo running %root%\setup.py build_ext --inplace
@echo ##################
set pythonexe="c:\Python372_x64\python.exe"
if not exist %pythonexe% set pythonexe="c:\Python370_x64\python.exe"
if not exist %pythonexe% set pythonexe="c:\Python366_x64\python.exe"
if not exist %pythonexe% set pythonexe="c:\Python365_x64\python.exe"
if not exist %pythonexe% set pythonexe="c:\Python364_x64\python.exe"
if not exist %pythonexe% set pythonexe="c:\Python363_x64\python.exe"
if not exist %pythonexe% set pythonexe="c:\Python36_x64\python.exe"
%pythonexe% -u %root%\setup.py build_ext --inplace
if %errorlevel% neq 0 exit /b %errorlevel%
@echo Done Compile.
@echo ##################
cd %root%
@echo Build
@echo running setup.py bdist_wheel sdist
@echo ##################
%pythonexe% -u setup.py bdist_wheel sdist
if %errorlevel% neq 0 exit /b %errorlevel%
@echo Done Build.
cd %current%

Update build.bat

Update build.bat


rm -rf ..\..\install\hdfs

mkdir ..\..\install\hdfs
mkdir ..\..\install\hdfs\conf

cp -r %PACKAGE_NAME%\webapps ..\..\install\hdfs
cp -r %PACKAGE_NAME%\lib ..\..\install\hdfs
cp %PACKAGE_NAME%\hadoop-0.20.0-p1-core.jar ..\..\install\hdfs\lib
cp %PACKAGE_NAME%\src\hdfs\hdfs-default.xml ..\..\install\hdfs\conf

rm -rf ..\..\install\hdfs

mkdir ..\..\install\hdfs
mkdir ..\..\install\hdfs\conf

cp -r %PACKAGE_SRC_NAME%\webapps ..\..\install\hdfs
cp -r %PACKAGE_SRC_NAME%\lib ..\..\install\hdfs
cp %PACKAGE_SRC_NAME%\hadoop-0.20.0-p1-core.jar ..\..\install\hdfs\lib
cp %PACKAGE_SRC_NAME%\src\hdfs\hdfs-default.xml ..\..\install\hdfs\conf

Fix windows build script for hadoop external.


Create Start-windows.bat

Create Start-windows.bat


"%R%" CMD INSTALL --build . %R_ARGS%
IF %ERRORLEVEL% NEQ 0 exit /B 1

Update bld.bat

Update bld.bat


@if "%_echo%" neq "on" echo off
setlocal

set INIT_TOOLS_LOG=%~dp0init-tools.log
if [%PACKAGES_DIR%]==[] set PACKAGES_DIR=%~dp0packages\
if [%TOOLRUNTIME_DIR%]==[] set TOOLRUNTIME_DIR=%~dp0Tools
set DOTNET_PATH=%TOOLRUNTIME_DIR%\dotnetcli\
if [%DOTNET_CMD%]==[] set DOTNET_CMD=%DOTNET_PATH%dotnet.exe
if [%BUILDTOOLS_SOURCE%]==[] set BUILDTOOLS_SOURCE=https://dotnet.myget.org/F/dotnet-buildtools/api/v3/index.json
set /P BUILDTOOLS_VERSION=< "%~dp0BuildToolsVersion.txt"
set BUILD_TOOLS_PATH=%PACKAGES_DIR%Microsoft.DotNet.BuildTools\%BUILDTOOLS_VERSION%\lib\
set PROJECT_JSON_PATH=%TOOLRUNTIME_DIR%\%BUILDTOOLS_VERSION%
set PROJECT_JSON_FILE=%PROJECT_JSON_PATH%\project.json
set PROJECT_JSON_CONTENTS={ "dependencies": { "Microsoft.DotNet.BuildTools": "%BUILDTOOLS_VERSION%" }, "frameworks": { "netcoreapp1.0": { } } }
set BUILD_TOOLS_SEMAPHORE=%PROJECT_JSON_PATH%\init-tools.completed

:: if force option is specified then clean the tool runtime and build tools package directory to force it to get recreated
if [%1]==[force] (
  if exist "%TOOLRUNTIME_DIR%" rmdir /S /Q "%TOOLRUNTIME_DIR%"
  if exist "%PACKAGES_DIR%Microsoft.DotNet.BuildTools" rmdir /S /Q "%PACKAGES_DIR%Microsoft.DotNet.BuildTools"
)

:: If sempahore exists do nothing
if exist "%BUILD_TOOLS_SEMAPHORE%" (
  echo Tools are already initialized.
  goto :EOF
)

if exist "%TOOLRUNTIME_DIR%" rmdir /S /Q "%TOOLRUNTIME_DIR%"

if NOT exist "%PROJECT_JSON_PATH%" mkdir "%PROJECT_JSON_PATH%"
echo %PROJECT_JSON_CONTENTS% > "%PROJECT_JSON_FILE%"
echo Running %0 > "%INIT_TOOLS_LOG%"

if exist "%DOTNET_CMD%" goto :afterdotnetrestore

echo Installing dotnet cli...
if NOT exist "%DOTNET_PATH%" mkdir "%DOTNET_PATH%"
set /p DOTNET_VERSION=< "%~dp0DotnetCLIVersion.txt"
set DOTNET_ZIP_NAME=dotnet-dev-win-x64.%DOTNET_VERSION%.zip
set DOTNET_REMOTE_PATH=https://dotnetcli.blob.core.windows.net/dotnet/Sdk/%DOTNET_VERSION%/%DOTNET_ZIP_NAME%
set DOTNET_LOCAL_PATH=%DOTNET_PATH%%DOTNET_ZIP_NAME%
echo Installing '%DOTNET_REMOTE_PATH%' to '%DOTNET_LOCAL_PATH%' >> "%INIT_TOOLS_LOG%"
powershell -NoProfile -ExecutionPolicy unrestricted -Command "$retryCount = 0; $success = $false; do { try { (New-Object Net.WebClient).DownloadFile('%DOTNET_REMOTE_PATH%', '%DOTNET_LOCAL_PATH%'); $success = $true; } catch { if ($retryCount -ge 6) { throw; } else { $retryCount++; Start-Sleep -Seconds (5 * $retryCount); } } } while ($success -eq $false); Add-Type -Assembly 'System.IO.Compression.FileSystem' -ErrorVariable AddTypeErrors; if ($AddTypeErrors.Count -eq 0) { [System.IO.Compression.ZipFile]::ExtractToDirectory('%DOTNET_LOCAL_PATH%', '%DOTNET_PATH%') } else { (New-Object -com shell.application).namespace('%DOTNET_PATH%').CopyHere((new-object -com shell.application).namespace('%DOTNET_LOCAL_PATH%').Items(),16) }" >> "%INIT_TOOLS_LOG%"
if NOT exist "%DOTNET_LOCAL_PATH%" (
  echo ERROR: Could not install dotnet cli correctly. See '%INIT_TOOLS_LOG%' for more details.
  exit /b 1
)

:afterdotnetrestore

if exist "%BUILD_TOOLS_PATH%" goto :afterbuildtoolsrestore
echo Restoring BuildTools version %BUILDTOOLS_VERSION%...
echo Running: "%DOTNET_CMD%" restore "%PROJECT_JSON_FILE%" --no-cache --packages "%PACKAGES_DIR%." --source "%BUILDTOOLS_SOURCE%" >> "%INIT_TOOLS_LOG%"
call "%DOTNET_CMD%" restore "%PROJECT_JSON_FILE%" --no-cache --packages "%PACKAGES_DIR%." --source "%BUILDTOOLS_SOURCE%" >> "%INIT_TOOLS_LOG%"
if NOT exist "%BUILD_TOOLS_PATH%init-tools.cmd" (
  echo ERROR: Could not restore build tools correctly. See '%INIT_TOOLS_LOG%' for more details.
  exit /b 1
)

:afterbuildtoolsrestore

echo Initializing BuildTools ...
echo Running: "%BUILD_TOOLS_PATH%init-tools.cmd" "%~dp0" "%DOTNET_CMD%" "%TOOLRUNTIME_DIR%" >> "%INIT_TOOLS_LOG%"
call "%BUILD_TOOLS_PATH%init-tools.cmd" "%~dp0" "%DOTNET_CMD%" "%TOOLRUNTIME_DIR%" >> "%INIT_TOOLS_LOG%"
set INIT_TOOLS_ERRORLEVEL=%ERRORLEVEL%
if not [%INIT_TOOLS_ERRORLEVEL%]==[0] (
	echo ERROR: An error occured when trying to initialize the tools. Please check '%INIT_TOOLS_LOG%' for more details.
	exit /b %INIT_TOOLS_ERRORLEVEL%
)

:: Create sempahore file
echo Done initializing tools.
echo Init-Tools.cmd completed for BuildTools Version: %BUILDTOOLS_VERSION% > "%BUILD_TOOLS_SEMAPHORE%"

@if "%_echo%" neq "on" echo off
setlocal

set INIT_TOOLS_LOG=%~dp0init-tools.log
if [%PACKAGES_DIR%]==[] set PACKAGES_DIR=%~dp0packages\
if [%TOOLRUNTIME_DIR%]==[] set TOOLRUNTIME_DIR=%~dp0Tools
set DOTNET_PATH=%TOOLRUNTIME_DIR%\dotnetcli\
if [%DOTNET_CMD%]==[] set DOTNET_CMD=%DOTNET_PATH%dotnet.exe
if [%BUILDTOOLS_SOURCE%]==[] set BUILDTOOLS_SOURCE=https://dotnet.myget.org/F/dotnet-buildtools/api/v3/index.json
set /P BUILDTOOLS_VERSION=< "%~dp0BuildToolsVersion.txt"
set BUILD_TOOLS_PATH=%PACKAGES_DIR%Microsoft.DotNet.BuildTools\%BUILDTOOLS_VERSION%\lib\
set PROJECT_JSON_PATH=%TOOLRUNTIME_DIR%\%BUILDTOOLS_VERSION%
set PROJECT_JSON_FILE=%PROJECT_JSON_PATH%\project.json
set PROJECT_JSON_CONTENTS={ "dependencies": { "Microsoft.DotNet.BuildTools": "%BUILDTOOLS_VERSION%" }, "frameworks": { "netcoreapp1.0": { } } }
set BUILD_TOOLS_SEMAPHORE=%PROJECT_JSON_PATH%\init-tools.completed

:: if force option is specified then clean the tool runtime and build tools package directory to force it to get recreated
if [%1]==[force] (
  if exist "%TOOLRUNTIME_DIR%" rmdir /S /Q "%TOOLRUNTIME_DIR%"
  if exist "%PACKAGES_DIR%Microsoft.DotNet.BuildTools" rmdir /S /Q "%PACKAGES_DIR%Microsoft.DotNet.BuildTools"
)

:: If sempahore exists do nothing
if exist "%BUILD_TOOLS_SEMAPHORE%" (
  echo Tools are already initialized.
  goto :EOF
)

if exist "%TOOLRUNTIME_DIR%" rmdir /S /Q "%TOOLRUNTIME_DIR%"

if NOT exist "%PROJECT_JSON_PATH%" mkdir "%PROJECT_JSON_PATH%"
echo %PROJECT_JSON_CONTENTS% > "%PROJECT_JSON_FILE%"
echo Running %0 > "%INIT_TOOLS_LOG%"

if exist "%DOTNET_CMD%" goto :afterdotnetrestore

echo Installing dotnet cli...
if NOT exist "%DOTNET_PATH%" mkdir "%DOTNET_PATH%"
set /p DOTNET_VERSION=< "%~dp0DotnetCLIVersion.txt"
set DOTNET_ZIP_NAME=dotnet-dev-win-x64.%DOTNET_VERSION%.zip
set DOTNET_REMOTE_PATH=https://dotnetcli.blob.core.windows.net/dotnet/Sdk/%DOTNET_VERSION%/%DOTNET_ZIP_NAME%
set DOTNET_LOCAL_PATH=%DOTNET_PATH%%DOTNET_ZIP_NAME%
echo Installing '%DOTNET_REMOTE_PATH%' to '%DOTNET_LOCAL_PATH%' >> "%INIT_TOOLS_LOG%"
powershell -NoProfile -ExecutionPolicy unrestricted -Command "$retryCount = 0; $success = $false; do { try { (New-Object Net.WebClient).DownloadFile('%DOTNET_REMOTE_PATH%', '%DOTNET_LOCAL_PATH%'); $success = $true; } catch { if ($retryCount -ge 6) { throw; } else { $retryCount++; Start-Sleep -Seconds (5 * $retryCount); } } } while ($success -eq $false); Add-Type -Assembly 'System.IO.Compression.FileSystem' -ErrorVariable AddTypeErrors; if ($AddTypeErrors.Count -eq 0) { [System.IO.Compression.ZipFile]::ExtractToDirectory('%DOTNET_LOCAL_PATH%', '%DOTNET_PATH%') } else { (New-Object -com shell.application).namespace('%DOTNET_PATH%').CopyHere((new-object -com shell.application).namespace('%DOTNET_LOCAL_PATH%').Items(),16) }" >> "%INIT_TOOLS_LOG%"
if NOT exist "%DOTNET_LOCAL_PATH%" (
  echo ERROR: Could not install dotnet cli correctly. See '%INIT_TOOLS_LOG%' for more details.
  exit /b 1
)

:afterdotnetrestore

if exist "%BUILD_TOOLS_PATH%" goto :afterbuildtoolsrestore
echo Restoring BuildTools version %BUILDTOOLS_VERSION%...
echo Running: "%DOTNET_CMD%" restore "%PROJECT_JSON_FILE%" --no-cache --packages "%PACKAGES_DIR%" --source "%BUILDTOOLS_SOURCE%" >> "%INIT_TOOLS_LOG%"
call "%DOTNET_CMD%" restore "%PROJECT_JSON_FILE%" --no-cache --packages "%PACKAGES_DIR%" --source "%BUILDTOOLS_SOURCE%" >> "%INIT_TOOLS_LOG%"
if NOT exist "%BUILD_TOOLS_PATH%init-tools.cmd" (
  echo ERROR: Could not restore build tools correctly. See '%INIT_TOOLS_LOG%' for more details.
  exit /b 1
)

:afterbuildtoolsrestore

echo Initializing BuildTools ...
echo Running: "%BUILD_TOOLS_PATH%init-tools.cmd" "%~dp0" "%DOTNET_CMD%" "%TOOLRUNTIME_DIR%" >> "%INIT_TOOLS_LOG%"
call "%BUILD_TOOLS_PATH%init-tools.cmd" "%~dp0" "%DOTNET_CMD%" "%TOOLRUNTIME_DIR%" >> "%INIT_TOOLS_LOG%"
set INIT_TOOLS_ERRORLEVEL=%ERRORLEVEL%
if not [%INIT_TOOLS_ERRORLEVEL%]==[0] (
	echo ERROR: An error occured when trying to initialize the tools. Please check '%INIT_TOOLS_LOG%' for more details.
	exit /b %INIT_TOOLS_ERRORLEVEL%
)

:: Create sempahore file
echo Done initializing tools.
echo Init-Tools.cmd completed for BuildTools Version: %BUILDTOOLS_VERSION% > "%BUILD_TOOLS_SEMAPHORE%"

Remove redundant dot

Remove redundant dot


@setlocal

@rem Check lf LLVM sources are available or obtainable
@set llvmsources=1
@if NOT EXIST "%devroot%\llvm\cmake\" if NOT EXIST "%devroot%\llvm-project\" IF %gitstate EQU 0 set llvmsources=0

@rem Ask to configure LLVM build
@IF %llvmsources% EQU 1 IF %cmakestate% GTR 0 set /p cfgllvmbuild=Generate LLVM build configuration command (y/n):
@IF %llvmsources% EQU 1 IF %cmakestate% GTR 0 echo.
@IF %llvmsources% EQU 0 IF %cmakestate% GTR 0 IF EXIST "%llvminstloc%\%abi%\lib\" set /p cfgllvmbuild=Generate LLVM build configuration command (y/n):
@IF %llvmsources% EQU 0 IF %cmakestate% GTR 0 IF EXIST "%llvminstloc%\%abi%\lib\" echo.
@if /I NOT "%cfgllvmbuild%"=="y" GOTO skipllvm

@rem Get/update LLVM source code
@set updllvmsrcver=15.0.2
@if /I "%legacyllvm%"=="y" set updllvmsrcver=14.0.6
@set llvmsrcver=0
@set llvmsrcloc="%devroot%\llvm-project\llvm\CMakeLists.txt"
@if NOT EXIST %llvmsrcloc% set llvmsrcloc="%devroot%\llvm\CMakeLists.txt"
@if NOT EXIST %llvmsrcloc% set llvmsrcloc=null
@if NOT %llvmsrcloc%==null for /f tokens^=2^ delims^=^(^)^ eol^= %%a IN ('type %llvmsrcloc%') DO @for /f tokens^=1^,2^ eol^= %%b IN ("%%a") DO @(
@IF /I "%%b"=="LLVM_VERSION_MAJOR" set /a llvmsrcver+=%%c*100
@IF /I "%%b"=="LLVM_VERSION_MINOR" set /a llvmsrcver+=%%c*10
@IF /I "%%b"=="LLVM_VERSION_PATCH" set /a llvmsrcver+=%%c
)
@if %llvmsrcver% GTR 0 set llvmsrcver=%llvmsrcver:~0,-2%.%llvmsrcver:~-2,1%.%llvmsrcver:~-1,1%
@IF %gitstate% GTR 0 if NOT %llvmsrcver%==%updllvmsrcver% (
@if EXIST "%devroot%\llvm-project\" echo Updating LLVM source code...
@if NOT EXIST "%devroot%\llvm-project\" MD "%devroot%\llvm-project"
@if EXIST "%devroot%\llvm-project\.git\" RD /S /Q "%devroot%\llvm-project\.git"
@CD "%devroot%\llvm-project"
@git init
@git config --local core.autocrlf false
@git remote add origin https://github.com/llvm/llvm-project.git
@git fetch --depth=1 origin llvmorg-%updllvmsrcver%
@git checkout -f FETCH_HEAD
@git clean -df
@echo.
)

@rem Apply is_trivially_copyable patch
@if NOT EXIST "%devroot%\llvm-project\" cd "%devroot%"
@if EXIST "%devroot%\llvm-project\" cd "%devroot%\llvm-project"

@rem Uncomment next line if still using LLVM<11 and build goes on fire
@rem IF %disableootpatch%==0 call "%devroot%\%projectname%\buildscript\modules\applypatch.cmd" llvm-vs-16_7
@IF %disableootpatch%==1 if EXIST "%msysloc%\usr\bin\patch.exe" echo Reverting out of tree patches...
@IF %disableootpatch%==1 IF EXIST "%msysloc%\usr\bin\patch.exe" %runmsys% patch -Np1 --no-backup-if-mismatch -R -r - -i "%devroot%\%projectname%\patches\llvm-vs-16_7.patch"
@IF %disableootpatch%==1 if EXIST "%msysloc%\usr\bin\patch.exe" echo.

@rem Ask for Ninja use if exists. Load it if opted for it.
@call "%devroot%\%projectname%\buildscript\modules\useninja.cmd"
@if /I "%useninja%"=="y" if %ninjastate%==1 set PATH=%devroot%\ninja\;%PATH%

@rem AMDGPU target (disabled, see https://github.com/pal1000/mesa-dist-win/issues/103)
@rem set /p amdgpu=Build AMDGPU target - required by RADV (y/n):
@rem echo.

@rem Clang
@if EXIST "%devroot%\llvm-project\" set /p buildclang=Build clang - required for OpenCL (y/n):
@if EXIST "%devroot%\llvm-project\" echo.

@rem Load cmake into build environment.
@if %cmakestate%==1 set PATH=%devroot%\cmake\bin\;%PATH%

@rem Construct build configuration command.
@set buildconf=cmake -G
@if /I NOT "%useninja%"=="y" set buildconf=%buildconf% "Visual Studio %toolset%"
@if %abi%==x86 if /I NOT "%useninja%"=="y" set buildconf=%buildconf% -A Win32
@if %abi%==x64 if /I NOT "%useninja%"=="y" set buildconf=%buildconf% -A x64
@if /I NOT "%useninja%"=="y" IF /I %PROCESSOR_ARCHITECTURE%==AMD64 set buildconf=%buildconf% -Thost=x64
@if /I "%useninja%"=="y" set buildconf=%buildconf%Ninja
@set buildconf=%buildconf% -DCMAKE_BUILD_TYPE=Release -DLLVM_USE_CRT_RELEASE=MT
@if EXIST "%devroot%\llvm-project\" IF /I NOT "%buildclang%"=="y" set buildconf=%buildconf% -DLLVM_ENABLE_PROJECTS=""
@IF /I "%buildclang%"=="y" set buildconf=%buildconf% -DLLVM_ENABLE_PROJECTS="clang"
@set buildconf=%buildconf% -DLLVM_TARGETS_TO_BUILD=
@IF /I "%amdgpu%"=="y" set buildconf=%buildconf%AMDGPU;
@set buildconf=%buildconf%X86 -DLLVM_OPTIMIZED_TABLEGEN=TRUE -DLLVM_INCLUDE_UTILS=OFF -DLLVM_INCLUDE_RUNTIMES=OFF -DLLVM_INCLUDE_TESTS=OFF -DLLVM_INCLUDE_EXAMPLES=OFF -DLLVM_INCLUDE_GO_TESTS=OFF -DLLVM_INCLUDE_BENCHMARKS=OFF -DLLVM_BUILD_LLVM_C_DYLIB=OFF -DLLVM_ENABLE_DIA_SDK=OFF
@if EXIST "%devroot%\llvm-project\" IF /I NOT "%buildclang%"=="y" set buildconf=%buildconf% -DLLVM_BUILD_TOOLS=OFF
@IF /I "%buildclang%"=="y" set buildconf=%buildconf% -DCLANG_BUILD_TOOLS=ON
@set buildconf=%buildconf% -DLLVM_ENABLE_RTTI=ON -DLLVM_ENABLE_TERMINFO=OFF

@if NOT EXIST "%devroot%\llvm-project\" echo LLVM build configuration command^: %buildconf% -DCMAKE_INSTALL_PREFIX="%llvminstloc%\%abi%" "%devroot%\llvm"
@if EXIST "%devroot%\llvm-project\" echo LLVM build configuration command^: %buildconf% -DCMAKE_INSTALL_PREFIX="%llvminstloc%\%abi%" "%devroot%\llvm-project\llvm"
@echo.

@rem Ask to do LLVM build
@if EXIST "%devroot%\llvm-project\" set /p buildllvm=Begin LLVM build (y/n):
@if EXIST "%devroot%\llvm-project\" echo.
@if NOT EXIST "%devroot%\llvm-project\" if EXIST "%devroot%\llvm\cmake\" set /p buildllvm=Begin LLVM build (y/n):
@if NOT EXIST "%devroot%\llvm-project\" if EXIST "%devroot%\llvm\cmake\" echo.
@IF /I NOT "%buildllvm%"=="y" GOTO skipllvm

@rem Always clean build
@echo Cleanning LLVM build. Please wait...
@echo.
@if EXIST "%llvminstloc%\%abi%\" RD /S /Q "%llvminstloc%\%abi%"
@if NOT EXIST "%devroot%\llvm-project\" cd "%devroot%\llvm"
@if EXIST "%devroot%\llvm-project\" cd "%devroot%\llvm-project"
@if EXIST "build\buildsys-%abi%\" RD /S /Q build\buildsys-%abi%
@if NOT EXIST "build\" MD build
@cd build
@if NOT EXIST "buildsys-%abi%\" md buildsys-%abi%
@cd buildsys-%abi%
@pause
@echo.

@rem Load Visual Studio environment. Can only be loaded in the background when using MsBuild.
@if /I "%useninja%"=="y" call %vsenv% %vsabi%
@if /I "%useninja%"=="y" if NOT EXIST "%devroot%\llvm-project\" cd "%llvminstloc%\buildsys-%abi%"
@if /I "%useninja%"=="y" if EXIST "%devroot%\llvm-project\" cd "%devroot%\llvm-project\build\buildsys-%abi%"
@if /I "%useninja%"=="y" echo.

@rem Configure and execute the build with the configuration made above.
@if NOT EXIST "%devroot%\llvm-project\" %buildconf% -DCMAKE_INSTALL_PREFIX="%llvminstloc%\%abi%" "%devroot%\llvm"
@if EXIST "%devroot%\llvm-project\" %buildconf% -DCMAKE_INSTALL_PREFIX="%llvminstloc%\%abi%" "%devroot%\llvm-project\llvm"
@echo.
@pause
@echo.
@if /I NOT "%useninja%"=="y" cmake --build . -j %throttle% --config Release --target install
@if /I NOT "%useninja%"=="y" IF /I NOT "%buildclang%"=="y" cmake --build . -j %throttle% --config Release --target llvm-config
@if /I NOT "%useninja%"=="y" IF /I NOT "%buildclang%"=="y" copy .\Release\bin\llvm-config.exe "%llvminstloc%\%abi%\bin\"
@if /I "%useninja%"=="y" ninja -j %throttle% install
@if /I "%useninja%"=="y" IF /I NOT "%buildclang%"=="y" ninja -j %throttle% llvm-config
@if /I "%useninja%"=="y" IF /I NOT "%buildclang%"=="y" copy .\bin\llvm-config.exe "%llvminstloc%\%abi%\bin\"
@echo.

@rem Avoid race condition in SPIRV LLVM translator sources checkout.
@pause
@echo.

:skipllvm
@IF %llvmsources% EQU 0 echo WARNING: LLVM source code not found and it couldn't be obtained.
@IF %cmakestate% EQU 0 echo WARNING: LLVM requires CMake to build.
@IF NOT EXIST "%llvminstloc%\%abi%\lib\" echo WARNING: LLVM binaries not found. If you want to build Mesa3D anyway it will be without llvmpipe, swr, RADV, lavapipe and all OpenCL drivers and high performance JIT won't be available for softpipe, osmesa and graw.
@IF %llvmsources% EQU 0 echo.
@IF %llvmsources% EQU 1 IF %cmakestate% EQU 0 echo.
@IF %llvmsources% EQU 1 IF %cmakestate% GTR 0 IF NOT EXIST "%llvminstloc%\%abi%\lib\" echo.
@IF EXIST "%llvminstloc%\%abi%\lib\cmake\llvm\LLVMConfig.cmake" if /I "%cfgllvmbuild%"=="y" call "%devroot%\%projectname%\buildscript\modules\llvmspv.cmd"

@rem Reset environment after LLVM build.
@endlocal
@cd "%devroot%"

@setlocal

@rem Check lf LLVM sources are available or obtainable
@set llvmsources=1
@if NOT EXIST "%devroot%\llvm\cmake\" if NOT EXIST "%devroot%\llvm-project\" IF %gitstate EQU 0 set llvmsources=0

@rem Ask to configure LLVM build
@IF %llvmsources% EQU 1 IF %cmakestate% GTR 0 set /p cfgllvmbuild=Generate LLVM build configuration command (y/n):
@IF %llvmsources% EQU 1 IF %cmakestate% GTR 0 echo.
@IF %llvmsources% EQU 0 IF %cmakestate% GTR 0 IF EXIST "%llvminstloc%\%abi%\lib\" set /p cfgllvmbuild=Generate LLVM build configuration command (y/n):
@IF %llvmsources% EQU 0 IF %cmakestate% GTR 0 IF EXIST "%llvminstloc%\%abi%\lib\" echo.
@if /I NOT "%cfgllvmbuild%"=="y" GOTO skipllvm

@rem Get/update LLVM source code
@set updllvmsrcver=15.0.2
@if /I "%legacyllvm%"=="y" set updllvmsrcver=14.0.6
@set llvmsrcver=0
@set llvmsrcloc="%devroot%\llvm-project\llvm\CMakeLists.txt"
@if NOT EXIST %llvmsrcloc% set llvmsrcloc="%devroot%\llvm\CMakeLists.txt"
@if NOT EXIST %llvmsrcloc% set llvmsrcloc=null
@if NOT %llvmsrcloc%==null for /f tokens^=2^ delims^=^(^)^ eol^= %%a IN ('type %llvmsrcloc%') DO @for /f tokens^=1^,2^ eol^= %%b IN ("%%a") DO @(
@IF /I "%%b"=="LLVM_VERSION_MAJOR" set /a llvmsrcver+=%%c*100
@IF /I "%%b"=="LLVM_VERSION_MINOR" set /a llvmsrcver+=%%c*10
@IF /I "%%b"=="LLVM_VERSION_PATCH" set /a llvmsrcver+=%%c
)
@if %llvmsrcver% GTR 0 set llvmsrcver=%llvmsrcver:~0,-2%.%llvmsrcver:~-2,1%.%llvmsrcver:~-1,1%
@IF %gitstate% GTR 0 if NOT %llvmsrcver%==%updllvmsrcver% (
@if EXIST "%devroot%\llvm-project\" echo Updating LLVM source code...
@if NOT EXIST "%devroot%\llvm-project\" MD "%devroot%\llvm-project"
@if EXIST "%devroot%\llvm-project\.git\" RD /S /Q "%devroot%\llvm-project\.git"
@CD "%devroot%\llvm-project"
@git init
@git config --local core.autocrlf false
@git remote add origin https://github.com/llvm/llvm-project.git
@git fetch --depth=1 origin llvmorg-%updllvmsrcver%
@git checkout -f FETCH_HEAD
@git clean -df
@echo.
)

@rem Apply is_trivially_copyable patch
@if NOT EXIST "%devroot%\llvm-project\" cd "%devroot%"
@if EXIST "%devroot%\llvm-project\" cd "%devroot%\llvm-project"

@rem Uncomment next line if still using LLVM<11 and build goes on fire
@rem IF %disableootpatch%==0 call "%devroot%\%projectname%\buildscript\modules\applypatch.cmd" llvm-vs-16_7
@IF %disableootpatch%==1 if EXIST "%msysloc%\usr\bin\patch.exe" echo Reverting out of tree patches...
@IF %disableootpatch%==1 IF EXIST "%msysloc%\usr\bin\patch.exe" %runmsys% patch -Np1 --no-backup-if-mismatch -R -r - -i "%devroot%\%projectname%\patches\llvm-vs-16_7.patch"
@IF %disableootpatch%==1 if EXIST "%msysloc%\usr\bin\patch.exe" echo.

@rem Ask for Ninja use if exists. Load it if opted for it.
@call "%devroot%\%projectname%\buildscript\modules\useninja.cmd"
@if /I "%useninja%"=="y" if %ninjastate%==1 set PATH=%devroot%\ninja\;%PATH%

@rem AMDGPU target (disabled, see https://github.com/pal1000/mesa-dist-win/issues/103)
@rem set /p amdgpu=Build AMDGPU target - required by RADV (y/n):
@rem echo.

@rem Clang
@if EXIST "%devroot%\llvm-project\" set /p buildclang=Build clang - required for OpenCL (y/n):
@if EXIST "%devroot%\llvm-project\" echo.

@rem Load cmake into build environment.
@if %cmakestate%==1 set PATH=%devroot%\cmake\bin\;%PATH%

@rem Construct build configuration command.
@set buildconf=cmake -G
@if /I NOT "%useninja%"=="y" set buildconf=%buildconf% "Visual Studio %toolset%"
@if %abi%==x86 if /I NOT "%useninja%"=="y" set buildconf=%buildconf% -A Win32
@if %abi%==x64 if /I NOT "%useninja%"=="y" set buildconf=%buildconf% -A x64
@if /I NOT "%useninja%"=="y" IF /I %PROCESSOR_ARCHITECTURE%==AMD64 set buildconf=%buildconf% -Thost=x64
@if /I "%useninja%"=="y" set buildconf=%buildconf%Ninja
@set buildconf=%buildconf% -DCMAKE_BUILD_TYPE=Release -DLLVM_USE_CRT_RELEASE=MT
@if EXIST "%devroot%\llvm-project\" IF /I NOT "%buildclang%"=="y" set buildconf=%buildconf% -DLLVM_ENABLE_PROJECTS=""
@IF /I "%buildclang%"=="y" set buildconf=%buildconf% -DLLVM_ENABLE_PROJECTS="clang"
@set buildconf=%buildconf% -DLLVM_TARGETS_TO_BUILD=
@IF /I "%amdgpu%"=="y" set buildconf=%buildconf%AMDGPU;
@set buildconf=%buildconf%X86 -DLLVM_OPTIMIZED_TABLEGEN=TRUE -DLLVM_INCLUDE_UTILS=OFF -DLLVM_INCLUDE_RUNTIMES=OFF -DLLVM_INCLUDE_TESTS=OFF -DLLVM_INCLUDE_EXAMPLES=OFF -DLLVM_INCLUDE_GO_TESTS=OFF -DLLVM_INCLUDE_BENCHMARKS=OFF -DLLVM_BUILD_LLVM_C_DYLIB=OFF -DLLVM_ENABLE_DIA_SDK=OFF
@if EXIST "%devroot%\llvm-project\" IF /I NOT "%buildclang%"=="y" set buildconf=%buildconf% -DLLVM_BUILD_TOOLS=OFF
@IF /I "%buildclang%"=="y" set buildconf=%buildconf% -DCLANG_BUILD_TOOLS=ON
@set buildconf=%buildconf% -DLLVM_ENABLE_RTTI=ON -DLLVM_ENABLE_TERMINFO=OFF

@if NOT EXIST "%devroot%\llvm-project\" echo LLVM build configuration command^: %buildconf% -DCMAKE_INSTALL_PREFIX="%llvminstloc%\%abi%" "%devroot%\llvm"
@if EXIST "%devroot%\llvm-project\" echo LLVM build configuration command^: %buildconf% -DCMAKE_INSTALL_PREFIX="%llvminstloc%\%abi%" "%devroot%\llvm-project\llvm"
@echo.

@rem Ask to do LLVM build
@if EXIST "%devroot%\llvm-project\" set /p buildllvm=Begin LLVM build (y/n):
@if EXIST "%devroot%\llvm-project\" echo.
@if NOT EXIST "%devroot%\llvm-project\" if EXIST "%devroot%\llvm\cmake\" set /p buildllvm=Begin LLVM build (y/n):
@if NOT EXIST "%devroot%\llvm-project\" if EXIST "%devroot%\llvm\cmake\" echo.
@IF /I NOT "%buildllvm%"=="y" GOTO skipllvm

@rem Always clean build
@echo Cleanning LLVM build. Please wait...
@echo.
@if EXIST "%llvminstloc%\%abi%\" RD /S /Q "%llvminstloc%\%abi%"
@if NOT EXIST "%devroot%\llvm-project\" cd "%devroot%\llvm"
@if EXIST "%devroot%\llvm-project\" cd "%devroot%\llvm-project"
@if EXIST "build\buildsys-%abi%\" RD /S /Q build\buildsys-%abi%
@if NOT EXIST "build\" MD build
@cd build
@if NOT EXIST "buildsys-%abi%\" md buildsys-%abi%
@cd buildsys-%abi%
@pause
@echo.

@rem Load Visual Studio environment. Can only be loaded in the background when using MsBuild.
@if /I "%useninja%"=="y" call %vsenv% %vsabi%
@if /I "%useninja%"=="y" if NOT EXIST "%devroot%\llvm-project\" cd "%devroot%\llvm\build\buildsys-%abi%"
@if /I "%useninja%"=="y" if EXIST "%devroot%\llvm-project\" cd "%devroot%\llvm-project\build\buildsys-%abi%"
@if /I "%useninja%"=="y" echo.

@rem Configure and execute the build with the configuration made above.
@if NOT EXIST "%devroot%\llvm-project\" %buildconf% -DCMAKE_INSTALL_PREFIX="%llvminstloc%\%abi%" "%devroot%\llvm"
@if EXIST "%devroot%\llvm-project\" %buildconf% -DCMAKE_INSTALL_PREFIX="%llvminstloc%\%abi%" "%devroot%\llvm-project\llvm"
@echo.
@pause
@echo.
@if /I NOT "%useninja%"=="y" cmake --build . -j %throttle% --config Release --target install
@if /I NOT "%useninja%"=="y" IF /I NOT "%buildclang%"=="y" cmake --build . -j %throttle% --config Release --target llvm-config
@if /I NOT "%useninja%"=="y" IF /I NOT "%buildclang%"=="y" copy .\Release\bin\llvm-config.exe "%llvminstloc%\%abi%\bin\"
@if /I "%useninja%"=="y" ninja -j %throttle% install
@if /I "%useninja%"=="y" IF /I NOT "%buildclang%"=="y" ninja -j %throttle% llvm-config
@if /I "%useninja%"=="y" IF /I NOT "%buildclang%"=="y" copy .\bin\llvm-config.exe "%llvminstloc%\%abi%\bin\"
@echo.

@rem Avoid race condition in SPIRV LLVM translator sources checkout.
@pause
@echo.

:skipllvm
@IF %llvmsources% EQU 0 echo WARNING: LLVM source code not found and it couldn't be obtained.
@IF %cmakestate% EQU 0 echo WARNING: LLVM requires CMake to build.
@IF NOT EXIST "%llvminstloc%\%abi%\lib\" echo WARNING: LLVM binaries not found. If you want to build Mesa3D anyway it will be without llvmpipe, swr, RADV, lavapipe and all OpenCL drivers and high performance JIT won't be available for softpipe, osmesa and graw.
@IF %llvmsources% EQU 0 echo.
@IF %llvmsources% EQU 1 IF %cmakestate% EQU 0 echo.
@IF %llvmsources% EQU 1 IF %cmakestate% GTR 0 IF NOT EXIST "%llvminstloc%\%abi%\lib\" echo.
@IF EXIST "%llvminstloc%\%abi%\lib\cmake\llvm\LLVMConfig.cmake" if /I "%cfgllvmbuild%"=="y" call "%devroot%\%projectname%\buildscript\modules\llvmspv.cmd"

@rem Reset environment after LLVM build.
@endlocal
@cd "%devroot%"

Fix LLVM core project only build with Ninja. Regression from last commit


@echo off

mkdir build
cd build

rem Need to handle Python 3.x case at some point (Visual Studio 2010)
if %ARCH%==32 (
  if %PY_VER% LSS 3 (
    set CMAKE_GENERATOR="Visual Studio 9 2008"
  )
)

if %ARCH%==64 (
  if %PY_VER% LSS 3 (
    set CMAKE_GENERATOR="Visual Studio 9 2008 Win64"
  )
)

cmake .. -G %CMAKE_GENERATOR% ^
 -DCMAKE_INSTALL_PREFIX=%LIBRARY_PREFIX% ^
 -DCMAKE_PREFIX_PATH=%LIBRARY_PREFIX%

cmake --build . --config Release

mkdir %LIBRARY_LIB%
copy /y Release\*.lib %LIBRARY_LIB% > nul
if errorlevel 1 exit 1

@echo off

mkdir build
cd build

rem Need to handle Python 3.x case at some point (Visual Studio 2010)
if %ARCH%==32 (
  if %PY_VER% LSS 3 (
    set CMAKE_GENERATOR="Visual Studio 9 2008"
  )
)

if %ARCH%==64 (
  if %PY_VER% LSS 3 (
    set CMAKE_GENERATOR="Visual Studio 9 2008 Win64"
  )
)

cmake .. -G %CMAKE_GENERATOR% ^
 -DCMAKE_INSTALL_PREFIX=%LIBRARY_PREFIX% ^
 -DCMAKE_PREFIX_PATH=%LIBRARY_PREFIX%

cmake --build . --config Release

rem mkdir %LIBRARY_PREFIX%\src
mkdir %LIBRARY_PREFIX%\src\gtest

copy /y Release\*.lib %LIBRARY_LIB% > nul
if errorlevel 1 exit 1

cd ..

xcopy include %LIBRARY_INC% /E /I > nul
if errorlevel 1 exit 1

xcopy src  %LIBRARY_PREFIX%\src\gtest\src /E /I > nul
if errorlevel 1 exit 1

xcopy cmake %LIBRARY_PREFIX%\src\gtest\cmake /E /I > nul
if errorlevel 1 exit 1

copy /y CmakeLists.txt %LIBRARY_PREFIX%\src\gtest > nul
if errorlevel 1 exit 1

Add missing headers and source files

gtest: Add missing headers and source files


echo NOTE: Do NOT use jdk1.4 - It doesn't work properly
@echo off

echo Design Doc Build System
echo ----------------

if "%JAVA_HOME%" == "" goto error

set LIBDIR=..\..\lib
set TARGET_CLASSPATH=%LIBDIR%\xerces-1.2.3.jar;%LIBDIR%\batik.jar;%LIBDIR%\ant.jar;%LIBDIR%\buildtools.jar;%LIBDIR%\xalan-2.0.0.jar;%LIBDIR%\bsf.jar;..\..\build\fop.jar;%LIBDIR%\logkit-1.0b4.jar;%LIBDIR%\avalon-framework-4.0.jar;%LIBDIR%\jimi-1.0.jar
set TARGET_CLASSPATH=%TARGET_CLASSPATH%;%JAVA_HOME%\lib\tools.jar;%JAVA_HOME%\lib\classes.zip

set ANT_HOME=%LIBDIR%

%JAVA_HOME%\bin\java.exe -classpath "%TARGET_CLASSPATH%" org.apache.tools.ant.Main %1 %2 %3 %4

goto end

:error

echo ERROR: JAVA_HOME not found in your environment.
echo Please, set the JAVA_HOME variable in your environment to match the
echo location of the Java Virtual Machine you want to use.

:end

rem set TARGET_CLASSPATH=

add build.bat for building on windows

add build.bat for building on windows

git-svn-id: 102839466c3b40dd9c7e25c0a1a6d26afc40150a@194458 13f79535-47bb-0310-9956-ffa450edef68


"%sdkver%" -q -version:v7.0
call setenv /x64
if %cython%==1 pip install cython
pip install -r requirements.txt

"%sdkver%" -q -version:v7.0
call setenv /x64
pip install nose
pip install Sphinx
pip install coverage
# Test against the current master of traits, traitsui and apptools
pip install git+http://github.com/enthought/traits.git#egg=traits
pip install git+http://github.com/enthought/traitsui.git#egg=traitsui
pip install git+http://github.com/enthought/apptools.git#egg=apptools
pip install git+http://github.com/enthought/pyface.git#egg=pyface
pip install git+http://github.com/enthought/envisage.git#egg=envisage
python setup.py develop

Update appveyor-install.cmd

Update appveyor-install.cmd


@echo off

REM This script can takes up to 4 parameters:
REM        - The architecture of the vm to build. Can be: i686 or x86_64. By default is i686.
REM        - The directory where to install Cygwin. By default "C:\cygwin" or "C:\cygwin64" depending on the architecture.
REM        - The path to the cygwin setup. By defaul "setup-x86.exe" or "setup-x86_64.exe" depending on the architecture.
REM        - The mirror from where download cygwin. By default http://cygwin.mirror.constant.com.

REM The architecture can either be i686 or x86_64. By default, if no argument is passed, it will be i686.
SET CYG_INSTALL_ARCH=%1
IF "%CYG_INSTALL_ARCH%"=="" (SET CYG_INSTALL_ARCH=i686)

REM Check that the value is a valid architecture
IF NOT "%CYG_INSTALL_ARCH%"=="i686" (
    IF NOT "%CYG_INSTALL_ARCH%"=="x86_64" (
        echo ERROR: Architecture can either be i686 or x86_64. Got %CYG_INSTALL_ARCH% && exit /b
    )
)

REM The CYG_INSTALL_ROOT is the locations where to install cygwin. If there is no argument to the command line, the default value is "C:\cygwin" if the architecture is i686 and "C:\cygwin64" if the architecture is x86_64.
SET CYG_INSTALL_ROOT=%2
IF "%CYG_INSTALL_ROOT%"=="" (
    IF "%CYG_INSTALL_ARCH%"=="i686" (
        SET CYG_INSTALL_ROOT="C:\cygwin"
    ) ELSE (
        IF "%CYG_INSTALL_ARCH%"=="x86_64" (SET CYG_INSTALL_ROOT="C:\cygwin64")
    )
)

REM The CYG_INSTALL_SETUP is the executable to use to install the vm. By default, it will be "setup-x86.exe" for i686 architecture and "setup-x86_64.exe" for x86_64.
SET CYG_INSTALL_SETUP=%3
IF "%CYG_INSTALL_SETUP%"=="" (
    IF "%CYG_INSTALL_ARCH%"=="i686" (
        SET CYG_INSTALL_SETUP="setup-x86.exe"
    ) ELSE (
        IF "%CYG_INSTALL_ARCH%"=="x86_64" (SET CYG_INSTALL_SETUP="setup-x86_64.exe")
    )
)

SET CYG_INSTALL_MIRROR=%4
IF "%CYG_INSTALL_MIRROR%"=="" (SET CYG_INSTALL_MIRROR=http://cygwin.mirror.constant.com)

echo Installing cygwin for architecture %CYG_INSTALL_ARCH% at %CYG_INSTALL_ROOT% using setup %CYG_INSTALL_SETUP% from mirror %CYG_INSTALL_MIRROR%

%CYG_INSTALL_SETUP% -dgnqNO -R "%CYG_INSTALL_ROOT%" -s "%CYG_INSTALL_MIRROR%" -l "%CYG_INSTALL_ROOT%\var\cache\setup"^
    -P gcc-core^
    -P gcc-g++^
    -P binutils^
    -P libtool^
    -P libiconv^
    -P automake^
    -P autoconf^
    -P make^
    -P cmake^
    -P wget^
    -P mingw64-%CYG_INSTALL_ARCH%-gcc-core^
    -P mingw64-%CYG_INSTALL_ARCH%-gcc-g++^
    -P mingw64-%CYG_INSTALL_ARCH%-headers^
    -P mingw64-%CYG_INSTALL_ARCH%-runtime^
    -P zip^
    -P mingw64-%CYG_INSTALL_ARCH%-clang^
    -P mingw64-%CYG_INSTALL_ARCH%-openssl^
    -P libiconv-devel^
    -P libglib2.0-devel^
    -P perl^
    -P mingw64-%CYG_INSTALL_ARCH%-zlib^
    -P mingw64-%CYG_INSTALL_ARCH%-win-iconv^
    -P unzip

REM unzip is not needed for the VM build but is needed for the VMMaker image building. Thus I add it in this script so that people can use it when building VMMaker on their computer.

@echo off

REM This script can takes up to 4 parameters:
REM        - The architecture of the vm to build. Can be: i686 or x86_64. By default is i686.
REM        - The directory where to install Cygwin. By default "C:\cygwin" or "C:\cygwin64" depending on the architecture.
REM        - The path to the cygwin setup. By defaul "setup-x86.exe" or "setup-x86_64.exe" depending on the architecture.
REM        - The mirror from where download cygwin. By default http://cygwin.mirror.constant.com.

REM The architecture can either be i686 or x86_64. By default, if no argument is passed, it will be i686.
SET CYG_INSTALL_ARCH=%1
IF "%CYG_INSTALL_ARCH%"=="" (SET CYG_INSTALL_ARCH=i686)

REM Check that the value is a valid architecture
IF NOT "%CYG_INSTALL_ARCH%"=="i686" (
    IF NOT "%CYG_INSTALL_ARCH%"=="x86_64" (
        echo ERROR: Architecture can either be i686 or x86_64. Got %CYG_INSTALL_ARCH% && exit /b
    )
)

REM The CYG_INSTALL_ROOT is the locations where to install cygwin. If there is no argument to the command line, the default value is "C:\cygwin" if the architecture is i686 and "C:\cygwin64" if the architecture is x86_64.
SET CYG_INSTALL_ROOT=%2
IF "%CYG_INSTALL_ROOT%"=="" (
    IF "%CYG_INSTALL_ARCH%"=="i686" (
        SET CYG_INSTALL_ROOT="C:\cygwin"
    ) ELSE (
        IF "%CYG_INSTALL_ARCH%"=="x86_64" (SET CYG_INSTALL_ROOT="C:\cygwin64")
    )
)

REM The CYG_INSTALL_SETUP is the executable to use to install the vm. By default, it will be "setup-x86.exe" for i686 architecture and "setup-x86_64.exe" for x86_64.
SET CYG_INSTALL_SETUP=%3
IF "%CYG_INSTALL_SETUP%"=="" (
    IF "%CYG_INSTALL_ARCH%"=="i686" (
        SET CYG_INSTALL_SETUP="setup-x86.exe"
    ) ELSE (
        IF "%CYG_INSTALL_ARCH%"=="x86_64" (SET CYG_INSTALL_SETUP="setup-x86_64.exe")
    )
)

SET CYG_INSTALL_MIRROR=%4
IF "%CYG_INSTALL_MIRROR%"=="" (SET CYG_INSTALL_MIRROR=http://cygwin.mirror.constant.com)

echo Installing cygwin for architecture %CYG_INSTALL_ARCH% at %CYG_INSTALL_ROOT% using setup %CYG_INSTALL_SETUP% from mirror %CYG_INSTALL_MIRROR%

%CYG_INSTALL_SETUP% -dgnqNO -R "%CYG_INSTALL_ROOT%" -s "%CYG_INSTALL_MIRROR%" -l "%CYG_INSTALL_ROOT%\var\cache\setup"^
    -P gcc-core^
    -P gcc-g++^
    -P binutils^
    -P libtool^
    -P libiconv^
    -P automake^
    -P autoconf^
    -P make^
    -P cmake^
    -P wget^
    -P curl^
    -P mingw64-%CYG_INSTALL_ARCH%-gcc-core^
    -P mingw64-%CYG_INSTALL_ARCH%-gcc-g++^
    -P mingw64-%CYG_INSTALL_ARCH%-headers^
    -P mingw64-%CYG_INSTALL_ARCH%-runtime^
    -P zip^
    -P mingw64-%CYG_INSTALL_ARCH%-clang^
    -P mingw64-%CYG_INSTALL_ARCH%-openssl^
    -P libiconv-devel^
    -P libglib2.0-devel^
    -P perl^
    -P mingw64-%CYG_INSTALL_ARCH%-zlib^
    -P mingw64-%CYG_INSTALL_ARCH%-win-iconv^
    -P unzip

REM unzip and curl are not needed for the VM build but is needed for the VMMaker image building. Thus I add it in this script so that people can use it when building VMMaker on their computer.

Add curl to default packages to install via cygwin to make VMMAker image building work on windows 10


@echo off
setlocal

pushd %~dp0\..

if not "%APPVEYOR%" == "" (
	set ELECTRON_RUN_AS_NODE=
)
set VSCODEUSERDATADIR=%TMP%\vscodeuserfolder-%RANDOM%-%TIME:~6,5%

:: Integration Tests
.\scripts\code.bat %~dp0\..\extensions\vscode-api-tests\testWorkspace --extensionDevelopmentPath=%~dp0\..\extensions\vscode-api-tests --extensionTestsPath=%~dp0\..\extensions\vscode-api-tests\out --disableExtensions --user-data-dir=%VSCODEUSERDATADIR%
.\scripts\code.bat %~dp0\..\extensions\vscode-colorize-tests\test --extensionDevelopmentPath=%~dp0\..\extensions\vscode-colorize-tests --extensionTestsPath=%~dp0\..\extensions\vscode-colorize-tests\out --user-data-dir=%VSCODEUSERDATADIR%
.\scripts\test-int-mocha.bat
.\scripts\code.bat $ROOT\extensions\emmet\test-fixtures --extensionDevelopmentPath=%~dp0\..\extensions\emmet --extensionTestsPath=%~dp0\..\extensions\emmet\out\test --disableExtensions --user-data-dir=%VSCODEUSERDATADIR%

rmdir /s /q %VSCODEUSERDATADIR%

popd

endlocal

@echo off
setlocal

pushd %~dp0\..

if not "%APPVEYOR%" == "" (
	set ELECTRON_RUN_AS_NODE=
)
set VSCODEUSERDATADIR=%TMP%\vscodeuserfolder-%RANDOM%-%TIME:~6,5%

:: Integration Tests
.\scripts\code.bat %~dp0\..\extensions\vscode-api-tests\testWorkspace --extensionDevelopmentPath=%~dp0\..\extensions\vscode-api-tests --extensionTestsPath=%~dp0\..\extensions\vscode-api-tests\out --disableExtensions --user-data-dir=%VSCODEUSERDATADIR%
.\scripts\code.bat %~dp0\..\extensions\vscode-colorize-tests\test --extensionDevelopmentPath=%~dp0\..\extensions\vscode-colorize-tests --extensionTestsPath=%~dp0\..\extensions\vscode-colorize-tests\out --user-data-dir=%VSCODEUSERDATADIR%
.\scripts\test-int-mocha.bat
.\scripts\code.bat $%~dp0\..\extensions\emmet\test-fixtures --extensionDevelopmentPath=%~dp0\..\extensions\emmet --extensionTestsPath=%~dp0\..\extensions\emmet\out\test --disableExtensions --user-data-dir=%VSCODEUSERDATADIR%

rmdir /s /q %VSCODEUSERDATADIR%

popd

endlocal

Use dp0 instead of ROOT in test-integration.bat


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

:: Keep environment variables within this script
:: unless invoked with --no-local.
if x%1==x--no-local goto nolocal
if x%2==x--no-local goto nolocal
setlocal
:nolocal

set GOBUILDFAIL=0

:: we disallow local import for non-local packages, if %GOROOT% happens
:: to be under %GOPATH%, then some tests below will fail
set GOPATH=

rem TODO avoid rebuild if possible

if x%1==x--no-rebuild goto norebuild
echo # Building packages and commands.
go install -a -v std
if errorlevel 1 goto fail
echo.
:norebuild

:: we must unset GOROOT_FINAL before tests, because runtime/debug requires
:: correct access to source code, so if we have GOROOT_FINAL in effect,
:: at least runtime/debug test will fail.
set GOROOT_FINAL=

:: get CGO_ENABLED
go env > env.bat
if errorlevel 1 goto fail
call env.bat
del env.bat
echo.

echo # Testing packages.
go test std -short -timeout=120s
if errorlevel 1 goto fail
echo.

echo # runtime -cpu=1,2,4
go test runtime -short -timeout=120s -cpu=1,2,4
if errorlevel 1 goto fail
echo.

echo # sync -cpu=10
go test sync -short -timeout=120s -cpu=10
if errorlevel 1 goto fail
echo.

if not "%GOHOSTOS%-%GOOS%-%GOARCH%-%CGO_ENABLED%" == "windows-windows-amd64-1" goto norace
echo # Testing race detector.
go test -race -i flag
if errorlevel 1 goto fail
go test -race -short flag
if errorlevel 1 goto fail
echo.
:norace

echo # ..\misc\dashboard\builder ..\misc\goplay
go build ..\misc\dashboard\builder ..\misc\goplay
if errorlevel 1 goto fail
echo.

echo # ..\test\bench\go1
go test ..\test\bench\go1
if errorlevel 1 goto fail
echo.

:: cgo tests
if x%CGO_ENABLED% == x0 goto nocgo
echo # ..\misc\cgo\life
go run "%GOROOT%\test\run.go" - ..\misc\cgo\life
if errorlevel 1 goto fail
echo.

echo # ..\misc\cgo\stdio
go run "%GOROOT%\test\run.go" - ..\misc\cgo\stdio
if errorlevel 1 goto fail
echo.

echo # ..\misc\cgo\test
go test ..\misc\cgo\test
if errorlevel 1 goto fail
echo.
:nocgo

echo # ..\doc\progs
go run "%GOROOT%\test\run.go" - ..\doc\progs
if errorlevel 1 goto fail
echo.

:: TODO: The other tests in run.bash.

set OLDGOMAXPROCS=%GOMAXPROCS%

echo # ..\test
cd ..\test
set FAIL=0
set GOMAXPROCS=
go run run.go
if errorlevel 1 set FAIL=1
cd ..\src
echo.
if %FAIL%==1 goto fail

set GOMAXPROCS=%OLDGOMAXPROCS%
set OLDGOMAXPROCS=

echo # Checking API compatibility.
go tool api -c ..\api\go1.txt -next ..\api\next.txt -except ..\api\except.txt
if errorlevel 1 goto fail
echo.

echo ALL TESTS PASSED
goto end

:fail
set GOBUILDFAIL=1

:end

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

:: Keep environment variables within this script
:: unless invoked with --no-local.
if x%1==x--no-local goto nolocal
if x%2==x--no-local goto nolocal
setlocal
:nolocal

set GOBUILDFAIL=0

:: we disallow local import for non-local packages, if %GOROOT% happens
:: to be under %GOPATH%, then some tests below will fail
set GOPATH=

rem TODO avoid rebuild if possible

if x%1==x--no-rebuild goto norebuild
echo # Building packages and commands.
go install -a -v std
if errorlevel 1 goto fail
echo.
:norebuild

:: we must unset GOROOT_FINAL before tests, because runtime/debug requires
:: correct access to source code, so if we have GOROOT_FINAL in effect,
:: at least runtime/debug test will fail.
set GOROOT_FINAL=

:: get CGO_ENABLED
go env > env.bat
if errorlevel 1 goto fail
call env.bat
del env.bat
echo.

echo # Testing packages.
go test std -short -timeout=120s
if errorlevel 1 goto fail
echo.

echo # runtime -cpu=1,2,4
go test runtime -short -timeout=240s -cpu=1,2,4
if errorlevel 1 goto fail
echo.

echo # sync -cpu=10
go test sync -short -timeout=120s -cpu=10
if errorlevel 1 goto fail
echo.

if not "%GOHOSTOS%-%GOOS%-%GOARCH%-%CGO_ENABLED%" == "windows-windows-amd64-1" goto norace
echo # Testing race detector.
go test -race -i flag
if errorlevel 1 goto fail
go test -race -short flag
if errorlevel 1 goto fail
echo.
:norace

echo # ..\misc\dashboard\builder ..\misc\goplay
go build ..\misc\dashboard\builder ..\misc\goplay
if errorlevel 1 goto fail
echo.

echo # ..\test\bench\go1
go test ..\test\bench\go1
if errorlevel 1 goto fail
echo.

:: cgo tests
if x%CGO_ENABLED% == x0 goto nocgo
echo # ..\misc\cgo\life
go run "%GOROOT%\test\run.go" - ..\misc\cgo\life
if errorlevel 1 goto fail
echo.

echo # ..\misc\cgo\stdio
go run "%GOROOT%\test\run.go" - ..\misc\cgo\stdio
if errorlevel 1 goto fail
echo.

echo # ..\misc\cgo\test
go test ..\misc\cgo\test
if errorlevel 1 goto fail
echo.
:nocgo

echo # ..\doc\progs
go run "%GOROOT%\test\run.go" - ..\doc\progs
if errorlevel 1 goto fail
echo.

:: TODO: The other tests in run.bash.

set OLDGOMAXPROCS=%GOMAXPROCS%

echo # ..\test
cd ..\test
set FAIL=0
set GOMAXPROCS=
go run run.go
if errorlevel 1 set FAIL=1
cd ..\src
echo.
if %FAIL%==1 goto fail

set GOMAXPROCS=%OLDGOMAXPROCS%
set OLDGOMAXPROCS=

echo # Checking API compatibility.
go tool api -c ..\api\go1.txt -next ..\api\next.txt -except ..\api\except.txt
if errorlevel 1 goto fail
echo.

echo ALL TESTS PASSED
goto end

:fail
set GOBUILDFAIL=1

:end

run.bat: make windows runtime test timeout same as other os

R=golang-dev, dave
CC=golang-dev
https://codereview.appspot.com/8551043


@echo off

set CUDA_VER=%1
set PY_VER=%2
set "CUDA_PATH=C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v%CUDA_VER%"
set PY_PATH=C:\Development\Python\Python%PY_VER%
set PATH=%CUDA_PATH%\bin;%CUDA_PATH%\libnvvp;%PY_PATH%;%PY_PATH%\Scripts\%PATH%

pip install --pre cupy-cuda101
pip install -e .[test]
pip install "onnx<1.7.0" onnxruntime pytest-cov
pip list -v

pytest -x -s -vvvs tests\onnx_chainer_tests --cov onnx_chainer

@echo off

set CUDA_VER=%1
set PY_VER=%2
set "CUDA_PATH=C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v%CUDA_VER%"
set PY_PATH=C:\Development\Python\Python%PY_VER%
set PATH=%CUDA_PATH%\bin;%CUDA_PATH%\libnvvp;%PY_PATH%;%PY_PATH%\Scripts\%PATH%

pip install --pre cupy-cuda101
pip install -e .[test]
pip install "onnx<1.7.0" onnxruntime==1.2.0 pytest-cov
pip list -v

pytest -x -s -vvvs tests\onnx_chainer_tests --cov onnx_chainer

Fix onnxruntime version for CI failure

Fix onnxruntime version for CI failure


set RINGQT_WEBASSEMBLY=1
set RINGQT_ANDROID=1
set RINGQT_QT512=1
set RINGQT_NOSQL=1
set RINGQT_NOPOSITIONING=1
set RINGQT_NOWEBKITWIDGETS=1
set RINGQT_NOWEBENGINEWIDGETS=1
set RINGQT_NOSERIALPORT=1
set RINGQT_NOAXCONTAINER=1
set RINGQT_NOQT3D=1
set RINGQT_NOWEBKIT=1
set RINGQT_NOBLUETOOTH=1

ring ..\codegen\parsec.ring classes\qt.cf cpp\src\ring_qt.cpp guilib\ring_qt.ring
cd events
ring qtevents.ring
cd ..
copy cpp\src\*.cpp ..\..\webassembly\ringqt\project
copy cpp\include\*.h ..\..\webassembly\ringqt\project

Update RingQt - Add gencodewebassembly.bat


@echo off
setlocal

:: make sure at Unity project root directory
set NunitDirectory=packages\NUnit.Runners.2.6.4\tools
echo %NunitDirectory%
set ConsoleRunner=%NunitDirectory%\nunit-console.exe
echo %ConsoleRunner%

:: run tests
echo Running "build\IntegrationTests\IntegrationTests.dll" "build\IntegrationTests\TestUtils.dll" "build\TaskSystemIntegrationTests\TaskSystemIntegrationTests.dll" "build\UnitTests\TestUtils.dll" "build\UnitTests\UnitTests.dll" "src\tests\TestUtils\bin\Release\TestUtils.dll" %1
call %ConsoleRunner% "build\IntegrationTests\IntegrationTests.dll" "build\IntegrationTests\TestUtils.dll" "build\TaskSystemIntegrationTests\TaskSystemIntegrationTests.dll" "build\UnitTests\TestUtils.dll" "build\UnitTests\UnitTests.dll" "src\tests\TestUtils\bin\Release\TestUtils.dll" %1

endlocal

@echo off
setlocal

set Config=Debug
if not %1.==. (
  set Config=%1
)

set Exclude=''
if not %2.==. (
  set Exclude=%2
)

:: make sure at Unity project root directory
set NunitDirectory=packages\NUnit.Runners.2.6.4\tools
echo %NunitDirectory%
set ConsoleRunner=%NunitDirectory%\nunit-console.exe
echo %ConsoleRunner%

:: run tests
echo Running "build\IntegrationTests\IntegrationTests.dll" "build\IntegrationTests\TestUtils.dll" "build\TaskSystemIntegrationTests\TaskSystemIntegrationTests.dll" "build\UnitTests\TestUtils.dll" "build\UnitTests\UnitTests.dll" "src\tests\TestUtils\bin\Release\TestUtils.dll" /config=%Config% /exclude=%Exclude%
call %ConsoleRunner% "build\IntegrationTests\IntegrationTests.dll" "build\IntegrationTests\TestUtils.dll" "build\TaskSystemIntegrationTests\TaskSystemIntegrationTests.dll" "build\UnitTests\TestUtils.dll" "build\UnitTests\UnitTests.dll" "src\tests\TestUtils\bin\Release\TestUtils.dll" /config=%Config% /exclude=%Exclude%

endlocal

Update parameters for test.cmd

Update parameters for test.cmd

Config parameter which is Debug by default.
Exclude parameter which is an empty string by default.


@echo off
net session >nul 2>&1
if %errorLevel% NEQ 0 (
    echo Please run this script with Administrator privileges.
    timeout 30
    EXIT /B 1
)
SET cdpath=%~dp0
if not exist %PROGRAMDATA%\docker\ (
    echo Error: Could not find Docker in %PROGRAMDATA%\docker\.
    echo Please install Docker before running this script.
    timeout 30
    EXIT /B 1
)
echo Setting the system environment variable DOCKER_HOST.
reg add "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment" /v DOCKER_HOST /t REG_SZ /d tcp://:2376 /f || goto :ERRORHANDLER
echo Setting the system environment variable DOCKER_TLS.
reg add "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment" /v DOCKER_TLS_VERIFY /t REG_SZ /d 1 /f || goto :ERRORHANDLER
echo Configuring the Docker daemon for TLS using %PROGRAMDATA%\Docker\certs.d
if not exist %PROGRAMDATA%\docker\certs.d\ (
    mkdir %PROGRAMDATA%\docker\certs.d\ || goto :ERRORHANDLER
)
icacls.exe %PROGRAMDATA%\docker\certs.d\ /T /grant BUILTIN\Administrators:(OI)(CI)F /grant SYSTEM:(OI)(CI)F /inheritance:r || goto :ERRORHANDLER
xcopy /O %cdpath%server\* %PROGRAMDATA%\docker\certs.d\ || goto :ERRORHANDLER
echo Configuring the Docker client in %USERPROFILE%\.docker\ to connect using TLS for the current user.
if not exist %USERPROFILE%\.docker\ (
    mkdir %USERPROFILE%\.docker\ || goto :ERRORHANDLER
)
icacls.exe %USERPROFILE%\.docker\ /T /grant %USERDOMAIN%\%USERNAME%:(OI)(CI)F /inheritance:r || goto :ERRORHANDLER
xcopy /O %cdpath%client\* %USERPROFILE%\.docker\ || goto :ERRORHANDLER
echo Restarting Docker.
net stop Docker || goto :ERRORHANDLER
net start Docker || goto :ERRORHANDLER
echo All done. Docker is now configured for TLS.
echo Please press enter and complete the preparation on the control domain console.
timeout 10 > NUL
EXIT /b 0
goto :EOF

:ERRORHANDLER
echo Error: Command failed with errorlevel #%errorlevel%.
timeout 30
exit /B %errorlevel%

@echo off
net session >nul 2>&1
if %errorLevel% NEQ 0 (
    echo Please run this script with Administrator privileges.
    timeout 30
    EXIT /B 1
)
SET cdpath=%~dp0
if not exist %PROGRAMDATA%\docker\ (
    echo Error: Could not find Docker in %PROGRAMDATA%\docker\.
    echo Please install Docker before running this script.
    timeout 30
    EXIT /B 1
)
echo Setting the system environment variable DOCKER_HOST.
reg add "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment" /v DOCKER_HOST /t REG_SZ /d tcp://:2376 /f || goto :ERRORHANDLER
echo Setting the system environment variable DOCKER_TLS.
reg add "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment" /v DOCKER_TLS_VERIFY /t REG_SZ /d 1 /f || goto :ERRORHANDLER
echo Configuring the Docker daemon for TLS using %PROGRAMDATA%\Docker\certs.d
if not exist %PROGRAMDATA%\docker\certs.d\ (
    mkdir %PROGRAMDATA%\docker\certs.d\ || goto :ERRORHANDLER
)
icacls.exe %PROGRAMDATA%\docker\certs.d\ /T /grant BUILTIN\Administrators:(OI)(CI)F /grant BUILTIN\Administrators:F /grant SYSTEM:(OI)(CI)F /grant SYSTEM:F /inheritance:r || goto :ERRORHANDLER
xcopy /O %cdpath%server\* %PROGRAMDATA%\docker\certs.d\ || goto :ERRORHANDLER
echo Configuring the Docker client in %USERPROFILE%\.docker\ to connect using TLS for the current user.
if not exist %USERPROFILE%\.docker\ (
    mkdir %USERPROFILE%\.docker\ || goto :ERRORHANDLER
)
icacls.exe %USERPROFILE%\.docker\ /T /grant %USERDOMAIN%\%USERNAME%:(OI)(CI)F /grant %USERDOMAIN%\%USERNAME%:F /inheritance:r || goto :ERRORHANDLER
xcopy /O %cdpath%client\* %USERPROFILE%\.docker\ || goto :ERRORHANDLER
echo Restarting Docker.
net stop Docker || goto :ERRORHANDLER
net start Docker || goto :ERRORHANDLER
echo All done. Docker is now configured for TLS.
echo Please press enter and complete the preparation on the control domain console.
timeout 10 > NUL
EXIT /b 0
goto :EOF

:ERRORHANDLER
echo Error: Command failed with errorlevel #%errorlevel%.
timeout 30
exit /B %errorlevel%

Set cert file permissions correctly to allow running configure_tls.cmd more than once

Problem:
We reset file permissions for the certificate files, which means that users
lose access access during the second installation.

Fix:
With this change, we'll configure sane permissions following the reset.

Signed-off-by: Robert Breker <bfcd7039ca4b92386f0756a1d5e67ea4ff23cfe0@citrix.com>


rmdir /s /q build
rmdir /s /q dist
venv\scripts\python.exe setup.py py2exe
REM venv\scripts\python.exe setup.py sdist
REM venv\scripts\python.exe setup.py bdist_msi

remove prior build folders

remove prior build folders


@echo OFF
@setlocal

set VERSION=1.24.0
set TFDIR=C:\TreeFrog\%VERSION%
set LZ4_VERSION=1.8.3

:parse_loop
if "%1" == "" goto :start
if /i "%1" == "--prefix" goto :prefix
if /i "%1" == "--enable-debug" goto :enable_debug
if /i "%1" == "--enable-gui-mod" goto :enable_gui_mod
if /i "%1" == "--help" goto :help
if /i "%1" == "-h" goto :help
goto :help
:continue
shift
goto :parse_loop

:help
  echo Usage: %0 [OPTION]... [VAR=VALUE]...
  echo;
  echo Configuration:
  echo   -h, --help          display this help and exit
  echo   --enable-debug      compile with debugging information
  echo   --enable-gui-mod    compile and link with QtGui module
  echo;
  echo Installation directories:
  echo   --prefix=PREFIX     install files in PREFIX [%TFDIR%]
  goto :exit

:prefix
  shift
  if "%1" == "" goto :help
  set TFDIR=%1
  goto :continue

:enable_debug
  set DEBUG=yes
  goto :continue

:enable_gui_mod
  set USE_GUI=use_gui=1
  goto :continue

:start
if "%DEBUG%" == "yes" (
  set OPT="CONFIG+=debug"
) else (
  set OPT="CONFIG+=release"
)

::
:: Generates tfenv.bat
::
for %%I in (qmake.exe) do if exist %%~$path:I set QMAKE=%%~$path:I
for %%I in (cl.exe) do if exist %%~$path:I set MSCOMPILER=%%~$path:I
for %%I in (g++.exe) do if exist %%~$path:I set GNUCOMPILER=%%~$path:I

if "%QMAKE%" == "" (
  echo Qt environment not found
  exit /b
)
if "%MSCOMPILER%" == "" if "%GNUCOMPILER%"  == "" (
  echo compiler not found
  exit /b
)

:: vcvarsall.bat setup
if not "%MSCOMPILER%" == "" (
  set MAKE=nmake
  if "%Platform%" == "X64" (
    set VCVARSOPT=amd64
    set ENVSTR=Environment to build for 64-bit executable  MSVC / Qt
  ) else if "%Platform%" == "x64" (
    set VCVARSOPT=amd64
    set ENVSTR=Environment to build for 64-bit executable  MSVC / Qt
  ) else (
    set VCVARSOPT=x86
    set ENVSTR=Environment to build for 32-bit executable  MSVC / Qt
  )
) else (
  set MAKE=mingw32-make
  set ENVSTR=Environment to build for 32-bit executable  MinGW / Qt
)
SET /P X="%ENVSTR%"<NUL
qtpaths.exe --qt-version

for %%I in (qtenv2.bat) do if exist %%~$path:I set QTENV=%%~$path:I
set TFENV=tfenv.bat
echo @echo OFF> %TFENV%
echo ::>> %TFENV%
echo :: This file is generated by configure.bat>> %TFENV%
echo ::>> %TFENV%
echo;>> %TFENV%
echo set TFDIR=%TFDIR%>> %TFENV%
echo set TreeFrog_DIR=%TFDIR%>> %TFENV%
echo set QTENV="%QTENV%">> %TFENV%
echo set QMAKESPEC=%QMAKESPEC%>> %TFENV%
echo if exist %%QTENV%% ( call %%QTENV%% )>> %TFENV%
if not "%VCVARSOPT%" == "" (
  echo if not "%%VS140COMNTOOLS%%" == "" ^(>> %TFENV%
  echo   set VCVARSBAT="%%VS140COMNTOOLS%%..\..\VC\vcvarsall.bat">> %TFENV%
  echo ^) else if not "%%VS120COMNTOOLS%%" == "" ^(>> %TFENV%
  echo   set VCVARSBAT="%%VS120COMNTOOLS%%..\..\VC\vcvarsall.bat">> %TFENV%
  echo ^) else ^(>> %TFENV%
  echo   set VCVARSBAT="">> %TFENV%
  echo ^)>> %TFENV%
  echo if exist %%VCVARSBAT%% ^(>> %TFENV%
  echo   echo Setting up environment for MSVC usage...>> %TFENV%
  echo   call %%VCVARSBAT%% %VCVARSOPT%>> %TFENV%
  echo ^)>> %TFENV%
)
echo set PATH=%%TFDIR^%%\bin;%%PATH%%>> %TFENV%
echo echo Setup a TreeFrog/Qt environment.>> %TFENV%
echo echo -- TFDIR set to %%TFDIR%%>> %TFENV%
echo cd /D %%HOMEDRIVE%%%%HOMEPATH%%>> %TFENV%

set TFDIR=%TFDIR:\=/%
del 3rdparty\mongo-c-driver\.qmake.stash src\.qmake.stash tools\.qmake.stash >nul 2>&1
:: Builds MongoDB driver
echo Compiling MongoDB driver library ...
cd 3rdparty\mongo-c-driver
if exist Makefile ( %MAKE% -k distclean >nul 2>&1 )

qmake -r %OPT%
%MAKE% >nul 2>&1
if ERRORLEVEL 1 (
  echo Compile failed.
  echo MongoDB driver not available.
  exit /b
)

:: Builds LZ4
cd ..
del /f /q lz4 >nul 2>&1
::mklink /d lz4 lz4-%LZ4_VERSION% >nul 2>&1
xcopy lz4-%LZ4_VERSION% lz4 /Q /D /E /Y /I /K
devenv lz4\visual\VS2017\lz4.sln /project liblz4 /rebuild "Release|x64"
cd ..

cd src
if exist Makefile ( %MAKE% -k distclean >nul 2>&1 )
qmake %OPT% target.path='%TFDIR%/bin' header.path='%TFDIR%/include' %USE_GUI%
cd ..
cd tools
if exist Makefile ( %MAKE% -k distclean >nul 2>&1 )
qmake -recursive %OPT% target.path='%TFDIR%/bin' header.path='%TFDIR%/include' datadir='%TFDIR%'
%MAKE% qmake
cd ..

echo;
echo First, run "%MAKE% install" in src directory.
echo Next, run "%MAKE% install" in tools directory.

:exit
exit /b

@echo OFF
@setlocal

set VERSION=1.24.0
set TFDIR=C:\TreeFrog\%VERSION%
set LZ4_VERSION=1.8.3

:parse_loop
if "%1" == "" goto :start
if /i "%1" == "--prefix" goto :prefix
if /i "%1" == "--enable-debug" goto :enable_debug
if /i "%1" == "--enable-gui-mod" goto :enable_gui_mod
if /i "%1" == "--help" goto :help
if /i "%1" == "-h" goto :help
goto :help
:continue
shift
goto :parse_loop

:help
  echo Usage: %0 [OPTION]... [VAR=VALUE]...
  echo;
  echo Configuration:
  echo   -h, --help          display this help and exit
  echo   --enable-debug      compile with debugging information
  echo   --enable-gui-mod    compile and link with QtGui module
  echo;
  echo Installation directories:
  echo   --prefix=PREFIX     install files in PREFIX [%TFDIR%]
  goto :exit

:prefix
  shift
  if "%1" == "" goto :help
  set TFDIR=%1
  goto :continue

:enable_debug
  set DEBUG=yes
  goto :continue

:enable_gui_mod
  set USE_GUI=use_gui=1
  goto :continue

:start
if "%DEBUG%" == "yes" (
  set OPT="CONFIG+=debug"
) else (
  set OPT="CONFIG+=release"
)

::
:: Generates tfenv.bat
::
for %%I in (qmake.exe) do if exist %%~$path:I set QMAKE=%%~$path:I
for %%I in (cl.exe) do if exist %%~$path:I set MSCOMPILER=%%~$path:I
for %%I in (g++.exe) do if exist %%~$path:I set GNUCOMPILER=%%~$path:I

if "%QMAKE%" == "" (
  echo Qt environment not found
  exit /b
)
if "%MSCOMPILER%" == "" if "%GNUCOMPILER%"  == "" (
  echo compiler not found
  exit /b
)

:: vcvarsall.bat setup
if not "%MSCOMPILER%" == "" (
  set MAKE=nmake
  if "%Platform%" == "X64" (
    set VCVARSOPT=amd64
    set ENVSTR=Environment to build for 64-bit executable  MSVC / Qt
  ) else if "%Platform%" == "x64" (
    set VCVARSOPT=amd64
    set ENVSTR=Environment to build for 64-bit executable  MSVC / Qt
  ) else (
    set VCVARSOPT=x86
    set ENVSTR=Environment to build for 32-bit executable  MSVC / Qt
  )
) else (
  set MAKE=mingw32-make
  set ENVSTR=Environment to build for 32-bit executable  MinGW / Qt
)
SET /P X="%ENVSTR%"<NUL
qtpaths.exe --qt-version

for %%I in (qtenv2.bat) do if exist %%~$path:I set QTENV=%%~$path:I
set TFENV=tfenv.bat
echo @echo OFF> %TFENV%
echo ::>> %TFENV%
echo :: This file is generated by configure.bat>> %TFENV%
echo ::>> %TFENV%
echo;>> %TFENV%
echo set TFDIR=%TFDIR%>> %TFENV%
echo set TreeFrog_DIR=%TFDIR%>> %TFENV%
echo set QTENV="%QTENV%">> %TFENV%
echo set QMAKESPEC=%QMAKESPEC%>> %TFENV%
echo if exist %%QTENV%% ( call %%QTENV%% )>> %TFENV%
if not "%VCVARSOPT%" == "" (
  echo if not "%%VS140COMNTOOLS%%" == "" ^(>> %TFENV%
  echo   set VCVARSBAT="%%VS140COMNTOOLS%%..\..\VC\vcvarsall.bat">> %TFENV%
  echo ^) else if not "%%VS120COMNTOOLS%%" == "" ^(>> %TFENV%
  echo   set VCVARSBAT="%%VS120COMNTOOLS%%..\..\VC\vcvarsall.bat">> %TFENV%
  echo ^) else ^(>> %TFENV%
  echo   set VCVARSBAT="">> %TFENV%
  echo ^)>> %TFENV%
  echo if exist %%VCVARSBAT%% ^(>> %TFENV%
  echo   echo Setting up environment for MSVC usage...>> %TFENV%
  echo   call %%VCVARSBAT%% %VCVARSOPT%>> %TFENV%
  echo ^)>> %TFENV%
)
echo set PATH=%%TFDIR^%%\bin;%%PATH%%>> %TFENV%
echo echo Setup a TreeFrog/Qt environment.>> %TFENV%
echo echo -- TFDIR set to %%TFDIR%%>> %TFENV%
echo cd /D %%HOMEDRIVE%%%%HOMEPATH%%>> %TFENV%

set TFDIR=%TFDIR:\=/%
del 3rdparty\mongo-c-driver\.qmake.stash src\.qmake.stash tools\.qmake.stash >nul 2>&1
:: Builds MongoDB driver
echo Compiling MongoDB driver library ...
cd 3rdparty\mongo-c-driver
if exist Makefile ( %MAKE% -k distclean >nul 2>&1 )

qmake -r %OPT%
%MAKE% >nul 2>&1
if ERRORLEVEL 1 (
  echo Compile failed.
  echo MongoDB driver not available.
  exit /b
)

:: Builds LZ4
cd ..
del /f /q /s lz4 >nul 2>&1
rd /s /q lz4 >nul 2>&1
mklink /d lz4 lz4-%LZ4_VERSION% >nul 2>&1
::xcopy lz4-%LZ4_VERSION% lz4 /Q /D /E /Y /I /K
devenv lz4\visual\VS2017\lz4.sln /project liblz4 /rebuild "Release|x64"
cd ..

cd src
if exist Makefile ( %MAKE% -k distclean >nul 2>&1 )
qmake %OPT% target.path='%TFDIR%/bin' header.path='%TFDIR%/include' %USE_GUI%
cd ..
cd tools
if exist Makefile ( %MAKE% -k distclean >nul 2>&1 )
qmake -recursive %OPT% target.path='%TFDIR%/bin' header.path='%TFDIR%/include' datadir='%TFDIR%'
%MAKE% qmake
cd ..

echo;
echo First, run "%MAKE% install" in src directory.
echo Next, run "%MAKE% install" in tools directory.

:exit
exit /b

update appveyor.yml

update appveyor.yml