@echo off
cd %~dp0

SETLOCAL
SET CACHED_NUGET=%LocalAppData%\NuGet\NuGet.exe

IF EXIST %CACHED_NUGET% goto copynuget
echo Downloading latest version of NuGet.exe...
IF NOT EXIST %LocalAppData%\NuGet md %LocalAppData%\NuGet
@powershell -NoProfile -ExecutionPolicy unrestricted -Command "$ProgressPreference = 'SilentlyContinue'; Invoke-WebRequest 'https://www.nuget.org/nuget.exe' -OutFile '%CACHED_NUGET%'"

:copynuget
IF EXIST .nuget\nuget.exe goto restore
md .nuget
copy %CACHED_NUGET% .nuget\nuget.exe > nul

:restore
.nuget\NuGet.exe install FSharpSupport -ExcludeVersion -o packages -nocache -pre
.nuget\NuGet.exe install KoreBuild -ExcludeVersion -o packages -nocache -pre
.nuget\NuGet.exe install KoreBuild -ExcludeVersion -o packages -nocache -pre

IF "%SKIP_KRE_INSTALL%"=="1" goto run
CALL packages\KoreBuild\build\kvm upgrade -svr50 -x86
REM CALL packages\KoreBuild\build\kvm install default -svrc50 -x86

:run
REM Get the path of `kpm` and store it as KPM_PATH
for /f "usebackq tokens=*" %%a in (`where kpm`) do set KPM_PATH=%%a
REM Get the dir name of `KPM_PATH`
for %%F in (%KPM_PATH%) do set KPM_DIR=%%~dpF

cd "%~dp0src\FSharpSupport"
call kpm restore

mkdir "%~dp0obj\pass0"
mkdir "%~dp0obj\pass1"
mkdir "%~dp0obj\pass2"
mkdir "%~dp0obj\pass3"

SET BOOTSTRAPPED="0"

:build
SET ERRORLEVEL=
REM First build to make sure source is valid
move "%~dp0\packages\FSharpSupport\lib\net45\FSharpSupport.dll" "%~dp0src\FSharpSupport\obj\pass1\FSharpSupport.dll" > nul
call klr --lib "%KPM_DIR%;%KPM_DIR%\lib\Microsoft.Framework.PackageManager;%~dp0\src\FSharpSupport\obj\pass1" "Microsoft.Framework.PackageManager" build
IF NOT "%ERRORLEVEL%" == "0" goto bootstrap

REM build again to make sure it fills the contracts
move "%~dp0src\FSharpSupport\bin\debug\net45\FSharpSupport.dll" "%~dp0src\FSharpSupport\obj\pass2\FSharpSupport.dll" > nul
move "%~dp0src\FSharpSupport\bin\debug\net45\FSharpSupport.pdb" "%~dp0src\FSharpSupport\obj\pass2\FSharpSupport.pdb" > nul
call klr --lib "%KPM_DIR%;%KPM_DIR%\lib\Microsoft.Framework.PackageManager;%~dp0\src\FSharpSupport\obj\pass2" "Microsoft.Framework.PackageManager" build
IF NOT "%ERRORLEVEL%" == "0" goto end

REM build again to make sure it constructs something that fills the contracts
move "%~dp0src\FSharpSupport\bin\debug\net45\FSharpSupport.dll" "%~dp0src\FSharpSupport\obj\pass3\FSharpSupport.dll" > nul
move "%~dp0src\FSharpSupport\bin\debug\net45\FSharpSupport.pdb" "%~dp0src\FSharpSupport\obj\pass3\FSharpSupport.pdb" > nul
call klr --lib "%KPM_DIR%;%KPM_DIR%\lib\Microsoft.Framework.PackageManager;%~dp0\src\FSharpSupport\obj\pass3" "Microsoft.Framework.PackageManager" build
IF NOT "%ERRORLEVEL%" == "0" goto end

IF "%K_BUILD_VERSION%" == "" goto end
IF NOT "%APPVEYOR_REPO_BRANCH%" == "master" goto wrongbranch
IF NOT "%APPVEYOR_PULL_REQUEST_NUMBER%" == "" goto pullreq
IF "%NUGET_SOURCE%" == "" goto end
echo Publishing "%~dp0src\FSharpSupport\bin\debug\FSharpSupport.0.1-alpha-%K_BUILD_VERSION%.nupkg"
%~dp0.nuget\NuGet.exe push "%~dp0src\FSharpSupport\bin\debug\FSharpSupport.0.1-alpha-%K_BUILD_VERSION%.nupkg" "%NUGET_API_KEY%" -Source "%NUGET_SOURCE%"

IF "%SYMBOL_SOURCE%" == "" goto end
echo Publishing "%~dp0src\FSharpSupport\bin\debug\FSharpSupport.0.1-alpha-%K_BUILD_VERSION%.symbols.nupkg"
%~dp0.nuget\NuGet.exe push "%~dp0src\FSharpSupport\bin\debug\FSharpSupport.0.1-alpha-%K_BUILD_VERSION%.symbols.nupkg" "%SYMBOL_API_KEY%" -Source "%SYMBOL_SOURCE%"
goto end

:wrongbranch
echo Skipping commit since branch = %APPVEYOR_REPO_NAME%
goto end

:pullreq
echo Skipping commit since it's a pull request
goto end

:bootstrap
IF NOT "%BOOTSTRAPPED%" == "0" goto end
set BOOTSTRAPPED="1"
echo Fowler prolly broke my code -.-
echo Bootstrapping
mkdir "%~dp0lib"
git clone https://github.com/davidfowl/vNextLanguageSupport.git "%~dp0lib\Fowler"
cd "%~dp0lib\Fowler\src\FSharpSupport"
call kpm restore

SET ERRORLEVEL=
kpm build
IF NOT "%ERRORLEVEL%" == "0" goto end
move "%~dp0lib\Fowler\src\FSharpSupport\bin\debug\net45\FSharpSupport.dll" "%~dp0src\FSharpSupport\obj\pass0\FSharpSupport.dll" > nul
move "%~dp0lib\Fowler\src\FSharpSupport\bin\debug\net45\FSharpSupport.pdb" "%~dp0src\FSharpSupport\obj\pass0\FSharpSupport.pdb" > nul
cd "%~dp0src\FSharpSupport"
call klr --lib "%KPM_DIR%;%KPM_DIR%\lib\Microsoft.Framework.PackageManager;%~dp0\src\FSharpSupport\obj\pass0" "Microsoft.Framework.PackageManager" build
goto build

:end
exit /b %ERRORLEVEL%

@echo on
cd %~dp0

SETLOCAL
SET CACHED_NUGET=%LocalAppData%\NuGet\NuGet.exe

IF EXIST %CACHED_NUGET% goto copynuget
echo Downloading latest version of NuGet.exe...
IF NOT EXIST %LocalAppData%\NuGet md %LocalAppData%\NuGet
@powershell -NoProfile -ExecutionPolicy unrestricted -Command "$ProgressPreference = 'SilentlyContinue'; Invoke-WebRequest 'https://www.nuget.org/nuget.exe' -OutFile '%CACHED_NUGET%'"

:copynuget
IF EXIST .nuget\nuget.exe goto restore
md .nuget
copy %CACHED_NUGET% .nuget\nuget.exe > nul

:restore
.nuget\NuGet.exe install FSharpSupport -ExcludeVersion -o packages -nocache -pre
.nuget\NuGet.exe install KoreBuild -ExcludeVersion -o packages -nocache -pre
.nuget\NuGet.exe install KoreBuild -ExcludeVersion -o packages -nocache -pre

IF "%SKIP_KRE_INSTALL%"=="1" goto run
CALL packages\KoreBuild\build\kvm upgrade -svr50 -x86
REM CALL packages\KoreBuild\build\kvm install default -svrc50 -x86

:run
REM Get the path of `kpm` and store it as KPM_PATH
for /f "usebackq tokens=*" %%a in (`where kpm`) do set KPM_PATH=%%a
REM Get the dir name of `KPM_PATH`
for %%F in (%KPM_PATH%) do set KPM_DIR=%%~dpF

cd "%~dp0src\FSharpSupport"
call kpm restore

mkdir "%~dp0obj\pass0"
mkdir "%~dp0obj\pass1"
mkdir "%~dp0obj\pass2"
mkdir "%~dp0obj\pass3"

SET BOOTSTRAPPED="0"

:build
SET ERRORLEVEL=
REM First build to make sure source is valid
move "%~dp0\packages\FSharpSupport\lib\net45\FSharpSupport.dll" "%~dp0src\FSharpSupport\obj\pass1\FSharpSupport.dll" > nul
call klr --lib "%KPM_DIR%;%KPM_DIR%\lib\Microsoft.Framework.PackageManager;%~dp0\src\FSharpSupport\obj\pass1" "Microsoft.Framework.PackageManager" build
IF NOT "%ERRORLEVEL%" == "0" goto bootstrap

REM build again to make sure it fills the contracts
move "%~dp0src\FSharpSupport\bin\debug\net45\FSharpSupport.dll" "%~dp0src\FSharpSupport\obj\pass2\FSharpSupport.dll" > nul
move "%~dp0src\FSharpSupport\bin\debug\net45\FSharpSupport.pdb" "%~dp0src\FSharpSupport\obj\pass2\FSharpSupport.pdb" > nul
call klr --lib "%KPM_DIR%;%KPM_DIR%\lib\Microsoft.Framework.PackageManager;%~dp0\src\FSharpSupport\obj\pass2" "Microsoft.Framework.PackageManager" build
IF NOT "%ERRORLEVEL%" == "0" goto end

REM build again to make sure it constructs something that fills the contracts
move "%~dp0src\FSharpSupport\bin\debug\net45\FSharpSupport.dll" "%~dp0src\FSharpSupport\obj\pass3\FSharpSupport.dll" > nul
move "%~dp0src\FSharpSupport\bin\debug\net45\FSharpSupport.pdb" "%~dp0src\FSharpSupport\obj\pass3\FSharpSupport.pdb" > nul
call klr --lib "%KPM_DIR%;%KPM_DIR%\lib\Microsoft.Framework.PackageManager;%~dp0\src\FSharpSupport\obj\pass3" "Microsoft.Framework.PackageManager" build
IF NOT "%ERRORLEVEL%" == "0" goto end

IF "%K_BUILD_VERSION%" == "" goto end
IF NOT "%APPVEYOR_REPO_BRANCH%" == "master" goto wrongbranch
IF NOT "%APPVEYOR_PULL_REQUEST_NUMBER%" == "" goto pullreq
IF "%NUGET_SOURCE%" == "" goto end
echo Publishing "%~dp0src\FSharpSupport\bin\debug\FSharpSupport.0.1-alpha-%K_BUILD_VERSION%.nupkg"
%~dp0.nuget\NuGet.exe push "%~dp0src\FSharpSupport\bin\debug\FSharpSupport.0.1-alpha-%K_BUILD_VERSION%.nupkg" "%NUGET_API_KEY%" -Source "%NUGET_SOURCE%"

IF "%SYMBOL_SOURCE%" == "" goto end
echo Publishing "%~dp0src\FSharpSupport\bin\debug\FSharpSupport.0.1-alpha-%K_BUILD_VERSION%.symbols.nupkg"
%~dp0.nuget\NuGet.exe push "%~dp0src\FSharpSupport\bin\debug\FSharpSupport.0.1-alpha-%K_BUILD_VERSION%.symbols.nupkg" "%SYMBOL_API_KEY%" -Source "%SYMBOL_SOURCE%"
goto end

:wrongbranch
echo Skipping commit since branch = %APPVEYOR_REPO_NAME%
goto end

:pullreq
echo Skipping commit since it's a pull request
goto end

:bootstrap
IF NOT "%BOOTSTRAPPED%" == "0" goto end
set BOOTSTRAPPED="1"
echo Fowler prolly broke my code -.-
echo Bootstrapping
mkdir "%~dp0lib"
git clone https://github.com/davidfowl/vNextLanguageSupport.git "%~dp0lib\Fowler"
cd "%~dp0lib\Fowler\src\FSharpSupport"
call kpm restore

SET ERRORLEVEL=
kpm build
IF NOT "%ERRORLEVEL%" == "0" goto end
move "%~dp0lib\Fowler\src\FSharpSupport\bin\debug\net45\FSharpSupport.dll" "%~dp0src\FSharpSupport\obj\pass0\FSharpSupport.dll" > nul
move "%~dp0lib\Fowler\src\FSharpSupport\bin\debug\net45\FSharpSupport.pdb" "%~dp0src\FSharpSupport\obj\pass0\FSharpSupport.pdb" > nul
cd "%~dp0src\FSharpSupport"
call klr --lib "%KPM_DIR%;%KPM_DIR%\lib\Microsoft.Framework.PackageManager;%~dp0\src\FSharpSupport\obj\pass0" "Microsoft.Framework.PackageManager" build
goto build

:end
exit /b %ERRORLEVEL%

enable echo

enable echo


@ECHO OFF
REM =========================================================================
REM
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.
REM
REM =========================================================================

SET SERVICEMIX_BASE=${servicemix.base}
SETLOCAL
SET SERVICEMIX_HOME=${servicemix.home}

%SERVICEMIX_HOME%\bin\servicemix.bat "$*"

@ECHO OFF
REM =========================================================================
REM
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.
REM
REM =========================================================================

SET SERVICEMIX_BASE=${servicemix.base}
SETLOCAL
SET SERVICEMIX_HOME=${servicemix.home}

%SERVICEMIX_HOME%\bin\servicemix.bat %*

SMX4KNL-87: Fix batch file used when generating new instances

git-svn-id: 60a1e9216d64284e4702c44631e657390eda35c3@698732 13f79535-47bb-0310-9956-ffa450edef68


setlocal
set specFile=%1
set namespace=%2
set autoRestVersion=%3
set generateFolder=%4

set source=-Source https://www.myget.org/F/autorest/api/v2

set repoRoot=%~dp0..
set autoRestExe=%repoRoot%\packages\autorest.%autoRestVersion%\tools\AutoRest.exe
REM set autoRestExe=%repoRoot%\..\autorest\binaries\net45\AutoRest.exe

%repoRoot%\tools\nuget.exe install autorest %source% -Version %autoRestVersion% -o %repoRoot%\packages -verbosity quiet

@echo on
%autoRestExe% -Modeler Swagger -CodeGenerator Azure.CSharp -Namespace %namespace% -Input %specFile% -outputDirectory %generateFolder% -Header MICROSOFT_MIT
@echo off
endlocal

setlocal
set specFile=%1
set namespace=%2
set autoRestVersion=%3
set generateFolder=%4

set source=-Source https://www.myget.org/F/autorest/api/v2

set repoRoot=%~dp0..
set autoRestExe=%repoRoot%\packages\autorest.%autoRestVersion%\tools\AutoRest.exe

%repoRoot%\tools\nuget.exe install autorest %source% -Version %autoRestVersion% -o %repoRoot%\packages -verbosity quiet

@echo on
%autoRestExe% -Modeler Swagger -CodeGenerator Azure.CSharp -Namespace %namespace% -Input %specFile% -outputDirectory %generateFolder% -Header MICROSOFT_MIT
@echo off
endlocal

