@echo off
echo "+++ Running %1"
FOR /L %%i IN (1,1,100) DO (
    %1 --use-colour no --order rand --rng-seed 'time' > nul
	if %errorlevel% neq 0 exit /b %errorlevel%
)
echo "Tests OK"

@echo off
echo "+++ Running %1"
FOR /L %%i IN (1,1,100) DO (
    %1 --use-colour no --order rand --rng-seed "time" > nul
	if %errorlevel% neq 0 exit /b %errorlevel%
)
echo "Tests OK"

fix bat file again

fix bat file again


@rem Build janet on windows
@rem
@rem Open a "Windows SDK Command Shell" and cd to the janet directory
@rem Then run this script with no arguments to build the executable

@echo off

@rem Ensure correct command prompt
@if not defined INCLUDE goto :BADCMD

@rem Sub commands
@if "%1"=="help" goto HELP
@if "%1"=="clean" goto CLEAN
@if "%1"=="test" goto TEST
@if "%1"=="dist" goto DIST
@if "%1"=="install" goto INSTALL
@if "%1"=="test-install" goto TESTINSTALL
@if "%1"=="all" goto ALL

@rem Set compile and link options here
@setlocal
@set JANET_COMPILE=cl /nologo /Isrc\include /Isrc\conf /c /O2 /W3 /D_CRT_SECURE_NO_WARNINGS
@set JANET_LINK=link /nologo
@set JANET_LINK_STATIC=lib /nologo

@rem Add janet build tag
if not "%JANET_BUILD%" == "" (
    @set JANET_COMPILE=%JANET_COMPILE% /DJANET_BUILD="\"%JANET_BUILD%\""
)

mkdir build
mkdir build\core
mkdir build\mainclient
mkdir build\boot

@rem Build the xxd tool for generating sources
cl /nologo /c tools/xxd.c /Fobuild\xxd.obj
@if errorlevel 1 goto :BUILDFAIL
link /nologo /out:build\xxd.exe build\xxd.obj
@if errorlevel 1 goto :BUILDFAIL

@rem Generate the embedded sources
build\xxd.exe src\boot\boot.janet build\boot.gen.c janet_gen_boot
@if errorlevel 1 goto :BUILDFAIL

@rem Build the generated sources
%JANET_COMPILE% /Fobuild\boot\boot.gen.obj build\boot.gen.c
@if errorlevel 1 goto :BUILDFAIL

@rem Build the bootstrap interpreter
for %%f in (src\core\*.c) do (
    %JANET_COMPILE% /DJANET_BOOTSTRAP /Fobuild\boot\%%~nf.obj %%f
    @if errorlevel 1 goto :BUILDFAIL
)
for %%f in (src\boot\*.c) do (
    %JANET_COMPILE% /DJANET_BOOTSTRAP /Fobuild\boot\%%~nf.obj %%f
    @if errorlevel 1 goto :BUILDFAIL
)
%JANET_LINK% /out:build\janet_boot.exe build\boot\*.obj
@if errorlevel 1 goto :BUILDFAIL
build\janet_boot build\core_image.c

@rem Build the core image
%JANET_COMPILE% /Fobuild\core_image.obj build\core_image.c
@if errorlevel 1 goto :BUILDFAIL

@rem Build the sources
for %%f in (src\core\*.c) do (
    %JANET_COMPILE% /Fobuild\core\%%~nf.obj %%f
    @if errorlevel 1 goto :BUILDFAIL
)

@rem Build the resources
rc /nologo /fobuild\janet_win.res janet_win.rc

@rem Build the main client
for %%f in (src\mainclient\*.c) do (
    %JANET_COMPILE% /Fobuild\mainclient\%%~nf.obj %%f
    @if errorlevel 1 goto :BUILDFAIL
)

@rem Link everything to main client
%JANET_LINK% /out:janet.exe build\core\*.obj build\mainclient\*.obj build\core_image.obj build\janet_win.res
@if errorlevel 1 goto :BUILDFAIL

@rem Build static library (libjanet.a)
%JANET_LINK_STATIC% /out:build\libjanet.lib build\core\*.obj build\core_image.obj
@if errorlevel 1 goto :BUILDFAIL

@rem Gen amlag
setlocal enabledelayedexpansion
set "amalg_files="
for %%f in (src\core\*.c) do (
    set "amalg_files=!amalg_files! %%f"
)
janet.exe tools\amalg.janet src\core\util.h src\core\state.h src\core\gc.h src\core\vector.h src\core\fiber.h src\core\regalloc.h src\core\compile.h src\core\emit.h src\core\symcache.h %amalg_files% build\core_image.c > build\janet.c
janet.exe tools\removecr.janet build\janet.c

@rem Gen shell.c
janet.exe tools\amalg.janet src\mainclient\line.h src\mainclient\line.c src\mainclient\main.c > build\shell.c
janet.exe tools\removecr.janet build\shell.c

echo === Successfully built janet.exe for Windows ===
echo === Run 'build_win test' to run tests. ==
echo === Run 'build_win clean' to delete build artifacts. ===
exit /b 0

@rem Not using correct command line
:BADCMD
@echo You must open a "Visual Studio .NET Command Prompt" to run this script
exit /b 1

@rem Show help
:HELP
@echo.
@echo Usage: build_windows [subcommand=clean,help,test,dist]
@echo.
@echo Script to build janet on windows. Must be run from the Visual Studio
@echo command prompt.
exit /b 0

@rem Clean build artifacts
:CLEAN
del *.exe *.lib *.exp
rd /s /q build
rd /s /q dist
exit /b 0

@rem Run tests
:TEST
for %%f in (test/suite*.janet) do (
    janet.exe test\%%f
    @if errorlevel 1 goto TESTFAIL
)
exit /b 0

@rem Build a dist directory
:DIST
mkdir dist
janet.exe tools\gendoc.janet > dist\doc.html
janet.exe tools\removecr.janet dist\doc.html

copy build\janet.c dist\janet.c
copy build\shell.c dist\shell.c
copy janet.exe dist\janet.exe
copy LICENSE dist\LICENSE
copy README.md dist\README.md

copy janet.lib dist\janet.lib
copy janet.exp dist\janet.exp

copy src\include\janet.h dist\janet.h
copy src\conf\janetconf.h dist\janetconf.h
copy build\libjanet.lib dist\libjanet.lib

copy auxbin\jpm dist\jpm
copy tools\jpm.bat dist\jpm.bat

@rem Create installer
"C:\Program Files (x86)\NSIS\makensis.exe" janet-installer.nsi
exit /b 0

@rem Run the installer. (Installs to the local user with default settings)
:INSTALL
@echo Running Installer...
FOR %%a in (janet-*-windows-installer.exe) DO (
    %%a /S /CurrentUser
)
exit /b 0

@rem Test the installation.
:TESTINSTALL
pushd test\install
call jpm clean
@if errorlevel 1 goto :TESTFAIL
call jpm test
@if errorlevel 1 goto :TESTFAIL
call jpm --verbose --modpath=. install https://github.com/janet-lang/json.git
@if errorlevel 1 goto :TESTFAIL
call build\testexec
@if errorlevel 1 goto :TESTFAIL
call jpm --verbose quickbin testexec.janet build\testexec2.exe
@if errorlevel 1 goto :TESTFAIL
call build\testexec2.exe
@if errorlevel 1 goto :TESTFAIL
call jpm --verbose --test --modpath=. install https://github.com/janet-lang/jhydro.git
@if errorlevel 1 goto :TESTFAIL
call jpm --verbose --test --modpath=. install https://github.com/janet-lang/path.git
@if errorlevel 1 goto :TESTFAIL
call jpm --verbose --test --modpath=. install https://github.com/janet-lang/argparse.git
@if errorlevel 1 goto :TESTFAIL
popd
exit /b 0

@rem build, test, dist, install. Useful for local dev.
:ALL
call %0 build
@if errorlevel 1 exit /b 1
call %0 test
@if errorlevel 1 exit /b 1
call %0 dist
@if errorlevel 1 exit /b 1
call %0 install
@if errorlevel 1 exit /b 1
@echo Done!
exit /b 0

:TESTFAIL
@echo.
@echo *******************************************************
@echo *** Tests FAILED -- Please check the error messages ***
@echo *******************************************************
exit /b 1

@rem Build failed
:BUILDFAIL
@echo.
@echo *******************************************************
@echo *** Build FAILED -- Please check the error messages ***
@echo *******************************************************
exit /b 1

@rem Build janet on windows
@rem
@rem Open a "Windows SDK Command Shell" and cd to the janet directory
@rem Then run this script with no arguments to build the executable

@echo off

@rem Ensure correct command prompt
@if not defined INCLUDE goto :BADCMD

@rem Sub commands
@if "%1"=="help" goto HELP
@if "%1"=="clean" goto CLEAN
@if "%1"=="test" goto TEST
@if "%1"=="dist" goto DIST
@if "%1"=="install" goto INSTALL
@if "%1"=="test-install" goto TESTINSTALL
@if "%1"=="all" goto ALL

@rem Set compile and link options here
@setlocal
@set JANET_COMPILE=cl /nologo /Isrc\include /Isrc\conf /c /O2 /W3 /D_CRT_SECURE_NO_WARNINGS
@set JANET_LINK=link /nologo
@set JANET_LINK_STATIC=lib /nologo

@rem Add janet build tag
if not "%JANET_BUILD%" == "" (
    @set JANET_COMPILE=%JANET_COMPILE% /DJANET_BUILD="\"%JANET_BUILD%\""
)

mkdir build
mkdir build\core
mkdir build\mainclient
mkdir build\boot

@rem Build the xxd tool for generating sources
cl /nologo /c tools/xxd.c /Fobuild\xxd.obj
@if errorlevel 1 goto :BUILDFAIL
link /nologo /out:build\xxd.exe build\xxd.obj
@if errorlevel 1 goto :BUILDFAIL

@rem Generate the embedded sources
build\xxd.exe src\boot\boot.janet build\boot.gen.c janet_gen_boot
@if errorlevel 1 goto :BUILDFAIL

@rem Build the generated sources
%JANET_COMPILE% /Fobuild\boot\boot.gen.obj build\boot.gen.c
@if errorlevel 1 goto :BUILDFAIL

@rem Build the bootstrap interpreter
for %%f in (src\core\*.c) do (
    %JANET_COMPILE% /DJANET_BOOTSTRAP /Fobuild\boot\%%~nf.obj %%f
    @if errorlevel 1 goto :BUILDFAIL
)
for %%f in (src\boot\*.c) do (
    %JANET_COMPILE% /DJANET_BOOTSTRAP /Fobuild\boot\%%~nf.obj %%f
    @if errorlevel 1 goto :BUILDFAIL
)
%JANET_LINK% /out:build\janet_boot.exe build\boot\*.obj
@if errorlevel 1 goto :BUILDFAIL
build\janet_boot build\core_image.c

@rem Build the core image
%JANET_COMPILE% /Fobuild\core_image.obj build\core_image.c
@if errorlevel 1 goto :BUILDFAIL

@rem Build the sources
for %%f in (src\core\*.c) do (
    %JANET_COMPILE% /Fobuild\core\%%~nf.obj %%f
    @if errorlevel 1 goto :BUILDFAIL
)

@rem Build the resources
rc /nologo /fobuild\janet_win.res janet_win.rc

@rem Build the main client
for %%f in (src\mainclient\*.c) do (
    %JANET_COMPILE% /Fobuild\mainclient\%%~nf.obj %%f
    @if errorlevel 1 goto :BUILDFAIL
)

@rem Link everything to main client
%JANET_LINK% /out:janet.exe build\core\*.obj build\mainclient\*.obj build\core_image.obj build\janet_win.res
@if errorlevel 1 goto :BUILDFAIL

@rem Build static library (libjanet.a)
%JANET_LINK_STATIC% /out:build\libjanet.lib build\core\*.obj build\core_image.obj
@if errorlevel 1 goto :BUILDFAIL

@rem Gen amlag
setlocal enabledelayedexpansion
set "amalg_files="
for %%f in (src\core\*.c) do (
    set "amalg_files=!amalg_files! %%f"
)
janet.exe tools\amalg.janet src\core\util.h src\core\state.h src\core\gc.h src\core\vector.h src\core\fiber.h src\core\regalloc.h src\core\compile.h src\core\emit.h src\core\symcache.h %amalg_files% build\core_image.c > build\janet.c
janet.exe tools\removecr.janet build\janet.c

@rem Gen shell.c
janet.exe tools\amalg.janet src\mainclient\line.h src\mainclient\line.c src\mainclient\main.c > build\shell.c
janet.exe tools\removecr.janet build\shell.c

echo === Successfully built janet.exe for Windows ===
echo === Run 'build_win test' to run tests. ==
echo === Run 'build_win clean' to delete build artifacts. ===
exit /b 0

@rem Not using correct command line
:BADCMD
@echo You must open a "Visual Studio .NET Command Prompt" to run this script
exit /b 1

@rem Show help
:HELP
@echo.
@echo Usage: build_windows [subcommand=clean,help,test,dist]
@echo.
@echo Script to build janet on windows. Must be run from the Visual Studio
@echo command prompt.
exit /b 0

@rem Clean build artifacts
:CLEAN
del *.exe *.lib *.exp
rd /s /q build
rd /s /q dist
exit /b 0

@rem Run tests
:TEST
for %%f in (test/suite*.janet) do (
    janet.exe test\%%f
    @if errorlevel 1 goto TESTFAIL
)
exit /b 0

@rem Build a dist directory
:DIST
mkdir dist
janet.exe tools\gendoc.janet > dist\doc.html
janet.exe tools\removecr.janet dist\doc.html

copy build\janet.c dist\janet.c
copy build\shell.c dist\shell.c
copy janet.exe dist\janet.exe
copy LICENSE dist\LICENSE
copy README.md dist\README.md

copy janet.lib dist\janet.lib
copy janet.exp dist\janet.exp

copy src\include\janet.h dist\janet.h
copy src\conf\janetconf.h dist\janetconf.h
copy build\libjanet.lib dist\libjanet.lib

copy auxbin\jpm dist\jpm
copy tools\jpm.bat dist\jpm.bat

@rem Create installer
"C:\Program Files (x86)\NSIS\makensis.exe" janet-installer.nsi
exit /b 0

@rem Run the installer. (Installs to the local user with default settings)
:INSTALL
@echo Running Installer...
FOR %%a in (janet-*-windows-installer.exe) DO (
    %%a /S /CurrentUser
)
exit /b 0

@rem Test the installation.
:TESTINSTALL
pushd test\install
call jpm clean
@if errorlevel 1 goto :TESTINSTALLFAIL
call jpm test
@if errorlevel 1 goto :TESTINSTALLFAIL
call jpm --verbose --modpath=. install https://github.com/janet-lang/json.git
@if errorlevel 1 goto :TESTINSTALLFAIL
call build\testexec
@if errorlevel 1 goto :TESTINSTALLFAIL
call jpm --verbose quickbin testexec.janet build\testexec2.exe
@if errorlevel 1 goto :TESTINSTALLFAIL
call build\testexec2.exe
@if errorlevel 1 goto :TESTINSTALLFAIL
call jpm --verbose --test --modpath=. install https://github.com/janet-lang/jhydro.git
@if errorlevel 1 goto :TESTINSTALLFAIL
call jpm --verbose --test --modpath=. install https://github.com/janet-lang/path.git
@if errorlevel 1 goto :TESTINSTALLFAIL
call jpm --verbose --test --modpath=. install https://github.com/janet-lang/argparse.git
@if errorlevel 1 goto :TESTINSTALLFAIL
:TESTINSTALLFAIL
popd
goto :TESTFAIL
exit /b 0