address CR

address CR


SET SCRIPTPATH=%~dp0
CD /D %~dp0

SET ICU_MAJOR_VER=60
SET ICU_MINOR_VER=2

SET platform=win_32
if defined ProgramFiles(x86) (
	SET platform=win_64
)

if defined TARGET (
	SET platform=%TARGET%
)

if "%TARGET%" == "win_32" (
  SET MACHINE=x86
)

if "%TARGET%" == "win_64" (
  SET MACHINE=x64
)

if not exist "%platform%" (
	md "%platform%"
)

if not exist "%platform%\build" (
	md "%platform%\build"
)

cd "%SCRIPTPATH%%platform%"

if exist "%SCRIPTPATH%%platform%\icu\" (
	echo "icu already exported"
) else (
	svn export http://source.icu-project.org/repos/icu/tags/release-%ICU_MAJOR_VER%-%ICU_MINOR_VER%/icu4c ./icu
)

SET VC=%ProgramFiles%\Microsoft Visual Studio 14.0\VC
SET VC64=%ProgramFiles(x86)%\Microsoft Visual Studio 14.0\VC
if exist %VC64% (
	SET VC=%VC64%
)

call "%VC%\vcvarsall.bat" %MACHINE%

if "%platform%" == "win_64" (
MSBuild.exe icu\source\allinone\allinone.sln /p:Configuration=Release /p:PlatformToolset=v140 /p:Platform="X64"
) else (
MSBuild.exe icu\source\allinone\allinone.sln /p:Configuration=Release /p:PlatformToolset=v140 /p:Platform="Win32"
)

if "%platform%" == "win_64" (
XCOPY /Y "%SCRIPTPATH%%platform%\icu\bin64\icudt%ICU_MAJOR_VER%.dll" "%SCRIPTPATH%%platform%\build\"
XCOPY /Y "%SCRIPTPATH%%platform%\icu\bin64\icuuc%ICU_MAJOR_VER%.dll" "%SCRIPTPATH%%platform%\build\"
XCOPY /Y "%SCRIPTPATH%%platform%\icu\lib64\icudt.lib" "%SCRIPTPATH%%platform%\build\"
XCOPY /Y "%SCRIPTPATH%%platform%\icu\lib64\icuuc.lib" "%SCRIPTPATH%%platform%\build\"
) else (
XCOPY /Y "%SCRIPTPATH%%platform%\icu\bin\icudt%ICU_MAJOR_VER%.dll" "%SCRIPTPATH%%platform%\build\"
XCOPY /Y "%SCRIPTPATH%%platform%\icu\bin\icuuc%ICU_MAJOR_VER%.dll" "%SCRIPTPATH%%platform%\build\"
XCOPY /Y "%SCRIPTPATH%%platform%\icu\lib\icudt.lib" "%SCRIPTPATH%%platform%\build\"
XCOPY /Y "%SCRIPTPATH%%platform%\icu\lib\icuuc.lib" "%SCRIPTPATH%%platform%\build\"
)

SET SCRIPTPATH=%~dp0
CD /D %~dp0

SET ICU_MAJOR_VER=60
SET ICU_MINOR_VER=2

SET build_platform=win_32
if defined ProgramFiles(x86) (
	SET build_platform=win_64
)

if defined TARGET (
	SET build_platform=%TARGET%
)

if "%build_platform%" == "win_32" (
  SET MACHINE=x86
)

if "%build_platform%" == "win_64" (
  SET MACHINE=x64
)

if not exist "%build_platform%" (
	md "%build_platform%"
)

if not exist "%build_platform%\build" (
	md "%build_platform%\build"
)

cd "%SCRIPTPATH%%build_platform%"

if exist "%SCRIPTPATH%%build_platform%\icu\" (
	echo "icu already exported"
) else (
	svn export http://source.icu-project.org/repos/icu/tags/release-%ICU_MAJOR_VER%-%ICU_MINOR_VER%/icu4c ./icu
)

SET VC=%ProgramFiles%\Microsoft Visual Studio 14.0\VC
SET VC64=%ProgramFiles(x86)%\Microsoft Visual Studio 14.0\VC
if exist %VC64% (
	SET VC=%VC64%
)

call "%VC%\vcvarsall.bat" %MACHINE%

if "%build_platform%" == "win_64" (
MSBuild.exe icu\source\allinone\allinone.sln /p:Configuration=Release /p:PlatformToolset=v140 /p:Platform="X64"
) else (
MSBuild.exe icu\source\allinone\allinone.sln /p:Configuration=Release /p:PlatformToolset=v140 /p:Platform="Win32"
)

if "%build_platform%" == "win_64" (
XCOPY /Y "%SCRIPTPATH%%build_platform%\icu\bin64\icudt%ICU_MAJOR_VER%.dll" "%SCRIPTPATH%%build_platform%\build\"
XCOPY /Y "%SCRIPTPATH%%build_platform%\icu\bin64\icuuc%ICU_MAJOR_VER%.dll" "%SCRIPTPATH%%build_platform%\build\"
XCOPY /Y "%SCRIPTPATH%%build_platform%\icu\lib64\icudt.lib" "%SCRIPTPATH%%build_platform%\build\"
XCOPY /Y "%SCRIPTPATH%%build_platform%\icu\lib64\icuuc.lib" "%SCRIPTPATH%%build_platform%\build\"
) else (
XCOPY /Y "%SCRIPTPATH%%build_platform%\icu\bin\icudt%ICU_MAJOR_VER%.dll" "%SCRIPTPATH%%build_platform%\build\"
XCOPY /Y "%SCRIPTPATH%%build_platform%\icu\bin\icuuc%ICU_MAJOR_VER%.dll" "%SCRIPTPATH%%build_platform%\build\"
XCOPY /Y "%SCRIPTPATH%%build_platform%\icu\lib\icudt.lib" "%SCRIPTPATH%%build_platform%\build\"
XCOPY /Y "%SCRIPTPATH%%build_platform%\icu\lib\icuuc.lib" "%SCRIPTPATH%%build_platform%\build\"
)

Fix the target chosing

Fix the target chosing


:: Compile clapack
"%PYTHON%" "%RECIPE_DIR%\get_clapack_src.py"
if errorlevel 1 exit 1

mkdir build_clapack
if errorlevel 1 exit 1
cd build_clapack
if errorlevel 1 exit 1

cmake ^
    -G "%CMAKE_GENERATOR%" ^
    -DCMAKE_INSTALL_PREFIX="%SRC_DIR%\ext" ^
    -DBoost_ROOT_DIR="%LIBRARY_INC%" ^
    ../clapack
if errorlevel 1 exit 1

cmake --build . --config Release -- /verbosity:minimal
if errorlevel 1 exit 1

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

:: Start actual ALPS build
cd %SRC_DIR%
if errorlevel 1 exit 1

mkdir build
if errorlevel 1 exit 1

cd build
if errorlevel 1 exit 1

set PYTHON_LIBRARY=%PREFIX%\libs\python%PY_VER:~0,1%%PY_VER:~2,1%.lib

cmake ^
      -Wno-dev ^
      -G "%CMAKE_GENERATOR%" ^
      -DCMAKE_INSTALL_PREFIX="%LIBRARY_PREFIX%" ^
      -DCMAKE_PREFIX_PATH="%LIBRARY_PREFIX%" ^
      -DBUILD_STATIC_LIBS=1 ^
      -DBUILD_SHARED_LIBS=1 ^
      -DALPS_ENABLE_MPI=OFF ^
      -DALPS_BUILD_TESTS=ON ^
      -DALPS_BUILD_APPLICATIONS=ON ^
      -DALPS_BUILD_EXAMPLES=OFF ^
      -DBOOST_ROOT="%PREFIX%" ^
      -DBoost_NO_SYSTEM_PATHS=ON ^
      -DBOOST_INCLUDEDIR="%LIBRARY_INC%" ^
      -DBOOST_LIBRARYDIR="%LIBRARY_LIB%" ^
      -DLAPACK_FOUND=TRUE ^
      -DBLAS_LIBRARY="%SRC_DIR%\ext\lib\blas.lib" ^
      -DLAPACK_LIBRARY="%SRC_DIR%\ext\lib\lapack.lib" ^
      -DPYTHON_EXECUTABLE="%PYTHON%" ^
      -DPYTHON_INCLUDE_DIR:PATH="%PREFIX%/include" ^
      -DPYTHON_LIBRARY:FILEPATH="%PYTHON_LIBRARY%" ^
      -DPYTHON_NUMPY_INCLUDE_DIR:PATH="%SP_DIR%/numpy/core/include" ^
      -DALPS_HAS_CMAKE_PI_MACROS=OFF ^
      ..
if errorlevel 1 exit 1

type CMakeCache.txt

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

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

ctest --output-on-failure
:: if errorlevel 1 exit 1

:: Move pyalps to site packages
move %LIBRARY_LIB%\pyalps "%SP_DIR%"

:: Compile clapack
"%PYTHON%" "%RECIPE_DIR%\get_clapack_src.py"
if errorlevel 1 exit 1

mkdir build_clapack
if errorlevel 1 exit 1
cd build_clapack
if errorlevel 1 exit 1

cmake ^
    -G "%CMAKE_GENERATOR%" ^
    -DCMAKE_INSTALL_PREFIX="%SRC_DIR%\ext" ^
    -DBoost_ROOT_DIR="%LIBRARY_INC%" ^
    ../clapack
if errorlevel 1 exit 1

cmake --build . --config Release -- /verbosity:minimal
if errorlevel 1 exit 1

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

:: Start actual ALPS build
cd %SRC_DIR%
if errorlevel 1 exit 1

mkdir build
if errorlevel 1 exit 1

cd build
if errorlevel 1 exit 1

set PYTHON_LIBRARY=%PREFIX%\libs\python%PY_VER:~0,1%%PY_VER:~2,1%.lib

cmake ^
      -Wno-dev ^
      -G "%CMAKE_GENERATOR%" ^
      -DCMAKE_INSTALL_PREFIX="%LIBRARY_PREFIX%" ^
      -DCMAKE_PREFIX_PATH="%LIBRARY_PREFIX%" ^
      -DBUILD_STATIC_LIBS=1 ^
      -DBUILD_SHARED_LIBS=1 ^
      -DALPS_ENABLE_MPI=OFF ^
      -DALPS_BUILD_TESTS=ON ^
      -DALPS_BUILD_APPLICATIONS=ON ^
      -DALPS_BUILD_EXAMPLES=OFF ^
      -DBOOST_ROOT="%PREFIX%" ^
      -DBoost_NO_SYSTEM_PATHS=ON ^
      -DBOOST_INCLUDEDIR="%LIBRARY_INC%" ^
      -DBOOST_LIBRARYDIR="%LIBRARY_LIB%" ^
      -DLAPACK_FOUND=TRUE ^
      -DBLAS_LIBRARY="%SRC_DIR%\ext\lib\blas.lib" ^
      -DLAPACK_LIBRARY="%SRC_DIR%\ext\lib\lapack.lib" ^
      -DPYTHON_EXECUTABLE="%PYTHON%" ^
      -DPYTHON_INCLUDE_DIR:PATH="%PREFIX%/include" ^
      -DPYTHON_LIBRARY:FILEPATH="%PYTHON_LIBRARY%" ^
      -DPYTHON_NUMPY_INCLUDE_DIR:PATH="%SP_DIR%/numpy/core/include" ^
      -DALPS_HAS_CMAKE_PI_MACROS=OFF ^
      ..
if errorlevel 1 exit 1

type CMakeCache.txt

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

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

ctest --output-on-failure  -E "python_|lattice_example1"
:: if errorlevel 1 exit 1

:: Move pyalps to site packages
move %LIBRARY_LIB%\pyalps "%SP_DIR%"

exclude some tests: 1) floating point comparison problem, 2) python tests require unix shell scripts


add rm command

add rm command


@ECHO OFF

REM Command file for Sphinx documentation

set SPHINXBUILD=sphinx-build
set BUILDDIR=_build
set ALLSPHINXOPTS=-d %BUILDDIR%/doctrees %SPHINXOPTS% .
if NOT "%PAPER%" == "" (
	set ALLSPHINXOPTS=-D latex_paper_size=%PAPER% %ALLSPHINXOPTS%
)

if "%1" == "" goto help

if "%1" == "help" (
	:help
	echo.Please use `make ^<target^>` where ^<target^> is one of
	echo.  html      to make standalone HTML files
	echo.  dirhtml   to make HTML files named index.html in directories
	echo.  pickle    to make pickle files
	echo.  json      to make JSON files
	echo.  htmlhelp  to make HTML files and a HTML help project
	echo.  qthelp    to make HTML files and a qthelp project
	echo.  latex     to make LaTeX files, you can set PAPER=a4 or PAPER=letter
	echo.  changes   to make an overview over all changed/added/deprecated items
	echo.  linkcheck to check all external links for integrity
	echo.  doctest   to run all doctests embedded in the documentation if enabled
	goto end
)

if "%1" == "clean" (
	for /d %%i in (%BUILDDIR%\*) do rmdir /q /s %%i
	del /q /s %BUILDDIR%\*
	goto end
)

if "%1" == "html" (
	%SPHINXBUILD% -b html %ALLSPHINXOPTS% %BUILDDIR%/html
	echo.
	echo.Build finished. The HTML pages are in %BUILDDIR%/html.
	goto end
)

if "%1" == "dirhtml" (
	%SPHINXBUILD% -b dirhtml %ALLSPHINXOPTS% %BUILDDIR%/dirhtml
	echo.
	echo.Build finished. The HTML pages are in %BUILDDIR%/dirhtml.
	goto end
)

if "%1" == "pickle" (
	%SPHINXBUILD% -b pickle %ALLSPHINXOPTS% %BUILDDIR%/pickle
	echo.
	echo.Build finished; now you can process the pickle files.
	goto end
)

if "%1" == "json" (
	%SPHINXBUILD% -b json %ALLSPHINXOPTS% %BUILDDIR%/json
	echo.
	echo.Build finished; now you can process the JSON files.
	goto end
)

if "%1" == "htmlhelp" (
	%SPHINXBUILD% -b htmlhelp %ALLSPHINXOPTS% %BUILDDIR%/htmlhelp
	echo.
	echo.Build finished; now you can run HTML Help Workshop with the ^
.hhp project file in %BUILDDIR%/htmlhelp.
	goto end
)

if "%1" == "qthelp" (
	%SPHINXBUILD% -b qthelp %ALLSPHINXOPTS% %BUILDDIR%/qthelp
	echo.
	echo.Build finished; now you can run "qcollectiongenerator" with the ^
.qhcp project file in %BUILDDIR%/qthelp, like this:
	echo.^> qcollectiongenerator %BUILDDIR%\qthelp\SfePy.qhcp
	echo.To view the help file:
	echo.^> assistant -collectionFile %BUILDDIR%\qthelp\SfePy.ghc
	goto end
)

if "%1" == "latex" (
	%SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex
	echo.
	echo.Build finished; the LaTeX files are in %BUILDDIR%/latex.
	goto end
)

if "%1" == "changes" (
	%SPHINXBUILD% -b changes %ALLSPHINXOPTS% %BUILDDIR%/changes
	echo.
	echo.The overview file is in %BUILDDIR%/changes.
	goto end
)

if "%1" == "linkcheck" (
	%SPHINXBUILD% -b linkcheck %ALLSPHINXOPTS% %BUILDDIR%/linkcheck
	echo.
	echo.Link check complete; look for any errors in the above output ^
or in %BUILDDIR%/linkcheck/output.txt.
	goto end
)

if "%1" == "doctest" (
	%SPHINXBUILD% -b doctest %ALLSPHINXOPTS% %BUILDDIR%/doctest
	echo.
	echo.Testing of doctests in the sources finished, look at the ^
results in %BUILDDIR%/doctest/output.txt.
	goto end
)

:end

add sphinx build file for windows

add sphinx build file for windows


rem Script to build SciTE for Windows with all the different
rem compilers and exercise all the projects and makefiles.
rem Current directory must be scite\scripts before running.
rem Contains references to local install directories on Neil's
rem machine so must be modified for other installations.
rem Assumes environment set up so gcc and MSVC can be called.
rem
cd ..\..
set
set BORLAND_BASE=C:\Borland\bcc55
set MSDEV_BASE=C:\Program Files (x86)\Microsoft Visual Studio\Common\MSDev98\Bin
set MSDEV71_BASE=C:\Program Files\Microsoft Visual Studio .NET 2003\Common7\Tools
rem
rem ************************************************************
rem Borland (target 1) no longer supported
rem
rem ************************************************************
rem Target 2: Normal gcc build
call scite\scripts\clearboth
cd scintilla\win32
mingw32-make
if ERRORLEVEL 2 goto ERROR
cd ..\test
pythonw simpleTests.py
pythonw lexTests.py
pythonw performanceTests.py
cd ..\..\scite\win32
mingw32-make
if ERRORLEVEL 2 goto ERROR
cd ..\..
rem
rem ************************************************************
rem Target 3: Microsoft VC++ build
call scite\scripts\clearboth
cd scintilla\win32
cl
nmake -f scintilla.mak QUIET=1
if ERRORLEVEL 2 goto ERROR
cd ..\..\scite\win32
nmake -f scite.mak QUIET=1
if ERRORLEVEL 2 goto ERROR
cd ..\..
rem
rem Set path for VC 6
path %MSDEV_BASE%;%path%
rem
rem ************************************************************
rem Target 4: Visual C++ .NET using scite\boundscheck\SciTE.sln
call "%MSDEV71_BASE%\vsvars32.bat"
call scite\scripts\clearboth
cd scite\boundscheck
devenv scite.sln /rebuild release
if ERRORLEVEL 2 goto ERROR
cd ..\..
rem
rem ************************************************************
rem Target 5: GTK+ version using gcc on scintilla\gtk\makefile
call scite\scripts\clearboth
cd scintilla\gtk
mingw32-make
if ERRORLEVEL 2 goto ERROR
cd ..\..
rem Visual C++ builds
call "%MSDEV_BASE%\..\..\..\VC98\bin\vcvars32.bat"
echo on
rem
rem ************************************************************
rem Target 6: Visual C++ 98 using scintilla\win32\scintilla_vc6.mak
call scite\scripts\clearboth
cd scintilla\win32
nmake -f scintilla_vc6.mak QUIET=1
if ERRORLEVEL 2 goto ERROR
cd ..\..
rem
rem ************************************************************
rem Target 7: Visual C++ using scintilla\vcbuild\SciLexer.dsp
call scite\scripts\clearboth
cd scintilla\vcbuild
msdev SciLexer.dsp /MAKE "SciLexer - Win32 Release" /REBUILD
if ERRORLEVEL 2 goto ERROR
cd ..\..
rem
rem ************************************************************
rem Target 8: Visual C++ using scite\vcbuild\SciTE.dsp
call scite\scripts\clearboth
cd scite\vcbuild
msdev SciTE.dsp /MAKE "SciTE - Win32 Release" /REBUILD
if ERRORLEVEL 2 goto ERROR
cd ..\..
rem
rem ************************************************************
rem Target 9: Visual C++ using scite\boundscheck\SciTE.dsp
call scite\scripts\clearboth
cd scite\boundscheck
msdev SciTE.dsp /MAKE "SciTE - Win32 Release" /REBUILD
if ERRORLEVEL 2 goto ERROR
cd ..\..
call scite\scripts\clearboth
goto CLEANUP
:ERROR
@echo checkbuilds.bat:1: Failed %ERRORLEVEL%
:CLEANUP
set SAVE_PATH=
set SAVE_INCLUDE=
set BORLAND_BASE=
set MSDEV_BASE=
set

rem Script to build SciTE for Windows with all the different
rem compilers and exercise all the projects and makefiles.
rem Current directory must be scite\scripts before running.
rem Contains references to local install directories on Neil's
rem machine so must be modified for other installations.
rem Assumes environment set up so gcc and MSVC can be called.
rem
cd ..\..
set
set BORLAND_BASE=C:\Borland\bcc55
set MSDEV_BASE=C:\Program Files (x86)\Microsoft Visual Studio\Common\MSDev98\Bin
set MSDEV71_BASE=C:\Program Files\Microsoft Visual Studio .NET 2003\Common7\Tools
rem
rem ************************************************************
rem Target 1: basic unit tests with gcc
call scite\scripts\clearboth
cd scintilla\test\unit
mingw32-make
if ERRORLEVEL 2 goto ERROR
.\unitTest
if ERRORLEVEL 2 goto ERROR
cd ..\..\..
rem
rem ************************************************************
rem Target 2: Normal gcc build
call scite\scripts\clearboth
cd scintilla\win32
mingw32-make
if ERRORLEVEL 2 goto ERROR
cd ..\test
pythonw simpleTests.py
pythonw lexTests.py
pythonw performanceTests.py
cd ..\..\scite\win32
mingw32-make
if ERRORLEVEL 2 goto ERROR
cd ..\..
rem
rem ************************************************************
rem Target 3: Microsoft VC++ build
call scite\scripts\clearboth
cd scintilla\win32
cl
nmake -f scintilla.mak QUIET=1
if ERRORLEVEL 2 goto ERROR
cd ..\..\scite\win32
nmake -f scite.mak QUIET=1
if ERRORLEVEL 2 goto ERROR
cd ..\..
rem
rem Set path for VC 6
path %MSDEV_BASE%;%path%
rem
rem ************************************************************
rem Target 4: Visual C++ .NET using scite\boundscheck\SciTE.sln
call "%MSDEV71_BASE%\vsvars32.bat"
call scite\scripts\clearboth
cd scite\boundscheck
devenv scite.sln /rebuild release
if ERRORLEVEL 2 goto ERROR
cd ..\..
rem
rem ************************************************************
rem Target 5: GTK+ version using gcc on scintilla\gtk\makefile
call scite\scripts\clearboth
cd scintilla\gtk
mingw32-make
if ERRORLEVEL 2 goto ERROR
cd ..\..
rem Visual C++ builds
call "%MSDEV_BASE%\..\..\..\VC98\bin\vcvars32.bat"
echo on
rem
rem ************************************************************
rem Target 6: Visual C++ 98 using scintilla\win32\scintilla_vc6.mak
call scite\scripts\clearboth
cd scintilla\win32
nmake -f scintilla_vc6.mak QUIET=1
if ERRORLEVEL 2 goto ERROR
cd ..\..
rem
rem ************************************************************
rem Target 7: Visual C++ using scintilla\vcbuild\SciLexer.dsp
call scite\scripts\clearboth
cd scintilla\vcbuild
msdev SciLexer.dsp /MAKE "SciLexer - Win32 Release" /REBUILD
if ERRORLEVEL 2 goto ERROR
cd ..\..
rem
rem ************************************************************
rem Target 8: Visual C++ using scite\vcbuild\SciTE.dsp
call scite\scripts\clearboth
cd scite\vcbuild
msdev SciTE.dsp /MAKE "SciTE - Win32 Release" /REBUILD
if ERRORLEVEL 2 goto ERROR
cd ..\..
rem
rem ************************************************************
rem Target 9: Visual C++ using scite\boundscheck\SciTE.dsp
call scite\scripts\clearboth
cd scite\boundscheck
msdev SciTE.dsp /MAKE "SciTE - Win32 Release" /REBUILD
if ERRORLEVEL 2 goto ERROR
cd ..\..
call scite\scripts\clearboth
goto CLEANUP
:ERROR
@echo checkbuilds.bat:1: Failed %ERRORLEVEL%
:CLEANUP
set SAVE_PATH=
set SAVE_INCLUDE=
set BORLAND_BASE=
set MSDEV_BASE=
set

Add basic unit tests.

Add basic unit tests.


@echo off
set NGen="%SystemRoot%\Microsoft.NET\Framework\v4.0.30319\ngen.exe"

if not defined Configuration set Configuration=Debug
if not defined NemerleBinPathRoot set NemerleBinPathRoot="%ProgramFiles%\Nemerle"
if not defined Nemerle set Nemerle=%NemerleBinPathRoot%\Net-4.0
set RuntimeDllPath=%~dp0\..\N2\N2.Runtime\bin\%Configuration%
set N2CompilerDllPath=%~dp0\..\N2\N2.Compiler\bin\%Configuration%\Stage1
rem for %%d in (%N2CompilerDllPath%\*.dll) DO %NGen% install %%d

echo ---- POSITIVE TESTS ----
set TeamCityArgs=
if defined TEAMCITY_VERSION set TeamCityArgs=-team-city-test-suite:Nitra_Positive
set OutDir=%~dp0\Bin\%Configuration%\Positive
set Tests=%~dp0\!Positive
call :runtests

echo ---- NEGATIVE TESTS ----
set TeamCityArgs=
if defined TEAMCITY_VERSION set TeamCityArgs=-team-city-test-suite:Nitra_Negative
set OutDir=%~dp0\Bin\%Configuration%\Negative
set Tests=%~dp0\!Negative
call :runtests

pause

goto :eof

:runtests
if exist %OutDir% rmdir %OutDir% /S /Q
mkdir %OutDir%
copy %~dp0\..\Grammars\Bin\%Configuration%\*.* %OutDir% /B /Z 1>nul
pushd .
cd %OutDir%
%Nemerle%\Nemerle.Compiler.Test.exe %Tests%\*.n %Tests%\*.cs %Tests%\*.n2 -output:%OutDir% -ref:System.Core -ref:%RuntimeDllPath%\N2.Runtime.dll -macro:%N2CompilerDllPath%\N2.Compiler.dll %TeamCityArgs%
popd
goto :eof

@echo off
set NGen="%SystemRoot%\Microsoft.NET\Framework\v4.0.30319\ngen.exe"

if not defined Configuration set Configuration=Debug
if not defined NemerleBinPathRoot set NemerleBinPathRoot="%ProgramFiles%\Nemerle"
if not defined Nemerle set Nemerle=%NemerleBinPathRoot%\Net-4.0
set RuntimeDllPath=%~dp0\..\N2\N2.Runtime\bin\%Configuration%
set CoreDllPath=%~dp0\..\N2\N2.Core\bin\%Configuration%
set N2CompilerDllPath=%~dp0\..\N2\N2.Compiler\bin\%Configuration%\Stage1
rem for %%d in (%N2CompilerDllPath%\*.dll) DO %NGen% install %%d

echo ---- POSITIVE TESTS ----
set TeamCityArgs=
if defined TEAMCITY_VERSION set TeamCityArgs=-team-city-test-suite:Nitra_Positive
set OutDir=%~dp0\Bin\%Configuration%\Positive
set Tests=%~dp0\!Positive
call :runtests

echo ---- NEGATIVE TESTS ----
set TeamCityArgs=
if defined TEAMCITY_VERSION set TeamCityArgs=-team-city-test-suite:Nitra_Negative
set OutDir=%~dp0\Bin\%Configuration%\Negative
set Tests=%~dp0\!Negative
call :runtests

pause

goto :eof

:runtests
if exist %OutDir% rmdir %OutDir% /S /Q
mkdir %OutDir%
copy %~dp0\..\Grammars\Bin\%Configuration%\*.* %OutDir% /B /Z 1>nul
pushd .
cd %OutDir%
%Nemerle%\Nemerle.Compiler.Test.exe %Tests%\*.n %Tests%\*.cs %Tests%\*.n2 -output:%OutDir% -ref:System.Core -ref:%RuntimeDllPath%\N2.Runtime.dll -ref:%CoreDllPath%\N2.Core.dll -macro:%N2CompilerDllPath%\N2.Compiler.dll %TeamCityArgs%
popd
goto :eof

Add reference to N2.Core for tests.

Add reference to N2.Core for tests.


npm rm ldapjs
npm install git://github.com/mcavage/node-ldapjs.git

npm rm passport-ldapauth
npm install passport-ldapauth --no-optional

Add windows script to fix ldap bug

Add windows script to fix ldap bug


@echo off
set lighttpd_dir=%~dp0..\third_party\lighttpd\win

REM copy lighttpd.exe to lighttpd_server.exe, because we don't want it to be
REM killed by taskkill.

xcopy /D %lighttpd_dir%\lighttpd.exe %lighttpd_dir%\lighttpd_server.exe

REM copy the cygwin dll to the lighttpd folder because otherwise it wont work.

xcopy /D %lighttpd_dir%\..\no_dll\CygWin1.dll %lighttpd_dir%

REM Start the server, using the conf file in the slave directory.

@echo on
%lighttpd_dir%\lighttpd_server.exe -f %~dp0\lighttpd.conf -m %lighttpd_dir%\lib

@echo off
set lighttpd_dir=%~dp0..\third_party\lighttpd\win

REM copy lighttpd.exe to lighttpd_server.exe, because we don't want it to be
REM killed by taskkill.

xcopy /D %lighttpd_dir%\lighttpd.exe %lighttpd_dir%\lighttpd_server.exe

REM copy the cygwin dll to the lighttpd folder because otherwise it wont work.

xcopy /D %lighttpd_dir%\..\no_dll\CygWin1.dll %lighttpd_dir%

REM Start the server, using the conf file in the slave directory.

:RESTART
echo Starting %lighttpd_dir%\lighttpd_server.exe -f %~dp0\lighttpd.conf -m %lighttpd_dir%\lib
%lighttpd_dir%\lighttpd_server.exe -f %~dp0\lighttpd.conf -m %lighttpd_dir%\lib
goto :RESTART

Make the web server auto-restart on crash

R=cmp@chromium.org
BUG=
TEST=

Review URL: http://codereview.chromium.org/8245014

git-svn-id: 239fca9b83025a0b6f823aeeca02ba5be3d9fd76@105112 0039d316-1c4b-4281-b951-d872f2087c98


sox.exe C:\CloudMusic\1\911-IDo.mp3 d:/1.wav  channels 1 rate 16k fade 3 norm

Create sox_cmd.bat

Create sox_cmd.bat


REM test_action_enter_edit_organization_level

"C:\Program Files\PostgreSQL\9.6\bin\psql.exe" -h localhost -U postgres -d program_manager_test_db  -p 5432 -f ..\action_enter_edit_organization_level.sql 1> test_action_enter_edit_organization_level.log 2>&1