@rem build, test, dist, install. Useful for local dev.
:ALL
call %0 build
@if errorlevel 1 exit /b 1
call %0 test
@if errorlevel 1 exit /b 1
call %0 dist
@if errorlevel 1 exit /b 1
call %0 install
@if errorlevel 1 exit /b 1
@echo Done!
exit /b 0

:TESTFAIL
@echo.
@echo *******************************************************
@echo *** Tests FAILED -- Please check the error messages ***
@echo *******************************************************
exit /b 1

@rem Build failed
:BUILDFAIL
@echo.
@echo *******************************************************
@echo *** Build FAILED -- Please check the error messages ***
@echo *******************************************************
exit /b 1

Fix build_win test-install.

Fix build_win test-install.

On failure, cd back to original directory.


rem Building & compressing serve-d for release inside a virtual machine with Windows 8 or above

cd %~dp0

@if not exist version.txt (
	echo.
    echo !-- Error: version.txt is missing :/
    echo.
    pause
    goto :eof
)

rem This will sync this repo with the folder %SystemDrive%\buildsd
robocopy . %SystemDrive%\buildsd /MIR /XA:SH /XD .* /XF .* /XF *.zip
pushd %SystemDrive%\buildsd

set /p Version=<version.txt
dub build --compiler=ldc2 --arch=x86

if exist windows del /S /Q windows
mkdir windows
copy serve-d.exe windows\serve-d.exe
copy libcurl.dll windows\libcurl.dll
copy libeay32.dll windows\libeay32.dll
copy ssleay32.dll windows\ssleay32.dll

if exist windows.zip del windows.zip
powershell -nologo -noprofile -command "& { Add-Type -A 'System.IO.Compression.FileSystem'; [IO.Compression.ZipFile]::CreateFromDirectory('windows', 'windows.zip'); }"
popd

move %SystemDrive%\buildsd\windows.zip "serve-d-%Version%-windows.zip"
pause

rem Building & compressing serve-d for release inside a virtual machine with Windows 8 or above

cd %~dp0

@if not exist version.txt (
	echo.
    echo !-- Error: version.txt is missing :/
    echo.
    pause
    goto :eof
)

rem This will sync this repo with the folder %SystemDrive%\buildsd
robocopy . %SystemDrive%\buildsd /MIR /XA:SH /XD .* /XF .* /XF *.zip
pushd %SystemDrive%\buildsd

set /p Version=<version.txt
dub upgrade
dub build --compiler=ldc2 --arch=x86

if exist windows del /S /Q windows
mkdir windows
copy serve-d.exe windows\serve-d.exe
copy libcurl.dll windows\libcurl.dll
copy libeay32.dll windows\libeay32.dll
copy ssleay32.dll windows\ssleay32.dll

if exist windows.zip del windows.zip
powershell -nologo -noprofile -command "& { Add-Type -A 'System.IO.Compression.FileSystem'; [IO.Compression.ZipFile]::CreateFromDirectory('windows', 'windows.zip'); }"
popd

move %SystemDrive%\buildsd\windows.zip "serve-d_%Version%-windows.zip"
pause

Update buildscript

Update buildscript

- Add `dub upgrade`
- Change zip name


rem The First Method
call "C:\Program Files\Microsoft Visual Studio 12.0\VC\vcvarsall.bat" x86

rem The Second Method
set VSCMD_START_DIR=%cd%
call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\Tools\VsDevCmd.bat"

echo off
cls

if exist "C:\Program Files\Microsoft Visual Studio 12.0\VC\vcvarsall.bat" (
	call "C:\Program Files\Microsoft Visual Studio 12.0\VC\vcvarsall.bat" x86
)

if exist "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\Tools\VsDevCmd.bat" (
	set VSCMD_START_DIR=%cd%
	call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\Tools\VsDevCmd.bat"
)

Update locatevc.bat

Update locatevc.bat


 rem Name: TimeChange.bat
 rem Author: DB
 rem Zmienia czas systemowy na 10 pazdziernik 2002
 rem Nalezy utworzyc skrot i w Wlasciwosciach: Skrot -> Zaawansowane -> Uruchom jako administrator

@echo off

date 02-10-10

GOTO:EOF

Create TimeChange.bat

Create TimeChange.bat

Zmiana czasu systemowego


@ECHO OFF
@REM
@REM Copyright 2011-2013 eBusiness Information, Groupe Excilys (www.ebusinessinformation.fr)
@REM
@REM Licensed under the Apache License, Version 2.0 (the "License");
@REM you may not use this file except in compliance with the License.
@REM You may obtain a copy of the License at
@REM
@REM 		http://www.apache.org/licenses/LICENSE-2.0
@REM
@REM Unless required by applicable law or agreed to in writing, software
@REM distributed under the License is distributed on an "AS IS" BASIS,
@REM WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@REM See the License for the specific language governing permissions and
@REM limitations under the License.
@REM

setlocal

rem set GATLING_HOME automatically if possible
set "OLD_DIR=%cd%"
cd ..
set "DEFAULT_GATLING_HOME=%cd%"
cd %OLD_DIR%

rem if gatling home is correctly set
if exist "%GATLING_HOME%\bin\gatling.bat" goto gotHome
rem if gatling home is not correctly set
if not "%GATLING_HOME%" == "" goto badHome
rem if not try current folder
if exist "%OLD_DIR%\bin\gatling.bat" set "GATLING_HOME=%OLD_DIR%" && goto gotHome
rem if not try parent folder
if exist "%DEFAULT_GATLING_HOME%\bin\gatling.bat" set "GATLING_HOME=%DEFAULT_GATLING_HOME%" && goto gotHome
rem else tell user to set GATLING_HOME
goto :noHome

:gotHome

echo GATLING_HOME is set to "%GATLING_HOME%"

set JAVA_OPTS=-server -XX:+UseThreadPriorities -XX:ThreadPriorityPolicy=42 -Xms512M -Xmx512M -Xmn100M -XX:+HeapDumpOnOutOfMemoryError -XX:+AggressiveOpts -XX:+OptimizeStringConcat -XX:+UseFastAccessorMethods -XX:+UseParNewGC -XX:+UseConcMarkSweepGC -XX:+CMSParallelRemarkEnabled -XX:+CMSClassUnloadingEnabled -XX:SurvivorRatio=8 -XX:MaxTenuringThreshold=1 -XX:CMSInitiatingOccupancyFraction=75 -XX:+UseCMSInitiatingOccupancyOnly %JAVA_OPTS%

set CLASSPATH="%GATLING_HOME%"\lib\*;"%GATLING_HOME%"\conf;"%GATLING_HOME%"\user-files;%JAVA_CLASSPATH%
set COMMAND=-cp %CLASSPATH% io.gatling.app.Gatling

java %JAVA_OPTS% %COMMAND% %*

goto exit

:badHome
echo The GATLING_HOME environnement variable points to the wrong directory.
echo Please set it to the correct folder and try to launch Gatling again.
goto exit

:noHome
echo GATLING_HOME environnement variable is not set and could not be guessed automatically.
echo Please set GATLING_HOME and try to launch Gatling again.
goto exit

:exit
pause
endlocal
exit /b 0

@ECHO OFF
@REM
@REM Copyright 2011-2013 eBusiness Information, Groupe Excilys (www.ebusinessinformation.fr)
@REM
@REM Licensed under the Apache License, Version 2.0 (the "License");
@REM you may not use this file except in compliance with the License.
@REM You may obtain a copy of the License at
@REM
@REM 		http://www.apache.org/licenses/LICENSE-2.0
@REM
@REM Unless required by applicable law or agreed to in writing, software
@REM distributed under the License is distributed on an "AS IS" BASIS,
@REM WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@REM See the License for the specific language governing permissions and
@REM limitations under the License.
@REM

setlocal

rem set GATLING_HOME automatically if possible
set "OLD_DIR=%cd%"
cd ..
set "DEFAULT_GATLING_HOME=%cd%"
cd %OLD_DIR%

rem if gatling home is correctly set
if exist "%GATLING_HOME%\bin\gatling.bat" goto gotHome
rem if gatling home is not correctly set
if not "%GATLING_HOME%" == "" goto badHome
rem if not try current folder
if exist "%OLD_DIR%\bin\gatling.bat" set "GATLING_HOME=%OLD_DIR%" && goto gotHome
rem if not try parent folder
if exist "%DEFAULT_GATLING_HOME%\bin\gatling.bat" set "GATLING_HOME=%DEFAULT_GATLING_HOME%" && goto gotHome
rem else tell user to set GATLING_HOME
goto :noHome

:gotHome

echo GATLING_HOME is set to "%GATLING_HOME%"

set JAVA_OPTS=-server -XX:+UseThreadPriorities -XX:ThreadPriorityPolicy=42 -Xms512M -Xmx512M -Xmn100M -XX:+HeapDumpOnOutOfMemoryError -XX:+AggressiveOpts -XX:+OptimizeStringConcat -XX:+UseFastAccessorMethods -XX:+UseParNewGC -XX:+UseConcMarkSweepGC -XX:+CMSParallelRemarkEnabled -XX:+CMSClassUnloadingEnabled -XX:SurvivorRatio=8 -XX:MaxTenuringThreshold=1 -XX:CMSInitiatingOccupancyFraction=75 -XX:+UseCMSInitiatingOccupancyOnly %JAVA_OPTS%

set CLASSPATH="%GATLING_HOME%"\lib\*;"%GATLING_HOME%"\conf;"%GATLING_HOME%"\user-files;%JAVA_CLASSPATH%
set COMMAND=-cp %CLASSPATH% io.gatling.app.Gatling

java %JAVA_OPTS% %COMMAND% %*

goto exit

:badHome
echo The GATLING_HOME environnement variable points to the wrong directory.
echo Please set it to the correct folder and try to launch Gatling again.
goto exit

:noHome
echo GATLING_HOME environnement variable is not set and could not be guessed automatically.
echo Please set GATLING_HOME and try to launch Gatling again.
goto exit

:exit
if not defined NO_PAUSE pause
endlocal
exit /b 0

Allow to get rid of the pause

Allow to get rid of the pause


cls
call ../../../src/locatevc.bat
cl /c /DEBUG ring_opengl42.c -I "..\..\..\libdepwin\glew\include" -I "..\..\..\libdepwin\freeglut\include" -I"..\..\..\include"
link /DEBUG ring_opengl42.obj  ..\..\..\lib\ring.lib ..\..\..\libdepwin\glew\lib\release\win32\glew32.lib ..\..\..\libdepwin\freeglut\lib\freeglut.lib /DLL /OUT:..\..\..\bin\ring_opengl42.dll /SUBSYSTEM:CONSOLE,"5.01"
del ring_opengl42.obj

cls
call ../../../src/locatevc.bat
cl /c /DEBUG ring_opengl42.c -I "..\..\..\extensions\libdepwin\glew\include" -I "..\..\..\extensions\libdepwin\freeglut\include" -I"..\..\..\include"
link /DEBUG ring_opengl42.obj  ..\..\..\lib\ring.lib ..\..\..\extensions\libdepwin\glew\lib\release\win32\glew32.lib ..\..\..\extensions\libdepwin\freeglut\lib\freeglut.lib /DLL /OUT:..\..\..\bin\ring_opengl42.dll /SUBSYSTEM:CONSOLE,"5.01"
del ring_opengl42.obj

Update extensions/ringopengl/opengl42/buildvc.bat


if not exist Results mkdir Results
set name=WhiteSharp
set nunit="%cd%\..\..\Tools\NUnit 2.6.3\bin"
set report="%cd%\..\..\Tools\NUnit2Report.Console"
%nunit%\nunit-console.exe WhiteSharp\bin\Debug\%name%.dll /out:Results\%name%.txt
%report%\NUnit2Report.Console.exe --todir Results --out %name%.html --fileset=TestResult.xml --lang en
pause

Update RunTests.bat

Update RunTests.bat