"C:\Program Files\PostgreSQL\9.6\bin\psql.exe" -h localhost -U postgres -d program_manager_test_db  -p 5432 -f test_action_enter_edit_organization_level.sql  1>> test_action_enter_edit_organization_level.log 2>>&1

REM install db
call C:\funda_components\programs_manager\programs_manager_database\program_manager_test_database\install_program_manager_test_db.bat

REM test_action_enter_edit_organization_level

"C:\Program Files\PostgreSQL\9.6\bin\psql.exe" -h localhost -U postgres -d program_manager_test_db  -p 5432 -f ..\action_enter_edit_organization_level.sql 1> test_action_enter_edit_organization_level.log 2>&1

"C:\Program Files\PostgreSQL\9.6\bin\psql.exe" -h localhost -U postgres -d program_manager_test_db  -p 5432 -f C:\funda_components\programs_manager\programs_manager_database\utility_functions\trig_log_organization_level_history.sql 1>> test_action_enter_edit_organizations.log 2>>&1

"C:\Program Files\PostgreSQL\9.6\bin\psql.exe" -h localhost -U postgres -d program_manager_test_db  -p 5432 -f test_action_enter_edit_organization_level.sql  1>> test_action_enter_edit_organization_level.log 2>>&1

install DB fresh before running tests

install DB fresh before running tests


echo off
rem call vc.bat
call "C:\Program Files\Microsoft Visual Studio 12.0\VC\vcvarsall.bat" x86

cls

cl  /c /Ox /DEBUG /Z7 ring.c  ^
ring_string.c ring_list.c ring_item.c ring_items.c ring_hashtable.c ring_state.c ring_scanner.c ring_parser.c ring_hashlib.c ring_vmgc.c ^
ring_stmt.c ring_expr.c ring_codegen.c ring_vm.c ring_vmexpr.c ring_vmvars.c ^
ring_vmlists.c ring_vmfuncs.c ring_api.c ring_vmoop.c ring_vmcui.c ^
ring_vmtrycatch.c ring_vmstrindex.c ring_vmjump.c ring_vmduprange.c ^
ring_vmperformance.c ring_vmexit.c ring_vmstackvars.c ring_vmstate.c ring_vmmath.c ring_vmfile.c ring_vmos.c ring_vmlistfuncs.c ring_vmrefmeta.c ^
ring_vmodbc.c ring_vmmysql.c ring_vmopenssl.c ring_vmcurl.c ring_ext.c ring_vmdll.c -I"..\include" -I"C:\curlBIN\include" -I"C:\OPENSSLBIN\include" -I"C:\Program Files\MySQL\MySQL Connector.C 6.1\include"

link /DLL /DEBUG /OUT:..\lib\ring.dll /SUBSYSTEM:CONSOLE,"5.01"  ring_string.obj ^
ring_list.obj ring_item.obj ring_items.obj ring_hashtable.obj ring_state.obj ring_scanner.obj ring_parser.obj ring_hashlib.obj ring_vmgc.obj ^
ring_stmt.obj ring_expr.obj ring_codegen.obj ring_vm.obj ring_vmexpr.obj ring_vmvars.obj ^
ring_vmlists.obj ring_vmfuncs.obj ring_api.obj ring_vmoop.obj ring_vmcui.obj ^
ring_vmtrycatch.obj ring_vmstrindex.obj ring_vmjump.obj ring_vmduprange.obj ^
ring_vmperformance.obj ring_vmexit.obj ring_vmstackvars.obj ring_vmstate.obj ring_vmmath.obj ring_vmfile.obj ring_vmos.obj ring_vmlistfuncs.obj ring_vmrefmeta.obj ^
ring_vmodbc.obj ring_vmmysql.obj ring_vmopenssl.obj ring_vmcurl.obj ring_ext.obj ring_vmdll.obj c:\curlbin\lib\libcurl.lib "C:\Program Files\MySQL\MySQL Connector.C 6.1\lib\libmysql.lib" c:\opensslbin\lib\libeay32.lib odbc32.lib

copy ..\lib\ring.dll ..\bin\

cl /DEBUG ring.c ..\lib\ring.lib -I"..\include"  /link /SUBSYSTEM:CONSOLE,"5.01" /OUT:..\bin\ring.exe

del *.obj

echo off
rem call vc.bat
call "C:\Program Files\Microsoft Visual Studio 12.0\VC\vcvarsall.bat" x86

cls

cl  /c /Ox /DEBUG /Z7 ring.c  ^
ring_string.c ring_list.c ring_item.c ring_items.c ring_hashtable.c ring_state.c ring_scanner.c ring_parser.c ring_hashlib.c ring_vmgc.c ^
ring_stmt.c ring_expr.c ring_codegen.c ring_vm.c ring_vmexpr.c ring_vmvars.c ^
ring_vmlists.c ring_vmfuncs.c ring_api.c ring_vmoop.c ring_vmcui.c ^
ring_vmtrycatch.c ring_vmstrindex.c ring_vmjump.c ring_vmduprange.c ^
ring_vmperformance.c ring_vmexit.c ring_vmstackvars.c ring_vmstate.c ring_vmmath.c ring_vmfile.c ring_vmos.c ring_vmlistfuncs.c ring_vmrefmeta.c ^
ring_vmodbc.c ring_vmmysql.c ring_vmopenssl.c ring_vmcurl.c ring_ext.c ring_vmdll.c -I"..\include" -I"..\libdepwin\libcurl\include" -I"..\libdepwin\OPENSSL\include" -I"..\libdepwin\MySQL\include"

link /DLL /DEBUG /OUT:..\lib\ring.dll /SUBSYSTEM:CONSOLE,"5.01"  ring_string.obj ^
ring_list.obj ring_item.obj ring_items.obj ring_hashtable.obj ring_state.obj ring_scanner.obj ring_parser.obj ring_hashlib.obj ring_vmgc.obj ^
ring_stmt.obj ring_expr.obj ring_codegen.obj ring_vm.obj ring_vmexpr.obj ring_vmvars.obj ^
ring_vmlists.obj ring_vmfuncs.obj ring_api.obj ring_vmoop.obj ring_vmcui.obj ^
ring_vmtrycatch.obj ring_vmstrindex.obj ring_vmjump.obj ring_vmduprange.obj ^
ring_vmperformance.obj ring_vmexit.obj ring_vmstackvars.obj ring_vmstate.obj ring_vmmath.obj ring_vmfile.obj ring_vmos.obj ring_vmlistfuncs.obj ring_vmrefmeta.obj ^
ring_vmodbc.obj ring_vmmysql.obj ring_vmopenssl.obj ring_vmcurl.obj ring_ext.obj ring_vmdll.obj ..\libdepwin\libcurl\lib\libcurl.lib "..\libdepwin\MySQL\lib\libmysql.lib" ..\libdepwin\OpenSSL\lib\libeay32.lib odbc32.lib

copy ..\lib\ring.dll ..\bin\

cl /DEBUG ring.c ..\lib\ring.lib -I"..\include"  /link /SUBSYSTEM:CONSOLE,"5.01" /OUT:..\bin\ring.exe

del *.obj

update buildvccomplete.bat to use libraries from folder ../libdepwin


if "%PACKER_BUILDER_TYPE:~0,6%"=="hyperv" (
  echo "Skip compact steps in Hyper-V build."
  goto :eof
)
if not exist "C:\Windows\Temp\7z1900-x64.msi" (
	powershell -Command "(New-Object System.Net.WebClient).DownloadFile('https://www.7-zip.org/a/7z1900-x64.msi', 'C:\Windows\Temp\7z1900-x64.msi')" <NUL
)
msiexec /qb /i C:\Windows\Temp\7z1900-x64.msi

if not exist "C:\Windows\Temp\ultradefrag.zip" (
	powershell -Command "(New-Object System.Net.WebClient).DownloadFile('https://downloads.sourceforge.net/project/ultradefrag/stable-release/6.1.0/ultradefrag-portable-6.1.0.bin.amd64.zip', 'C:\Windows\Temp\ultradefrag.zip')" <NUL
)

if not exist "C:\Windows\Temp\ultradefrag-portable-6.1.0.amd64\udefrag.exe" (
	cmd /c ""C:\Program Files\7-Zip\7z.exe" x C:\Windows\Temp\ultradefrag.zip -oC:\Windows\Temp"
)

if not exist "C:\Windows\Temp\SDelete.zip" (
  powershell -Command "(New-Object System.Net.WebClient).DownloadFile('https://download.sysinternals.com/files/SDelete.zip', 'C:\Windows\Temp\SDelete.zip')" <NUL
  powershell -Command "(New-Object System.Net.WebClient).DownloadFile('https://vagrantboxes.blob.core.windows.net/box/sdelete/v1.6.1/sdelete.exe', 'C:\Windows\Temp\sdelete.exe')" <NUL
)

if not exist "C:\Windows\Temp\sdelete.exe" (
	cmd /c ""C:\Program Files\7-Zip\7z.exe" x C:\Windows\Temp\SDelete.zip -oC:\Windows\Temp"
)

msiexec /qb /x C:\Windows\Temp\7z1900-x64.msi

net stop wuauserv
rmdir /S /Q C:\Windows\SoftwareDistribution\Download
mkdir C:\Windows\SoftwareDistribution\Download
net start wuauserv

if "%PACKER_BUILDER_TYPE%" neq "hyperv-iso" (
	cmd /c C:\Windows\Temp\ultradefrag-portable-6.1.0.amd64\udefrag.exe --optimize --repeat C:

	cmd /c %SystemRoot%\System32\reg.exe ADD HKCU\Software\Sysinternals\SDelete /v EulaAccepted /t REG_DWORD /d 1 /f
	cmd /c C:\Windows\Temp\sdelete.exe -q -z C:
)

if "%PACKER_BUILDER_TYPE:~0,6%"=="hyperv" (
  echo "Skip compact steps in Hyper-V build."
  goto :eof
)
if not exist "C:\Windows\Temp\7z1900-x64.msi" (
	powershell -Command "(New-Object System.Net.WebClient).DownloadFile('https://www.7-zip.org/a/7z1900-x64.msi', 'C:\Windows\Temp\7z1900-x64.msi')" <NUL
)
msiexec /qb /i C:\Windows\Temp\7z1900-x64.msi

if not exist "C:\Windows\Temp\ultradefrag.zip" (
	powershell -Command "[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; (New-Object System.Net.WebClient).DownloadFile('https://downloads.sourceforge.net/project/ultradefrag/stable-release/6.1.0/ultradefrag-portable-6.1.0.bin.amd64.zip', 'C:\Windows\Temp\ultradefrag.zip')" <NUL
)

if not exist "C:\Windows\Temp\ultradefrag-portable-6.1.0.amd64\udefrag.exe" (
	cmd /c ""C:\Program Files\7-Zip\7z.exe" x C:\Windows\Temp\ultradefrag.zip -oC:\Windows\Temp"
)

if not exist "C:\Windows\Temp\SDelete.zip" (
  powershell -Command "(New-Object System.Net.WebClient).DownloadFile('https://download.sysinternals.com/files/SDelete.zip', 'C:\Windows\Temp\SDelete.zip')" <NUL
  powershell -Command "(New-Object System.Net.WebClient).DownloadFile('https://vagrantboxes.blob.core.windows.net/box/sdelete/v1.6.1/sdelete.exe', 'C:\Windows\Temp\sdelete.exe')" <NUL
)

if not exist "C:\Windows\Temp\sdelete.exe" (
	cmd /c ""C:\Program Files\7-Zip\7z.exe" x C:\Windows\Temp\SDelete.zip -oC:\Windows\Temp"
)

msiexec /qb /x C:\Windows\Temp\7z1900-x64.msi

net stop wuauserv
rmdir /S /Q C:\Windows\SoftwareDistribution\Download
mkdir C:\Windows\SoftwareDistribution\Download
net start wuauserv

if "%PACKER_BUILDER_TYPE%" neq "hyperv-iso" (
	cmd /c C:\Windows\Temp\ultradefrag-portable-6.1.0.amd64\udefrag.exe --optimize --repeat C:

	cmd /c %SystemRoot%\System32\reg.exe ADD HKCU\Software\Sysinternals\SDelete /v EulaAccepted /t REG_DWORD /d 1 /f
	cmd /c C:\Windows\Temp\sdelete.exe -q -z C:
)

Use TLS 1.2 for ultradefrag download

Use TLS 1.2 for ultradefrag download

The request to sourceforge.net fails without it, and it needs to be
explicitly set in order for Windows Server 2012 R2 to use it.


@echo OFF
REM Application Manager for managing application lifecycle for Purchase application
SET APP_JAR_NAME=Purchase-1.0.jar

SET APP_NAME=Purchase
SET FLOW_NAME=PurchaseFlow
SET PROCEDURE_NAME=PurchaseProcedure

REM Set the base directory
for %%i in ("%~dp0..\") do (SET APP_HOME=%%~dpi)

REM Set path for curl.exe
SET PATH=%APP_HOME%libexec

REM Process Command line
IF "%1" == "start" GOTO START
IF "%1" == "stop" GOTO STOP
IF "%1" == "status" GOTO STATUS
IF "%1" == "deploy" GOTO DEPLOY
GOTO USAGE

:USAGE
echo Application lifecycle management tool
echo Usage: %0 {deploy^|start^|stop^|status}
GOTO :EOF

:DEPLOY
echo Deploying application...
FOR /F %%i IN ('curl -X POST -sL -w %%{http_code} -H "X-Archive-Name: %APP_JAR_NAME%" --data-binary @"target\%APP_JAR_NAME%" http://localhost:10000/v2/apps') DO SET RESPONSE=%%i
IF  %RESPONSE% == 200  (echo Deployed application
                        GOTO :EOF)

echo Fail to deploy application
GOTO :EOF

:START
CALL :POST %APP_NAME% flows %FLOW_NAME% start
CALL :POST %APP_NAME% procedures %PROCEDURE_NAME% start
GOTO :EOF

:STOP
CALL :POST %APP_NAME% flows %FLOW_NAME% stop
CALL :POST %APP_NAME% procedures %PROCEDURE_NAME% stop
GOTO :EOF

:STATUS
CALL :POST %APP_NAME% flows %FLOW_NAME% status
CALL :POST %APP_NAME% procedures %PROCEDURE_NAME% status
GOTO :EOF

:POST
SET APP=%~1
SET PROGRAM_TYPE=%~2
SET PROGRAM_NAME=%~3
SET ACTION=%~4

echo %ACTION% %PROGRAM_NAME% for application %APP%

FOR /F %%i IN ('curl -X POST -sL -w %%{http_code} http://localhost:10000/v2/apps/%APP%/%PROGRAM_TYPE%/%PROGRAM_NAME%/%ACTION%') DO SET RESPONSE=%%i
IF NOT %RESPONSE% == 200  (
 echo %ACTION% failed
 GOTO :EOF
)
echo %ACTION% successful
GOTO :EOF

:GET
SET APP=%~1
SET PROGRAM_TYPE=%~2
SET PROGRAM_NAME=%~3
SET ACTION=%~4

echo %ACTION% %PROGRAM_NAME% for application %APP%
curl -X GET -sL  http://localhost:10000/v2/apps/%APP%/%PROGRAM_TYPE%/%PROGRAM_NAME%/%ACTION%
echo.
GOTO :EOF

@echo OFF
REM Application Manager for managing application lifecycle for Purchase application
SET APP_JAR_PREFIX=Purchase

SET APP_NAME=Purchase
SET FLOW_NAME=PurchaseFlow
SET PROCEDURE_NAME=PurchaseProcedure

REM Set the base directory
for %%i in ("%~dp0..\") do (SET APP_HOME=%%~dpi)

REM Set path for curl.exe
SET PATH=%APP_HOME%libexec

for /r %APP_HOME%\target %%a in (%APP_JAR_PREFIX%*) do SET JAR_PATH=%%~dpnxa

if %JAR_PATH% == "" (echo "Could not find application jar with name %APP_JAR_PREFIX%"
                     GOTO :EOF)

REM Process Command line
IF "%1" == "start" GOTO START
IF "%1" == "stop" GOTO STOP
IF "%1" == "status" GOTO STATUS
IF "%1" == "deploy" GOTO DEPLOY
GOTO USAGE

:USAGE
echo Application lifecycle management tool
echo Usage: %0 {deploy^|start^|stop^|status}
GOTO :EOF

:DEPLOY
echo Deploying application...
FOR /F %%i IN ('curl -X POST -sL -w %%{http_code} -H "X-Archive-Name: %APP_JAR_NAME%" --data-binary @"%JAR_PATH%" http://localhost:10000/v2/apps') DO SET RESPONSE=%%i
IF  %RESPONSE% == 200  (echo Deployed application
                        GOTO :EOF)

echo Fail to deploy application
GOTO :EOF

:START
CALL :POST %APP_NAME% flows %FLOW_NAME% start
CALL :POST %APP_NAME% procedures %PROCEDURE_NAME% start
GOTO :EOF

:STOP
CALL :POST %APP_NAME% flows %FLOW_NAME% stop
CALL :POST %APP_NAME% procedures %PROCEDURE_NAME% stop
GOTO :EOF

:STATUS
CALL :POST %APP_NAME% flows %FLOW_NAME% status
CALL :POST %APP_NAME% procedures %PROCEDURE_NAME% status
GOTO :EOF

:POST
SET APP=%~1
SET PROGRAM_TYPE=%~2
SET PROGRAM_NAME=%~3
SET ACTION=%~4

echo %ACTION% %PROGRAM_NAME% for application %APP%

FOR /F %%i IN ('curl -X POST -sL -w %%{http_code} http://localhost:10000/v2/apps/%APP%/%PROGRAM_TYPE%/%PROGRAM_NAME%/%ACTION%') DO SET RESPONSE=%%i
IF NOT %RESPONSE% == 200  (
 echo %ACTION% failed
 GOTO :EOF
)
echo %ACTION% successful
GOTO :EOF

:GET
SET APP=%~1
SET PROGRAM_TYPE=%~2
SET PROGRAM_NAME=%~3
SET ACTION=%~4

echo %ACTION% %PROGRAM_NAME% for application %APP%
curl -X GET -sL  http://localhost:10000/v2/apps/%APP%/%PROGRAM_TYPE%/%PROGRAM_NAME%/%ACTION%
echo.
GOTO :EOF

Update bat files

Update bat files


@ECHO off
@TITLE GrinBot

SET root=%~dp0
CD /D %root%

CLS
ECHO Welcome to GrinBot Auto Restart and Update!
ECHO --------------------------------------------
ECHO 1.Update & Start Bot
ECHO 2.Start Bot
ECHO 3.To exit
ECHO.

CHOICE /C 1234 /M "Enter your choice within 15 seconds, will default to 1:" /T 15 /D 1

:: Note - list ERRORLEVELS in decreasing order
IF ERRORLEVEL 3 GOTO exit
IF ERRORLEVEL 2 GOTO autorun
IF ERRORLEVEL 1 GOTO latestar

:latestar
ECHO Auto Restart and Update with Dev Build (latest)
ECHO Bot will auto update on every restart!
timeout /t 3
CD /D %~dp0GrinBot\src\NadekoBot
dotnet run --configuration Release
ECHO Updating...
timeout /t 3
SET "FILENAME=%~dp0\Latest.bat"
bitsadmin.exe /transfer "Downloading GrinBot (Latest)" /priority high https://github.com/Grinjr/NadekoBot/raw/dev/scripts/Latest.bat "%FILENAME%"
ECHO GrinBot Dev Build (latest) downloaded.
SET root=%~dp0
CD /D %root%
CALL Latest.bat
GOTO latestar

:stablear
ECHO Auto Restart and Update with Stable Build
ECHO Bot will auto update on every restart!
timeout /t 3
CD /D %~dp0NadekoBot\src\NadekoBot
dotnet run --configuration Release
ECHO Updating...
timeout /t 3
SET "FILENAME=%~dp0\Stable.bat"
bitsadmin.exe /transfer "Downloading Nadeko (Stable)" /priority high https://github.com/Kwoth/NadekoBot/raw/master/scripts/Stable.bat "%FILENAME%"
ECHO NadekoBot Stable build downloaded.
SET root=%~dp0
CD /D %root%
CALL Stable.bat
GOTO stablear

:autorun
ECHO Normal Auto Restart
ECHO Bot will not auto update on every restart!
timeout /t 3
CD /D %~dp0GrinBot\src\NadekoBot
dotnet run --configuration Release
goto autorun

:Exit
SET root=%~dp0
CD /D %root%
exit
del NadekoAutoRun.bat
CALL NadekoInstaller.bat

@ECHO off
@TITLE GrinBot

SET root=%~dp0
CD /D %root%

CLS
ECHO Welcome to GrinBot Auto Restart and Update!
ECHO --------------------------------------------
ECHO 1.Update ^& Start Bot
ECHO 2.Start Bot
ECHO 3.To exit
ECHO.

CHOICE /C 1234 /M "Enter your choice within 15 seconds, will default to 1:" /T 15 /D 1

:: Note - list ERRORLEVELS in decreasing order
IF ERRORLEVEL 3 GOTO exit
IF ERRORLEVEL 2 GOTO autorun
IF ERRORLEVEL 1 GOTO latestar

:latestar
ECHO Auto Restart and Update with Dev Build (latest)
ECHO Bot will auto update on every restart!
timeout /t 3
CD /D %~dp0GrinBot\src\NadekoBot
dotnet run --configuration Release
ECHO Updating...
timeout /t 3
SET "FILENAME=%~dp0\Latest.bat"
bitsadmin.exe /transfer "Downloading GrinBot (Latest)" /priority high https://github.com/Grinjr/NadekoBot/raw/dev/scripts/Latest.bat "%FILENAME%"
ECHO GrinBot Dev Build (latest) downloaded.
SET root=%~dp0
CD /D %root%
CALL Latest.bat
GOTO latestar

:stablear
ECHO Auto Restart and Update with Stable Build
ECHO Bot will auto update on every restart!
timeout /t 3
CD /D %~dp0NadekoBot\src\NadekoBot
dotnet run --configuration Release
ECHO Updating...
timeout /t 3
SET "FILENAME=%~dp0\Stable.bat"
bitsadmin.exe /transfer "Downloading Nadeko (Stable)" /priority high https://github.com/Kwoth/NadekoBot/raw/master/scripts/Stable.bat "%FILENAME%"
ECHO NadekoBot Stable build downloaded.
SET root=%~dp0
CD /D %root%
CALL Stable.bat
GOTO stablear

:autorun
ECHO Normal Auto Restart
ECHO Bot will not auto update on every restart!
timeout /t 3
CD /D %~dp0GrinBot\src\NadekoBot
dotnet run --configuration Release
goto autorun

:Exit
SET root=%~dp0
CD /D %root%
exit
del NadekoAutoRun.bat
CALL NadekoInstaller.bat

update updater pt 2

update updater pt 2

woops, didn't escape a & character!


@echo off

REM echo --- Environment Variables
REM SET

echo --- Creating Build Environment

REM Returns the location of this file

SET BUILDBOX_DIR=%~dp0

REM Add the BUILDBOX_DIR to the PATH

SET PATH=%PATH%;%BUILDBOX_DIR%

REM Create the build directory

SET SANITIED_PROJECT_SLUG=%BUILDBOX_PROJECT_SLUG:/=\%
SET BUILDBOX_BUILD_DIR=%BUILDBOX_DIR%%BUILDBOX_AGENT_NAME%\%SANITIED_PROJECT_SLUG%

IF NOT EXIST %BUILDBOX_BUILD_DIR% (
  REM Create the build directory

  ECHO ^> MKDIR %BUILDBOX_BUILD_DIR%
  MKDIR %BUILDBOX_BUILD_DIR%
  IF %ERRORLEVEL% NEQ 0 EXIT %ERRORLEVEL%
)

REM Move to the build directory

ECHO ^> CD %BUILDBOX_BUILD_DIR%
CD %BUILDBOX_BUILD_DIR%
IF %ERRORLEVEL% NEQ 0 EXIT %ERRORLEVEL%

REM Do we need to do a git checkout?

IF NOT EXIST ".git" (
  ECHO ^> git clone %BUILDBOX_REPO%
  CALL git clone "%BUILDBOX_REPO%" . -v
  ECHO It was this: %ERRORLEVEL%
  IF %ERRORLEVEL% NEQ 0 EXIT %ERRORLEVEL%
)

REM Clean the repo

ECHO ^> git clean -fdq
CALL git clean -fdq
IF %ERRORLEVEL% NEQ 0 EXIT %ERRORLEVEL%

REM Fetch the latest code

ECHO ^> git fetch -q
CALL git fetch -q
IF %ERRORLEVEL% NEQ 0 EXIT %ERRORLEVEL%

REM Only reset to the branch if we're not on a tag

IF "%BUILDBOX_TAG%" == "" (
  ECHO ^> git reset --hard origin/%BUILDBOX_BRANCH%
  CALL git reset --hard origin/%BUILDBOX_BRANCH%
  IF %ERRORLEVEL% NEQ 0 EXIT %ERRORLEVEL%
)

ECHO ^> git checkout -qf "%BUILDBOX_COMMIT%"
CALL git checkout -qf "%BUILDBOX_COMMIT%"
IF %ERRORLEVEL% NEQ 0 EXIT %ERRORLEVEL%

echo --- Running %BUILDBOX_SCRIPT_PATH%

IF "%BUILDBOX_SCRIPT_PATH%" == "" (
  echo ERROR: No script path has been set for this project. Please go to \"Project Settings\" and add the path to your build script
  exit 1
) ELSE (
  CALL %BUILDBOX_SCRIPT_PATH%
)

@echo off

REM echo --- Environment Variables
REM SET

echo --- Creating Build Environment

REM Returns the location of this file

SET BUILDBOX_DIR=%~dp0

REM Add the BUILDBOX_DIR to the PATH

SET PATH=%PATH%;%BUILDBOX_DIR%

REM Create the build directory

SET SANITIED_PROJECT_SLUG=%BUILDBOX_PROJECT_SLUG:/=\%
SET BUILDBOX_BUILD_DIR=%BUILDBOX_DIR%%BUILDBOX_AGENT_NAME%\%SANITIED_PROJECT_SLUG%

IF NOT EXIST %BUILDBOX_BUILD_DIR% (
  REM Create the build directory

  ECHO ^> MKDIR %BUILDBOX_BUILD_DIR%
  MKDIR %BUILDBOX_BUILD_DIR%
  IF %ERRORLEVEL% NEQ 0 EXIT %ERRORLEVEL%
)

REM Move to the build directory

ECHO ^> CD %BUILDBOX_BUILD_DIR%
CD %BUILDBOX_BUILD_DIR%
IF %ERRORLEVEL% NEQ 0 EXIT %ERRORLEVEL%

REM Do we need to do a git checkout?

IF NOT EXIST ".git" (
  ECHO ^> git clone %BUILDBOX_REPO%
  CALL git clone "%BUILDBOX_REPO%" . -v
  ECHO It was this: %ERRORLEVEL%
  IF %ERRORLEVEL% NEQ 0 EXIT %ERRORLEVEL%
)

REM Clean the repo

ECHO ^> git clean -fdq
CALL git clean -fdq
IF %ERRORLEVEL% NEQ 0 EXIT %ERRORLEVEL%

REM Fetch the latest code

ECHO ^> git fetch -q
CALL git fetch -q
IF %ERRORLEVEL% NEQ 0 EXIT %ERRORLEVEL%

REM Only reset to the branch if we're not on a tag

IF "%BUILDBOX_TAG%" == "" (
  ECHO ^> git reset --hard origin/%BUILDBOX_BRANCH%
  CALL git reset --hard origin/%BUILDBOX_BRANCH%
  IF %ERRORLEVEL% NEQ 0 EXIT %ERRORLEVEL%
)

ECHO ^> git checkout -qf "%BUILDBOX_COMMIT%"
CALL git checkout -qf "%BUILDBOX_COMMIT%"
IF %ERRORLEVEL% NEQ 0 EXIT %ERRORLEVEL%

ECHO --- Running Build Script

IF "%BUILDBOX_SCRIPT_PATH%" == "" (
  echo ERROR: No script path has been set for this project. Please go to \"Project Settings\" and add the path to your build script
  exit 1
) ELSE (
  ECHO ^> CALL %BUILDBOX_SCRIPT_PATH%
  CALL %BUILDBOX_SCRIPT_PATH%
  SET EXIT_STATUS=%ERRORLEVEL%
)

IF NOT "%BUILDBOX_ARTIFACT_PATHS%" == "" (
  REM If you want to upload artifacts to your own server, uncomment the lines below
  REM and replace the AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY with keys to your
  REM own bucket.
  REM
  REM SET AWS_SECRET_ACCESS_KEY=yyy
  REM SET AWS_ACCESS_KEY_ID=xxx
  REM SET AWS_S3_ACL=private
  REM call buildbox-agent artifact upload "%BUILDBOX_ARTIFACT_PATHS%" "s3://name-of-your-s3-bucket/%BUILDBOX_JOB_ID%"

  REM Show the output of the artifact uploder when in debug mode
  IF "%BUILDBOX_AGENT_DEBUG%" == "true" (
    ECHO --- Uploading Artifacts
    ECHO ^> %BUILDBOX_DIR%\buildbox-agent artifact upload "%BUILDBOX_ARTIFACT_PATHS%"
    call %BUILDBOX_DIR%\buildbox-agent artifact upload "%BUILDBOX_ARTIFACT_PATHS%"
    IF %ERRORLEVEL% NEQ 0 EXIT %ERRORLEVEL%
  ) ELSE (
    call %BUILDBOX_DIR%\buildbox-agent artifact upload "%BUILDBOX_ARTIFACT_PATHS%" >&2 nul
    IF %ERRORLEVEL% NEQ 0 EXIT %ERRORLEVEL%
  )
)

EXIT %EXIT_STATUS%

Handle build artifacts in the bootstrap.bat file


cd ..
set "destination=testcoverage"

rmdir /q /s %destination%
mkdir %destination%
cd content/tests
dotnet test /p:AltCover=true /p:AltCoverAssemblyExcludeFilter="xunit"
mv coverage.xml ../../%destination%/coverage.xml

cd ../../%destination%

set "reportgenerator=%UserProfile%\.nuget\packages\reportgenerator\4.3.3\tools\net47\ReportGenerator.exe"
set "targetdir=."

"%reportGenerator%" -reports:coverage.xml -reporttypes:HtmlInline -targetdir:%targetdir%

cd ..
set "destination=testcoverage"

rmdir /q /s %destination%
mkdir %destination%
cd content/tests
dotnet test /p:AltCover=true /p:AltCoverAssemblyExcludeFilter="xunit"
mv coverage.xml ../../%destination%/coverage.xml

cd ../../%destination%

set "reportgenerator=%UserProfile%\.nuget\packages\reportgenerator\4.3.5\tools\net47\ReportGenerator.exe"
set "targetdir=."

"%reportGenerator%" -reports:coverage.xml -reporttypes:HtmlInline -targetdir:%targetdir%

bump to reportgenerator dep to 4.3.5

chore: bump to reportgenerator dep to 4.3.5


@echo off
:##############################################################################
:#                                                                            #
:#  Filename        12.bat	                                              #
:#                                                                            #
:#  Description     Pipe clipboard data through a command and back            #
:#                                                                            #
:#  Notes 	                                                              #
:#                                                                            #
:#  History                                                                   #
:#   2006-10-21 JFL Created this script.		                      #
:#   2014-04-18 JFL Added the new -A options to both 1clip and 2clip, as data #
:#                  from GUI programs is likely to be encoded as ANSI, and    #
:#                  some of my filter programs still only support ANSI data.  #
:#   2017-05-10 JFL Removed the -A options as the filters are now fixed.      #
:#   2017-05-11 JFL Actually, no, the Tcl tools still assume that the input   #
:#                  and output pipes contain ANSI data. But my C tools now    #
:#                  follow cmd.exe's own convention of using the console code #
:#		    page for pipes. So to be compatible with both...          #
:#                  Temporarily change to the system's default ANSI codepage. #
:#                                                                            #
:##############################################################################

setlocal EnableExtensions EnableDelayedExpansion
set "VERSION=2017-05-11"

:# Get the current console code page
for /f "tokens=2 delims=:" %%n in ('chcp') do for %%p in (%%n) do set OLDCP=%%p
:# Get the default system code page
set "KEY=HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Nls\CodePage"
for /f "tokens=3" %%p in ('reg query "%KEY%" /v "ACP" ^| findstr REG_SZ') do set "NEWCP=%%p"
:# Change to the default system code page if needed
if not "%OLDCP%"=="%NEWCP%" chcp %NEWCP% >NUL

1clip | %* | 2clip

:# Return to the initial code page if it was different
if not "%OLDCP%"=="%NEWCP%" chcp %OLDCP% >NUL

@echo off
:##############################################################################
:#                                                                            #
:#  Filename        12.bat	                                              #
:#                                                                            #
:#  Description     Pipe clipboard data through a command and back            #
:#                                                                            #
:#  Notes 	                                                              #
:#                                                                            #
:#  History                                                                   #
:#   2006-10-21 JFL Created this script.		                      #
:#   2014-04-18 JFL Added the new -A options to both 1clip and 2clip, as data #
:#                  from GUI programs is likely to be encoded as ANSI, and    #
:#                  some of my filter programs still only support ANSI data.  #
:#   2017-05-10 JFL Removed the -A options as the filters are now fixed.      #
:#   2017-05-11 JFL Actually, no, the Tcl tools still assume that the input   #
:#                  and output pipes contain ANSI data. But my C tools now    #
:#                  follow cmd.exe's own convention of using the console code #
:#		    page for pipes. So to be compatible with both...          #
:#                  Temporarily change to the system's default ANSI codepage. #
:#   2018-09-11 JFL Use codepage 65001 = UTF-8, to handle all Unicode chars   #
:#                  in the pipe. This is possible now that flipmails.tcl      #
:#                  correctly handles code pages, like my C tools did.        #
:#                                                                            #
:##############################################################################

setlocal EnableExtensions EnableDelayedExpansion
set "VERSION=2018-09-11"

:# Get the current console code page
for /f "tokens=2 delims=:" %%n in ('chcp') do for %%p in (%%n) do set OLDCP=%%p
:# Get the default system code page
:# set "KEY=HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Nls\CodePage"
:# for /f "tokens=3" %%p in ('reg query "%KEY%" /v "ACP" ^| findstr REG_SZ') do set "NEWCP=%%p"
:# Actually use UTF-8 in all cases now
set "NEWCP=65001"
:# Change to the default system code page if needed
if not "%OLDCP%"=="%NEWCP%" chcp %NEWCP% >NUL

1clip | %* | 2clip

:# Return to the initial code page if it was different
if not "%OLDCP%"=="%NEWCP%" chcp %OLDCP% >NUL

Use codepage 65001 = UTF-8, to handle all Unicode characters in the pipe. This is possible now that flipmails.tcl correctly handles code pages, like my C tools did.


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

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

set GOBUILDFAIL=0

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

rem TODO avoid rebuild if possible

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

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

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

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

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

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

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

:: TODO(brainman): disabled, because it fails with: mkdir C:\Users\ADMINI~1\AppData\Local\Temp\2.....\test\bench\: The filename or extension is too long.
::echo # ..\test\bench\go1
::go test ..\test\bench\go1
::if errorlevel 1 goto fail
::echo.

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

:: TODO ..\misc\cgo\stdio

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

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

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

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

echo ALL TESTS PASSED
goto end

:fail
set GOBUILDFAIL=1

:end

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

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

set GOBUILDFAIL=0

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

rem TODO avoid rebuild if possible

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

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

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

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

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

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

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

:: TODO(brainman): disabled, because it fails with: mkdir C:\Users\ADMINI~1\AppData\Local\Temp\2.....\test\bench\: The filename or extension is too long.
::echo # ..\test\bench\go1
::go test ..\test\bench\go1
::if errorlevel 1 goto fail
::echo.

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

:: TODO ..\misc\cgo\stdio

:: TODO(brainman): disabled, because it fails with: mkdir C:\Users\ADMINI~1\AppData\Local\Temp\2.....\go\misc\cgo\: The filename or extension is too long.
::echo # ..\misc\cgo\test
::go test ..\misc\cgo\test
::if errorlevel 1 goto fail
::echo.
:nocgo

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

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

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

echo ALL TESTS PASSED
goto end

:fail
set GOBUILDFAIL=1

:end

misc/cgo/test: disable test on windows (attempt to fix windows build)

see issus 3358 for similar problem

R=golang-dev
CC=golang-dev, minux.ma
http://codereview.appspot.com/6464072


@echo off

call "%~dp0lib_base.cmd"
call "%%~dp0lib_console"
set lib_path=call "%~dp0lib_path.cmd"

if "%~1" == "/h" (
    %lib_base% help "%~0"
) else if "%1" neq "" (
    call :%*
)

exit /b

:enhance_path
:::===============================================================================
:::enhance_path - Add a directory to the path env variable if required.
:::
:::include:
:::
:::  call "lib_path.cmd"
:::
:::usage:
:::
:::  %lib_path% enhance_path "[dir_path]" [append]
:::
:::required:
:::
:::  [dir_path] <in> Fully qualified directory path. Ex: "c:\bin"
:::
:::options:
:::
:::  append     <in> Append to the path env variable rather than pre-pend.
:::
:::output:
:::
:::  path       <out> Sets the path env variable if required.
:::-------------------------------------------------------------------------------

    if "%~1" neq "" (
        set "add_path=%~1"
    ) else (
        %lib_console% show_error "You must specify a directory to add to the path!"
        exit 1
    )

    if "%~2" neq "" if /i "%~2" == "append" (
        set "position=%~2"
    ) else (
        set "position="
    )

    dir "%add_path%" | findstr -i "\.COM \.EXE \.BAT \.CMD \.PS1 \.VBS" >NUL
    if "%ERRORLEVEL%" == "0" (
        set "add_to_path=%add_path%"
    ) else (
        set "add_to_path="
    )

    if "%fast_init%" == "1" (
      if "%position%" == "append" (
        set "PATH=%PATH%;%add_to_path%"
      ) else (
        set "PATH=%add_to_path%;%PATH%"
      )
      goto :end_enhance_path
    ) else if "add_to_path" equ "" (
      goto :end_enhance_path
    )

    set found=0
    set "find_query=%add_to_path%"
    set "find_query=%find_query:\=\\%"
    set "find_query=%find_query: =\ %"
    set OLD_PATH=%PATH%

    setlocal enabledelayedexpansion
    if "%found%" == "0" (
      echo "%path%"|%WINDIR%\System32\findstr >nul /I /R /C:";%find_query%;"
      call :set_found
    )
    %lib_console% debug_output  :enhance_path "Env Var INSIDE PATH %find_query% - found=%found%"

    if /i "%position%" == "append" (
      if "!found!" == "0" (
        echo "%path%"|%WINDIR%\System32\findstr >nul /I /R /C:";%find_query%\"$"
        call :set_found
      )
      %lib_console% debug_output  :enhance_path "Env Var END PATH %find_query% - found=!found!"
    ) else (
      if "!found!" == "0" (
        echo "%path%"|%WINDIR%\System32\findstr >nul /I /R /C:"^\"%find_query%;"
        call :set_found
      )
      %lib_console% debug_output  :enhance_path "Env Var BEGIN PATH %find_query% - found=!found!"
    )
    endlocal & set found=%found%

    if "%found%" == "0" (
        if /i "%position%" == "append" (
            %lib_console% debug_output :enhance_path "Appending '%add_to_path%'"
            set "PATH=%PATH%;%add_to_path%"
        ) else (
            %lib_console% debug_output :enhance_path "Prepending '%add_to_path%'"
            set "PATH=%add_to_path%;%PATH%"
        )

        set found=1
    )

    :end_enhance_path
    set "PATH=%PATH:;;=;%"
    if NOT "%OLD_PATH%" == "%PATH%" (
      %lib_console% debug_output  :enhance_path "END Env Var - PATH=%path%"
      %lib_console% debug_output  :enhance_path "Env Var %find_query% - found=%found%"
    )
    set "position="
    exit /b

:set_found
    if "%ERRORLEVEL%" == "0" (
      set found=1
    )

    exit /b

:enhance_path_recursive
:::===============================================================================
:::enhance_path_recursive - Add a directory and subs to the path env variable if
:::                         required.
:::.
:::include:
:::.
:::  call "$0"
:::.
:::usage:
:::.
:::  call "%~DP0lib_path" enhance_path_recursive "[dir_path]" [max_depth] [append]
:::.
:::required:
:::.
:::  [dir_path] <in> Fully qualified directory path. Ex: "c:\bin"
:::.
:::options:
:::.
:::  [max_depth] <in> Max recuse depth.  Default: 1
:::.
:::  append      <in> Append instead to path env variable rather than pre-pend.
:::.
:::output:
:::.
:::  path       <out> Sets the path env variable if required.
:::-------------------------------------------------------------------------------
    if "%~1" neq "" (
        set "add_path=%~1"
    ) else (
        %lib_console% show_error "You must specify a directory to add to the path!"
        exit 1
    )

    set "depth=%~2"
    set "max_depth=%~3"

    if "%~4" neq "" if /i "%~4" == "append" (
        set "position=%~4"
    ) else (
        set "position="
    )

    dir "%add_path%" >NUL | findstr -i "\.COM \.EXE \.BAT \.CMD \.PS1 \.VBS" >NUL

    if "%ERRORLEVEL%" == "0" (
        set "add_to_path=%add_path%"
    ) else (
        set "add_to_path="
    )

    if "%fast_init%" == "1" (
        if "%add_to_path%" neq "" (
            call :enhance_path "%add_to_path%" %position%
        )
    )

    set "PATH=%PATH:;;=;%"
    if "%fast_init%" == "1" (
      exit /b
    )

    %lib_console% debug_output  :enhance_path_recursive "Env Var - add_path=%add_to_path%"
    %lib_console% debug_output  :enhance_path_recursive "Env Var - position=%position%"
    %lib_console% debug_output  :enhance_path_recursive "Env Var - depth=%depth%"
    %lib_console% debug_output  :enhance_path_recursive "Env Var - max_depth=%max_depth%"

    if %max_depth% gtr %depth% (
        if "%add_to_path%" neq "" (
            %lib_console% debug_output :enhance_path_recursive "Adding parent directory - '%add_to_path%'"
            call :enhance_path "%add_to_path%" %position%
        )
        call :set_depth
        call :loop_depth
    )

    set "PATH=%PATH%"

    exit /b

: set_depth
    set /a "depth=%depth%+1"
    exit /b

:loop_depth
    if %depth% == %max_depth% (
        exit /b
    )

    for /d %%i in ("%add_path%\*") do (
        %lib_console% debug_output  :enhance_path_recursive "Env Var BEFORE - depth=%depth%"
        %lib_console% debug_output :enhance_path_recursive "Found Subdirectory - '%%~fi'"
        call :enhance_path_recursive "%%~fi" %depth% %max_depth% %position%
        %lib_console% debug_output  :enhance_path_recursive "Env Var AFTER- depth=%depth%"
    )
    exit /b

@echo off

call "%~dp0lib_base.cmd"
call "%%~dp0lib_console"
set lib_path=call "%~dp0lib_path.cmd"

if "%~1" == "/h" (
    %lib_base% help "%~0"
) else if "%1" neq "" (
    call :%*
)

exit /b

:enhance_path
:::===============================================================================
:::enhance_path - Add a directory to the path env variable if required.
:::
:::include:
:::
:::  call "lib_path.cmd"
:::
:::usage:
:::
:::  %lib_path% enhance_path "[dir_path]" [append]
:::
:::required:
:::
:::  [dir_path] <in> Fully qualified directory path. Ex: "c:\bin"
:::
:::options:
:::
:::  append     <in> Append to the path env variable rather than pre-pend.
::B
:::
:::output:
:::
:::  path       <out> Sets the path env variable if required.
:::-------------------------------------------------------------------------------

    if "%~1" neq "" (
        set "add_path=%~1"
    ) else (
        %lib_console% show_error "You must specify a directory to add to the path!"
        exit 1
    )

    if "%~2" neq "" if /i "%~2" == "append" (
        set "position=%~2"
    ) else (
        set "position="
    )

    dir "%add_path%" | findstr -i "\.COM \.EXE \.BAT \.CMD \.PS1 \.VBS" >NUL
    if "%ERRORLEVEL%" == "0" (
        set "add_to_path=%add_path%"
    ) else (
        set "add_to_path="
    )

    if "%fast_init%" == "1" (
      if "%position%" == "append" (
        set "PATH=%PATH%;%add_to_path%"
      ) else (
        set "PATH=%add_to_path%;%PATH%"
      )
      goto :end_enhance_path
    ) else if "add_to_path" equ "" (
      goto :end_enhance_path
    )

    set found=0
    set "find_query=%add_to_path%"
    set "find_query=%find_query:\=\\%"
    set "find_query=%find_query: =\ %"
    set OLD_PATH=%PATH%

    setlocal enabledelayedexpansion
    if "%found%" == "0" (
      echo "%path%"|%WINDIR%\System32\findstr >nul /I /R /C:";%find_query%;"
      call :set_found
    )
    %lib_console% debug_output  :enhance_path "Env Var INSIDE PATH %find_query% - found=%found%"

    if /i "%position%" == "append" (
      if "!found!" == "0" (
        echo "%path%"|%WINDIR%\System32\findstr >nul /I /R /C:";%find_query%\"$"
        call :set_found
      )
      %lib_console% debug_output  :enhance_path "Env Var END PATH %find_query% - found=!found!"
    ) else (
      if "!found!" == "0" (
        echo "%path%"|%WINDIR%\System32\findstr >nul /I /R /C:"^\"%find_query%;"
        call :set_found
      )
      %lib_console% debug_output  :enhance_path "Env Var BEGIN PATH %find_query% - found=!found!"
    )
    endlocal & set found=%found%

    if "%found%" == "0" (
        if /i "%position%" == "append" (
            %lib_console% debug_output :enhance_path "Appending '%add_to_path%'"
            set "PATH=%PATH%;%add_to_path%"
        ) else (
            %lib_console% debug_output :enhance_path "Prepending '%add_to_path%'"
            set "PATH=%add_to_path%;%PATH%"
        )

        set found=1
    )

    :end_enhance_path
    set "PATH=%PATH:;;=;%"
    if NOT "%OLD_PATH%" == "%PATH%" (
      %lib_console% debug_output  :enhance_path "END Env Var - PATH=%path%"
      %lib_console% debug_output  :enhance_path "Env Var %find_query% - found=%found%"
    )
    set "position="
    exit /b

:set_found
    if "%ERRORLEVEL%" == "0" (
      set found=1
    )

    exit /b

:enhance_path_recursive
:::===============================================================================
:::enhance_path_recursive - Add a directory and subs to the path env variable if
:::                         required.
:::.
:::include:
:::.
:::  call "$0"
:::.
:::usage:
:::.
:::  call "%~DP0lib_path" enhance_path_recursive "[dir_path]" [max_depth] [append]
:::.
:::required:
:::.
:::  [dir_path] <in> Fully qualified directory path. Ex: "c:\bin"
:::.
:::options:
:::.
:::  [max_depth] <in> Max recuse depth.  Default: 1
:::.
:::  append      <in> Append instead to path env variable rather than pre-pend.
:::.
:::output:
:::.
:::  path       <out> Sets the path env variable if required.
:::-------------------------------------------------------------------------------
    if "%~1" neq "" (
        set "add_path=%~1"
    ) else (
        %lib_console% show_error "You must specify a directory to add to the path!"
        exit 1
    )

    set "depth=%~2"
    set "max_depth=%~3"

    if "%~4" neq "" if /i "%~4" == "append" (
        set "position=%~4"
    ) else (
        set "position="
    )

    dir "%add_path%" 2>NUL | findstr -i "\.COM \.EXE \.BAT \.CMD \.PS1 \.VBS" >NUL

    if "%ERRORLEVEL%" == "0" (
        set "add_to_path=%add_path%"
    ) else (
        set "add_to_path="
    )

    if "%fast_init%" == "1" (
        if "%add_to_path%" neq "" (
            call :enhance_path "%add_to_path%" %position%
        )
    )

    set "PATH=%PATH:;;=;%"
    if "%fast_init%" == "1" (
      exit /b
    )

    %lib_console% debug_output  :enhance_path_recursive "Env Var - add_path=%add_to_path%"
    %lib_console% debug_output  :enhance_path_recursive "Env Var - position=%position%"
    %lib_console% debug_output  :enhance_path_recursive "Env Var - depth=%depth%"
    %lib_console% debug_output  :enhance_path_recursive "Env Var - max_depth=%max_depth%"

    if %max_depth% gtr %depth% (
        if "%add_to_path%" neq "" (
            %lib_console% debug_output :enhance_path_recursive "Adding parent directory - '%add_to_path%'"
            call :enhance_path "%add_to_path%" %position%
        )
        call :set_depth
        call :loop_depth
    )

    set "PATH=%PATH%"

    exit /b

: set_depth
    set /a "depth=%depth%+1"
    exit /b

:loop_depth
    if %depth% == %max_depth% (
        exit /b
    )

    for /d %%i in ("%add_path%\*") do (
        %lib_console% debug_output  :enhance_path_recursive "Env Var BEFORE - depth=%depth%"
        %lib_console% debug_output :enhance_path_recursive "Found Subdirectory - '%%~fi'"
        call :enhance_path_recursive "%%~fi" %depth% %max_depth% %position%
        %lib_console% debug_output  :enhance_path_recursive "Env Var AFTER- depth=%depth%"
    )
    exit /b

fix lib_path

fix lib_path


MSBuild.exe ../Mappy.sln /p:Configuration=Release /t:Clean,Build && python MakeReleaseZip.py --release
@pause

"C:/Program Files (x86)/MSBuild/14.0/bin/amd64/MSBuild.exe" ../Mappy.sln /p:Configuration=Release /t:Clean,Build && python MakeReleaseZip.py --release
@pause

Use absolute path to MSBuild in release script


:: Windows Installer for Simple 2D
::   This script will install includes, libraries, and DLLs for
::   building Simple 2D apps.

@echo off

echo.
echo Simple 2D and its dependencies will be installed to:
echo   %%LOCALAPPDATA%%\simple2d
echo   Resolving to %LOCALAPPDATA%\simple2d
echo.

set INPUT=
set /p INPUT=Continue? (y/n) %=%
if /i "%INPUT%"=="y" goto yes
echo.
echo Quitting...
timeout 3
exit /b 0

:yes
echo. & echo Copying... & echo.
set S2D_DIR=%LOCALAPPDATA%\simple2d
if not exist %S2D_DIR% mkdir %S2D_DIR%
xcopy /e /y simple2d\* %S2D_DIR%

echo.
echo Simple 2D installed successfully!
echo Remember to add %%LOCALAPPDATA%%\simple2d to your %%PATH%%
echo.
pause

Add Visual C++ installation script

Add Visual C++ installation script

This will be packaged with each release. This will install everything
needed to build Simple 2D apps using Visual C++, installed to
`%LOCALAPPDATA%\simple2d`.


set RINGQT_ANDROID=1
ring ..\codegen\parsec.ring qt.cf ring_qt.cpp ring_qt.ring
ring qtevents.ring
copy *.cpp ..\..\android\ringqt\project
copy *.h ..\..\android\ringqt\project
copy qt.cf ..\..\android\ringqt\project
copy ring_qt.ring ..\..\android\ringqt\project

Update RingQt - gencodeandroid.bat

Update RingQt - gencodeandroid.bat


@echo off

echo.
echo == Copy
echo.

set ZIP="..\build-tools\7zip\7za.exe"
set EXTRACTED_DIR="..\extracted"
set TARGET_DIR="..\repackage"

echo.
echo === Prepare repackaging folder %TARGET_DIR%
echo.

pushd extracted

if not exist %TARGET_DIR% (mkdir %TARGET_DIR%)

echo.
echo === Copying/Moving Build Tools into the folder %TARGET_DIR%
echo.

echo CMake
move "%EXTRACTED_DIR%\cmake" "%TARGET_DIR%"

echo Swig
move "%EXTRACTED_DIR%\swig" "%TARGET_DIR%"

echo Python27
rem include Python from Appveyor
xcopy /SIQY C:\Python27 "%TARGET_DIR%\Python27"

echo Python27.dll
rem add the mising python27.dll to the python folder
copy C:\Windows\SysWOW64\python27.dll "%TARGET_DIR%\Python27"

echo Copy needed dlls vcruntime140.dll msvcp140.dll
copy "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\redist\x86\Microsoft.VC140.CRT\vcruntime140.dll" "%TARGET_DIR%\Python27\Lib\site-packages\fife\vcruntime140.dll"
copy "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\redist\x86\Microsoft.VC140.CRT\msvcp140.dll" "%TARGET_DIR%\Python27\Lib\site-packages\fife\msvcp140.dll"

rem echo Python35
rem include Python from Appveyor
rem xcopy /SIQY C:\Python35 "%TARGET_DIR%\Python35"

rem echo TDM-GCC-MINGW
rem move "%EXTRACTED_DIR%\mingw" "%TARGET_DIR%"

echo.
echo === Copying/Moving Fifengine Dependencies into the folder %TARGET_DIR%
echo.

echo Fifengine Dependencies
move "%EXTRACTED_DIR%\fifengine-includes" "%TARGET_DIR%"

echo Fifengine Python27 Installer
move "%EXTRACTED_DIR%\libfife.win32-py2.7.msi" "%TARGET_DIR%"

rem echo Fifengine Python34 Installer
rem move "%EXTRACTED_DIR%\libfife.win32-py3.4.msi" "%TARGET_DIR%"

echo Fifengine Mapeditor
move "%EXTRACTED_DIR%\fifengine-editor-master" "%TARGET_DIR%\mapeditor"

echo Fifengine Python Demos
move "%EXTRACTED_DIR%\fifengine-demos-master" "%TARGET_DIR%\python-demos"

echo Fifengine Python Tutorials
move "%EXTRACTED_DIR%\python-tutorials-master" "%TARGET_DIR%\python-tutorials"

rem echo Fifengine C++ Tutorials
rem move "%EXTRACTED_DIR%\cpp-tutorials-master" "%TARGET_DIR%\cpp-tutorials"

rem echo Fifengine Atlas Creator
rem move "%EXTRACTED_DIR%\fifengine-atlas-creator*" "%TARGET_DIR%\atlascreator"

rem echo Fifengine Documentations
rem move "%EXTRACTED_DIR%\*.pdf" "%TARGET_DIR%\docs"

popd

@echo off

echo.
echo == Copy
echo.

set ZIP="..\build-tools\7zip\7za.exe"
set EXTRACTED_DIR="..\extracted"
set TARGET_DIR="..\repackage"

echo.
echo === Prepare repackaging folder %TARGET_DIR%
echo.

pushd extracted

if not exist %TARGET_DIR% (mkdir %TARGET_DIR%)

echo.
echo === Copying/Moving Build Tools into the folder %TARGET_DIR%
echo.

echo CMake
move "%EXTRACTED_DIR%\cmake" "%TARGET_DIR%"

echo Swig
move "%EXTRACTED_DIR%\swig" "%TARGET_DIR%"

echo Python27
rem include Python from Appveyor
xcopy /SIQY C:\Python27 "%TARGET_DIR%\Python27"

echo Python27.dll
rem add the mising python27.dll to the python folder
copy C:\Windows\SysWOW64\python27.dll "%TARGET_DIR%\Python27"

echo Copy needed dlls vcruntime140.dll msvcp140.dll
mkdir "%TARGET_DIR%\Python27\Lib\site-packages\fife"
copy "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\redist\x86\Microsoft.VC140.CRT\vcruntime140.dll" "%TARGET_DIR%\Python27\Lib\site-packages\fife\vcruntime140.dll"
copy "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\redist\x86\Microsoft.VC140.CRT\msvcp140.dll" "%TARGET_DIR%\Python27\Lib\site-packages\fife\msvcp140.dll"

rem echo Python35
rem include Python from Appveyor
rem xcopy /SIQY C:\Python35 "%TARGET_DIR%\Python35"

rem echo TDM-GCC-MINGW
rem move "%EXTRACTED_DIR%\mingw" "%TARGET_DIR%"

echo.
echo === Copying/Moving Fifengine Dependencies into the folder %TARGET_DIR%
echo.

echo Fifengine Dependencies
move "%EXTRACTED_DIR%\fifengine-includes" "%TARGET_DIR%"

echo Fifengine Python27 Installer
move "%EXTRACTED_DIR%\libfife.win32-py2.7.msi" "%TARGET_DIR%"

rem echo Fifengine Python34 Installer
rem move "%EXTRACTED_DIR%\libfife.win32-py3.4.msi" "%TARGET_DIR%"

echo Fifengine Mapeditor
move "%EXTRACTED_DIR%\fifengine-editor-master" "%TARGET_DIR%\mapeditor"

echo Fifengine Python Demos
move "%EXTRACTED_DIR%\fifengine-demos-master" "%TARGET_DIR%\python-demos"

echo Fifengine Python Tutorials
move "%EXTRACTED_DIR%\python-tutorials-master" "%TARGET_DIR%\python-tutorials"

rem echo Fifengine C++ Tutorials
rem move "%EXTRACTED_DIR%\cpp-tutorials-master" "%TARGET_DIR%\cpp-tutorials"

rem echo Fifengine Atlas Creator
rem move "%EXTRACTED_DIR%\fifengine-atlas-creator*" "%TARGET_DIR%\atlascreator"

rem echo Fifengine Documentations
rem move "%EXTRACTED_DIR%\*.pdf" "%TARGET_DIR%\docs"

popd

fix build

fix build


mongoimport -d segmentationExample -c initial --type csv --file ..\Step1\CSVInKeys.csv --headerline

mongoimport --drop -d segmentationExample -c initial --type csv --file ..\Step1\CSVInKeys.csv --headerline

Make a drop before import the data

Make a drop before import the data


echo off
REM
REM This batch file builds both 32-bit and 64-bit versions of the loader.
REM It is assumed that the developer has run the update_external_sources.bat
REM file prior to running this.
REM

REM Determine the appropriate CMake strings for the current version of Visual Studio
echo Determining VS version
python .\determine_vs_version.py > vsversion.tmp
set /p VS_VERSION=< vsversion.tmp
echo Detected Visual Studio Version as %VS_VERSION%

REM Cleanup the file we used to collect the VS version output since it's no longer needed.
del /Q /F vsversion.tmp

rmdir /Q /S build
rmdir /Q /S build32

REM *******************************************
REM 64-bit LoaderAndTools build
REM *******************************************
mkdir build
pushd build

echo Generating 64-bit spirv-tools CMake files for Visual Studio %VS_VERSION%
cmake -G "Visual Studio %VS_VERSION% Win64" ..

echo Building 64-bit Debug LoaderAndTools
msbuild ALL_BUILD.vcxproj /p:Platform=x64 /p:Configuration=Debug /verbosity:quiet

REM Check for existence of one DLL, even though we should check for all results
if not exist .\loader\Debug\vulkan-1.dll (
   echo.
   echo LoaderAndTools 64-bit Debug build failed!
   set errorCode=1
)

echo Building 64-bit Release LoaderAndTools
msbuild ALL_BUILD.vcxproj /p:Platform=x64 /p:Configuration=Release /verbosity:quiet

REM Check for existence of one DLL, even though we should check for all results
if not exist .\loader\Release\vulkan-1.dll (
   echo.
   echo LoaderAndTools 64-bit Release build failed!
   set errorCode=1
)

popd

REM *******************************************
REM 32-bit LoaderAndTools build
REM *******************************************
mkdir build32
pushd build32

echo Generating 32-bit LoaderAndTools CMake files for Visual Studio %VS_VERSION%
cmake -G "Visual Studio %VS_VERSION%" ..

echo Building 32-bit Debug LoaderAndTools
msbuild ALL_BUILD.vcxproj /p:Platform=x86 /p:Configuration=Debug /verbosity:quiet

REM Check for existence of one DLL, even though we should check for all results
if not exist .\loader\Debug\vulkan-1.dll (
   echo.
   echo LoaderAndTools 32-bit Debug build failed!
   set errorCode=1
)

echo Building 32-bit Release LoaderAndTools
msbuild ALL_BUILD.vcxproj /p:Platform=x86 /p:Configuration=Release /verbosity:quiet

REM Check for existence of one DLL, even though we should check for all results
if not exist .\loader\Release\vulkan-1.dll (
   echo.
   echo LoaderAndTools 32-bit Release build failed!
   set errorCode=1
)

popd

echo off
REM
REM This batch file builds both 32-bit and 64-bit versions of the loader.
REM It is assumed that the developer has run the update_external_sources.bat
REM file prior to running this.
REM

REM Determine the appropriate CMake strings for the current version of Visual Studio
echo Determining VS version
python .\determine_vs_version.py > vsversion.tmp
set /p VS_VERSION=< vsversion.tmp
echo Detected Visual Studio Version as %VS_VERSION%

REM Cleanup the file we used to collect the VS version output since it's no longer needed.
del /Q /F vsversion.tmp

rmdir /Q /S build
rmdir /Q /S build32

REM *******************************************
REM 64-bit Samples build
REM *******************************************
mkdir build
pushd build

echo Generating 64-bit spirv-tools CMake files for Visual Studio %VS_VERSION%
cmake -G "Visual Studio %VS_VERSION% Win64" ..

echo Building 64-bit Debug Samples
REM msbuild doesn't seem to see the dependency between the Overlay sample and layer_utils
cd layers
msbuild generate_vk_layer_helpers.vcxproj /p:Platform=x64 /p:Configuration=Debug /verbosity:quiet
msbuild layer_utils_static.vcxproj /p:Platform=x64 /p:Configuration=Debug /verbosity:quiet
cd ..
msbuild ALL_BUILD.vcxproj /p:Platform=x64 /p:Configuration=Debug /verbosity:quiet

REM Check for existence of one DLL, even though we should check for all results
if not exist .\loader\Debug\vulkan-1.dll (
   echo.
   echo Samples 64-bit Debug build failed!
   set errorCode=1
)

echo Building 64-bit Release Samples
REM msbuild doesn't seem to see the dependency between the Overlay sample and layer_utils
cd layers
msbuild generate_vk_layer_helpers.vcxproj /p:Platform=x64 /p:Configuration=Release /verbosity:quiet
msbuild layer_utils_static.vcxproj /p:Platform=x64 /p:Configuration=Release /verbosity:quiet
cd ..
msbuild ALL_BUILD.vcxproj /p:Platform=x64 /p:Configuration=Release /verbosity:quiet

REM Check for existence of one DLL, even though we should check for all results
if not exist .\loader\Release\vulkan-1.dll (
   echo.
   echo Samples 64-bit Release build failed!
   set errorCode=1
)

popd

REM *******************************************
REM 32-bit Samples build
REM *******************************************
mkdir build32
pushd build32

echo Generating 32-bit Samples CMake files for Visual Studio %VS_VERSION%
cmake -G "Visual Studio %VS_VERSION%" ..

echo Building 32-bit Debug Samples
REM msbuild doesn't seem to see the dependency between the Overlay sample and layer_utils
cd layers
msbuild generate_vk_layer_helpers.vcxproj /p:Platform=x86 /p:Configuration=Debug /verbosity:quiet
msbuild layer_utils_static.vcxproj /p:Platform=x86 /p:Configuration=Debug /verbosity:quiet
cd ..
msbuild ALL_BUILD.vcxproj /p:Platform=x86 /p:Configuration=Debug /verbosity:quiet

REM Check for existence of one DLL, even though we should check for all results
if not exist .\loader\Debug\vulkan-1.dll (
   echo.
   echo Samples 32-bit Debug build failed!
   set errorCode=1
)

echo Building 32-bit Release Samples
REM msbuild doesn't seem to see the dependency between the Overlay sample and layer_utils
cd layers
msbuild generate_vk_layer_helpers.vcxproj /p:Platform=x86 /p:Configuration=Release /verbosity:quiet
msbuild layer_utils_static.vcxproj /p:Platform=x86 /p:Configuration=Release /verbosity:quiet
cd ..
msbuild ALL_BUILD.vcxproj /p:Platform=x86 /p:Configuration=Release /verbosity:quiet

REM Check for existence of one DLL, even though we should check for all results
if not exist .\loader\Release\vulkan-1.dll (
   echo.
   echo Samples 32-bit Release build failed!
   set errorCode=1
)

popd

Fix windows build script to accomodate Overlay layer dependency

Change-Id: I6456b28f448f029c9afeca52f03b8c32307f1eaa


Set Book=%BookName%%1
Call Generate %Book% name SongTi FontSize48
Call Generate %Book% name KaiTi FontSize48
:: Call Generate %Book% name QuanZiKuFont FontSize48

:: The following fonts generated unreadable characters.
:: Call Generate %Book% name FangSong FontSize48
:: Call Generate %Book% name KaiTi FontSize48

:: The following fonts generated incomplete text.
REM Call Generate %Book% name BeiShiDaFont FontSize48
REM Call Generate %Book% name JinWen FontSize48
REM Call Generate %Book% name LiShu FontSize48
REM Call Generate %Book% name JiaGuWen FontSize48

Set Destination=%OutputFolder%\%1
RmDir %Destinaton% /s /q
MkDir %Destinaton%
Move /Y %Book%*.pdf %Destinaton%

Set Book=%BookName%%1
Call Generate %Book% name SongTi FontSize48
Call Generate %Book% name KaiTi FontSize48
:: Call Generate %Book% name QuanZiKuFont FontSize48

:: The following fonts generated unreadable characters.
:: Call Generate %Book% name FangSong FontSize48
:: Call Generate %Book% name KaiTi FontSize48

:: The following fonts generated incomplete text.
REM Call Generate %Book% name BeiShiDaFont FontSize48
REM Call Generate %Book% name JinWen FontSize48
REM Call Generate %Book% name LiShu FontSize48
REM Call Generate %Book% name JiaGuWen FontSize48

Set Destination=%OutputFolder%\%1
RmDir %Destination% /s /q
MkDir %Destination%
Move /Y %Book%*.pdf %Destination%

Fix typo

Fix typo


SET GOPATH=%CD%\cf-release-repo
SET GATSPATH=%GOPATH%\src\github.com\cloudfoundry\cf-acceptance-tests

SET PATH=C:\Go\bin;%PATH%
SET PATH=C:\Program Files\Git\cmd\;%PATH%
SET PATH=%CD%\cf-release-repo\bin;%PATH%
SET PATH=C:\Program Files\GnuWin32\bin;%PATH%
SET PATH=C:\Program Files\cURL\bin;%PATH%
SET PATH=%CD%;%PATH%

SET /p DOMAIN=<%CD%\bosh-lite-lock\name
call %CD%\cli\ci\tasks\create-cats-config.bat
SET CONFIG=%CD%\config.json

go get -v github.com/onsi/ginkgo/ginkgo

pushd %CD%\cf-cli-binaries
	gzip -d cf-cli-binaries.tgz
	tar -xvf cf-cli-binaries.tar
	MOVE %CD%\cf-cli_winx64.exe ..\cf.exe
	dir ..
popd

go get -v github.com/onsi/ginkgo/ginkgo

cd %GATSPATH%
ginkgo.exe -r -slowSpecThreshold=120 -skipPackage="logging,services,v3,routing_api,routing,backend_compatibility,ssh" -skip="NO_DEA_SUPPORT|go makes the app reachable via its bound route|SSO|takes effect after a restart, not requiring a push|doesn't die when printing 32MB|exercises basic loggregator|firehose data|Downloads the droplet for the app" -nodes=2

SET GOPATH=%CD%\cf-release-repo
SET GATSPATH=%GOPATH%\src\github.com\cloudfoundry\cf-acceptance-tests

SET PATH=C:\Go\bin;%PATH%
SET PATH=C:\Program Files\Git\cmd\;%PATH%
SET PATH=%CD%\cf-release-repo\bin;%PATH%
SET PATH=C:\Program Files\7-Zip;%PATH%
SET PATH=C:\Program Files\cURL\bin;%PATH%
SET PATH=%CD%;%PATH%

SET /p DOMAIN=<%CD%\bosh-lite-lock\name
call %CD%\cli\ci\tasks\create-cats-config.bat
SET CONFIG=%CD%\config.json

go get -v github.com/onsi/ginkgo/ginkgo

pushd %CD%\cf-cli-binaries
	7z x cf-cli-binaries.tgz
	7z x cf-cli-binaries.tar
	MOVE %CD%\cf-cli_winx64.exe ..\cf.exe
	dir ..
popd

go get -v github.com/onsi/ginkgo/ginkgo

cd %GATSPATH%
ginkgo.exe -r -slowSpecThreshold=120 -skipPackage="logging,services,v3,routing_api,routing,backend_compatibility,ssh" -skip="NO_DEA_SUPPORT|go makes the app reachable via its bound route|SSO|takes effect after a restart, not requiring a push|doesn't die when printing 32MB|exercises basic loggregator|firehose data|Downloads the droplet for the app" -nodes=2

swap GnuWin32 with 7zip, cuz sourceforge is broke


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

set SOURCE_DIR=%CD%
set ZLIB_ZIP=%CD%\cppbuild\zlib1211.zip
set BUILD_DIR=%CD%\cppbuild\Release
set ZLIB_BUILD_DIR=%BUILD_DIR%\zlib-build
set ZLIB_INSTALL_DIR=%BUILD_DIR%\zlib64
set EXTRA_CMAKE_ARGS=-DAERON_SYSTEM_TESTS=OFF

for %%o in (%*) do (

    set PROCESSED=0

    if "%%o"=="--help" (
        echo cppbuild-vs.cmd [--c-warnings-as-errors] [--cxx-warnings-as-errors] [--build-aeron-driver]
        exit /b
    )

    if "%%o"=="--c-warnings-as-errors" (
        set EXTRA_CMAKE_ARGS=!EXTRA_CMAKE_ARGS! -DC_WARNINGS_AS_ERRORS=ON
        set PROCESSED=1
    )

    if "%%o"=="--cxx-warnings-as-errors" (
        set EXTRA_CMAKE_ARGS=!EXTRA_CMAKE_ARGS! -DCXX_WARNINGS_AS_ERRORS=ON
        set PROCESSED=1
    )

    if "%%o"=="--build-aeron-driver" (
        echo "Enabling building of aeron driver is now the default"
        set PROCESSED=1
    )

    if "%%o"=="--link-samples-client-shared" (
        set EXTRA_CMAKE_ARGS=!EXTRA_CMAKE_ARGS! -DLINK_SAMPLES_CLIENT_SHARED=ON
        set PROCESSED=1
    )
)

call cppbuild\vs-helper.cmd
if %ERRORLEVEL% neq 0 exit /b %ERRORLEVEL%

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

md %BUILD_DIR%
pushd %BUILD_DIR%
md %ZLIB_BUILD_DIR%
pushd %ZLIB_BUILD_DIR%
7z x %ZLIB_ZIP%
pushd zlib-1.2.11
md build
pushd build

cmake -DCMAKE_INSTALL_PREFIX=%ZLIB_INSTALL_DIR% ..
if %ERRORLEVEL% neq 0 exit /b %ERRORLEVEL%

cmake --build . --config Release --target install
if %ERRORLEVEL% neq 0 exit /b %ERRORLEVEL%

pushd %BUILD_DIR%
cmake %EXTRA_CMAKE_ARGS% %SOURCE_DIR%
if %ERRORLEVEL% neq 0 exit /b %ERRORLEVEL%

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

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

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

set "DIR=%~dp0"
set "SOURCE_DIR=%DIR%\.."
set "BUILD_DIR=%DIR%\Release"
set "BUILD_CONFIG=Release"
set "ZLIB_ZIP=%DIR%\zlib1211.zip"
set "ZLIB_BUILD_DIR=%BUILD_DIR%\zlib-build"
set "ZLIB_INSTALL_DIR=%BUILD_DIR%\zlib64"
set "EXTRA_CMAKE_ARGS="

for %%o in (%*) do (

    if "%%o"=="--help" (
        echo %0 [--c-warnings-as-errors] [--cxx-warnings-as-errors] [--build-aeron-driver] [--link-samples-client-shared] [--build-archive-api] [--no-system-tests] [--debug-build] [--help]
        exit /b
    )

    if "%%o"=="--c-warnings-as-errors" (
        set "EXTRA_CMAKE_ARGS=!EXTRA_CMAKE_ARGS! -DC_WARNINGS_AS_ERRORS=ON"
    )

    if "%%o"=="--cxx-warnings-as-errors" (
        set "EXTRA_CMAKE_ARGS=!EXTRA_CMAKE_ARGS! -DCXX_WARNINGS_AS_ERRORS=ON"
    )

    if "%%o"=="--build-aeron-driver" (
        echo "Enabling building of aeron driver is now the default"
    )

    if "%%o"=="--link-samples-client-shared" (
        set "EXTRA_CMAKE_ARGS=!EXTRA_CMAKE_ARGS! -DLINK_SAMPLES_CLIENT_SHARED=ON"
    )

    if "%%o"=="--build-archive-api" (
        set "EXTRA_CMAKE_ARGS=!EXTRA_CMAKE_ARGS! -DBUILD_AERON_ARCHIVE_API=ON"
    )

    if "%%o"=="--no-system-tests" (
        set "EXTRA_CMAKE_ARGS=!EXTRA_CMAKE_ARGS! -DAERON_SYSTEM_TESTS=OFF"
    )

    if "%%o"=="--debug-build" (
        set "EXTRA_CMAKE_ARGS=!EXTRA_CMAKE_ARGS! -DCMAKE_BUILD_TYPE=Debug"
        set "BUILD_DIR=%DIR%\Debug"
        set "BUILD_CONFIG=Debug"
    )
)

call %DIR%\vs-helper.cmd
if %ERRORLEVEL% neq 0 exit /b %ERRORLEVEL%

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

md %BUILD_DIR%
pushd %BUILD_DIR%
md %ZLIB_BUILD_DIR%
pushd %ZLIB_BUILD_DIR%
7z x %ZLIB_ZIP%
pushd zlib-1.2.11
md build
pushd build

cmake -DCMAKE_INSTALL_PREFIX=%ZLIB_INSTALL_DIR% ..
if %ERRORLEVEL% neq 0 exit /b %ERRORLEVEL%

cmake --build . --config Release --target install
if %ERRORLEVEL% neq 0 exit /b %ERRORLEVEL%

pushd %BUILD_DIR%
cmake %EXTRA_CMAKE_ARGS% %SOURCE_DIR%
if %ERRORLEVEL% neq 0 exit /b %ERRORLEVEL%

cmake --build . --config %BUILD_CONFIG%
if %ERRORLEVEL% neq 0 exit /b %ERRORLEVEL%

ctest -C %BUILD_CONFIG% --output-on-failure
if %ERRORLEVEL% neq 0 exit /b %ERRORLEVEL%

[C] Enable system tests on Windows and add missing build options.