git reset .
git add -A
git reset .idea/*
git reset */*.iml
git reset */target/*

git reset .
git add -A
git reset *.iml
git reset */*.iml
git reset .idea/.name
git reset .idea/*
git reset */target/*

add two delete sentences into git.bat

add two delete sentences into git.bat


"%sdkver%" -q -version:v7.0
call setenv /x64
coverage erase
coverage run -p -m nose.core -v tvtk/tests
coverage run -p -m nose.core -v mayavi
coverage combine
coverage report

"%sdkver%" -q -version:v7.0
call setenv /x64
coverage erase
coverage run -p -m nose.core -v tvtk/tests
if %errorlevel% neq 0 exit /b %errorlevel%
coverage run -p -m nose.core -v mayavi
if %errorlevel% neq 0 exit /b %errorlevel%
coverage combine
coverage report

exit batch file on error

exit batch file on error


@echo off
echo [INFO] create db.
echo [INFO] please confirm db encoding utf-8.
echo [INFO] please confirm has modified es/web/pom.xml--^>profile--^>development---^>connection.admin.url/connection.username/password
cd %~dp0
cd ../web
call mvn db:create -e -X

cd ../bin
pause

@echo off
echo [INFO] create db.
echo [INFO] please confirm db encoding utf-8.
echo [INFO] please confirm has modified es/web/pom.xml--^>profile--^>development---^>connection.admin.url/connection.username/password
cd %~dp0
cd ../web
call mvn db:create

cd ../bin
pause

Revert "print detailed debug info when creating DB"

This reverts commit 976cb30fbeae2de2a39cdd0ff8ff73f152dd7f15.


@echo off
::ϵͳ
::HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment
::û
::HKEY_CURRENT_USER\Environment

set regOgrepath=HKEY_CURRENT_USER\Environment

::BINĿ¼
set regBINName=NFBIN_HOME
set regBINValue=D:\NoahGameFrame\trunk\_Out\Client\Bin
reg add "%regOgrepath%" /v "%regBINName%" /d "%regBINValue%" /f

::SERVER_BINĿ¼
set regSERVERBINName=NFBIN_SERVER
set regSERVERBINValue=D:\NoahGameFrame\trunk\_Out\Server
reg add "%regOgrepath%" /v "%regSERVERBINName%" /d "%regSERVERBINValue%" /f

::COMM_BINĿ¼
set regCOMMBINName=NFBIN_COMM
set regCOMMBINValue=D:\NoahGameFrame\trunk\_Out\Comm
reg add "%regOgrepath%" /v "%regCOMMBINName%" /d "%regCOMMBINValue%" /f

::NF_HOMEĿ¼
set regNF_HOMEName=NF_HOME
set regNF_HOMEValue=D:\NoahGameFrame\trunk\\
reg add "%regOgrepath%" /v "%regNF_HOMEName%" /d "%regNF_HOMEValue%" /f

::APP_LIBĿ¼
set regAPP_LIBName=APP_DEPLIB
set regAPP_LIBVALUE=D:\NoahGameFrame\trunk\Dependencies\lib\\
reg add "%regOgrepath%" /v "%regAPP_LIBName%" /d "%regAPP_LIBVALUE%" /f

::NF_NOSQL_NETĿ¼
set regNF_HOMEName=NF_NOSQL_NET
set regNF_HOMEValue=D:\NoahGameFrame\trunk\Dependencies\redis-cplusplus-client\msvc\anet_win32\\
reg add "%regOgrepath%" /v "%regNF_HOMEName%" /d "%regNF_HOMEValue%" /f

::BOOST
set regBOOSTName=BOOST_HOME
set regBOOSTValue=D:\NoahGameFrame\trunk\Dependencies\boost_1_53_0\\
reg add "%regOgrepath%" /v "%regBOOSTName%" /d "%regBOOSTValue%" /f

::BOOSTLIB
set regBOOSTLIBName=BOOST_LIB
set regBOOSTLIBValue=D:\NoahGameFrame\trunk\Dependencies\boost_1_53_0\stage\lib\x64\vs11_0
reg add "%regOgrepath%" /v "%regBOOSTLIBName%" /d "%regBOOSTLIBValue%" /f

::Dependencies
set regDEPName=NF_DEP
set regDEPNameValue=D:\NoahGameFrame\trunk\Dependencies\\
reg add "%regOgrepath%" /v "%regDEPName%" /d "%regDEPNameValue%" /f

::GLOGĿ¼
set regGLOGName=GLOG_HOME
set regGLOGValue=D:\NoahGameFrame\trunk\Dependencies\glog-0.3.3\src\windows\\
reg add "%regOgrepath%" /v "%regGLOGName%" /d "%regGLOGValue%" /f

::TheronĿ¼
set regTHERONName=THERON_HOME
set regTHERONValue=D:\NoahGameFrame\trunk\Dependencies\Theron-6.00.01\Include\\
reg add "%regOgrepath%" /v "%regTHERONName%" /d "%regTHERONValue%" /f

echo Set Environment end

rem ====================================================================================
echo Start to extract boost_1_53_0

cd Tool
7z x "..\Dependencies\boost_1_53_0.zip" -o"..\Dependencies\" -y

echo Extract boost_1_53_0 completed!
rem ====================================================================================

echo Start to extract nessasery lib

7z x "..\Dependencies\lib.zip" -o"..\Dependencies\" -y

echo Extract nessasery lib completed!
rem ====================================================================================

pause

@echo off
::ϵͳ
::HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment
::û
::HKEY_CURRENT_USER\Environment

REM set regOgrepath=HKEY_CURRENT_USER\Environment

REM ::BINĿ¼
REM set regBINName=NFBIN_HOME
REM set regBINValue=D:\NoahGameFrame\trunk\_Out\Client\Bin
REM reg add "%regOgrepath%" /v "%regBINName%" /d "%regBINValue%" /f

REM ::SERVER_BINĿ¼
REM set regSERVERBINName=NFBIN_SERVER
REM set regSERVERBINValue=D:\NoahGameFrame\trunk\_Out\Server
REM reg add "%regOgrepath%" /v "%regSERVERBINName%" /d "%regSERVERBINValue%" /f

REM ::COMM_BINĿ¼
REM set regCOMMBINName=NFBIN_COMM
REM set regCOMMBINValue=D:\NoahGameFrame\trunk\_Out\Comm
REM reg add "%regOgrepath%" /v "%regCOMMBINName%" /d "%regCOMMBINValue%" /f

REM ::NF_HOMEĿ¼
REM set regNF_HOMEName=NF_HOME
REM set regNF_HOMEValue=D:\NoahGameFrame\trunk\\
REM reg add "%regOgrepath%" /v "%regNF_HOMEName%" /d "%regNF_HOMEValue%" /f

REM ::APP_LIBĿ¼
REM set regAPP_LIBName=APP_DEPLIB
REM set regAPP_LIBVALUE=D:\NoahGameFrame\trunk\Dependencies\lib\\
REM reg add "%regOgrepath%" /v "%regAPP_LIBName%" /d "%regAPP_LIBVALUE%" /f

REM ::NF_NOSQL_NETĿ¼
REM set regNF_HOMEName=NF_NOSQL_NET
REM set regNF_HOMEValue=D:\NoahGameFrame\trunk\Dependencies\redis-cplusplus-client\msvc\anet_win32\\
REM reg add "%regOgrepath%" /v "%regNF_HOMEName%" /d "%regNF_HOMEValue%" /f

REM ::BOOST
REM set regBOOSTName=BOOST_HOME
REM set regBOOSTValue=D:\NoahGameFrame\trunk\Dependencies\boost_1_53_0\\
REM reg add "%regOgrepath%" /v "%regBOOSTName%" /d "%regBOOSTValue%" /f

REM ::BOOSTLIB
REM set regBOOSTLIBName=BOOST_LIB
REM set regBOOSTLIBValue=D:\NoahGameFrame\trunk\Dependencies\boost_1_53_0\stage\lib\x64\vs11_0
REM reg add "%regOgrepath%" /v "%regBOOSTLIBName%" /d "%regBOOSTLIBValue%" /f

REM ::Dependencies
REM set regDEPName=NF_DEP
REM set regDEPNameValue=D:\NoahGameFrame\trunk\Dependencies\\
REM reg add "%regOgrepath%" /v "%regDEPName%" /d "%regDEPNameValue%" /f

REM ::GLOGĿ¼
REM set regGLOGName=GLOG_HOME
REM set regGLOGValue=D:\NoahGameFrame\trunk\Dependencies\glog-0.3.3\src\windows\\
REM reg add "%regOgrepath%" /v "%regGLOGName%" /d "%regGLOGValue%" /f

REM ::TheronĿ¼
REM set regTHERONName=THERON_HOME
REM set regTHERONValue=D:\NoahGameFrame\trunk\Dependencies\Theron-6.00.01\Include\\
REM reg add "%regOgrepath%" /v "%regTHERONName%" /d "%regTHERONValue%" /f

REM echo Set Environment end

rem ====================================================================================
echo Start to extract boost_1_53_0

cd Tool
7z x "..\Dependencies\boost_1_53_0.zip" -o"..\Dependencies\" -y

echo Extract boost_1_53_0 completed!
rem ====================================================================================

echo Start to extract nessasery lib

7z x "..\Dependencies\lib.zip" -o"..\Dependencies\" -y

echo Extract nessasery lib completed!
rem ====================================================================================

pause

delete use reg to set Environment

delete use reg to set Environment


# check if all required nodes are
# up, if at least one fails test will stop
exec 001-alive alpha
exec 001-alive beta
exec 001-alive koppa

# save syscall, no-op when already done
exec 003-save-sysctls alpha
exec 003-save-sysctls beta
exec 003-save-sysctls koppa

# restore sysctls to initial default
exec 003-restore-sysctls alpha
exec 003-restore-sysctls beta
exec 003-restore-sysctls koppa

# start netperf as receiver at TCP port
# 8000 and background process
exec xxx-netperf-sink beta 8000

# limit rate at forwarding radio to 10000 byte/sec
exec xxx-netem koppa rate:10000

# set IW at sender to 20
exec xxx-set-iw alpha 20
# send 10000 byte from to beta (at node alpha)
# do not background, wait in foreground, process
# will block here until all bytes are transmitted
exec xxx-netpert-sender alpha beta 10000

# ok, if the previous process returns the data is transmitted

# now read the data at the sink. This command will
# simple return the data writen with the previous backgrounded
# "exec xxx-netperf-sink beta 8000" call. The data file
# is copied here, the file at beta is removed (cleaned)
exec xxx-netperf-sink beta data

# check if all required nodes are
# up, if at least one fails test will stop
exec 001-alive alpha
exec 001-alive beta
exec 001-alive koppa

# save syscall, no-op when already done
exec 003-save-sysctls alpha
exec 003-save-sysctls beta
exec 003-save-sysctls koppa

# restore sysctls to initial default
exec 003-restore-sysctls alpha
exec 003-restore-sysctls beta
exec 003-restore-sysctls koppa

# start netperf as receiver at TCP port
# 8000 and background process. This applet
# probably copy a local python helper program
# to node beta.
# xxx- prefixed applets are not implemented yet
exec xxx-netperf-sink beta mode:background port:8000

# limit rate at forwarding radio to 10000 byte/sec
exec xxx-netem koppa rate:10000

# set IW at sender to 20
exec xxx-conf-iw alpha 20
# send 10000 byte from to beta (at node alpha)
# do not background, wait in foreground, process
# will block here until all bytes are transmitted
exec xxx-netpert-sender alpha beta 10000

# ok, if the previous process returns the data is transmitted

# now read the data at the sink. This command will
# simple return the data writen with the previous backgrounded
# "exec xxx-netperf-sink beta 8000" call. The data file
# is copied here, the file at beta is removed (cleaned)
exec xxx-netperf-sink beta stop-backgrouding
exec xxx-netperf-sink beta fetch-data

add more comments to example campaign

add more comments to example campaign


mkdir build
cd build

cmake ^
    -G "NMake Makefiles" ^
    -DCMAKE_INSTALL_PREFIX=%LIBRARY_PREFIX% ^
    -DCMAKE_PREFIX_PATH=%LIBRARY_PREFIX% ^
    -DCMAKE_BUILD_TYPE=Release ^
    -DCMAKE_INSTALL_LIBDIR=lib ^
    -DBUILD_SHARED_LIBS=ON ^
    %SRC_DIR%
if errorlevel 1 exit 1

:: Build.
cmake --build . --config Release
if errorlevel 1 exit 1

:: Install.
cmake --build . --config Release --target install
if errorlevel 1 exit 1

Add cppad bld.bat

Add cppad bld.bat


@ECHO OFF

SET BASEDIR=%~dp0..
SET USERINI=%BASEDIR%\user.ini
FOR /F "tokens=1,2 delims=:" %%a in ("%STEELTOE_PCF_CREDENTIALS%") do (
   set CF_USER=%%a
   set CF_PASS=%%b
)

SET PYTHON_HOME=C:\Python36
SET DOTNET_HOME=C:\Program Files\dotnet
SET JAVA_HOME=C:\opt\oracle-jdk-8
SET GIT_HOME=C:\Program Files\Git
SET MAVEN_HOME=C:\opt\apache-maven-3.3.9
SET CF_HOME=C:\ProgramData\chocolatey\bin
SET TEST_OUT=C:\st\%~nx1

ECHO [behave.userdata] > %USERINI%
ECHO cf_apiurl = api.run.pcfbeta.io >> %USERINI%
ECHO cf_org = STEELTOE >> %USERINI%
ECHO cf_username = %CF_USER% >> %USERINI%
ECHO cf_password = %CF_PASS% >> %USERINI%
ECHO cf_max_attempts = 250 >> %USERINI%
ECHO output = %TEST_OUT% >> %USERINI%

SET PATH=%PYTHON_HOME%;%PYTHON_HOME%\Scripts;%DOTNET_HOME%;%CF_HOME%;%JAVA_HOME%\bin;%GIT_HOME%\bin;%MAVEN_HOME%\bin;%PATH%
PATH

RMDIR /S /Q %TEST_OUT%
CALL %BASEDIR%\test-setup
CALL %BASEDIR%\test-run %*

@ECHO OFF

SET BASEDIR=%~dp0..
SET USERINI=%BASEDIR%\user.ini
FOR /F "tokens=1,2 delims=:" %%a in ("%STEELTOE_PCF_CREDENTIALS%") do (
   set CF_USER=%%a
   set CF_PASS=%%b
)

SET PYTHON_HOME=C:\Python36
SET DOTNET_HOME=C:\Program Files\dotnet
SET JAVA_HOME=C:\opt\oracle-jdk-8
SET GIT_HOME=C:\Program Files\Git
SET MAVEN_HOME=C:\opt\apache-maven-3.3.9
SET CF_HOME=C:\ProgramData\chocolatey\bin
SET TEST_OUT=C:\st\%~nx1

ECHO [behave.userdata] > %USERINI%
ECHO cf_apiurl = api.run.pcfbeta.io >> %USERINI%
ECHO cf_org = STEELTOE >> %USERINI%
ECHO cf_username = %CF_USER% >> %USERINI%
ECHO cf_password = %CF_PASS% >> %USERINI%
ECHO cf_max_attempts = 250 >> %USERINI%
ECHO output = %TEST_OUT% >> %USERINI%

SET PATH=%PYTHON_HOME%;%PYTHON_HOME%\Scripts;%DOTNET_HOME%;%CF_HOME%;%JAVA_HOME%\bin;%GIT_HOME%\bin;%MAVEN_HOME%\bin;%PATH%
PATH

RMDIR /S /Q %TEST_OUT%
REM CALL %BASEDIR%\test-setup
REM CALL %BASEDIR%\test-run %*
behave %*

Disable Python virtualenv on Jenkins

Disable Python virtualenv on Jenkins


@echo off

:: current path with a slash \
for %%A in ("%~dp0\..") do set "CURRENT_PATH=%%~fA\"

:: change path to where script was run (root dir)
cd /D "%CURRENT_PATH%"

:: localization
@call module\i18n.inc.bat
set i18n=module\i18n.inc.bat

set TOOLS_PATH=%CURRENT_PATH%module\tools\
set EXEC_TOOL=%TOOLS_PATH%exec_tool.bat

rem ----------- THIRD PARTY TOOLS ------------

:: http://gnuwin32.sourceforge.net/packages/wget.htm
::set URL_TOOL_WGET=https://kent.dl.sourceforge.net/project/gnuwin32/wget/1.11.4-1/wget-1.11.4-1-bin.zip
::set URL_TOOL_WGET_DEP=https://kent.dl.sourceforge.net/project/gnuwin32/wget/1.11.4-1/wget-1.11.4-1-dep.zip
set URL_TOOL_WGET=https://eternallybored.org/misc/wget/1.19.4/32/wget.exe

:: http://www.etree.org/md5com.html
set URL_TOOL_MD5SUM=http://www.etree.org/cgi-bin/counter.cgi/software/md5sum.exe

:: https://fossies.org/windows/misc/unz600xn.exe/
set URL_TOOL_UNZIP=https://fossies.org/windows/misc/unz600xn.exe/unzip.exe

:: https://github.com/Microsoft/vswhere
set URL_TOOL_VSWHERE=https://github.com/Microsoft/vswhere/releases/download/2.3.2/vswhere.exe

:: https://cmake.org
set CMAKE_VERSION=cmake-3.10.2-win32-x86
set URL_TOOL_CMAKE=https://cmake.org/files/v3.10/%CMAKE_VERSION%.zip

:: ----------- build_pvpgn VARIABLES ------------

:: LOG=false output cmake and vs output to console
:: LOG=true logs cmake and vs output to cmake.log, visualstudio.log
set LOG=false

set PVPGN_SOURCE=source\
set PVPGN_BUILD=build\

set URL_UPDATE=https://raw.githubusercontent.com/pvpgn/pvpgn-magic-builder/master/

set PVPGN_PATH=https://github.com/pvpgn/pvpgn-server/archive/

set ZLIB_PATH=module\include\zlib\1.2.11\
set LUA_PATH=module\include\lua\5.1\
:: FIXME: important full path?
set ATLMFC_INCLUDE_PATH=%CURRENT_PATH%module\include\atlmfc\

:: ----------- build_d2gs VARIABLES ------------
set URL_MPQ=http://cdn.pvpgn.pro/diablo2/

set D2GS_RELEASE=d2gs\
set URL_BNHASH_API=http://harpywar.pvpgn.pl/api.php?method=hash^&password=

:: ----------- build_pvpgn_dev VARIABLES ------------

:: current path with a backslash /
set CURRENT_PATH_BACKSLASH=%CURRENT_PATH:\=/%

:: root dir for any project
set PROJECT_ROOT_DIR=..\..\..\

set PVPGN_DEVKIT=dev\

@echo off

:: current path with a slash \
for %%A in ("%~dp0\..") do set "CURRENT_PATH=%%~fA\"

:: change path to where script was run (root dir)
cd /D "%CURRENT_PATH%"

:: localization
@call module\i18n.inc.bat
set i18n=module\i18n.inc.bat

set TOOLS_PATH=%CURRENT_PATH%module\tools\
set EXEC_TOOL=%TOOLS_PATH%exec_tool.bat

rem ----------- THIRD PARTY TOOLS ------------

:: http://gnuwin32.sourceforge.net/packages/wget.htm
::set URL_TOOL_WGET=https://kent.dl.sourceforge.net/project/gnuwin32/wget/1.11.4-1/wget-1.11.4-1-bin.zip
::set URL_TOOL_WGET_DEP=https://kent.dl.sourceforge.net/project/gnuwin32/wget/1.11.4-1/wget-1.11.4-1-dep.zip
set URL_TOOL_WGET=https://eternallybored.org/misc/wget/1.19.4/32/wget.exe

:: http://www.etree.org/md5com.html
set URL_TOOL_MD5SUM=https://web.archive.org/web/20170430031141/http://www.etree.org:80/cgi-bin/counter.cgi/software/md5sum.exe

:: https://fossies.org/windows/misc/unz600xn.exe/
set URL_TOOL_UNZIP=https://fossies.org/windows/misc/unz600xn.exe/unzip.exe

:: https://github.com/Microsoft/vswhere
set URL_TOOL_VSWHERE=https://github.com/Microsoft/vswhere/releases/download/2.5.2/vswhere.exe

:: https://cmake.org
set CMAKE_VERSION=cmake-3.12.4-win32-x86
set URL_TOOL_CMAKE=https://cmake.org/files/v3.12/%CMAKE_VERSION%.zip

:: ----------- build_pvpgn VARIABLES ------------

:: LOG=false output cmake and vs output to console
:: LOG=true logs cmake and vs output to cmake.log, visualstudio.log
set LOG=false

set PVPGN_SOURCE=source\
set PVPGN_BUILD=build\

set URL_UPDATE=https://raw.githubusercontent.com/pvpgn/pvpgn-magic-builder/master/

set PVPGN_PATH=https://github.com/pvpgn/pvpgn-server/archive/

set ZLIB_PATH=module\include\zlib\1.2.11\
set LUA_PATH=module\include\lua\5.1\
:: FIXME: important full path?
set ATLMFC_INCLUDE_PATH=%CURRENT_PATH%module\include\atlmfc\

:: ----------- build_d2gs VARIABLES ------------
set URL_MPQ=http://cdn.pvpgn.pro/diablo2/

set D2GS_RELEASE=d2gs\
set URL_BNHASH_API=http://harpywar.pvpgn.pl/api.php?method=hash^&password=

:: ----------- build_pvpgn_dev VARIABLES ------------

:: current path with a backslash /
set CURRENT_PATH_BACKSLASH=%CURRENT_PATH:\=/%

:: root dir for any project
set PROJECT_ROOT_DIR=..\..\..\

set PVPGN_DEVKIT=dev\

update forbidden link to md5sum.exe

update forbidden link to md5sum.exe


@echo off
REM ======================================================================
REM
REM  Copyright (C) 1990-2007, Condor Team, Computer Sciences Department,
REM  University of Wisconsin-Madison, WI.
REM
REM  Licensed under the Apache License, Version 2.0 (the "License"); you
REM  may not use this file except in compliance with the License.  You may
REM  obtain a copy of the License at
REM
REM     http://www.apache.org/licenses/LICENSE-2.0
REM
REM  Unless required by applicable law or agreed to in writing, software
REM  distributed under the License is distributed on an "AS IS" BASIS,
REM  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
REM  See the License for the specific language governing permissions and
REM  limitations under the License.
REM
REM ======================================================================

REM ======================================================================
REM First set all the variables that contain common bits for our build
REM environment.
REM * * * * * * * * * * * * * PLEASE READ * * * * * * * * * * * * * * * *
REM Microsoft Visual Studio will choke on variables that contain strings
REM exceeding 255 chars, so be careful when editing this file! It's
REM totally lame but there's nothing we can do about it.
REM ======================================================================

REM We assume all software is installed on the main system drive, but
REM in the case that it is not, change the variable bellow.
set ROOT_DRIVE=%SystemDrive%

REM Set paths to Visual C++, the Platform SDKs, and Perl
set VS_DIR=%ROOT_DRIVE%\Program Files\Microsoft Visual Studio 9.0
set VC_DIR=%VS_DIR%\VC
set VC_BIN=%VC_DIR%\bin
set PERL_DIR=%ROOT_DRIVE%\Perl\bin
set SDK_DIR=%ProgramFiles%\Microsoft Platform SDK
set DBG_DIR=%ProgramFiles%\Debugging Tools for Windows (x86)
set DOTNET_DIR=%ROOT_DRIVE%\Windows\Microsoft.NET\Framework\v3.5

REM For some reason this is not defined whilst in some environments
if "A%VS90COMNTOOLS%"=="A" set VS90COMNTOOLS=%VS_DIR%\Common7\Tools\

REM Specify symbol image path for debugging
if "A%_NT_SYMBOL_PATH%"=="A" set _NT_SYMBOL_PATH=SRV*%ROOT_DRIVE%\Symbols*http://msdl.microsoft.com/download/symbols

REM For externals: it just tells them we would like to have manifest
REM files embeded in the rem DLLs (In the future, when we do not have
REM VC6, we can remove this.  After we--of course--remove any reference
REM to it from the externals)
set NEED_MANIFESTS_IN_EXTERNALS=True

REM Where do the completed externals live?
if "A%EXTERN_DIR%"=="A" set EXTERN_DIR=%cd%\..\externals
set EXT_INSTALL=%EXTERN_DIR%\install
set EXT_TRIGGERS=%EXTERN_DIR%\triggers

REM Specify which versions of the externals we're using. To add a
REM new external, just add its version here, and add that to the
REM EXTERNALS_NEEDED variable defined below.
set EXT_GSOAP_VERSION=gsoap-2.7.10-p3
set EXT_OPENSSL_VERSION=openssl-0.9.8h
set EXT_POSTGRESQL_VERSION=postgresql-8.0.2
set EXT_KERBEROS_VERSION=krb5-1.4.3-p0
set EXT_PCRE_VERSION=pcre-7.6
set EXT_DRMAA_VERSION=drmaa-1.6

REM Now tell the build system what externals we need built.
set EXTERNALS_NEEDED=%EXT_GSOAP_VERSION% %EXT_OPENSSL_VERSION% %EXT_KERBEROS_VERSION% %EXT_PCRE_VERSION% %EXT_POSTGRESQL_VERSION% %EXT_DRMAA_VERSION%

REM Put msconfig in the PATH, since it's got lots of stuff we need
REM like awk, gunzip, tar, bison, yacc...
set PATH=%cd%;%SystemRoot%;%SystemRoot%\system32;%PERL_DIR%;%VS_DIR%;%VC_DIR%;%VC_BIN%;%SDK_DIR%;%DOTNET_DIR%;%DBG_DIR%

REM ======================================================================
REM ====== THIS SHOULD BE REMOVED WHEN Win2K IS NO LONGER SUPPORTED ======
REM Since we a still stuck in the past (i.e. supporting Win2K) we must
REM lie to the setenv script, and pretend the DevEnvDir environment
REM is alredy configured properly (yay! jump to VC2K8, but support
REM Win2K... *sigh*)
set MSVCDir=%VC_DIR%
set DevEnvDir=%VS_DIR%\Common7\IDE
set MSVCVer=9.0
REM ====== THIS SHOULD BE REMOVED WHEN Win2K IS NO LONGER SUPPORTED ======
REM ======================================================================

REM Configure Visual C++
call vcvarsall.bat x86
if not defined INCLUDE ( echo. && echo *** Failed to run vcvarsall.bat! Is Microsoft Visual Studio installed? && exit /B 1 )

REM ======================================================================
REM ====== THIS SHOULD BE REMOVED WHEN Win2K IS NO LONGER SUPPORTED ======
REM We set these here as the above script will find the wrong versions
REM of everything... *sigh*
set WindowsSdkDir=%SDK_DIR%
REM ====== THIS SHOULD BE REMOVED WHEN Win2K IS NO LONGER SUPPORTED ======
REM ======================================================================

REM Configure the Platform SDK environment
call setenv /2000 /RETAIL
if not defined MSSDK ( echo. && echo *** Failed to run setenv.cmd! Are the Microsoft Platform SDK installed? && exit /B 1 )

REM ======================================================================
REM ====== THIS SHOULD BE REMOVED WHEN Win2K IS NO LONGER SUPPORTED ======
set INCLUDE=%ROOT_DRIVE%\Program Files\Microsoft Platform SDK\Include;%ROOT_DRIVE%\Program Files\Microsoft Visual Studio 9.0\VC\ATLMFC\INCLUDE;%ROOT_DRIVE%\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE;%ROOT_DRIVE%\Program Files\Microsoft Visual Studio 9.0\VC\ATLMFC\INCLUDE;%ROOT_DRIVE%\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE;
set LIB=%ROOT_DRIVE%\Program Files\Microsoft Platform SDK\Lib;%ROOT_DRIVE%\Program Files\Microsoft Visual Studio 9.0\VC\ATLMFC\LIB;%ROOT_DRIVE%\Program Files\Microsoft Visual Studio 9.0\VC\LIB;
set LIBPATH=%ROOT_DRIVE%\WINDOWS\Microsoft.NET\Framework\v3.5;c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727;%ROOT_DRIVE%\Program Files\Microsoft Visual Studio 9.0\VC\ATLMFC\LIB;%ROOT_DRIVE%\Program Files\Microsoft Visual Studio 9.0\VC\LIB;
REM ====== THIS SHOULD BE REMOVED WHEN Win2K IS NO LONGER SUPPORTED ======
REM ======================================================================

REM Set up some stuff for BISON
set BISON_SIMPLE=%cd%\bison.simple
set BISON_HAIRY=%cd%\bison.hairy

REM Tell the build system where we can find soapcpp2
set SOAPCPP2=%EXT_INSTALL%\%EXT_GSOAP_VERSION%\soapcpp2.exe

REM Determine the build id, if it is defined
pushd ..
set BID=none
if exist BUILD-ID. (
    echo Found BUILD-ID in %cd%
    for /f %%i in ('more BUILD-ID') do set BID=%%i
) else (
    echo No build-id defined: %cd%\BUILD-ID is missing.
)
echo Using build-id: %BID% & echo.
popd

set CONDOR_NOWARN=/D_CRT_SECURE_NO_DEPRECATE /D_CRT_SECURE_NO_WARNINGS /D_CRT_NONSTDC_NO_WARNINGS /D_CRT_NON_CONFORMING_SWPRINTFS
REM /D_CONST_RETURN
set CONDOR_CPPARGS=/GR /MP4
set CONDOR_DEFINE=/DHAVE_CONFIG_H /DBUILDID=%BID% %CONDOR_CPPARGS% %CONDOR_NOWARN%
set CONDOR_INCLUDE=/I "..\src\h" /I "..\src\condor_includes" /I "..\src\condor_c++_util" /I "..\src\condor_daemon_client" /I "..\src\condor_daemon_core.V6" /I "..\src\condor_schedd.V6"
set CONDOR_LIB=crypt32.lib mpr.lib psapi.lib mswsock.lib netapi32.lib imagehlp.lib ws2_32.lib powrprof.lib iphlpapi.lib userenv.lib
set CONDOR_LIBPATH=/NOLOGO

REM ======================================================================
REM Now set the individual variables specific to each external package.
REM Some have been defined, but are not in use yet (they have /NOLOGO
REM to make them a no-op during the build).
REM ======================================================================

REM ** GSOAP
set CONDOR_GSOAP_INCLUDE=/I %EXT_INSTALL%\%EXT_GSOAP_VERSION%\src
set CONDOR_GSOAP_LIB=/NOLOGO
set CONDOR_GSOAP_LIBPATH=/NOLOGO

REM ** OPENSSL
set CONDOR_OPENSSL_INCLUDE=/I %EXT_INSTALL%\%EXT_OPENSSL_VERSION%\inc32
set CONDOR_OPENSSL_LIB=libeay32.lib ssleay32.lib
set CONDOR_OPENSSL_LIBPATH=/LIBPATH:%EXT_INSTALL%\%EXT_OPENSSL_VERSION%\out32dll

REM ** POSTGRESQL
set CONDOR_POSTGRESQL_INCLUDE=/I %EXT_INSTALL%\%EXT_POSTGRESQL_VERSION%\inc32
set CONDOR_POSTGRESQL_LIB=libpqdll.lib
set CONDOR_POSTGRESQL_LIBPATH=/LIBPATH:%EXT_INSTALL%\%EXT_POSTGRESQL_VERSION%\out32dll

REM ** KERBEROS
set CONDOR_KERB_INCLUDE=/I %EXT_INSTALL%\%EXT_KERBEROS_VERSION%\include
set CONDOR_KERB_LIB=comerr32.lib gssapi32.lib k5sprt32.lib krb5_32.lib xpprof32.lib
set CONDOR_KERB_LIBPATH=/LIBPATH:%EXT_INSTALL%\%EXT_KERBEROS_VERSION%\lib

REM ** PCRE
set CONDOR_PCRE_INCLUDE=/I %EXT_INSTALL%\%EXT_PCRE_VERSION%\include
set CONDOR_PCRE_LIB=libpcre.lib
set CONDOR_PCRE_LIBPATH=/LIBPATH:%EXT_INSTALL%\%EXT_PCRE_VERSION%\lib

REM Dump the Windows build environment at this point
REM echo ----------------------- WIN ENV DUMP ----------------------
REM set
REM echo ----------------------- WIN ENV DUMP ----------------------

exit /B 0

@echo off
REM ======================================================================
REM
REM  Copyright (C) 1990-2007, Condor Team, Computer Sciences Department,
REM  University of Wisconsin-Madison, WI.
REM
REM  Licensed under the Apache License, Version 2.0 (the "License"); you
REM  may not use this file except in compliance with the License.  You may
REM  obtain a copy of the License at
REM
REM     http://www.apache.org/licenses/LICENSE-2.0
REM
REM  Unless required by applicable law or agreed to in writing, software
REM  distributed under the License is distributed on an "AS IS" BASIS,
REM  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
REM  See the License for the specific language governing permissions and
REM  limitations under the License.
REM
REM ======================================================================

REM ======================================================================
REM First set all the variables that contain common bits for our build
REM environment.
REM * * * * * * * * * * * * * PLEASE READ * * * * * * * * * * * * * * * *
REM Microsoft Visual Studio will choke on variables that contain strings
REM exceeding 255 chars, so be careful when editing this file! It's
REM totally lame but there's nothing we can do about it.
REM ======================================================================

REM We assume all software is installed on the main system drive, but
REM in the case that it is not, change the variable bellow.
set ROOT_DRIVE=%SystemDrive%

REM Set paths to Visual C++, the Platform SDKs, and Perl
set VS_DIR=%ROOT_DRIVE%\Program Files\Microsoft Visual Studio 9.0
set VC_DIR=%VS_DIR%\VC
set VC_BIN=%VC_DIR%\bin
set PERL_DIR=%SystemDrive%\Perl\bin;%SystemDrive%\Perl64\bin;%SystemDrive%\prereq\ActivePerl-5.10.1\bin
set SDK_DIR=%ProgramFiles%\Microsoft Platform SDK
set DBG_DIR=%ProgramFiles%\Debugging Tools for Windows (x86)
set DOTNET_DIR=%ROOT_DRIVE%\Windows\Microsoft.NET\Framework\v3.5

REM For some reason this is not defined whilst in some environments
if "A%VS90COMNTOOLS%"=="A" set VS90COMNTOOLS=%VS_DIR%\Common7\Tools\

REM Specify symbol image path for debugging
if "A%_NT_SYMBOL_PATH%"=="A" set _NT_SYMBOL_PATH=SRV*%ROOT_DRIVE%\Symbols*http://msdl.microsoft.com/download/symbols

REM For externals: it just tells them we would like to have manifest
REM files embeded in the rem DLLs (In the future, when we do not have
REM VC6, we can remove this.  After we--of course--remove any reference
REM to it from the externals)
set NEED_MANIFESTS_IN_EXTERNALS=True

REM Where do the completed externals live?
if "A%EXTERN_DIR%"=="A" set EXTERN_DIR=%cd%\..\externals
set EXT_INSTALL=%EXTERN_DIR%\install
set EXT_TRIGGERS=%EXTERN_DIR%\triggers

REM Specify which versions of the externals we're using. To add a
REM new external, just add its version here, and add that to the
REM EXTERNALS_NEEDED variable defined below.
set EXT_GSOAP_VERSION=gsoap-2.7.10-p3
set EXT_OPENSSL_VERSION=openssl-0.9.8h
set EXT_POSTGRESQL_VERSION=postgresql-8.0.2
set EXT_KERBEROS_VERSION=krb5-1.4.3-p0
set EXT_PCRE_VERSION=pcre-7.6
set EXT_DRMAA_VERSION=drmaa-1.6

REM Now tell the build system what externals we need built.
set EXTERNALS_NEEDED=%EXT_GSOAP_VERSION% %EXT_OPENSSL_VERSION% %EXT_KERBEROS_VERSION% %EXT_PCRE_VERSION% %EXT_POSTGRESQL_VERSION% %EXT_DRMAA_VERSION%

REM Put msconfig in the PATH, since it's got lots of stuff we need
REM like awk, gunzip, tar, bison, yacc...
set PATH=%cd%;%SystemRoot%;%SystemRoot%\system32;%PERL_DIR%;%VS_DIR%;%VC_DIR%;%VC_BIN%;%SDK_DIR%;%DOTNET_DIR%;%DBG_DIR%

REM ======================================================================
REM ====== THIS SHOULD BE REMOVED WHEN Win2K IS NO LONGER SUPPORTED ======
REM Since we a still stuck in the past (i.e. supporting Win2K) we must
REM lie to the setenv script, and pretend the DevEnvDir environment
REM is alredy configured properly (yay! jump to VC2K8, but support
REM Win2K... *sigh*)
set MSVCDir=%VC_DIR%
set DevEnvDir=%VS_DIR%\Common7\IDE
set MSVCVer=9.0
REM ====== THIS SHOULD BE REMOVED WHEN Win2K IS NO LONGER SUPPORTED ======
REM ======================================================================

REM Configure Visual C++
call vcvarsall.bat x86
if not defined INCLUDE ( echo. && echo *** Failed to run vcvarsall.bat! Is Microsoft Visual Studio installed? && exit /B 1 )

REM ======================================================================
REM ====== THIS SHOULD BE REMOVED WHEN Win2K IS NO LONGER SUPPORTED ======
REM We set these here as the above script will find the wrong versions
REM of everything... *sigh*
set WindowsSdkDir=%SDK_DIR%
REM ====== THIS SHOULD BE REMOVED WHEN Win2K IS NO LONGER SUPPORTED ======
REM ======================================================================

REM Configure the Platform SDK environment
call setenv /2000 /RETAIL
if not defined MSSDK ( echo. && echo *** Failed to run setenv.cmd! Are the Microsoft Platform SDK installed? && exit /B 1 )

REM ======================================================================
REM ====== THIS SHOULD BE REMOVED WHEN Win2K IS NO LONGER SUPPORTED ======
set INCLUDE=%ROOT_DRIVE%\Program Files\Microsoft Platform SDK\Include;%ROOT_DRIVE%\Program Files\Microsoft Visual Studio 9.0\VC\ATLMFC\INCLUDE;%ROOT_DRIVE%\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE;%ROOT_DRIVE%\Program Files\Microsoft Visual Studio 9.0\VC\ATLMFC\INCLUDE;%ROOT_DRIVE%\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE;
set LIB=%ROOT_DRIVE%\Program Files\Microsoft Platform SDK\Lib;%ROOT_DRIVE%\Program Files\Microsoft Visual Studio 9.0\VC\ATLMFC\LIB;%ROOT_DRIVE%\Program Files\Microsoft Visual Studio 9.0\VC\LIB;
set LIBPATH=%ROOT_DRIVE%\WINDOWS\Microsoft.NET\Framework\v3.5;c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727;%ROOT_DRIVE%\Program Files\Microsoft Visual Studio 9.0\VC\ATLMFC\LIB;%ROOT_DRIVE%\Program Files\Microsoft Visual Studio 9.0\VC\LIB;
REM ====== THIS SHOULD BE REMOVED WHEN Win2K IS NO LONGER SUPPORTED ======
REM ======================================================================

REM Set up some stuff for BISON
set BISON_SIMPLE=%cd%\bison.simple
set BISON_HAIRY=%cd%\bison.hairy

REM Tell the build system where we can find soapcpp2
set SOAPCPP2=%EXT_INSTALL%\%EXT_GSOAP_VERSION%\soapcpp2.exe

REM Determine the build id, if it is defined
pushd ..
set BID=none
if exist BUILD-ID. (
    echo Found BUILD-ID in %cd%
    for /f %%i in ('more BUILD-ID') do set BID=%%i
) else (
    echo No build-id defined: %cd%\BUILD-ID is missing.
)
echo Using build-id: %BID% & echo.
popd

set CONDOR_NOWARN=/D_CRT_SECURE_NO_DEPRECATE /D_CRT_SECURE_NO_WARNINGS /D_CRT_NONSTDC_NO_WARNINGS /D_CRT_NON_CONFORMING_SWPRINTFS
REM /D_CONST_RETURN
set CONDOR_CPPARGS=/GR /MP4
set CONDOR_DEFINE=/DHAVE_CONFIG_H /DBUILDID=%BID% %CONDOR_CPPARGS% %CONDOR_NOWARN%
set CONDOR_INCLUDE=/I "..\src\h" /I "..\src\condor_includes" /I "..\src\condor_c++_util" /I "..\src\condor_daemon_client" /I "..\src\condor_daemon_core.V6" /I "..\src\condor_schedd.V6"
set CONDOR_LIB=crypt32.lib mpr.lib psapi.lib mswsock.lib netapi32.lib imagehlp.lib ws2_32.lib powrprof.lib iphlpapi.lib userenv.lib
set CONDOR_LIBPATH=/NOLOGO

REM ======================================================================
REM Now set the individual variables specific to each external package.
REM Some have been defined, but are not in use yet (they have /NOLOGO
REM to make them a no-op during the build).
REM ======================================================================

REM ** GSOAP
set CONDOR_GSOAP_INCLUDE=/I %EXT_INSTALL%\%EXT_GSOAP_VERSION%\src
set CONDOR_GSOAP_LIB=/NOLOGO
set CONDOR_GSOAP_LIBPATH=/NOLOGO

REM ** OPENSSL
set CONDOR_OPENSSL_INCLUDE=/I %EXT_INSTALL%\%EXT_OPENSSL_VERSION%\inc32
set CONDOR_OPENSSL_LIB=libeay32.lib ssleay32.lib
set CONDOR_OPENSSL_LIBPATH=/LIBPATH:%EXT_INSTALL%\%EXT_OPENSSL_VERSION%\out32dll

REM ** POSTGRESQL
set CONDOR_POSTGRESQL_INCLUDE=/I %EXT_INSTALL%\%EXT_POSTGRESQL_VERSION%\inc32
set CONDOR_POSTGRESQL_LIB=libpqdll.lib
set CONDOR_POSTGRESQL_LIBPATH=/LIBPATH:%EXT_INSTALL%\%EXT_POSTGRESQL_VERSION%\out32dll

REM ** KERBEROS
set CONDOR_KERB_INCLUDE=/I %EXT_INSTALL%\%EXT_KERBEROS_VERSION%\include
set CONDOR_KERB_LIB=comerr32.lib gssapi32.lib k5sprt32.lib krb5_32.lib xpprof32.lib
set CONDOR_KERB_LIBPATH=/LIBPATH:%EXT_INSTALL%\%EXT_KERBEROS_VERSION%\lib

REM ** PCRE
set CONDOR_PCRE_INCLUDE=/I %EXT_INSTALL%\%EXT_PCRE_VERSION%\include
set CONDOR_PCRE_LIB=libpcre.lib
set CONDOR_PCRE_LIBPATH=/LIBPATH:%EXT_INSTALL%\%EXT_PCRE_VERSION%\lib

REM Dump the Windows build environment at this point
REM echo ----------------------- WIN ENV DUMP ----------------------
REM set
REM echo ----------------------- WIN ENV DUMP ----------------------

exit /B 0

update the PERL_DIR so V7_2-branch can build again


@echo off
set OPT=/EHsc -I../xbyak /W4 -D_CRT_SECURE_NO_WARNINGS /nologo

add set_opt.bat for test on Windows

add set_opt.bat for test on Windows


mkdir -p out
mkdir -p mods

javac -d out \
    src/kata/modules/hmod/HelloModules.java \
    src/module-info.java

jar -cfe mods/hmod.jar kata.modules.hmod.HelloModules -C out .

$JAVA_HOME/bin/jlink \
--module-path mods/:$JAVA9_MACOS_HOME/jmods \
--add-modules hmod \
--launcher hmod=hmod \
--output hmod-image-java9-macos

$JAVA_HOME/bin/jlink \
--module-path mods/:$JAVA9_WIN64_HOME/jmods \
--add-modules hmod \
--launcher hmod=hmod \
--output hmod-image-java9-win64

$JAVA_HOME/bin/jlink \
--module-path mods/:$JAVA9_LINUX_HOME/jmods \
--add-modules hmod \
--launcher hmod=hmod \
--output hmod-image-java9-linux

Create build.bat

Create build.bat


conda build toolchain -c statiskit
conda create -n _appveyor toolchain --use-local
activate _appveyor
conda build libboost-python -c statiskit
conda build python-scons -c statiskit
conda build python-parse -c statiskit

IF NOT "%APPVEYOR_REPO_BRANCH%"=="master" GOTO DONE
IF "%ANACONDA_USERNAME%"=="" GOTO DONE
IF "%ANACONDA_PASSWORD%"=="" GOTO DONE

conda install anaconda-client;
anaconda login --username "%ANACONDA_USERNAME%" --password "%ANACONDA_PASSWORD%"

FOR %%CONDA_RECIPE IN (toolchain, python-scons, python-parse) DO (
  FOR /f %%i in ('conda build %CONDA_RECIPE% --output') DO (set CONDA_FILE=%%i)
  anaconda upload --user statiskit %CONDA_FILE% --force;
)

GOTO DONE

:DONE
ECHO ~~~~~~~~~~~~~~~~~~~~~~ DONE %~f0 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Create appveyor_build.bat

Create appveyor_build.bat


@echo off

REM This file is part of the DITA Open Toolkit project.
REM See the accompanying license.txt file for applicable licenses.

REM Derived from Apache Ant command line tool.

REM  Licensed to the Apache Software Foundation (ASF) under one or more
REM  contributor license agreements.  See the NOTICE file distributed with
REM  this work for additional information regarding copyright ownership.
REM  The ASF licenses this file to You under the Apache License, Version 2.0
REM  (the "License"); you may not use this file except in compliance with
REM  the License.  You may obtain a copy of the License at
REM
REM      http://www.apache.org/licenses/LICENSE-2.0
REM
REM  Unless required by applicable law or agreed to in writing, software
REM  distributed under the License is distributed on an "AS IS" BASIS,
REM  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
REM  See the License for the specific language governing permissions and
REM  limitations under the License.

if "%HOME%"=="" goto homeDrivePathPre
if exist "%HOME%\antrc_pre.bat" call "%HOME%\antrc_pre.bat"

:homeDrivePathPre
if "%HOMEDRIVE%%HOMEPATH%"=="" goto userProfilePre
if "%HOMEDRIVE%%HOMEPATH%"=="%HOME%" goto userProfilePre
if exist "%HOMEDRIVE%%HOMEPATH%\antrc_pre.bat" call "%HOMEDRIVE%%HOMEPATH%\antrc_pre.bat"

:userProfilePre
if "%USERPROFILE%"=="" goto alpha
if "%USERPROFILE%"=="%HOME%" goto alpha
if "%USERPROFILE%"=="%HOMEDRIVE%%HOMEPATH%" goto alpha
if exist "%USERPROFILE%\antrc_pre.bat" call "%USERPROFILE%\antrc_pre.bat"

:alpha

if "%OS%"=="Windows_NT" @setlocal
if "%OS%"=="WINNT" @setlocal

if "%DITA_HOME%"=="" goto setDefaultAntHome

:stripAntHome
if not _%DITA_HOME:~-1%==_\ goto checkClasspath
set DITA_HOME=%DITA_HOME:~0,-1%
goto stripAntHome

:setDefaultAntHome
rem %~dp0 is expanded pathname of the current script under NT
set DITA_HOME=%~dp0..

:checkClasspath
set _USE_CLASSPATH=yes
rem CLASSPATH must not be used if it is equal to ""
if "%CLASSPATH%"=="""" set _USE_CLASSPATH=no
if "%CLASSPATH%"=="" set _USE_CLASSPATH=no

rem Slurp the command line arguments. This loop allows for an unlimited number
rem of arguments (up to the command line limit, anyway).
set DITA_CMD_LINE_ARGS=
:setupArgs
if ""%1""=="""" goto doneStart
if ""%1""==""-noclasspath"" goto clearclasspath
set DITA_CMD_LINE_ARGS=%DITA_CMD_LINE_ARGS% %1
shift
goto setupArgs

rem here is there is a -noclasspath in the options
:clearclasspath
set _USE_CLASSPATH=no
shift
goto setupArgs

rem This label provides a place for the argument list loop to break out
rem and for NT handling to skip to.

:doneStart

if "%_USE_CLASSPATH%"=="no" goto findDitaHome

:stripClasspath
if not _%CLASSPATH:~-1%==_\ goto findDitaHome
set CLASSPATH=%CLASSPATH:~0,-1%
goto stripClasspath

:findDitaHome
rem find DITA_HOME if it does not exist due to either an invalid value passed
rem by the user or the %0 problem on Windows 9x
if exist "%DITA_HOME%\lib\ant.jar" goto checkJava

rem check for ant in Program Files
if not exist "%ProgramFiles%\ant" goto checkSystemDrive
set DITA_HOME=%ProgramFiles%\ant
goto checkJava

:checkSystemDrive
rem check for ant in root directory of system drive
if not exist %SystemDrive%\ant\lib\ant.jar goto checkCDrive
set DITA_HOME=%SystemDrive%\ant
goto checkJava

:checkCDrive
rem check for ant in C:\ant for Win9X users
if not exist C:\ant\lib\ant.jar goto noAntHome
set DITA_HOME=C:\ant
goto checkJava

:noAntHome
echo DITA_HOME is set incorrectly or ant could not be located. Please set DITA_HOME.
goto fend

:checkJava
rem Set environment variables
call "%DITA_HOME%\resources\env.sh"

set _JAVACMD=%JAVACMD%

if "%JAVA_HOME%" == "" goto noJavaHome
if not exist "%JAVA_HOME%\bin\java.exe" goto noJavaHome
if "%_JAVACMD%" == "" set _JAVACMD=%JAVA_HOME%\bin\java.exe

:noJavaHome
if "%_JAVACMD%" == "" set _JAVACMD=java.exe

:runAnt
if "%_USE_CLASSPATH%"=="no" goto runAntNoClasspath
:runAntWithClasspath
"%_JAVACMD%" %ANT_OPTS% -classpath "%DITA_HOME%\lib\ant-launcher.jar" "-Dant.home=%DITA_HOME%" org.apache.tools.ant.launch.Launcher %ANT_ARGS% -cp "%CLASSPATH%" %DITA_CMD_LINE_ARGS% -buildfile "%DITA_HOME%\build.xml" -main "org.dita.dost.invoker.Main"
rem Check the error code of the Ant build
if not "%OS%"=="Windows_NT" goto onError
set ANT_ERROR=%ERRORLEVEL%
goto end

:runAntNoClasspath
"%_JAVACMD%" %ANT_OPTS% -classpath "%DITA_HOME%\lib\ant-launcher.jar" "-Dant.home=%DITA_HOME%" org.apache.tools.ant.launch.Launcher %ANT_ARGS% %DITA_CMD_LINE_ARGS% -buildfile "%DITA_HOME%\build.xml" -main "org.dita.dost.invoker.Main"
rem Check the error code of the Ant build
if not "%OS%"=="Windows_NT" goto onError
set ANT_ERROR=%ERRORLEVEL%
goto end

:onError
rem Windows 9x way of checking the error code.  It matches via brute force.
for %%i in (1 10 100) do set err%%i=
for %%i in (0 1 2) do if errorlevel %%i00 set err100=%%i
if %err100%==2 goto onError200
if %err100%==0 set err100=
for %%i in (0 1 2 3 4 5 6 7 8 9) do if errorlevel %err100%%%i0 set err10=%%i
if "%err100%"=="" if %err10%==0 set err10=
:onError1
for %%i in (0 1 2 3 4 5 6 7 8 9) do if errorlevel %err100%%err10%%%i set err1=%%i
goto onErrorEnd
:onError200
for %%i in (0 1 2 3 4 5) do if errorlevel 2%%i0 set err10=%%i
if err10==5 for %%i in (0 1 2 3 4 5) do if errorlevel 25%%i set err1=%%i
if not err10==5 goto onError1
:onErrorEnd
set ANT_ERROR=%err100%%err10%%err1%
for %%i in (1 10 100) do set err%%i=

:end
rem bug ID 32069: resetting an undefined env variable changes the errorlevel.
if not "%_JAVACMD%"=="" set _JAVACMD=
if not "%_DITA_CMD_LINE_ARGS%"=="" set DITA_CMD_LINE_ARGS=

if "%ANT_ERROR%"=="0" goto mainEnd

goto omega

:mainEnd

rem If there were no errors, we run the post script.
if "%OS%"=="Windows_NT" @endlocal
if "%OS%"=="WINNT" @endlocal

if "%HOME%"=="" goto homeDrivePathPost
if exist "%HOME%\antrc_post.bat" call "%HOME%\antrc_post.bat"

:homeDrivePathPost
if "%HOMEDRIVE%%HOMEPATH%"=="" goto userProfilePost
if "%HOMEDRIVE%%HOMEPATH%"=="%HOME%" goto userProfilePost
if exist "%HOMEDRIVE%%HOMEPATH%\antrc_post.bat" call "%HOMEDRIVE%%HOMEPATH%\antrc_post.bat"

:userProfilePost
if "%USERPROFILE%"=="" goto omega
if "%USERPROFILE%"=="%HOME%" goto omega
if "%USERPROFILE%"=="%HOMEDRIVE%%HOMEPATH%" goto omega
if exist "%USERPROFILE%\antrc_post.bat" call "%USERPROFILE%\antrc_post.bat"

:omega

exit /b %ANT_ERROR%

@echo off

REM This file is part of the DITA Open Toolkit project.
REM See the accompanying license.txt file for applicable licenses.

REM Derived from Apache Ant command line tool.

REM  Licensed to the Apache Software Foundation (ASF) under one or more
REM  contributor license agreements.  See the NOTICE file distributed with
REM  this work for additional information regarding copyright ownership.
REM  The ASF licenses this file to You under the Apache License, Version 2.0
REM  (the "License"); you may not use this file except in compliance with
REM  the License.  You may obtain a copy of the License at
REM
REM      http://www.apache.org/licenses/LICENSE-2.0
REM
REM  Unless required by applicable law or agreed to in writing, software
REM  distributed under the License is distributed on an "AS IS" BASIS,
REM  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
REM  See the License for the specific language governing permissions and
REM  limitations under the License.

if "%HOME%"=="" goto homeDrivePathPre
if exist "%HOME%\antrc_pre.bat" call "%HOME%\antrc_pre.bat"

:homeDrivePathPre
if "%HOMEDRIVE%%HOMEPATH%"=="" goto userProfilePre
if "%HOMEDRIVE%%HOMEPATH%"=="%HOME%" goto userProfilePre
if exist "%HOMEDRIVE%%HOMEPATH%\antrc_pre.bat" call "%HOMEDRIVE%%HOMEPATH%\antrc_pre.bat"

:userProfilePre
if "%USERPROFILE%"=="" goto alpha
if "%USERPROFILE%"=="%HOME%" goto alpha
if "%USERPROFILE%"=="%HOMEDRIVE%%HOMEPATH%" goto alpha
if exist "%USERPROFILE%\antrc_pre.bat" call "%USERPROFILE%\antrc_pre.bat"

:alpha

if "%OS%"=="Windows_NT" @setlocal
if "%OS%"=="WINNT" @setlocal

if "%DITA_HOME%"=="" goto setDefaultAntHome

:stripAntHome
if not _%DITA_HOME:~-1%==_\ goto checkClasspath
set DITA_HOME=%DITA_HOME:~0,-1%
goto stripAntHome

:setDefaultAntHome
rem %~dp0 is expanded pathname of the current script under NT
set DITA_HOME=%~dp0..

:checkClasspath
set _USE_CLASSPATH=yes
rem CLASSPATH must not be used if it is equal to ""
if "%CLASSPATH%"=="""" set _USE_CLASSPATH=no
if "%CLASSPATH%"=="" set _USE_CLASSPATH=no

rem Slurp the command line arguments. This loop allows for an unlimited number
rem of arguments (up to the command line limit, anyway).
set DITA_CMD_LINE_ARGS=
:setupArgs
if ""%1""=="""" goto doneStart
if ""%1""==""-noclasspath"" goto clearclasspath
set DITA_CMD_LINE_ARGS=%DITA_CMD_LINE_ARGS% %1
shift
goto setupArgs

rem here is there is a -noclasspath in the options
:clearclasspath
set _USE_CLASSPATH=no
shift
goto setupArgs

rem This label provides a place for the argument list loop to break out
rem and for NT handling to skip to.

:doneStart

if "%_USE_CLASSPATH%"=="no" goto findDitaHome

:stripClasspath
if not _%CLASSPATH:~-1%==_\ goto findDitaHome
set CLASSPATH=%CLASSPATH:~0,-1%
goto stripClasspath

:findDitaHome
rem find DITA_HOME if it does not exist due to either an invalid value passed
rem by the user or the %0 problem on Windows 9x
if exist "%DITA_HOME%\lib\ant.jar" goto checkJava

rem check for ant in Program Files
if not exist "%ProgramFiles%\ant" goto checkSystemDrive
set DITA_HOME=%ProgramFiles%\ant
goto checkJava

:checkSystemDrive
rem check for ant in root directory of system drive
if not exist %SystemDrive%\ant\lib\ant.jar goto checkCDrive
set DITA_HOME=%SystemDrive%\ant
goto checkJava

:checkCDrive
rem check for ant in C:\ant for Win9X users
if not exist C:\ant\lib\ant.jar goto noAntHome
set DITA_HOME=C:\ant
goto checkJava

:noAntHome
echo DITA_HOME is set incorrectly or ant could not be located. Please set DITA_HOME.
goto fend

:checkJava
rem Set environment variables
call "%DITA_HOME%\resources\env.bat"

set _JAVACMD=%JAVACMD%

if "%JAVA_HOME%" == "" goto noJavaHome
if not exist "%JAVA_HOME%\bin\java.exe" goto noJavaHome
if "%_JAVACMD%" == "" set _JAVACMD=%JAVA_HOME%\bin\java.exe

:noJavaHome
if "%_JAVACMD%" == "" set _JAVACMD=java.exe

:runAnt
if "%_USE_CLASSPATH%"=="no" goto runAntNoClasspath
:runAntWithClasspath
"%_JAVACMD%" %ANT_OPTS% -classpath "%DITA_HOME%\lib\ant-launcher.jar" "-Dant.home=%DITA_HOME%" org.apache.tools.ant.launch.Launcher %ANT_ARGS% -cp "%CLASSPATH%" %DITA_CMD_LINE_ARGS% -buildfile "%DITA_HOME%\build.xml" -main "org.dita.dost.invoker.Main"
rem Check the error code of the Ant build
if not "%OS%"=="Windows_NT" goto onError
set ANT_ERROR=%ERRORLEVEL%
goto end

:runAntNoClasspath
"%_JAVACMD%" %ANT_OPTS% -classpath "%DITA_HOME%\lib\ant-launcher.jar" "-Dant.home=%DITA_HOME%" org.apache.tools.ant.launch.Launcher %ANT_ARGS% %DITA_CMD_LINE_ARGS% -buildfile "%DITA_HOME%\build.xml" -main "org.dita.dost.invoker.Main"
rem Check the error code of the Ant build
if not "%OS%"=="Windows_NT" goto onError
set ANT_ERROR=%ERRORLEVEL%
goto end

:onError
rem Windows 9x way of checking the error code.  It matches via brute force.
for %%i in (1 10 100) do set err%%i=
for %%i in (0 1 2) do if errorlevel %%i00 set err100=%%i
if %err100%==2 goto onError200
if %err100%==0 set err100=
for %%i in (0 1 2 3 4 5 6 7 8 9) do if errorlevel %err100%%%i0 set err10=%%i
if "%err100%"=="" if %err10%==0 set err10=
:onError1
for %%i in (0 1 2 3 4 5 6 7 8 9) do if errorlevel %err100%%err10%%%i set err1=%%i
goto onErrorEnd
:onError200
for %%i in (0 1 2 3 4 5) do if errorlevel 2%%i0 set err10=%%i
if err10==5 for %%i in (0 1 2 3 4 5) do if errorlevel 25%%i set err1=%%i
if not err10==5 goto onError1
:onErrorEnd
set ANT_ERROR=%err100%%err10%%err1%
for %%i in (1 10 100) do set err%%i=

:end
rem bug ID 32069: resetting an undefined env variable changes the errorlevel.
if not "%_JAVACMD%"=="" set _JAVACMD=
if not "%_DITA_CMD_LINE_ARGS%"=="" set DITA_CMD_LINE_ARGS=

if "%ANT_ERROR%"=="0" goto mainEnd

goto omega

:mainEnd

rem If there were no errors, we run the post script.
if "%OS%"=="Windows_NT" @endlocal
if "%OS%"=="WINNT" @endlocal

if "%HOME%"=="" goto homeDrivePathPost
if exist "%HOME%\antrc_post.bat" call "%HOME%\antrc_post.bat"

:homeDrivePathPost
if "%HOMEDRIVE%%HOMEPATH%"=="" goto userProfilePost
if "%HOMEDRIVE%%HOMEPATH%"=="%HOME%" goto userProfilePost
if exist "%HOMEDRIVE%%HOMEPATH%\antrc_post.bat" call "%HOMEDRIVE%%HOMEPATH%\antrc_post.bat"

:userProfilePost
if "%USERPROFILE%"=="" goto omega
if "%USERPROFILE%"=="%HOME%" goto omega
if "%USERPROFILE%"=="%HOMEDRIVE%%HOMEPATH%" goto omega
if exist "%USERPROFILE%\antrc_post.bat" call "%USERPROFILE%\antrc_post.bat"

:omega

exit /b %ANT_ERROR%

Use correct environment file in batch CLI


@ECHO OFF

if "%NUGET_API_KEY%" == "" goto NO_KEY
if "%1" == "" goto MISSING_INPUT_FOLDER

REM dotnet nuget push %1\*.nupkg --api-key %NUGET_API_KEY%

for %%f in (%1\*.nupkg) do dotnet nuget push %%f --api-key %NUGET_API_KEY% --source https://nuget.org/

GOTO END

:NO_KEY
ECHO Couldn't find 'NUGET_API_KEY' environment variable.
EXIT /B 1

:MISSING_INPUT_FOLDER

ECHO You must supply the folder in which the nuget packages live.
EXIT /B 2

:END

Remove echo so the API key doesn't appear on screen.


rem ------------------
rem AUTOCLEAN-PREP.BAT
rem ------------------

rem crappy to do list follows...
rem add test for techtemp
rem add test for null entries
rem add test for
rem add test for if Tron updated and copy back to BEAST overwriting old Tron
rem add test for network connectivity (eth & BEAST access)
rem ESC chars and color codes do not work in Win7 prompt

@echo off
:: BatchGotAdmin
:-------------------------------------
REM  --> Check for permissions
>nul 2>&1 "%SYSTEMROOT%\system32\cacls.exe" "%SYSTEMROOT%\system32\config\system"

REM --> If error flag set, we do not have admin.
if '%errorlevel%' NEQ '0' (
    echo Requesting administrative privileges...
    goto UACPrompt
) else ( goto gotAdmin )

:UACPrompt
    echo Set UAC = CreateObject^("Shell.Application"^) > "%temp%\getadmin.vbs"
    echo UAC.ShellExecute "%~s0", "", "", "runas", 1 >> "%temp%\getadmin.vbs"

    "%temp%\getadmin.vbs"
    exit /B

:gotAdmin
    if exist "%temp%\getadmin.vbs" ( del "%temp%\getadmin.vbs" )
    pushd "%CD%"
    CD /D "%~dp0"
:--------------------------------------
    color 1f
    mode 90,35
	title TechTutor's Clean Up Script - Prep Stage

    SETLOCAL EnableDelayedExpansion

	cls

	set horiz_line=-
	set dash=-

	for /L %%i in (0,1,88) do (
		set horiz_line=-!horiz_line!
	)

	echo %horiz_line%
	echo TechTutor's Clean Up Script - Prep Stage
	echo %horiz_line%
	echo,

	set workingdir=c:%HOMEPATH%\Desktop\techtemp
	echo cd %workingdir%
	cd %workingdir%

	echo copy /y NUL autoclean-prep >NUL
	echo,

	copy /y NUL autoclean-prep >NUL
	pause

	:drivelettertest
	for %%d in (a b c d e f g h i j k l m n o p q r s t u v) do (if not exist %%d: echo Beast documents folder will be mapped to: %%d: & set "netletter=%%d:" & goto :netletter)

	:netletter
    for /f "skip=1 tokens=1-6 delims= " %%a in ('wmic path Win32_LocalTime Get Day^,Hour^,Minute^,Month^,Second^,Year /Format:table') do (
        IF NOT "%%~f"=="" (
            set /a FormattedDate=10000 * %%f + 100 * %%d + %%a
            set FormattedDate=!FormattedDate:~-0,4!-!FormattedDate:~-4,2!-!FormattedDate:~-2,2!
        )
    )

	echo mkdir %HOMEPATH%\Desktop\techtemp
	mkdir %HOMEPATH%\Desktop\techtemp
	rem echo cd %HOMEPATH%\Desktop\techtemp
	rem cd %HOMEPATH%\Desktop\techtemp

	:clientname
	echo,
	set input=
	set /p firstname="Client's first name: "
	set /p lastname="Client's Last name: "
	echo,
	:clientnameconfirm
	set /p input=You entered: %firstname% %lastname%. Is this correct? (y/n) %=%
	if /i %input%==y goto :clientnamegood
	if /i %input%==n goto :clientname
	echo Incorrect input. & goto :clientnameconfirm

	:clientnamegood

	:avira
	echo,
	set av=
	set /p av="Does the client need Avira installed? (y/n): "

	:aviraconfirm
	if /i %av%==y goto :aviraneeded
	if /i %av%==n goto :noavira
	echo Incorrect input. & goto :avira

	:aviraneeded
	set ninite=Ninite Avira Chrome Teamviewer 12 Installer.exe
	goto :netmap

	:noavira
	set ninite=Ninite Chrome Teamviewer 12 Installer.exe

	:netmap
	echo Mapping Beast Documents folder to drive letter %netletter%
	echo,

    echo net use %netletter% \\BEAST\Documents /user:techtutors *
	net use %netletter% \\BEAST\Documents /user:techtutors *
	echo Network drive mapped to %netletter%
	echo Creating clean up subdirectories for %firstname% %lastname% on the BEAST...
	echo,

	echo mkdir "%netletter%\Clean Up Logs\%lastname%-%firstname%-%FormattedDate%"
	mkdir "%netletter%\Clean Up Logs\%lastname%-%firstname%-%FormattedDate%"
	echo ...Done.
	echo,

	echo Dumping preclean system info...
	echo msinfo32 /nfo "%netletter%\Sysinfo Dumps\%lastname%-%firstname%-preclean-%FormattedDate%.nfo"
	msinfo32 /nfo "%netletter%\Sysinfo Dumps\%lastname%-%firstname%-preclean-%FormattedDate%.nfo"
	echo ...Done.
	echo,

	echo Copying automation files to %workingdir%
	echo ...Done.
	echo,
	robocopy /s "%netletter%\Automation\Clean Up" %workingdir% /MIR

	echo Importing perfmon xml...
	echo logman import -n TT-CleanUp -xml CleanUp-Test.xml
	echo,
	logman import -n TT-CleanUp -xml CleanUp-Test.xml

    echo Starting Performance Monitor. Please wait...
	echo,

	echo logman start TT-CleanUp
	logman start TT-CleanUp

	echo Waiting for perfmon to finish...
    echo timeout 120
	timeout 120
	echo ...Done!
	echo,

	echo Launching PC Decrapifier
	echo START "" /WAIT "%workingdir%\The PC Decrapifier.exe"
	START "" /WAIT "%workingdir%\The PC Decrapifier.exe"
	echo,

	echo Launching ADWCLeaner
	echo START "" /WAIT "%workingdir%\Tron\stage_9_manual_tools\adwcleaner.exe"
	START "" /WAIT "%workingdir%\Tron\stage_9_manual_tools\adwcleaner.exe"
	echo,

	if /i %av%==y echo Installing/updating Avira, Chrome, Teamviewer 12 else echo Installing/updating Chrome & Teamviewer 12
	echo START "" /WAIT "%workingdir%\%ninite%"
	START "" /WAIT "%workingdir%\%ninite%"
	echo,

	echo Adding next stage to Startup
	echo %workingdir%\autoclean-startclean.bat %lastname% %firstname% %FormattedDate%>"C:%HOMEPATH%\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup\autoclean-startcleantemp.bat
	rem echo Adding startclean batch file to RunOnce registry key
	rem echo REG ADD "HKCU\Software\Microsoft\Windows\CurrentVersion\RunOnce" /v AutoClean-StartClean /t REG_EXPAND_SZ /d "%workingdir%\autoclean-startclean.bat %lastname% %firstname% %FormattedDate%"
	rem REG ADD "HKCU\Software\Microsoft\Windows\CurrentVersion\RunOnce" /v AutoClean-StartClean /t REG_EXPAND_SZ /d "%workingdir%\autoclean-startclean.bat %lastname% %firstname% %FormattedDate%"

	echo Starting BootTimer. Prepare for reboot...
	%workingdir%/boottimer.exe

	rem Removing autoclean-start flag file
	echo del autoclean-prep
	echo,
	del autoclean-prep
	rem NOTE: Need to check how to automatically log the number that gets presented in the BootTimer dialogue. (Does it output to STDERR?)

 	rem -I don't think this code is necessary as Windows will just release upon reboot anyway - echo net use %netletter% /delete
	rem net use %netletter% /delete
	pause

rem ------------------
rem AUTOCLEAN-PREP.BAT
rem ------------------

rem crappy to do list follows...
rem add test for techtemp
rem add test for null entries
rem add test for
rem add test for if Tron updated and copy back to BEAST overwriting old Tron
rem add test for network connectivity (eth & BEAST access)
rem ESC chars and color codes do not work in Win7 prompt

@echo off
:: BatchGotAdmin
:-------------------------------------
REM  --> Check for permissions
>nul 2>&1 "%SYSTEMROOT%\system32\cacls.exe" "%SYSTEMROOT%\system32\config\system"

REM --> If error flag set, we do not have admin.
if '%errorlevel%' NEQ '0' (
    echo Requesting administrative privileges...
    goto UACPrompt
) else ( goto gotAdmin )

:UACPrompt
    echo Set UAC = CreateObject^("Shell.Application"^) > "%temp%\getadmin.vbs"
    echo UAC.ShellExecute "%~s0", "", "", "runas", 1 >> "%temp%\getadmin.vbs"

    "%temp%\getadmin.vbs"
    exit /B

:gotAdmin
    if exist "%temp%\getadmin.vbs" ( del "%temp%\getadmin.vbs" )
    pushd "%CD%"
    CD /D "%~dp0"
:--------------------------------------
    color 1f
    mode 90,35
	title TechTutor's Clean Up Script - Prep Stage

    SETLOCAL EnableDelayedExpansion

	cls

	set horiz_line=-
	set dash=-

	for /L %%i in (0,1,88) do (
		set horiz_line=-!horiz_line!
	)

	echo %horiz_line%
	echo TechTutor's Clean Up Script - Prep Stage
	echo %horiz_line%
	echo,

	set workingdir=c:%HOMEPATH%\Desktop\techtemp
	mkdir %workingdir%
	echo cd %workingdir%
	cd %workingdir%

	echo copy /y NUL autoclean-prep >NUL
	echo,

	copy /y NUL autoclean-prep >NUL
	pause

	:drivelettertest
	for %%d in (a b c d e f g h i j k l m n o p q r s t u v) do (if not exist %%d: echo Beast documents folder will be mapped to: %%d: & set "netletter=%%d:" & goto :netletter)

	:netletter
    for /f "skip=1 tokens=1-6 delims= " %%a in ('wmic path Win32_LocalTime Get Day^,Hour^,Minute^,Month^,Second^,Year /Format:table') do (
        IF NOT "%%~f"=="" (
            set /a FormattedDate=10000 * %%f + 100 * %%d + %%a
            set FormattedDate=!FormattedDate:~-0,4!-!FormattedDate:~-4,2!-!FormattedDate:~-2,2!
        )
    )

	:clientname
	echo,
	set input=
	set /p firstname="Client's first name: "
	set /p lastname="Client's Last name: "
	echo,
	:clientnameconfirm
	set /p input=You entered: %firstname% %lastname%. Is this correct? (y/n) %=%
	if /i %input%==y goto :clientnamegood
	if /i %input%==n goto :clientname
	echo Incorrect input. & goto :clientnameconfirm

	:clientnamegood

	:avira
	echo,
	set av=
	set /p av="Does the client need Avira installed? (y/n): "

	:aviraconfirm
	if /i %av%==y goto :aviraneeded
	if /i %av%==n goto :noavira
	echo Incorrect input. & goto :avira

	:aviraneeded
	set ninite=Ninite Avira Chrome Teamviewer 12 Installer.exe
	goto :netmap

	:noavira
	set ninite=Ninite Chrome Teamviewer 12 Installer.exe

	:netmap
	echo Mapping Beast Documents folder to drive letter %netletter%
	echo,

    echo net use %netletter% \\BEAST\Documents /user:techtutors *
	net use %netletter% \\BEAST\Documents /user:techtutors *
	echo Network drive mapped to %netletter%
	echo Creating clean up subdirectories for %firstname% %lastname% on the BEAST...
	echo,

	echo mkdir "%netletter%\Clean Up Logs\%lastname%-%firstname%-%FormattedDate%"
	mkdir "%netletter%\Clean Up Logs\%lastname%-%firstname%-%FormattedDate%"
	echo ...Done.
	echo,

	echo Dumping preclean system info...
	echo msinfo32 /nfo "%netletter%\Sysinfo Dumps\%lastname%-%firstname%-preclean-%FormattedDate%.nfo"
	msinfo32 /nfo "%netletter%\Sysinfo Dumps\%lastname%-%firstname%-preclean-%FormattedDate%.nfo"
	echo ...Done.
	echo,

	echo Copying automation files to %workingdir%
	echo ...Done.
	echo,
	robocopy /s "%netletter%\Automation\Clean Up" %workingdir% /MIR

	echo Importing perfmon xml...
	echo logman import -n TT-CleanUp -xml CleanUp-Test.xml
	echo,
	logman import -n TT-CleanUp -xml CleanUp-Test.xml

    echo Starting Performance Monitor. Please wait...
	echo,

	echo logman start TT-CleanUp
	logman start TT-CleanUp

	echo Waiting for perfmon to finish...
    echo timeout 120
	timeout 120
	echo ...Done!
	echo,

	echo Launching PC Decrapifier
	echo START "" /WAIT "%workingdir%\The PC Decrapifier.exe"
	START "" /WAIT "%workingdir%\The PC Decrapifier.exe"
	echo,

	echo Launching ADWCLeaner
	echo START "" /WAIT "%workingdir%\Tron\stage_9_manual_tools\adwcleaner.exe"
	START "" /WAIT "%workingdir%\Tron\stage_9_manual_tools\adwcleaner.exe"
	echo,

	if /i %av%==y echo Installing/updating Avira, Chrome, Teamviewer 12 else echo Installing/updating Chrome & Teamviewer 12
	echo START "" /WAIT "%workingdir%\%ninite%"
	START "" /WAIT "%workingdir%\%ninite%"
	echo,

	echo Adding next stage to Startup
	echo %workingdir%\autoclean-startclean.bat %lastname% %firstname% %FormattedDate%>"C:%HOMEPATH%\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup\autoclean-startcleantemp.bat
	rem echo Adding startclean batch file to RunOnce registry key
	rem echo REG ADD "HKCU\Software\Microsoft\Windows\CurrentVersion\RunOnce" /v AutoClean-StartClean /t REG_EXPAND_SZ /d "%workingdir%\autoclean-startclean.bat %lastname% %firstname% %FormattedDate%"
	rem REG ADD "HKCU\Software\Microsoft\Windows\CurrentVersion\RunOnce" /v AutoClean-StartClean /t REG_EXPAND_SZ /d "%workingdir%\autoclean-startclean.bat %lastname% %firstname% %FormattedDate%"

	echo Starting BootTimer. Prepare for reboot...
	%workingdir%/boottimer.exe

	rem Removing autoclean-start flag file
	echo del autoclean-prep
	echo,
	del autoclean-prep
	rem NOTE: Need to check how to automatically log the number that gets presented in the BootTimer dialogue. (Does it output to STDERR?)

 	rem -I don't think this code is necessary as Windows will just release upon reboot anyway - echo net use %netletter% /delete
	rem net use %netletter% /delete
	pause

Move mkdir up sequence

Move mkdir up sequence


cd test
mkdir build
cd build
cmake .. -GNinja -DCMAKE_PREFIX_PATH=%LIBRARY_PREFIX% -DCMAKE_BUILD_TYPE=Release
ninja
test.exe

echo on

cd test
mkdir build
cd build

cmake .. ^
    -GNinja ^
    -DCMAKE_PREFIX_PATH=%LIBRARY_PREFIX% ^
    -DCMAKE_BUILD_TYPE=Release ^
    -DCMAKE_VERBOSE_MAKEFILE=ON || goto :error

ninja || goto :error

test.exe || goto :error

exit /B 0

:error
echo ERROR!
echo Command exit status: %ERRORLEVEL%

Improve run_test for Windows

Improve run_test for Windows


:: Edit the list of directories below!

cd %~dp0
java -jar FolderWatcher.jar "C:\Users\Joe\Desktop" "C:\Users\Joe"

Add example launch script for Windows

Add example launch script for Windows


add cp command

add cp command


@if "%DEBUG%" == "" @echo off
@rem ##########################################################################
@rem                                                                         ##
@rem  Groovy JVM Bootstrap for Windowz                                       ##
@rem                                                                         ##
@rem ##########################################################################

@rem
@rem $Revision: 4170 $ $Date: 2006-10-26 12:11:12 +0000 (Thu, 26 Oct 2006) $
@rem

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

set DIRNAME=%~1
shift

set CLASS=%~1
shift

if exist "%USERPROFILE%/.groovy/preinit.bat" call "%USERPROFILE%/.groovy/preinit.bat"

@rem Determine the command interpreter to execute the "CD" later
set COMMAND_COM="cmd.exe"
if exist "%SystemRoot%\system32\cmd.exe" set COMMAND_COM="%SystemRoot%\system32\cmd.exe"
if exist "%SystemRoot%\command.com" set COMMAND_COM="%SystemRoot%\command.com"

@rem Use explicit find.exe to prevent cygwin and others find.exe from being used
set FIND_EXE="find.exe"
if exist "%SystemRoot%\system32\find.exe" set FIND_EXE="%SystemRoot%\system32\find.exe"
if exist "%SystemRoot%\command\find.exe" set FIND_EXE="%SystemRoot%\command\find.exe"

:check_JAVA_HOME
@rem Make sure we have a valid JAVA_HOME
if not "%JAVA_HOME%" == "" goto have_JAVA_HOME

echo.
echo ERROR: Environment variable JAVA_HOME has not been set.
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
echo.
goto end

:have_JAVA_HOME
@rem Validate JAVA_HOME
%COMMAND_COM% /C DIR "%JAVA_HOME%" 2>&1 | %FIND_EXE% /I /C "%JAVA_HOME%" >nul
if not errorlevel 1 goto check_GROOVY_HOME

echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
echo.
goto end

:check_GROOVY_HOME
@rem Define GROOVY_HOME if not set
if "%GROOVY_HOME%" == "" set GROOVY_HOME=%DIRNAME%..

:init
@rem Get command-line arguments, handling Windowz variants
if "%@eval[2+2]" == "4" goto 4NT_args

:win9xME_args
@rem remove trailing slash from GRAILS_HOME
if "%GRAILS_HOME:~-1%"=="\" SET GRAILS_HOME=%GRAILS_HOME:~0,-1%

@rem Slurp the command line arguments.
set CMD_LINE_ARGS=
set CP=
set GRAILS_OPTIONS=

:win9xME_args_slurp
if "x%~1" == "x" goto execute
set CURR_ARG=%~1
if "%CURR_ARG:~0,2%" == "-D" (
	set GRAILS_OPTIONS=%GRAILS_OPTIONS% %~1=%~2
	shift
	shift
	goto win9xME_args_slurp
) else (
	if "x%~1" == "x-cp" (
		set CP=%~2
		shift
		shift
		goto win9xME_args_slurp
	) else (
		if "x%~1" == "x-classpath" (
			set CP=%~2
			shift
			shift
			goto win9xME_args_slurp
		) else (
			set CMD_LINE_ARGS=%CMD_LINE_ARGS% %1
			shift
			goto win9xME_args_slurp
		)
	)
)

:4NT_args
@rem Get arguments from the 4NT Shell from JP Software
set CMD_LINE_ARGS=%$

:execute
@rem Setup the command line
set STARTER_CLASSPATH=%GRAILS_HOME%\lib\groovy-all-1.5.4.jar;%GRAILS_HOME%\dist\grails-cli-1.0.3-SNAPSHOT.jar

if exist "%USERPROFILE%/.groovy/init.bat" call "%USERPROFILE%/.groovy/init.bat"

@rem Setting a classpath using the -cp or -classpath option means not to use
@rem the global classpath. Groovy behaves then the same as the java
@rem interpreter
if "x" == "x%CP%" goto empty_cp
:non_empty_cp
set CP=%CP%;.
goto after_cp
:empty_cp
set CP=.
:after_cp

if "x" == "x%CLASSPATH%" goto after_classpath
set CP=%CP%;%CLASSPATH%
:after_classpath

set STARTER_MAIN_CLASS=org.codehaus.groovy.grails.cli.support.GrailsStarter
set STARTER_CONF=%GRAILS_HOME%\conf\groovy-starter.conf

set JAVA_EXE=%JAVA_HOME%\bin\java.exe
set TOOLS_JAR=%JAVA_HOME%\lib\tools.jar

if "%JAVA_OPTS%" == "" set JAVA_OPTS="-Xmx128m"
set JAVA_OPTS=%JAVA_OPTS% -Dprogram.name="%PROGNAME%"
set JAVA_OPTS=%JAVA_OPTS% -Dgrails.home="%GRAILS_HOME%"
set JAVA_OPTS=%JAVA_OPTS% -Dbase.dir="."
set JAVA_OPTS=%JAVA_OPTS% -Dtools.jar="%TOOLS_JAR%"
set JAVA_OPTS=%JAVA_OPTS% -Dgroovy.starter.conf="%STARTER_CONF%"

if exist "%USERPROFILE%/.groovy/postinit.bat" call "%USERPROFILE%/.groovy/postinit.bat"

@rem Execute Groovy
CALL "%JAVA_EXE%" %JAVA_OPTS% %GRAILS_OPTIONS% -classpath "%STARTER_CLASSPATH%" %STARTER_MAIN_CLASS% --main %CLASS% --conf "%STARTER_CONF%" --classpath "%CP%" "%CMD_LINE_ARGS%"
:end
@rem End local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" endlocal

@rem Optional pause the batch file
if "%GROOVY_BATCH_PAUSE%" == "on" pause

@if "%DEBUG%" == "" @echo off
@rem ##########################################################################
@rem                                                                         ##
@rem  Groovy JVM Bootstrap for Windowz                                       ##
@rem                                                                         ##
@rem ##########################################################################

@rem
@rem $Revision: 4170 $ $Date: 2006-10-26 12:11:12 +0000 (Thu, 26 Oct 2006) $
@rem

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

set DIRNAME=%~1
shift

set CLASS=%~1
shift

if exist "%USERPROFILE%/.groovy/preinit.bat" call "%USERPROFILE%/.groovy/preinit.bat"

@rem Determine the command interpreter to execute the "CD" later
set COMMAND_COM="cmd.exe"
if exist "%SystemRoot%\system32\cmd.exe" set COMMAND_COM="%SystemRoot%\system32\cmd.exe"
if exist "%SystemRoot%\command.com" set COMMAND_COM="%SystemRoot%\command.com"

@rem Use explicit find.exe to prevent cygwin and others find.exe from being used
set FIND_EXE="find.exe"
if exist "%SystemRoot%\system32\find.exe" set FIND_EXE="%SystemRoot%\system32\find.exe"
if exist "%SystemRoot%\command\find.exe" set FIND_EXE="%SystemRoot%\command\find.exe"

:check_JAVA_HOME
@rem Make sure we have a valid JAVA_HOME
if not "%JAVA_HOME%" == "" goto have_JAVA_HOME

echo.
echo ERROR: Environment variable JAVA_HOME has not been set.
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
echo.
goto end

:have_JAVA_HOME
@rem Validate JAVA_HOME
%COMMAND_COM% /C DIR "%JAVA_HOME%" 2>&1 | %FIND_EXE% /I /C "%JAVA_HOME%" >nul
if not errorlevel 1 goto check_GROOVY_HOME

echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
echo.
goto end

:check_GROOVY_HOME
@rem Define GROOVY_HOME if not set
if "%GROOVY_HOME%" == "" set GROOVY_HOME=%DIRNAME%..

:init
@rem Get command-line arguments, handling Windowz variants
if "%@eval[2+2]" == "4" goto 4NT_args

:win9xME_args
@rem remove trailing slash from GRAILS_HOME
if "%GRAILS_HOME:~-1%"=="\" SET GRAILS_HOME=%GRAILS_HOME:~0,-1%

@rem Slurp the command line arguments.
set CMD_LINE_ARGS=
set CP=
set GRAILS_OPTIONS=

:win9xME_args_slurp
if "x%~1" == "x" goto execute
set CURR_ARG=%~1
if "%CURR_ARG:~0,2%" == "-D" (
	set GRAILS_OPTIONS=%GRAILS_OPTIONS% %~1=%~2
	shift
	shift
	goto win9xME_args_slurp
) else (
	if "x%~1" == "x-cp" (
		set CP=%~2
		shift
		shift
		goto win9xME_args_slurp
	) else (
		if "x%~1" == "x-classpath" (
			set CP=%~2
			shift
			shift
			goto win9xME_args_slurp
		) else (
			set CMD_LINE_ARGS=%CMD_LINE_ARGS% %1
			shift
			goto win9xME_args_slurp
		)
	)
)

:4NT_args
@rem Get arguments from the 4NT Shell from JP Software
set CMD_LINE_ARGS=%$

:execute
@rem Setup the command line
set STARTER_CLASSPATH=%GRAILS_HOME%\lib\groovy-all-1.5.4.jar;%GRAILS_HOME%\dist\grails-cli-1.0.3-SNAPSHOT.jar

if exist "%USERPROFILE%/.groovy/init.bat" call "%USERPROFILE%/.groovy/init.bat"

@rem Setting a classpath using the -cp or -classpath option means not to use
@rem the global classpath. Groovy behaves then the same as the java
@rem interpreter
if "x" == "x%CP%" goto empty_cp
:non_empty_cp
set CP=%CP%;.
goto after_cp
:empty_cp
set CP=.
:after_cp

if "x" == "x%CLASSPATH%" goto after_classpath
set CP=%CP%;%CLASSPATH%
:after_classpath

set STARTER_MAIN_CLASS=org.codehaus.groovy.grails.cli.support.GrailsStarter
set STARTER_CONF=%GRAILS_HOME%\conf\groovy-starter.conf

set JAVA_EXE=%JAVA_HOME%\bin\java.exe
set TOOLS_JAR=%JAVA_HOME%\lib\tools.jar

if "%JAVA_OPTS%" == "" set JAVA_OPTS="-Xmx512m"
set JAVA_OPTS=%JAVA_OPTS% -Dprogram.name="%PROGNAME%"
set JAVA_OPTS=%JAVA_OPTS% -Dgrails.home="%GRAILS_HOME%"
set JAVA_OPTS=%JAVA_OPTS% -Dbase.dir="."
set JAVA_OPTS=%JAVA_OPTS% -Dtools.jar="%TOOLS_JAR%"
set JAVA_OPTS=%JAVA_OPTS% -Dgroovy.starter.conf="%STARTER_CONF%"

if exist "%USERPROFILE%/.groovy/postinit.bat" call "%USERPROFILE%/.groovy/postinit.bat"

@rem Execute Groovy
CALL "%JAVA_EXE%" %JAVA_OPTS% %GRAILS_OPTIONS% -classpath "%STARTER_CLASSPATH%" %STARTER_MAIN_CLASS% --main %CLASS% --conf "%STARTER_CONF%" --classpath "%CP%" "%CMD_LINE_ARGS%"
:end
@rem End local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" endlocal

@rem Optional pause the batch file
if "%GROOVY_BATCH_PAUSE%" == "on" pause

Fix for GRAILS-2719: increased default max heap size for Grails to 512Mb on Windows, which brings it into line with the *nix version.

git-svn-id: 29aad96320b2a07b98332cd568fc1316025c072f@6850 1cfb16fd-6d17-0410-8ff1-b7e8e1e2867d


:: Start with bootstrap
:: cd .\tools\build
ECHO .\bootstrap.bat
CALL .\bootstrap.bat
IF errorlevel 1 exit 1
ECHO .\bootstrap.bat mingw
CALL .\bootstrap.bat mingw
ECHO type bootstrap.log
CALL type bootstrap.log
CALL .\bootstrap.bat mingw
IF errorlevel 1 exit 1
:: ECHO .\b2.exe install toolset=gcc --prefix=%SRC_DIR%\b2_for_mingw
:: CALL .\b2.exe install toolset=gcc --prefix=%SRC_DIR%\b2_for_mingw
:: ECHO cd %SRCDIR%
:: cd %SRCDIR%
:: set PATH=%PATH%;%SRCDIR%\b2_for_mingw\bin
:: ECHO b2 toolset=gcc --build-type=complete stage ^
::      --build-dir=buildboost ^
::      --prefix=%LIBRARY_PREFIX% ^
::      address-model=%ARCH% ^
::      variant=release ^
::      threading=multi ^
::      link=shared ^
::      -j%CPU_COUNT% ^
::      -s ZLIB_INCLUDE="%LIBRARY_INC%" ^
::      -s ZLIB_LIBPATH="%LIBRARY_LIB%" ^
::      --with-python
:: CALL b2 toolset=gcc --build-type=complete stage ^
::      --build-dir=buildboost ^
::      --prefix=%LIBRARY_PREFIX% ^
::      address-model=%ARCH% ^
::      variant=release ^
::      threading=multi ^
::      link=shared ^
::      -j%CPU_COUNT% ^
::      -s ZLIB_INCLUDE="%LIBRARY_INC%" ^
::      -s ZLIB_LIBPATH="%LIBRARY_LIB%" ^
::      --with-python

:: cd ..\..
:: dir .
:: CALL .\tools\build\b2.exe install toolset=gcc --prefix=%LIBRARY_PREFIX%
:: dir .
:: set PATH=%PATH%;%LIBRARY_BIN%
::
:: Build step
:: CALL b2 install ^
::     --build-dir=buildboost ^
::     --prefix=%LIBRARY_PREFIX% ^
::     toolset=gcc ^
::     address-model=%ARCH% ^
::     variant=release ^
::     threading=multi ^
::     link=shared ^
::     -j%CPU_COUNT% ^
::     -s ZLIB_INCLUDE="%LIBRARY_INC%" ^
::     -s ZLIB_LIBPATH="%LIBRARY_LIB%" ^
::     --with-python
:: IF errorlevel 1 exit 1
::
:: :: Install fix-up for a non version-specific boost include
:: move %LIBRARY_INC%\boost-1_61\boost %LIBRARY_INC%
:: IF errorlevel 1 exit 1
::
:: Move dll's to LIBRARY_BIN
:: move %LIBRARY_LIB%\*vc%LIB_VER%-mt-1_61.dll "%LIBRARY_BIN%"
:: IF errorlevel 1 exit 1
:: Status API Training Shop Blog About

:: Start with bootstrap
:: cd .\tools\build
ECHO .\bootstrap.bat
CALL .\bootstrap.bat
IF errorlevel 1 exit 1
ECHO .\bootstrap.bat gcc
CALL .\bootstrap.bat gcc
ECHO type bootstrap.log
CALL type bootstrap.log
CALL .\bootstrap.bat gcc
IF errorlevel 1 exit 1
:: ECHO .\b2.exe install toolset=gcc --prefix=%SRC_DIR%\b2_for_mingw
:: CALL .\b2.exe install toolset=gcc --prefix=%SRC_DIR%\b2_for_mingw
:: ECHO cd %SRCDIR%
:: cd %SRCDIR%
:: set PATH=%PATH%;%SRCDIR%\b2_for_mingw\bin
:: ECHO b2 toolset=gcc --build-type=complete stage ^
::      --build-dir=buildboost ^
::      --prefix=%LIBRARY_PREFIX% ^
::      address-model=%ARCH% ^
::      variant=release ^
::      threading=multi ^
::      link=shared ^
::      -j%CPU_COUNT% ^
::      -s ZLIB_INCLUDE="%LIBRARY_INC%" ^
::      -s ZLIB_LIBPATH="%LIBRARY_LIB%" ^
::      --with-python
:: CALL b2 toolset=gcc --build-type=complete stage ^
::      --build-dir=buildboost ^
::      --prefix=%LIBRARY_PREFIX% ^
::      address-model=%ARCH% ^
::      variant=release ^
::      threading=multi ^
::      link=shared ^
::      -j%CPU_COUNT% ^
::      -s ZLIB_INCLUDE="%LIBRARY_INC%" ^
::      -s ZLIB_LIBPATH="%LIBRARY_LIB%" ^
::      --with-python

:: cd ..\..
:: dir .
:: CALL .\tools\build\b2.exe install toolset=gcc --prefix=%LIBRARY_PREFIX%
:: dir .
:: set PATH=%PATH%;%LIBRARY_BIN%
::
:: Build step
:: CALL b2 install ^
::     --build-dir=buildboost ^
::     --prefix=%LIBRARY_PREFIX% ^
::     toolset=gcc ^
::     address-model=%ARCH% ^
::     variant=release ^
::     threading=multi ^
::     link=shared ^
::     -j%CPU_COUNT% ^
::     -s ZLIB_INCLUDE="%LIBRARY_INC%" ^
::     -s ZLIB_LIBPATH="%LIBRARY_LIB%" ^
::     --with-python
:: IF errorlevel 1 exit 1
::
:: :: Install fix-up for a non version-specific boost include
:: move %LIBRARY_INC%\boost-1_61\boost %LIBRARY_INC%
:: IF errorlevel 1 exit 1
::
:: Move dll's to LIBRARY_BIN
:: move %LIBRARY_LIB%\*vc%LIB_VER%-mt-1_61.dll "%LIBRARY_BIN%"
:: IF errorlevel 1 exit 1
:: Status API Training Shop Blog About

Update bld.bat

Update bld.bat


@ECHO OFF

REM ; %PROJECT_NAME% is set by Jenkins, this allows us to use the same script to verify
REM ; Chef and Angry Chef
cd C:\opscode\%PROJECT_NAME%\bin

REM ; We don't want to add the embedded bin dir to the main PATH as this
REM ; could mask issues in our binstub shebangs.
SET EMBEDDED_BIN_DIR=C:\opscode\%PROJECT_NAME%\embedded\bin

ECHO(

FOR %%b IN (
  chef-client
  knife
  chef-solo
  ohai
) DO (

  ECHO Checking for existence of binfile `%%b`...

  IF EXIST %%b (

    ECHO ...FOUND IT!

  ) ELSE (

    GOTO :error

  )
  ECHO(
)

call chef-client --version

REM ; Exercise various packaged tools to validate binstub shebangs
call %EMBEDDED_BIN_DIR%\ruby --version
call %EMBEDDED_BIN_DIR%\gem --version
call %EMBEDDED_BIN_DIR%\bundle --version
call %EMBEDDED_BIN_DIR%\rspec --version

SET PATH=C:\opscode\%PROJECT_NAME%\bin;C:\opscode\%PROJECT_NAME%\embedded\bin;%PATH%

REM ; Test against the appbundle'd Chef
cd c:\opscode\%PROJECT_NAME%\embedded\apps\chef
call bundle exec rspec -r rspec_junit_formatter -f RspecJunitFormatter -o %WORKSPACE%\test.xml -f documentation spec/unit

@ECHO OFF

REM ; %PROJECT_NAME% is set by Jenkins, this allows us to use the same script to verify
REM ; Chef and Angry Chef
cd C:\opscode\%PROJECT_NAME%\bin

REM ; We don't want to add the embedded bin dir to the main PATH as this
REM ; could mask issues in our binstub shebangs.
SET EMBEDDED_BIN_DIR=C:\opscode\%PROJECT_NAME%\embedded\bin

ECHO(

FOR %%b IN (
  chef-client
  knife
  chef-solo
  ohai
) DO (

  ECHO Checking for existence of binfile `%%b`...

  IF EXIST %%b (

    ECHO ...FOUND IT!

  ) ELSE (

    GOTO :error

  )
  ECHO(
)

call chef-client --version

REM ; Exercise various packaged tools to validate binstub shebangs
call %EMBEDDED_BIN_DIR%\ruby --version
call %EMBEDDED_BIN_DIR%\gem --version
call %EMBEDDED_BIN_DIR%\bundle --version
call %EMBEDDED_BIN_DIR%\rspec --version

SET PATH=C:\opscode\%PROJECT_NAME%\bin;C:\opscode\%PROJECT_NAME%\embedded\bin;%PATH%

REM ; Test against the appbundle'd Chef
cd c:\opscode\%PROJECT_NAME%\embedded\apps\chef

IF "%PIPELINE_NAME%" == "chef-13" (
REM ; Running unit and functional tests
call bundle exec rspec -r rspec_junit_formatter -f RspecJunitFormatter -o %WORKSPACE%\test.xml -f documentation spec/unit spec/functional
) ELSE (
REM ; Running unit tests
call bundle exec rspec -r rspec_junit_formatter -f RspecJunitFormatter -o %WORKSPACE%\test.xml -f documentation spec/unit
)

Enable functional tests to run for chef client in jenkins for windows