@echo off
setlocal
if exist coverage.bat goto ok
echo coverage.bat must be run from its folder
goto end
: ok

call env.bat

if not exist test_temp mkdir test_temp

if exist .\test_temp\coverage.out  del .\test_temp\coverage.out
if exist .\test_temp\coverage.html del .\test_temp\coverage.html

for /f %%d in ('go list ./...^|findstr -v "github"') do (
	if exist .\test_temp\coverage.out (
		go test -coverprofile=./test_temp/coverage1.out %%d
		if exist .\test_temp\coverage1.out (
			findstr -v "mode": .\test_temp\coverage1.out >> .\test_temp\coverage.out
			@echo off
			del .\test_temp\coverage1.out
		)
	) else (
		go test -coverprofile=./test_temp/coverage.out %%d
	)
)

go tool cover -html=./test_temp/coverage.out -o ./test_temp/coverage.html
if exist .\test_temp\coverage.html (
	.\test_temp\coverage.html
)

:end
echo finished

@echo off
setlocal
if exist coverage.bat goto ok
echo coverage.bat must be run from its folder
goto end
: ok

call env.bat

if not exist test_temp mkdir test_temp

if exist .\test_temp\coverage.out  del .\test_temp\coverage.out
if exist .\test_temp\coverage.html del .\test_temp\coverage.html

for /f %%d in ('go list ./...^|findstr -v "github"') do (
	if exist .\test_temp\coverage.out (
		go test -coverprofile=./test_temp/coverage1.out %%d
		if exist .\test_temp\coverage1.out (
			findstr -v "mode": .\test_temp\coverage1.out >> .\test_temp\coverage.out
			@echo off
			del .\test_temp\coverage1.out
		)
	) else (
		go test -coverprofile=./test_temp/coverage.out %%d
	)
)

go tool cover -func=./test_temp/coverage.out -o ./test_temp/coverage.txt
findstr "total" .\test_temp\coverage.txt >> .\test_temp\coverage2.txt
del .\test_temp\coverage.txt

for /f "tokens=1,2,3 delims=	" %%a in (.\test_temp\coverage2.txt) do (
    echo %%a %%c of statements
)
del .\test_temp\coverage2.txt

go tool cover -html=./test_temp/coverage.out -o ./test_temp/coverage.html
if exist .\test_temp\coverage.html (
	.\test_temp\coverage.html
)

:end
echo finished

modify coverage_all.bat

modify coverage_all.bat


:<<"::CMDLITERAL"
@ECHO OFF
SET MASTHEADURL=http://%1:52311/masthead/masthead.afxm
ECHO

REM http://stackoverflow.com/questions/4781772/how-to-test-if-an-executable-exists-in-the-path-from-a-windows-batch-file
where /q powershell || ECHO Cound not find powershell. && EXIT /B

powershell -command "& { (New-Object Net.WebClient).DownloadFile('http://software.bigfix.com/download/bes/95/BigFix-BES-Client-9.5.1.9.exe', 'c:\Windows\Temp\BESClient.exe') }" -ExecutionPolicy Bypass
powershell -command "& { (New-Object Net.WebClient).DownloadFile('%MASTHEADURL%', 'c:\Windows\Temp\actionsite.afxm') }" -ExecutionPolicy Bypass

REM https://www.ibm.com/developerworks/community/wikis/home?lang=en#!/wiki/Tivoli%20Endpoint%20Manager/page/Configuration%20Settings
REM https://gist.github.com/jgstew/51a99ab4b5997efa0318
ECHO "" > C:\Windows\Temp\clientsettings.cfg
ECHO "_BESClient_RelaySelect_FailoverRelay=http://%1:port/bfmirror/downloads/" >> C:\Windows\Temp\clientsettings.cfg
ECHO "_BESClient_Resource_StartupNormalSpeed=1" >> C:\Windows\Temp\clientsettings.cfg
ECHO "_BESClient_Download_RetryMinutes=1" >> C:\Windows\Temp\clientsettings.cfg
ECHO "_BESClient_Resource_WorkIdle=20" >> C:\Windows\Temp\clientsettings.cfg
ECHO "_BESClient_Resource_SleepIdle=500" >> C:\Windows\Temp\clientsettings.cfg
ECHO "_BESClient_Comm_CommandPollEnable=1" >> C:\Windows\Temp\clientsettings.cfg
ECHO "_BESClient_Comm_CommandPollIntervalSeconds=10800" >> C:\Windows\Temp\clientsettings.cfg
ECHO "_BESClient_Log_Days=30" >> C:\Windows\Temp\clientsettings.cfg
ECHO "_BESClient_Download_UtilitiesCacheLimitMB=500" >> C:\Windows\Temp\clientsettings.cfg
ECHO "_BESClient_Download_DownloadsCacheLimitMB=5000" >> C:\Windows\Temp\clientsettings.cfg
ECHO "_BESClient_Download_MinimumDiskFreeMB=2000" >> C:\Windows\Temp\clientsettings.cfg

ECHO I am %COMSPEC%
ECHO put CMD/BAT lines in here.
ECHO %0
ECHO %1
ECHO %MASTHEADURL%

PAUSE
EXIT
::CMDLITERAL

:<<"::CMDLITERAL"
@ECHO OFF
SET MASTHEADURL=http://%1:52311/masthead/masthead.afxm
ECHO

REM http://stackoverflow.com/questions/4781772/how-to-test-if-an-executable-exists-in-the-path-from-a-windows-batch-file
where /q powershell || ECHO Cound not find powershell. && EXIT /B

powershell -command "& { (New-Object Net.WebClient).DownloadFile('http://software.bigfix.com/download/bes/95/BigFix-BES-Client-9.5.1.9.exe', 'c:\Windows\Temp\BESClient.exe') }" -ExecutionPolicy Bypass
powershell -command "& { (New-Object Net.WebClient).DownloadFile('%MASTHEADURL%', 'c:\Windows\Temp\actionsite.afxm') }" -ExecutionPolicy Bypass

REM https://www.ibm.com/developerworks/community/wikis/home?lang=en#!/wiki/Tivoli%20Endpoint%20Manager/page/Configuration%20Settings
REM https://gist.github.com/jgstew/51a99ab4b5997efa0318
ECHO "" > C:\Windows\Temp\clientsettings.cfg
ECHO "_BESClient_RelaySelect_FailoverRelay=http://%1:port/bfmirror/downloads/" >> C:\Windows\Temp\clientsettings.cfg
ECHO "_BESClient_Resource_StartupNormalSpeed=1" >> C:\Windows\Temp\clientsettings.cfg
ECHO "_BESClient_Download_RetryMinutes=1" >> C:\Windows\Temp\clientsettings.cfg
ECHO "_BESClient_Resource_WorkIdle=20" >> C:\Windows\Temp\clientsettings.cfg
ECHO "_BESClient_Resource_SleepIdle=500" >> C:\Windows\Temp\clientsettings.cfg
ECHO "_BESClient_Comm_CommandPollEnable=1" >> C:\Windows\Temp\clientsettings.cfg
ECHO "_BESClient_Comm_CommandPollIntervalSeconds=10800" >> C:\Windows\Temp\clientsettings.cfg
ECHO "_BESClient_Log_Days=30" >> C:\Windows\Temp\clientsettings.cfg
ECHO "_BESClient_Download_UtilitiesCacheLimitMB=500" >> C:\Windows\Temp\clientsettings.cfg
ECHO "_BESClient_Download_DownloadsCacheLimitMB=5000" >> C:\Windows\Temp\clientsettings.cfg
ECHO "_BESClient_Download_MinimumDiskFreeMB=2000" >> C:\Windows\Temp\clientsettings.cfg
ECHO "" >> C:\Windows\Temp\clientsettings.cfg

ECHO I am %COMSPEC%
ECHO put CMD/BAT lines in here.
ECHO %0
ECHO %1
ECHO %MASTHEADURL%

PAUSE
EXIT
::CMDLITERAL

Update install_bigfix.bat

Update install_bigfix.bat


:: Copyright 2017 - Refael Ackermann
:: Distributed under MIT style license
:: See accompanying file LICENSE at https://github.com/node4good/windows-autoconf
:: version: 1.15.5

@if not defined DEBUG_HELPER @ECHO OFF
setlocal
set "InstallerPath=%ProgramFiles(x86)%\Microsoft Visual Studio\Installer"
if not exist "%InstallerPath%" set "InstallerPath=%ProgramFiles%\Microsoft Visual Studio\Installer"
if not exist "%InstallerPath%" goto :no-vswhere
:: Manipulate %Path% for easier " handeling
set "Path=%Path%;%InstallerPath%"
where vswhere 2> nul > nul
if errorlevel 1 goto :no-vswhere
set VSWHERE_REQ=-requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64
set VSWHERE_PRP=-property installationPath
set VSWHERE_LMT=-version "[15.0,16.0)"
vswhere -prerelease > nul
if "%~1"=="prerelase" set VSWHERE_WITH_PRERELASE=1
if not errorlevel 1 if "%VSWHERE_WITH_PRERELASE%"=="1" set "VSWHERE_LMT=%VSWHERE_LMT% -prerelease"
SET VSWHERE_ARGS=-latest -products * %VSWHERE_REQ% %VSWHERE_PRP% %VSWHERE_LMT%
for /f "usebackq tokens=*" %%i in (`vswhere %VSWHERE_ARGS%`) do (
    endlocal
    set "VCINSTALLDIR=%%i\VC\"
    set "VS150COMNTOOLS=%%i\Common7\Tools\"
    exit /B 0
)

:no-vswhere
endlocal
echo could not find "vswhere"
exit /B 1

:: Copyright 2017 - Refael Ackermann
:: Distributed under MIT style license
:: See accompanying file LICENSE at https://github.com/node4good/windows-autoconf
:: version: 2.0.0

@if not defined DEBUG_HELPER @ECHO OFF
setlocal
if "%~1"=="prerelease" set VSWHERE_WITH_PRERELEASE=1
set "InstallerPath=%ProgramFiles(x86)%\Microsoft Visual Studio\Installer"
if not exist "%InstallerPath%" set "InstallerPath=%ProgramFiles%\Microsoft Visual Studio\Installer"
if not exist "%InstallerPath%" goto :no-vswhere
:: Manipulate %Path% for easier " handeling
set "Path=%Path%;%InstallerPath%"
where vswhere 2> nul > nul
if errorlevel 1 goto :no-vswhere
set VSWHERE_REQ=-requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64
set VSWHERE_PRP=-property installationPath
set VSWHERE_LMT=-version "[15.0,16.0)"
vswhere -prerelease > nul
if not errorlevel 1 if "%VSWHERE_WITH_PRERELEASE%"=="1" set "VSWHERE_LMT=%VSWHERE_LMT% -prerelease"
SET VSWHERE_ARGS=-latest -products * %VSWHERE_REQ% %VSWHERE_PRP% %VSWHERE_LMT%
for /f "usebackq tokens=*" %%i in (`vswhere %VSWHERE_ARGS%`) do (
    endlocal
    set "VCINSTALLDIR=%%i\VC\"
    set "VS150COMNTOOLS=%%i\Common7\Tools\"
    exit /B 0
)

:no-vswhere
endlocal
echo could not find "vswhere"
exit /B 1

rename arg `prerelase` -> `prerelease`

semver-major: rename arg `prerelase` -> `prerelease`


@ECHO OFF

REM Command file for Sphinx documentation

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

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.  singlehtml to make a single large HTML file
	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.  devhelp    to make HTML files and a Devhelp project
	echo.  epub       to make an epub
	echo.  latex      to make LaTeX files, you can set PAPER=a4 or PAPER=letter
	echo.  text       to make text files
	echo.  man        to make manual pages
	echo.  texinfo    to make Texinfo files
	echo.  gettext    to make PO message catalogs
	echo.  changes    to make an overview over all changed/added/deprecated items
	echo.  xml        to make Docutils-native XML files
	echo.  pseudoxml  to make pseudoxml-XML files for display purposes
	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
)

%SPHINXBUILD% 2> nul
if errorlevel 9009 (
	echo.
	echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
	echo.installed, then set the SPHINXBUILD environment variable to point
	echo.to the full path of the 'sphinx-build' executable. Alternatively you
	echo.may add the Sphinx directory to PATH.
	echo.
	echo.If you don't have Sphinx installed, grab it from
	echo.http://sphinx-doc.org/
	exit /b 1
)

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

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

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

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

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

if "%1" == "htmlhelp" (
	%SPHINXBUILD% -b htmlhelp %ALLSPHINXOPTS% %BUILDDIR%/htmlhelp
	if errorlevel 1 exit /b 1
	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
	if errorlevel 1 exit /b 1
	echo.
	echo.Build finished; now you can run "qcollectiongenerator" with the ^
.qhcp project file in %BUILDDIR%/qthelp, like this:
	echo.^> qcollectiongenerator %BUILDDIR%\qthelp\Sphinx-Gallery.qhcp
	echo.To view the help file:
	echo.^> assistant -collectionFile %BUILDDIR%\qthelp\Sphinx-Gallery.ghc
	goto end
)

if "%1" == "devhelp" (
	%SPHINXBUILD% -b devhelp %ALLSPHINXOPTS% %BUILDDIR%/devhelp
	if errorlevel 1 exit /b 1
	echo.
	echo.Build finished.
	goto end
)

if "%1" == "epub" (
	%SPHINXBUILD% -b epub %ALLSPHINXOPTS% %BUILDDIR%/epub
	if errorlevel 1 exit /b 1
	echo.
	echo.Build finished. The epub file is in %BUILDDIR%/epub.
	goto end
)

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

if "%1" == "latexpdf" (
	%SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex
	cd %BUILDDIR%/latex
	make all-pdf
	cd %BUILDDIR%/..
	echo.
	echo.Build finished; the PDF files are in %BUILDDIR%/latex.
	goto end
)

if "%1" == "latexpdfja" (
	%SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex
	cd %BUILDDIR%/latex
	make all-pdf-ja
	cd %BUILDDIR%/..
	echo.
	echo.Build finished; the PDF files are in %BUILDDIR%/latex.
	goto end
)

if "%1" == "text" (
	%SPHINXBUILD% -b text %ALLSPHINXOPTS% %BUILDDIR%/text
	if errorlevel 1 exit /b 1
	echo.
	echo.Build finished. The text files are in %BUILDDIR%/text.
	goto end
)

if "%1" == "man" (
	%SPHINXBUILD% -b man %ALLSPHINXOPTS% %BUILDDIR%/man
	if errorlevel 1 exit /b 1
	echo.
	echo.Build finished. The manual pages are in %BUILDDIR%/man.
	goto end
)

if "%1" == "texinfo" (
	%SPHINXBUILD% -b texinfo %ALLSPHINXOPTS% %BUILDDIR%/texinfo
	if errorlevel 1 exit /b 1
	echo.
	echo.Build finished. The Texinfo files are in %BUILDDIR%/texinfo.
	goto end
)

if "%1" == "gettext" (
	%SPHINXBUILD% -b gettext %I18NSPHINXOPTS% %BUILDDIR%/locale
	if errorlevel 1 exit /b 1
	echo.
	echo.Build finished. The message catalogs are in %BUILDDIR%/locale.
	goto end
)

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

if "%1" == "linkcheck" (
	%SPHINXBUILD% -b linkcheck %ALLSPHINXOPTS% %BUILDDIR%/linkcheck
	if errorlevel 1 exit /b 1
	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
	if errorlevel 1 exit /b 1
	echo.
	echo.Testing of doctests in the sources finished, look at the ^
results in %BUILDDIR%/doctest/output.txt.
	goto end
)

if "%1" == "xml" (
	%SPHINXBUILD% -b xml %ALLSPHINXOPTS% %BUILDDIR%/xml
	if errorlevel 1 exit /b 1
	echo.
	echo.Build finished. The XML files are in %BUILDDIR%/xml.
	goto end
)

if "%1" == "pseudoxml" (
	%SPHINXBUILD% -b pseudoxml %ALLSPHINXOPTS% %BUILDDIR%/pseudoxml
	if errorlevel 1 exit /b 1
	echo.
	echo.Build finished. The pseudo-XML files are in %BUILDDIR%/pseudoxml.
	goto end
)

:end

@ECHO OFF

REM Command file for Sphinx documentation

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

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.  singlehtml to make a single large HTML file
	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.  devhelp    to make HTML files and a Devhelp project
	echo.  epub       to make an epub
	echo.  latex      to make LaTeX files, you can set PAPER=a4 or PAPER=letter
	echo.  text       to make text files
	echo.  man        to make manual pages
	echo.  texinfo    to make Texinfo files
	echo.  gettext    to make PO message catalogs
	echo.  changes    to make an overview over all changed/added/deprecated items
	echo.  xml        to make Docutils-native XML files
	echo.  pseudoxml  to make pseudoxml-XML files for display purposes
	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%\*
	if exist auto_examples rd /q /s auto_examples
	if exist auto_mayavi_examples rd /q /s auto_mayavi_examples
	if exist auto_pyvista_examples rd /q /s auto_pyvista_examples
	if exist tutorials rd /q /s tutorials
	if exist gen_modules rd /q /s gen_modules
	goto end
)

%SPHINXBUILD% 2> nul
if errorlevel 9009 (
	echo.
	echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
	echo.installed, then set the SPHINXBUILD environment variable to point
	echo.to the full path of the 'sphinx-build' executable. Alternatively you
	echo.may add the Sphinx directory to PATH.
	echo.
	echo.If you don't have Sphinx installed, grab it from
	echo.http://sphinx-doc.org/
	exit /b 1
)

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

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

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

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

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

if "%1" == "htmlhelp" (
	%SPHINXBUILD% -b htmlhelp %ALLSPHINXOPTS% %BUILDDIR%/htmlhelp
	if errorlevel 1 exit /b 1
	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
	if errorlevel 1 exit /b 1
	echo.
	echo.Build finished; now you can run "qcollectiongenerator" with the ^
.qhcp project file in %BUILDDIR%/qthelp, like this:
	echo.^> qcollectiongenerator %BUILDDIR%\qthelp\Sphinx-Gallery.qhcp
	echo.To view the help file:
	echo.^> assistant -collectionFile %BUILDDIR%\qthelp\Sphinx-Gallery.ghc
	goto end
)

if "%1" == "devhelp" (
	%SPHINXBUILD% -b devhelp %ALLSPHINXOPTS% %BUILDDIR%/devhelp
	if errorlevel 1 exit /b 1
	echo.
	echo.Build finished.
	goto end
)

if "%1" == "epub" (
	%SPHINXBUILD% -b epub %ALLSPHINXOPTS% %BUILDDIR%/epub
	if errorlevel 1 exit /b 1
	echo.
	echo.Build finished. The epub file is in %BUILDDIR%/epub.
	goto end
)

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

if "%1" == "latexpdf" (
	%SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex
	cd %BUILDDIR%/latex
	make all-pdf
	cd %BUILDDIR%/..
	echo.
	echo.Build finished; the PDF files are in %BUILDDIR%/latex.
	goto end
)

if "%1" == "latexpdfja" (
	%SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex
	cd %BUILDDIR%/latex
	make all-pdf-ja
	cd %BUILDDIR%/..
	echo.
	echo.Build finished; the PDF files are in %BUILDDIR%/latex.
	goto end
)

if "%1" == "text" (
	%SPHINXBUILD% -b text %ALLSPHINXOPTS% %BUILDDIR%/text
	if errorlevel 1 exit /b 1
	echo.
	echo.Build finished. The text files are in %BUILDDIR%/text.
	goto end
)

if "%1" == "man" (
	%SPHINXBUILD% -b man %ALLSPHINXOPTS% %BUILDDIR%/man
	if errorlevel 1 exit /b 1
	echo.
	echo.Build finished. The manual pages are in %BUILDDIR%/man.
	goto end
)

if "%1" == "texinfo" (
	%SPHINXBUILD% -b texinfo %ALLSPHINXOPTS% %BUILDDIR%/texinfo
	if errorlevel 1 exit /b 1
	echo.
	echo.Build finished. The Texinfo files are in %BUILDDIR%/texinfo.
	goto end
)

if "%1" == "gettext" (
	%SPHINXBUILD% -b gettext %I18NSPHINXOPTS% %BUILDDIR%/locale
	if errorlevel 1 exit /b 1
	echo.
	echo.Build finished. The message catalogs are in %BUILDDIR%/locale.
	goto end
)

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

if "%1" == "linkcheck" (
	%SPHINXBUILD% -b linkcheck %ALLSPHINXOPTS% %BUILDDIR%/linkcheck
	if errorlevel 1 exit /b 1
	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
	if errorlevel 1 exit /b 1
	echo.
	echo.Testing of doctests in the sources finished, look at the ^
results in %BUILDDIR%/doctest/output.txt.
	goto end
)

if "%1" == "xml" (
	%SPHINXBUILD% -b xml %ALLSPHINXOPTS% %BUILDDIR%/xml
	if errorlevel 1 exit /b 1
	echo.
	echo.Build finished. The XML files are in %BUILDDIR%/xml.
	goto end
)

if "%1" == "pseudoxml" (
	%SPHINXBUILD% -b pseudoxml %ALLSPHINXOPTS% %BUILDDIR%/pseudoxml
	if errorlevel 1 exit /b 1
	echo.
	echo.Build finished. The pseudo-XML files are in %BUILDDIR%/pseudoxml.
	goto end
)

:end

MNT: make "clean" behave the same on Windows as on Linux (#1020)


@ECHO OFF
REM -- Automates cygwin installation

SETLOCAL

REM -- Change to the directory of the executing batch file
CD %~dp0

REM -- Configure our paths
SET ROOTDIR=C:\cygwin
SET SITE=http://cygwin.mirrors.pair.com/
SET SSHD_PORT=13610

REM -- Additional variables
SET ADD_ARGS="-K http://cygwinports.org/ports.gpg -s ftp://ftp.cygwinports.org/pub/cygwinports"
SET LOCALDIR="%ROOTDIR%\setup"
set HSTART_URL=http://files.ntwind.com/download/Hstart_4.2-bin.zip
IF "%PROCESSOR_ARCHITECTURE%" == "x86" (
	SET SETUP_NAME=setup-x86.exe
	SET HSTART_BIN=hstart.exe
) else (
	SET SETUP_NAME=setup-x86_64.exe
	SET HSTART_BIN=hstart64.exe
)

REM -- STARTING SCRIPT
set DLOAD_SCRIPT=download.vbs
REM -- Get the user's startup directory
for /F "skip=2 tokens=2*" %%j in ('reg query "HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" /v "Startup"') do set STARTUP_DIR=%%k

REM -- pure batch downloader: https://semitwist.com/articles/article/view/downloading-files-from-plain-batch-with-zero-dependencies
REM -- Windows has no built-in wget or curl, so generate a VBS script to do it:
REM -------------------------------------------------------------------------
ECHO Option Explicit                                                    >  %DLOAD_SCRIPT%
ECHO Dim args, http, fileSystem, adoStream, url, target, status         >> %DLOAD_SCRIPT%
ECHO.                                                                   >> %DLOAD_SCRIPT%
ECHO Set args = Wscript.Arguments                                       >> %DLOAD_SCRIPT%
ECHO Set http = CreateObject("WinHttp.WinHttpRequest.5.1")              >> %DLOAD_SCRIPT%
ECHO url = args(0)                                                      >> %DLOAD_SCRIPT%
ECHO target = args(1)                                                   >> %DLOAD_SCRIPT%
ECHO WScript.Echo "Getting '" ^& target ^& "' from '" ^& url ^& "'..."  >> %DLOAD_SCRIPT%
ECHO.                                                                   >> %DLOAD_SCRIPT%
ECHO http.Open "GET", url, False                                        >> %DLOAD_SCRIPT%
ECHO http.Send                                                          >> %DLOAD_SCRIPT%
ECHO status = http.Status                                               >> %DLOAD_SCRIPT%
ECHO.                                                                   >> %DLOAD_SCRIPT%
ECHO If status ^<^> 200 Then                                            >> %DLOAD_SCRIPT%
ECHO 	WScript.Echo "FAILED to download: HTTP Status " ^& status       >> %DLOAD_SCRIPT%
ECHO 	WScript.Quit 1                                                  >> %DLOAD_SCRIPT%
ECHO End If                                                             >> %DLOAD_SCRIPT%
ECHO.                                                                   >> %DLOAD_SCRIPT%
ECHO Set adoStream = CreateObject("ADODB.Stream")                       >> %DLOAD_SCRIPT%
ECHO adoStream.Open                                                     >> %DLOAD_SCRIPT%
ECHO adoStream.Type = 1                                                 >> %DLOAD_SCRIPT%
ECHO adoStream.Write http.ResponseBody                                  >> %DLOAD_SCRIPT%
ECHO adoStream.Position = 0                                             >> %DLOAD_SCRIPT%
ECHO.                                                                   >> %DLOAD_SCRIPT%
ECHO Set fileSystem = CreateObject("Scripting.FileSystemObject")        >> %DLOAD_SCRIPT%
ECHO If fileSystem.FileExists(target) Then fileSystem.DeleteFile target >> %DLOAD_SCRIPT%
ECHO adoStream.SaveToFile target                                        >> %DLOAD_SCRIPT%
ECHO adoStream.Close                                                    >> %DLOAD_SCRIPT%
ECHO.                                                                   >> %DLOAD_SCRIPT%
REM -------------------------------------------------------------------------

mkdir "%ROOTDIR%"
mkdir "%LOCALDIR%"

IF NOT EXIST "%ROOTDIR%\%SETUP_NAME%" cscript //Nologo "%DLOAD_SCRIPT%" http://cygwin.com/%SETUP_NAME% "%ROOTDIR%\%SETUP_NAME%"

REM -- cleanup temp files
del "%DLOAD_SCRIPT%"

REM -- These are the packages we will install (in addition to the default packages)
SET PACKAGES=bash-completion,bc,bind,ca-certificates,curl,fdupes,git,git-completion,git-svn
SET PACKAGES=%PACKAGES%,inetutils,nc,nc6,ncurses,openssh,openssl,procps,rsync,screen,unzip,vim,wget,xxd
REM -- Extra packages
SET PACKAGES=%PACKAGES%,heimdal

REM -- Do it!
ECHO *** INSTALLING DEFAULT PACKAGES
"%ROOTDIR%\%SETUP_NAME%" -q -d -D -L -X -s "%SITE%" -l "%LOCALDIR%" -R "%ROOTDIR%" "%ADD_ARGS%"
ECHO.
ECHO.
ECHO *** INSTALLING CUSTOM PACKAGES
"%ROOTDIR%\%SETUP_NAME%" -q -d -D -L -X -s "%SITE%" -l "%LOCALDIR%" -R "%ROOTDIR%" "%ADD_ARGS%" -P "%PACKAGES%"

REM -- Show what we did
ECHO.
ECHO.
ECHO cygwin installation updated
ECHO - "%PACKAGES%"
ECHO.

REM -- make cygdrive root / instead of /cygdrive
ECHO.
ECHO.
ECHO updating cygdrive fstab
"%ROOTDIR%\bin\bash.exe" --login -c "sed -i 's/# none \/cygdrive cygdrive /none \/ cygdrive /' /etc/fstab"
"%ROOTDIR%\bin\bash.exe" --login -c "sed -i 's/none \/cygdrive cygdrive /none \/ cygdrive /' /etc/fstab"
ECHO.
ECHO.

REM -- make the home directory
ECHO.
ECHO.
ECHO making the home directory be the windows home
REM -- WIN XP-
"%ROOTDIR%\bin\bash.exe" --login -c "if [[ -d \"/c/Documents and Settings/$USER\" ]]; then mv \"/home/$USER\" \"/home/$USER.bak\"; ln -s \"/c/Documents and Settings/$USER\" \"/home/$USER\"; fi;"
REM -- WIN Vista+
"%ROOTDIR%\bin\bash.exe" --login -c "if [[ -d \"/c/Users/$USER\" ]]; then mv \"/home/$USER\" \"/home/$USER.bak\"; ln -s \"/c/Users/$USER\" \"/home/$USER\"; fi;"
ECHO.
ECHO.

REM -- setup sshd for local user only
ECHO.
ECHO.
ECHO setup sshd for local user only
"%ROOTDIR%\bin\bash.exe" --login -c "ssh-host-config --no --port %SSHD_PORT%"
"%ROOTDIR%\bin\bash.exe" --login -c "sed -i 's/^#ListenAddress 0.0.0.0$/ListenAddress 127.0.0.1/' /etc/sshd_config"
"%ROOTDIR%\bin\bash.exe" --login -c "sed -i 's/^#ListenAddress ::$/ListenAddress ::1/' /etc/sshd_config"
"%ROOTDIR%\bin\bash.exe" --login -c "sed -i 's/^#PasswordAuthentication yes$/PasswordAuthentication no/' /etc/sshd_config"
"%ROOTDIR%\bin\bash.exe" --login -c "sed -i 's/^UsePrivilegeSeparation sandbox/UsePrivilegeSeparation no/' /etc/sshd_config"
"%ROOTDIR%\bin\bash.exe" --login -c "if [[ ! -f ~/.ssh/id_rsa ]]; then ssh-keygen -q -t rsa -N '' -f ~/.ssh/id_rsa && cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys && chmod 0600 ~/.ssh/authorized_keys; fi;"
"%ROOTDIR%\bin\bash.exe" --login -c "echo > /etc/motd"

REM -- download hstart
IF NOT EXIST "%ROOTDIR%\startup\%HSTART_BIN%" (
	"%ROOTDIR%\bin\bash.exe" --login -c "mkdir /startup"
	"%ROOTDIR%\bin\bash.exe" --login -c "wget -O /tmp/hstart.zip %HSTART_URL% && unzip -p /tmp/hstart.zip %HSTART_BIN% > /startup/%HSTART_BIN%"
	"%ROOTDIR%\bin\bash.exe" --login -c "rm -f /tmp/hstart.zip"
)

REM -- create the startup entry for ssh to run on login
IF NOT EXIST "%ROOTDIR%\startup\sshd.cmd" (
echo ^
SET PATH=%%PATH%%;%ROOTDIR%\bin^

chdir %ROOTDIR%^

start "" "%ROOTDIR%\startup\%HSTART_BIN%" /noconsole /elevate "%ROOTDIR%\bin\bash.exe --login -c '/usr/sbin/sshd.exe -D'"^
 > "%ROOTDIR%\startup\sshd.cmd"
)

IF NOT EXIST "%STARTUP_DIR%\sshd.cmd" (
	mklink "%STARTUP_DIR%\sshd.cmd" "%ROOTDIR%\startup\sshd.cmd"
)

IF NOT EXIST "%ROOTDIR%\cygsetup.cmd" (
	echo "%ROOTDIR%\%SETUP_NAME%" -s "%SITE%" -l "%LOCALDIR%" -R "%ROOTDIR%" "%ADD_ARGS%" > "%ROOTDIR%\cygsetup.cmd"
)

ECHO.
ECHO.

ENDLOCAL

PAUSE
EXIT /B 0

@ECHO OFF
REM -- Automates cygwin installation

SETLOCAL

REM -- Change to the directory of the executing batch file
CD %~dp0

REM -- Configure our paths
SET ROOTDIR=C:\cygwin
SET SITE=http://cygwin.mirrors.pair.com/
SET SSHD_PORT=13610

REM -- Additional variables
SET ADD_ARGS="-K http://cygwinports.org/ports.gpg -s ftp://ftp.cygwinports.org/pub/cygwinports"
SET LOCALDIR="%ROOTDIR%\setup"
set HSTART_URL=http://files.ntwind.com/download/Hstart_4.2-bin.zip
IF "%PROCESSOR_ARCHITECTURE%" == "x86" (
	SET SETUP_NAME=setup-x86.exe
	SET HSTART_BIN=hstart.exe
) else (
	SET SETUP_NAME=setup-x86_64.exe
	SET HSTART_BIN=hstart64.exe
)

REM -- STARTING SCRIPT
set DLOAD_SCRIPT=download.vbs
REM -- Get the user's startup directory
for /F "skip=2 tokens=2*" %%j in ('reg query "HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" /v "Startup"') do set STARTUP_DIR=%%k

REM -- pure batch downloader: https://semitwist.com/articles/article/view/downloading-files-from-plain-batch-with-zero-dependencies
REM -- Windows has no built-in wget or curl, so generate a VBS script to do it:
REM -------------------------------------------------------------------------
ECHO Option Explicit                                                    >  %DLOAD_SCRIPT%
ECHO Dim args, http, fileSystem, adoStream, url, target, status         >> %DLOAD_SCRIPT%
ECHO.                                                                   >> %DLOAD_SCRIPT%
ECHO Set args = Wscript.Arguments                                       >> %DLOAD_SCRIPT%
ECHO Set http = CreateObject("WinHttp.WinHttpRequest.5.1")              >> %DLOAD_SCRIPT%
ECHO url = args(0)                                                      >> %DLOAD_SCRIPT%
ECHO target = args(1)                                                   >> %DLOAD_SCRIPT%
ECHO WScript.Echo "Getting '" ^& target ^& "' from '" ^& url ^& "'..."  >> %DLOAD_SCRIPT%
ECHO.                                                                   >> %DLOAD_SCRIPT%
ECHO http.Open "GET", url, False                                        >> %DLOAD_SCRIPT%
ECHO http.Send                                                          >> %DLOAD_SCRIPT%
ECHO status = http.Status                                               >> %DLOAD_SCRIPT%
ECHO.                                                                   >> %DLOAD_SCRIPT%
ECHO If status ^<^> 200 Then                                            >> %DLOAD_SCRIPT%
ECHO 	WScript.Echo "FAILED to download: HTTP Status " ^& status       >> %DLOAD_SCRIPT%
ECHO 	WScript.Quit 1                                                  >> %DLOAD_SCRIPT%
ECHO End If                                                             >> %DLOAD_SCRIPT%
ECHO.                                                                   >> %DLOAD_SCRIPT%
ECHO Set adoStream = CreateObject("ADODB.Stream")                       >> %DLOAD_SCRIPT%
ECHO adoStream.Open                                                     >> %DLOAD_SCRIPT%
ECHO adoStream.Type = 1                                                 >> %DLOAD_SCRIPT%
ECHO adoStream.Write http.ResponseBody                                  >> %DLOAD_SCRIPT%
ECHO adoStream.Position = 0                                             >> %DLOAD_SCRIPT%
ECHO.                                                                   >> %DLOAD_SCRIPT%
ECHO Set fileSystem = CreateObject("Scripting.FileSystemObject")        >> %DLOAD_SCRIPT%
ECHO If fileSystem.FileExists(target) Then fileSystem.DeleteFile target >> %DLOAD_SCRIPT%
ECHO adoStream.SaveToFile target                                        >> %DLOAD_SCRIPT%
ECHO adoStream.Close                                                    >> %DLOAD_SCRIPT%
ECHO.                                                                   >> %DLOAD_SCRIPT%
REM -------------------------------------------------------------------------

mkdir "%ROOTDIR%"
mkdir "%LOCALDIR%"

IF NOT EXIST "%ROOTDIR%\%SETUP_NAME%" cscript //Nologo "%DLOAD_SCRIPT%" http://cygwin.com/%SETUP_NAME% "%ROOTDIR%\%SETUP_NAME%"

REM -- cleanup temp files
del "%DLOAD_SCRIPT%"

REM -- These are the packages we will install (in addition to the default packages)
SET PACKAGES=bash-completion,bc,bind,ca-certificates,curl,cygutils-extra,fdupes,git,git-completion,git-svn
SET PACKAGES=%PACKAGES%,inetutils,nc,nc6,ncurses,openssh,openssl,procps,rsync,screen,unzip,vim,wget,xxd
REM -- Extra packages
SET PACKAGES=%PACKAGES%,heimdal

REM -- Do it!
ECHO *** INSTALLING DEFAULT PACKAGES
"%ROOTDIR%\%SETUP_NAME%" -q -d -D -L -X -s "%SITE%" -l "%LOCALDIR%" -R "%ROOTDIR%" "%ADD_ARGS%"
ECHO.
ECHO.
ECHO *** INSTALLING CUSTOM PACKAGES
"%ROOTDIR%\%SETUP_NAME%" -q -d -D -L -X -s "%SITE%" -l "%LOCALDIR%" -R "%ROOTDIR%" "%ADD_ARGS%" -P "%PACKAGES%"

REM -- Show what we did
ECHO.
ECHO.
ECHO cygwin installation updated
ECHO - "%PACKAGES%"
ECHO.

REM -- make cygdrive root / instead of /cygdrive
ECHO.
ECHO.
ECHO updating cygdrive fstab
"%ROOTDIR%\bin\bash.exe" --login -c "sed -i 's/# none \/cygdrive cygdrive /none \/ cygdrive /' /etc/fstab"
"%ROOTDIR%\bin\bash.exe" --login -c "sed -i 's/none \/cygdrive cygdrive /none \/ cygdrive /' /etc/fstab"
ECHO.
ECHO.

REM -- make the home directory
ECHO.
ECHO.
ECHO making the home directory be the windows home
REM -- WIN XP-
"%ROOTDIR%\bin\bash.exe" --login -c "if [[ -d \"/c/Documents and Settings/$USER\" ]]; then mv \"/home/$USER\" \"/home/$USER.bak\"; ln -s \"/c/Documents and Settings/$USER\" \"/home/$USER\"; fi;"
REM -- WIN Vista+
"%ROOTDIR%\bin\bash.exe" --login -c "if [[ -d \"/c/Users/$USER\" ]]; then mv \"/home/$USER\" \"/home/$USER.bak\"; ln -s \"/c/Users/$USER\" \"/home/$USER\"; fi;"
ECHO.
ECHO.

REM -- setup sshd for local user only
ECHO.
ECHO.
ECHO setup sshd for local user only
"%ROOTDIR%\bin\bash.exe" --login -c "ssh-host-config --no --port %SSHD_PORT%"
"%ROOTDIR%\bin\bash.exe" --login -c "sed -i 's/^#ListenAddress 0.0.0.0$/ListenAddress 127.0.0.1/' /etc/sshd_config"
"%ROOTDIR%\bin\bash.exe" --login -c "sed -i 's/^#ListenAddress ::$/ListenAddress ::1/' /etc/sshd_config"
"%ROOTDIR%\bin\bash.exe" --login -c "sed -i 's/^#PasswordAuthentication yes$/PasswordAuthentication no/' /etc/sshd_config"
"%ROOTDIR%\bin\bash.exe" --login -c "sed -i 's/^UsePrivilegeSeparation sandbox/UsePrivilegeSeparation no/' /etc/sshd_config"
"%ROOTDIR%\bin\bash.exe" --login -c "if [[ ! -f ~/.ssh/id_rsa ]]; then ssh-keygen -q -t rsa -N '' -f ~/.ssh/id_rsa && cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys && chmod 0600 ~/.ssh/authorized_keys; fi;"
"%ROOTDIR%\bin\bash.exe" --login -c "echo > /etc/motd"

REM -- download hstart
IF NOT EXIST "%ROOTDIR%\startup\%HSTART_BIN%" (
	"%ROOTDIR%\bin\bash.exe" --login -c "mkdir /startup"
	"%ROOTDIR%\bin\bash.exe" --login -c "wget -O /tmp/hstart.zip %HSTART_URL% && unzip -p /tmp/hstart.zip %HSTART_BIN% > /startup/%HSTART_BIN%"
	"%ROOTDIR%\bin\bash.exe" --login -c "rm -f /tmp/hstart.zip"
)

REM -- create the startup entry for ssh to run on login
IF NOT EXIST "%ROOTDIR%\startup\sshd.cmd" (
echo ^
SET PATH=%%PATH%%;%ROOTDIR%\bin^

chdir %ROOTDIR%^

start "" "%ROOTDIR%\startup\%HSTART_BIN%" /noconsole /elevate "%ROOTDIR%\bin\bash.exe --login -c '/usr/sbin/sshd.exe -D'"^
 > "%ROOTDIR%\startup\sshd.cmd"
)

IF NOT EXIST "%STARTUP_DIR%\sshd.cmd" (
	mklink "%STARTUP_DIR%\sshd.cmd" "%ROOTDIR%\startup\sshd.cmd"
)

IF NOT EXIST "%ROOTDIR%\cygsetup.cmd" (
	echo "%ROOTDIR%\%SETUP_NAME%" -s "%SITE%" -l "%LOCALDIR%" -R "%ROOTDIR%" "%ADD_ARGS%" > "%ROOTDIR%\cygsetup.cmd"
)

ECHO.
ECHO.

ENDLOCAL

PAUSE
EXIT /B 0

Update cygwin default packages

Update cygwin default packages


::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
::
:: aartifact
:: http://www.aartifact.org/src/
:: Copyright (C) 2008-2010
:: A. Lapets
::
:: This software is made available under the GNU GPLv3.
::
:: Make.bat
::   Batch script for compiling with GHC under Windows
::   environments.

::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
::

@IF EXIST o GOTO make
@MD o
@IF EXIST hi GOTO make
@MD hi
:make
ghc -O2 --make -odir o -hidir hi Main -o aa.exe

::eof

Add build script for Windows environments.


@echo off

if /i "%~1" == "/N" (
	set "FAR_NAME=%~2"
	shift /1
	shift /1
)

if not defined FAR_NAME if exist "%~dp0vendors\%~nx0" call "%~dp0vendors\Far3.bat"

if not defined FAR_NAME set "FAR_NAME=Far3"

set "FAR_HOME=%~dp0vendors\%FAR_NAME%"

if not exist "%FAR_HOME%" (
	call :error "%FAR_HOME% not found"
	goto :EOF
)

if not exist "%FAR_HOME%\Far.exe" (
	call :error "%FAR_HOME%\Far.exe not found"
	goto :EOF
)

:: Path to the common directory for all FAR-related stuffs
:: It can be redeclared in "shellenv.bat"
set "FAR_CONF=%~dp0etc\Far3"

:: FAR startup options
:: It can be redeclared in "shellenv.bat"
set "FAR_OPTS=/w /p"%FAR_HOME%\Plugins;%FAR_CONF%\Profile\Plugins;%ConEmuDir%\Plugins\ConEmu""

if exist "%~dp0shellenv.bat" call "%~dp0shellenv.bat"

if defined SHOW_BANNER_FAR if exist "%~dp0shellinfo.bat" call "%~dp0shellinfo.bat" %SHOW_BANNER_FAR%

if not exist "%FAR_HOME%\Far.exe.ini" (
	echo:
	echo:*** "%FAR_HOME%\Far.exe.ini" not found
	if exist "%FAR_CONF%\Far.exe.ini" (
		echo:*** Copying from "%FAR_CONF%\Far.exe.ini"
		copy /b "%FAR_CONF%\Far.exe.ini" "%FAR_HOME%\Far.exe.ini"
	) else (
		echo:*** Creating
		call :far.exe.ini_create >"%FAR_HOME%\Far.exe.ini"
	)
	if errorlevel 1 (
		call :error "Cannot create %FAR_CONF%\Far.exe.ini"
		goto :EOF
	)
)

echo:Starting %FAR_NAME%
echo:[ %DATE% %TIME% ]

"%FAR_HOME%\Far.exe" %FAR_OPTS% %1 %2 %3 %4 %5 %6 %7 %8 %9

echo:Terminating...
goto :EOF

:: ========================================================================

:usage
echo:Usage: %~n0 /N FAR_NAME
goto :EOF

:: ========================================================================

:error
echo:
echo:*** CRITICAL ERROR ***
echo:%~1
echo:
call :usage
pause
goto :EOF

:: ========================================================================

:far.exe.ini_create
echo:
echo:[General]
echo:
echo:UseSystemProfiles=0
echo:
echo:UserProfileDir=%%FARHOME%%\..\..\etc\Far3\Profile
echo:UserLocalProfileDir=%%FARHOME%%\..\..\etc\Far3\Profile
echo:
echo:TemplateProfile=%%FARHOME%%\..\..\etc\Far3\Default.farconfig
echo:
echo:GlobalUserMenuDir=%%FARHOME%%\..\..\etc\Far3
echo:
echo:DefaultLanguage=Russian
echo:
echo:ReadOnlyConfig=0
goto :EOF

:: ========================================================================

:: EOF

@echo off

set "FAR_NAME="

if /i "%~1" == "/N" (
	set "FAR_NAME=%~2"
	shift /1
	shift /1
)

if not defined FAR_NAME if exist "%~dp0vendors\%~nx0" call "%~dp0vendors\Far3.bat"

if not defined FAR_NAME set "FAR_NAME=Far3"

set "FAR_HOME=%~dp0vendors\%FAR_NAME%"

if not exist "%FAR_HOME%" (
	call :error "%FAR_HOME% not found"
	goto :EOF
)

if not exist "%FAR_HOME%\Far.exe" (
	call :error "%FAR_HOME%\Far.exe not found"
	goto :EOF
)

:: Path to the common directory for all FAR-related stuffs
:: It can be redeclared in "shellenv.bat"
set "FAR_CONF=%~dp0etc\Far3"

:: FAR startup options
:: It can be redeclared in "shellenv.bat"
set "FAR_OPTS=/w /p"%FAR_HOME%\Plugins;%FAR_CONF%\Profile\Plugins;%ConEmuDir%\Plugins\ConEmu""

if exist "%~dp0shellenv.bat" call "%~dp0shellenv.bat"

if defined SHOW_BANNER_FAR if exist "%~dp0shellinfo.bat" call "%~dp0shellinfo.bat" %SHOW_BANNER_FAR%

if not exist "%FAR_HOME%\Far.exe.ini" (
	echo:
	echo:*** "%FAR_HOME%\Far.exe.ini" not found
	if exist "%FAR_CONF%\Far.exe.ini" (
		echo:*** Copying from "%FAR_CONF%\Far.exe.ini"
		copy /b "%FAR_CONF%\Far.exe.ini" "%FAR_HOME%\Far.exe.ini"
	) else (
		echo:*** Creating
		call :far.exe.ini_create >"%FAR_HOME%\Far.exe.ini"
	)
	if errorlevel 1 (
		call :error "Cannot create %FAR_CONF%\Far.exe.ini"
		goto :EOF
	)
)

echo:Starting %FAR_NAME%
echo:[ %DATE% %TIME% ]

"%FAR_HOME%\Far.exe" %FAR_OPTS% %1 %2 %3 %4 %5 %6 %7 %8 %9

echo:Terminating...
goto :EOF

:: ========================================================================

:usage
echo:Usage: %~n0 /N FAR_NAME
goto :EOF

:: ========================================================================

:error
echo:
echo:*** CRITICAL ERROR ***
echo:%~1
echo:
call :usage
pause
goto :EOF

:: ========================================================================

:far.exe.ini_create
echo:
echo:[General]
echo:
echo:UseSystemProfiles=0
echo:
echo:UserProfileDir=%%FARHOME%%\..\..\etc\Far3\Profile
echo:UserLocalProfileDir=%%FARHOME%%\..\..\etc\Far3\Profile
echo:
echo:TemplateProfile=%%FARHOME%%\..\..\etc\Far3\Default.farconfig
echo:
echo:GlobalUserMenuDir=%%FARHOME%%\..\..\etc\Far3
echo:
echo:DefaultLanguage=Russian
echo:
echo:ReadOnlyConfig=0
goto :EOF

:: ========================================================================

:: EOF

Initialize (cleranup) env.variable before using


@echo off
if "%1" == "" goto paramErr
if "%VSINSTALLDIR%" == "" goto envErr

set COMPILER=%1

rem Determine CMake generator
if "%COMPILER%" == "vc71" set GENERATOR="Visual Studio 7 .NET 2003"
if "%COMPILER%" == "vc8" set GENERATOR="Visual Studio 8 2005"
if "%COMPILER%" == "vc8_x64" set GENERATOR="Visual Studio 8 2005 Win64"
if "%COMPILER%" == "vc9" set GENERATOR="Visual Studio 9 2008"
if "%COMPILER%" == "vc9_x64" set GENERATOR="Visual Studio 9 2008 Win64"
if "%COMPILER%" == "vc10" set GENERATOR="Visual Studio 10"
if "%COMPILER%" == "vc10_x64" set GENERATOR="Visual Studio 10 Win64"

if %GENERATOR% == "" goto paramErr

rem check 7z and dot
7z > NUL
if errorlevel 1 goto 7zerror
dot -V > NUL
if errorlevel 1 goto doterror

set BUILD_DIR=%COMPILER%

if "%2" == "clean" rmdir /Q/S %BUILD_DIR%
mkdir %BUILD_DIR%
pushd %BUILD_DIR%
rem call CMake
cmake -DOGRE_INSTALL_SAMPLES_SOURCE:BOOL=TRUE -DOGRE_INSTALL_DOCS:BOOL=TRUE -G%GENERATOR% ..\..\..
if errorlevel 1 goto cmakeerror

rem Read OGRE version
set /p OGREVERSION=<%BUILD_DIR%\version.txt

rem Detect whether we're using full version of VStudio or Express
devenv /? > NUL

if errorlevel 1 goto tryexpress
set DEVENV=devenv
goto detecteddevenv
:tryexpress
set DEVENV=VCExpress
:detecteddevenv

rem build docs explicitly since INSTALL doesn't include it
%DEVENV% OGRE.sln /build "Release" /project "doc"

if errorlevel 1 goto msvcerror

rem Delete unnecessary doc files
pushd api\html
del /Q/F *.hhk *.hhc *.map *.md5 *.dot *.hhp *.plist
popd

rem Build main binaries
%DEVENV% OGRE.sln /build "Debug" /project "INSTALL"
%DEVENV% OGRE.sln /build "Release" /project "INSTALL"

rem call CMake in sdk
pushd sdk
cmake -G%GENERATOR% .\
if errorlevel 1 goto cmakeerror
rem delete cache (since it will include absolute paths)
del CMakeCache.txt
rmdir /S/Q CMakeFiles

rem Patch up absolute references to pdbs & debug directories
rem The former should be fixed in a future version of CMake, but the latter is because we configure these files in manually
dir /b /s *.vcproj *.vcproj.user > filestopatch.txt
for /F "delims=" %%f in ('type filestopatch.txt') do (
cscript //nologo ..\..\removeabsolutepaths.vbs "%%f"
)
del /Q/F filestopatch.txt
popd

popd

rem Package up
set SDKNAME=OgreSDK_%COMPILER%_v%OGREVERSION%
rmdir /S/Q %SDKNAME%
move %BUILD_DIR%\sdk %SDKNAME%
del /Q/F %SDKNAME%.7z
rem create self-extracting 7zip archive
7z a -r -y -sfx %SDKNAME%.exe %SDKNAME%

echo Done! Test %SDKNAME%.exe and then release
goto end

:paramErr
echo Required: Build tool (vc71, vc8, vc8x64, vc9, vc9x64, vc10, vc10x64)
set errorlevel=1
goto end

:envErr
echo You need to run this script after running vcvars32.bat
set errorlevel=1
goto end

:cmakeerror
popd
echo CMake not found on your path or CMake error - see above and correct
goto end

:7zerror
echo 7z.exe not found on your path, please add
goto end

:doterror
echo dot.exe not found on your path, please add
goto end

:msvcerror
popd
echo Neither devenv.exe nor VCExpress are on your path, use vcvars32.bat
goto end

:end

@echo off
if "%1" == "" goto paramErr
if "%VSINSTALLDIR%" == "" goto envErr

set COMPILER=%1

rem Determine CMake generator
if "%COMPILER%" == "vc71" set GENERATOR="Visual Studio 7 .NET 2003"
if "%COMPILER%" == "vc8" set GENERATOR="Visual Studio 8 2005"
if "%COMPILER%" == "vc8_x64" set GENERATOR="Visual Studio 8 2005 Win64"
if "%COMPILER%" == "vc9" set GENERATOR="Visual Studio 9 2008"
if "%COMPILER%" == "vc9_x64" set GENERATOR="Visual Studio 9 2008 Win64"
if "%COMPILER%" == "vc10" set GENERATOR="Visual Studio 10"
if "%COMPILER%" == "vc10_x64" set GENERATOR="Visual Studio 10 Win64"

if %GENERATOR% == "" goto paramErr

rem check 7z and dot
7z > NUL
if errorlevel 1 goto 7zerror
dot -V > NUL
if errorlevel 1 goto doterror

set BUILD_DIR=%COMPILER%

if "%2" == "clean" rmdir /Q/S %BUILD_DIR%
mkdir %BUILD_DIR%
pushd %BUILD_DIR%
rem call CMake
cmake -DOGRE_INSTALL_SAMPLES_SOURCE:BOOL=TRUE -DOGRE_INSTALL_DOCS:BOOL=TRUE -G%GENERATOR% ..\..\..
if errorlevel 1 goto cmakeerror

rem Read OGRE version
set /p OGREVERSION=<version.txt

rem Detect whether we're using full version of VStudio or Express
devenv /? > NUL

if errorlevel 1 goto tryexpress
set DEVENV=devenv
goto detecteddevenv
:tryexpress
set DEVENV=VCExpress
:detecteddevenv

rem build docs explicitly since INSTALL doesn't include it
%DEVENV% OGRE.sln /build "Release" /project "doc"

if errorlevel 1 goto msvcerror

rem Delete unnecessary doc files
pushd api\html
del /Q/F *.hhk *.hhc *.map *.md5 *.dot *.hhp *.plist
popd

rem Build main binaries
%DEVENV% OGRE.sln /build "Debug" /project "INSTALL"
%DEVENV% OGRE.sln /build "Release" /project "INSTALL"

rem call CMake in sdk
pushd sdk
cmake -G%GENERATOR% .\
if errorlevel 1 goto cmakeerror
rem delete cache (since it will include absolute paths)
del CMakeCache.txt
rmdir /S/Q CMakeFiles

rem Patch up absolute references to pdbs & debug directories
rem The former should be fixed in a future version of CMake, but the latter is because we configure these files in manually
dir /b /s *.vcproj *.vcproj.user > filestopatch.txt
for /F "delims=" %%f in ('type filestopatch.txt') do (
cscript //nologo ..\..\removeabsolutepaths.vbs "%%f"
)
del /Q/F filestopatch.txt
popd

popd

rem Package up
set SDKNAME=OgreSDK_%COMPILER%_v%OGREVERSION%
rmdir /S/Q %SDKNAME%
move %BUILD_DIR%\sdk %SDKNAME%
del /Q/F %SDKNAME%.7z
rem create self-extracting 7zip archive
7z a -r -y -sfx %SDKNAME%.exe %SDKNAME%

echo Done! Test %SDKNAME%.exe and then release
goto end

:paramErr
echo Required: Build tool (vc71, vc8, vc8x64, vc9, vc9x64, vc10, vc10x64)
set errorlevel=1
goto end

:envErr
echo You need to run this script after running vcvars32.bat
set errorlevel=1
goto end

:cmakeerror
popd
echo CMake not found on your path or CMake error - see above and correct
goto end

:7zerror
echo 7z.exe not found on your path, please add
goto end

:doterror
echo dot.exe not found on your path, please add
goto end

:msvcerror
popd
echo Neither devenv.exe nor VCExpress are on your path, use vcvars32.bat
goto end

:end

Read OGREVERSION correctly

Read OGREVERSION correctly


@echo off
rem Run Tests.  Run the regression test suite.
rem Usage:  rt [-d] [-O] [-q] [-x64] regrtest_args
rem -d   Run Debug build (python_d.exe).  Else release build.
rem -O   Run python.exe or python_d.exe (see -d) with -O.
rem -q   "quick" -- normally the tests are run twice, the first time
rem      after deleting all the .py[co] files reachable from Lib/.
rem      -q runs the tests just once, and without deleting .py[co] files.
rem -x64 Run the 64-bit build of python (or python_d if -d was specified)
rem      from the 'amd64' dir instead of the 32-bit build in this dir.
rem All leading instances of these switches are shifted off, and
rem whatever remains is passed to regrtest.py.  For example,
rem     rt -O -d -x test_thread
rem runs
rem     python_d -O ../lib/test/regrtest.py -x test_thread
rem twice, and
rem     rt -q -g test_binascii
rem runs
rem     python_d ../lib/test/regrtest.py -g test_binascii
rem to generate the expected-output file for binascii quickly.
rem
rem Confusing:  if you want to pass a comma-separated list, like
rem     -u network,largefile
rem then you have to quote it on the rt line, like
rem     rt -u "network,largefile"

setlocal

set prefix=.\
set suffix=
set qmode=
set dashO=
set tcltk=

:CheckOpts
if "%1"=="-O" (set dashO=-O)     & shift & goto CheckOpts
if "%1"=="-q" (set qmode=yes)    & shift & goto CheckOpts
if "%1"=="-d" (set suffix=_d)    & shift & goto CheckOpts
if "%1"=="-x64" (set prefix=amd64) & (set tcltk=tcltk64) & shift & goto CheckOpts

PATH %PATH%;..\..\%tcltk%\bin
set exe=%prefix%\python%suffix%
set cmd=%exe% %dashO% -E -tt ../lib/test/regrtest.py %1 %2 %3 %4 %5 %6 %7 %8 %9
if defined qmode goto Qmode

echo Deleting .pyc/.pyo files ...
%exe% rmpyc.py

echo on
%cmd%
@echo off

echo About to run again without deleting .pyc/.pyo first:
pause

:Qmode
echo on
%cmd%

@echo off
rem Run Tests.  Run the regression test suite.
rem Usage:  rt [-d] [-O] [-q] [-x64] regrtest_args
rem -d   Run Debug build (python_d.exe).  Else release build.
rem -O   Run python.exe or python_d.exe (see -d) with -O.
rem -q   "quick" -- normally the tests are run twice, the first time
rem      after deleting all the .py[co] files reachable from Lib/.
rem      -q runs the tests just once, and without deleting .py[co] files.
rem -x64 Run the 64-bit build of python (or python_d if -d was specified)
rem      from the 'amd64' dir instead of the 32-bit build in this dir.
rem All leading instances of these switches are shifted off, and
rem whatever remains is passed to regrtest.py.  For example,
rem     rt -O -d -x test_thread
rem runs
rem     python_d -O ../lib/test/regrtest.py -x test_thread
rem twice, and
rem     rt -q -g test_binascii
rem runs
rem     python_d ../lib/test/regrtest.py -g test_binascii
rem to generate the expected-output file for binascii quickly.
rem
rem Confusing:  if you want to pass a comma-separated list, like
rem     -u network,largefile
rem then you have to quote it on the rt line, like
rem     rt -u "network,largefile"

setlocal

set prefix=.\
set suffix=
set qmode=
set dashO=
set tcltk=

:CheckOpts
if "%1"=="-O" (set dashO=-O)     & shift & goto CheckOpts
if "%1"=="-q" (set qmode=yes)    & shift & goto CheckOpts
if "%1"=="-d" (set suffix=_d)    & shift & goto CheckOpts
if "%1"=="-x64" (set prefix=amd64) & (set tcltk=tcltk64) & shift & goto CheckOpts

PATH %PATH%;..\..\%tcltk%\bin
set exe=%prefix%\python%suffix%
set cmd=%exe% %dashO% -Wd -3 -E -tt ../lib/test/regrtest.py %1 %2 %3 %4 %5 %6 %7 %8 %9
if defined qmode goto Qmode

echo Deleting .pyc/.pyo files ...
%exe% rmpyc.py

echo on
%cmd%
@echo off

echo About to run again without deleting .pyc/.pyo first:
pause

:Qmode
echo on
%cmd%

Add -Wd and -3 to the flags used to run the tests on Windows.


REM create windows installer package(runtime included) for LLPAD
REM In order to execute this batch file, java 8 or later needs to be installed
REM In case creating exe installer, Download Inno Setup 5 or later from http://www.jrsoftware.org and add it to the PATH.
REM In case creating msi installer, Download WiX 3.0 or later from http://wix.sf.net and add it to the PATH.

echo off

set APP_VERSION=0.5.0

IF "%JAVA_HOME%" == "" (
    echo Please set the JAVA_HOME variable in your environment to match the location of your Java installation.
    exit /B
)

REM change dir to project dir where this bat is placed.
cd %~dp0

set JAR_NAME=llpad-%APP_VERSION%-jar-with-dependencies.jar
set JAR_FULLPATH=%CD%\target\%JAR_NAME%
set PACKAGE_PATH=%CD%\package
set PACKAGE_RESOURCE_PATH=%CD%\package_resource
set INFILE_PATH=%PACKAGE_PATH%\infiles
set OUTFILE_PATH=%PACKAGE_PATH%\outfiles
set PACKAGE_FOR_WINDOWS_PATH=%PACKAGE_PATH%\windows

IF NOT EXIST "%JAR_FULLPATH%" (
echo The jar file "%JAR_FULLPATH%" not found.Please run "mvn install" first. Or APP_VERSION %APP_VERSION% may be incorrect.
echo The version code must be same as project/version in the POM.xml
    exit /B
)

rmdir /s /q %PACKAGE_PATH%
mkdir %PACKAGE_PATH%

rmdir %INFILE_PATH%
mkdir %INFILE_PATH%

rmdir %OUTFILE_PATH%
mkdir %OUTFILE_PATH%

rmdir %PACKAGE_FOR_WINDOWS_PATH%
mkdir %PACKAGE_FOR_WINDOWS_PATH%

copy %JAR_FULLPATH% %INFILE_PATH%
copy %PACKAGE_RESOURCE_PATH%\license.txt %INFILE_PATH%

REM Create a directory "[PJ_ROOT]/package/windows" and put app icon named "[APPNAME].ico" it's a rule of javapackager.
copy %PACKAGE_RESOURCE_PATH%\LLPAD.ico %PACKAGE_FOR_WINDOWS_PATH%

"%JAVA_HOME%\bin\javapackager" ^
-deploy ^
-native exe ^
-BappVersion=%APP_VERSION% ^
-BshortcutHint=true ^
-Bvendor="Riversun" ^
-Bwin.menuGroup="LLPAD" ^
-BsystemWide=true ^
-srcdir package/infiles ^
-outdir package/outfiles ^
-outfile LLPAD_OUT ^
-appclass org.riversun.llpad.AppMain ^
-BlicenseFile=license.txt ^
-name "LLPAD" ^
-title "LLPAD" ^
-Bruntime="%JAVA_HOME%\jre" ^
-srcfiles %JAR_NAME%;license.txt ^
-v

echo package creation finished.

pause

Add bat file for generating installer for windows


@ECHO OFF
SET RepoRoot=%~dp0..\..

ECHO Building Microsoft.AspNetCore.Runtime.SiteExtension
CALL %RepoRoot%\build.cmd -arch x64 -projects %~dp0Runtime\Microsoft.AspNetCore.Runtime.SiteExtension.pkgproj /bl:artifacts/log/SiteExtensions-Runtime-x64.binlog %*
CALL %RepoRoot%\build.cmd -arch x86 -projects %~dp0Runtime\Microsoft.AspNetCore.Runtime.SiteExtension.pkgproj /bl:artifacts/log/SiteExtensions-Runtime-x86.binlog %*

IF %ERRORLEVEL% NEQ 0 (
   EXIT /b %ErrorLevel%
)

ECHO Building LoggingBranch
REM Remove /p:DisablePackageAssetsCache=true /p:DisableTransitiveFrameworkReferences=true which workarounds dotnet store and publish behaviour changes in preview 6
CALL %RepoRoot%\build.cmd -forceCoreMsbuild -arch x64 -projects %~dp0LoggingBranch\LB.csproj /p:DisablePackageAssetsCache=true /p:DisableTransitiveFrameworkReferences=true /bl:artifacts/log/SiteExtensions-LoggingBranch-x64.binlog %*
CALL %RepoRoot%\build.cmd -forceCoreMsbuild -arch x86 -projects %~dp0LoggingBranch\LB.csproj /p:DisablePackageAssetsCache=true /p:DisableTransitiveFrameworkReferences=true /bl:artifacts/log/SiteExtensions-LoggingBranch-x86.binlog %*

IF %ERRORLEVEL% NEQ 0 (
   EXIT /b %ErrorLevel%
)

ECHO Building Microsoft.AspNetCore.AzureAppServices.SiteExtension
CALL %RepoRoot%\build.cmd -forceCoreMsbuild -projects %~dp0LoggingAggregate\src\Microsoft.AspNetCore.AzureAppServices.SiteExtension\Microsoft.AspNetCore.AzureAppServices.SiteExtension.csproj /bl:artifacts/log/SiteExtensions-LoggingAggregate.binlog %*

IF %ERRORLEVEL% NEQ 0 (
   EXIT /b %ErrorLevel%
)

ECHO SiteExtensions successfully built!

@ECHO OFF
SET RepoRoot=%~dp0..\..

ECHO Building Microsoft.AspNetCore.Runtime.SiteExtension
CALL %RepoRoot%\build.cmd -arch x64 -projects %~dp0Runtime\Microsoft.AspNetCore.Runtime.SiteExtension.pkgproj /bl:artifacts/log/SiteExtensions-Runtime-x64.binlog %*
CALL %RepoRoot%\build.cmd -arch x86 -projects %~dp0Runtime\Microsoft.AspNetCore.Runtime.SiteExtension.pkgproj /bl:artifacts/log/SiteExtensions-Runtime-x86.binlog %*

IF %ERRORLEVEL% NEQ 0 (
   EXIT /b %ErrorLevel%
)

ECHO Building LoggingBranch
REM /p:DisableTransitiveFrameworkReferences=true is needed to prevent SDK from picking up transitive references to Microsoft.AspNetCore.App as framework references https://github.com/dotnet/sdk/pull/3221
CALL %RepoRoot%\build.cmd -forceCoreMsbuild -arch x64 -projects %~dp0LoggingBranch\LB.csproj /p:DisableTransitiveFrameworkReferences=true /bl:artifacts/log/SiteExtensions-LoggingBranch-x64.binlog %*
CALL %RepoRoot%\build.cmd -forceCoreMsbuild -arch x86 -projects %~dp0LoggingBranch\LB.csproj /p:DisableTransitiveFrameworkReferences=true /bl:artifacts/log/SiteExtensions-LoggingBranch-x86.binlog %*

IF %ERRORLEVEL% NEQ 0 (
   EXIT /b %ErrorLevel%
)

ECHO Building Microsoft.AspNetCore.AzureAppServices.SiteExtension
CALL %RepoRoot%\build.cmd -forceCoreMsbuild -projects %~dp0LoggingAggregate\src\Microsoft.AspNetCore.AzureAppServices.SiteExtension\Microsoft.AspNetCore.AzureAppServices.SiteExtension.csproj /bl:artifacts/log/SiteExtensions-LoggingAggregate.binlog %*

IF %ERRORLEVEL% NEQ 0 (
   EXIT /b %ErrorLevel%
)

ECHO SiteExtensions successfully built!

Remove site-extension workarounds (#13044)


@echo off

rem OW2 FraSCAti distribution
rem Copyright (C) 2008-2009 INRIA, USTL
rem
rem This library is free software; you can redistribute it and/or
rem modify it under the terms of the GNU Lesser General Public
rem License as published by the Free Software Foundation; either
rem version 2 of the License, or (at your option) any later version.
rem
rem This library is distributed in the hope that it will be useful,
rem but WITHOUT ANY WARRANTY; without even the implied warranty of
rem MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
rem Lesser General Public License for more details.
rem
rem You should have received a copy of the GNU Lesser General Public
rem License along with this library; if not, write to the Free Software
rem Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307
rem USA

@setlocal

if defined JAVA_HOME (
  set JAVA=%JAVA_HOME%\bin\java
  set JAVAC=%JAVA_HOME%\bin\javac
  set JAR=%JAVA_HOME%\bin\jar
  set JAVA_OPTS=-Xms16m -Xmx32m
) else (
  echo The JAVA_HOME variable is not set. Please initialize it in your environment
)

if exist "%FRASCATI_HOME%" goto CONFIG

set FRASCATI_HOME=%~dp0
rem Removes the "/bin/" string at the end of this script path
set FRASCATI_HOME=%FRASCATI_HOME:~0,-5%
echo The FRASCATI_HOME variable is not set. Using %FRASCATI_HOME% as default value.

:CONFIG
set FRASCATI_VERSION=1.4
set FRASCATI_LIB=%FRASCATI_HOME%\lib
set FRASCATI_MAIN=org.ow2.frascati.factory.FactoryCommandLine
set FSCRIPT_CONSOLE_MAIN=org.ow2.frascati.fscript.console.Main
set LOGGING=%FRASCATI_HOME%\conf\logging.properties
set LAUNCHER_MAIN=org.ow2.frascati.Launcher
set LAUNCHER_LIB=%FRASCATI_LIB%\frascati-runtime-%FRASCATI_VERSION%.jar
set SCA_APPS_FOLDER=%FRASCATI_HOME%\sca-apps

set FRASCATI_CMD=%1
set PARAMS=%*

rem Test if an option -s is specified or not
rem WARNING: This code can only work if there is one and only one option available for the frascati command

if "%1" == "-version"  goto VERSION
if "%1" == "--version"  goto VERSION
if "%1" == "-v"  goto VERSION

if "%2" == "-s"  set FRASCATI_SCRIPT_FLAG=TRUE
if "%3" == "-s"  set FRASCATI_SCRIPT_FLAG=TRUE
if "%2" == "-r"  set FRASCATI_REMOTE_FLAG=TRUE
if "%3" == "-r"  set FRASCATI_REMOTE_FLAG=TRUE

if "%1" == "wsdl2java" (
	echo Compiling ...
    goto WSDL2JAVA
) else if "%1" == "compile" (
	echo Compiling ...
    goto COMPILE
) else if "%1" == "run" (
	echo Running OW2 FraSCAti ...
	"%JAVA%" %JAVA_OPTS% -Djava.security.policy="%FRASCATI_HOME%\conf\java.policy" -Djava.util.logging.config.file="%LOGGING%" -Dlog4j.configuration=logging.properties -cp "%FRASCATI_HOME%"\conf;"%LAUNCHER_LIB%" %LAUNCHER_MAIN% %FRASCATI_MAIN% -lib "%FRASCATI_LIB%" %PARAMS:~4%
	echo Exiting OW2 FraSCAti ...
	goto END
) else if "%1" == "explorer" (
	goto EXPLORER
) else if "%1" == "console" (
	echo Running the OW2 FraSCAti FScript console ...
	"%JAVA%" %JAVA_OPTS% -Djava.security.policy="%FRASCATI_HOME%\conf\java.policy" -Djava.util.logging.config.file="%LOGGING%" -Dlog4j.configuration=logging.properties -cp "%FRASCATI_HOME%"\conf;"%LAUNCHER_LIB%" %LAUNCHER_MAIN% %FSCRIPT_CONSOLE_MAIN% -lib "%FRASCATI_LIB%","%FRASCATI_LIB%"\fscript %PARAMS:~4%
	echo Exiting OW2 FraSCAti FScript console ...
	goto END
) else (
	echo "Usage: frascati {wsdl2java|compile|run|explorer|console}"
	echo frascati -?     print this message
	echo frascati -v     OW2 FraSCAti version
	goto END
)

:WSDL2JAVA
set FRASCATI_MAIN=org.ow2.frascati.factory.WebServiceCommandLine
"%JAVA%" -Djava.util.logging.config.file="%LOGGING%" -Dlog4j.configuration=logging.properties -cp "%FRASCATI_HOME%\conf;%LAUNCHER_LIB%" "%LAUNCHER_MAIN%" "%FRASCATI_MAIN%" -lib "%FRASCATI_LIB%" %PARAMS:~4%
goto END

:COMPILE
shift
if "%1"=="" goto COMPILE_USAGE
if "%2"=="" goto COMPILE_USAGE

set CURRENT_DIR=%CD%
set OUTPUT=tmp
mkdir %OUTPUT%

rem Search java sources in .\src\...
setlocal ENABLEDELAYEDEXPANSION
IF ERRORLEVEL 1 (
  echo Impossible d'activer les extensions
  goto END
)
set SRC_FILES=
for /r %1 %%X in (*.java) do (set SRC_FILES=!SRC_FILES! "%%X")
setlocal DISABLEDELAYEDEXPANSION
set SRC_FILES=%SRC_FILES:\=/%
echo %SRC_FILES% > javasrc.tmp~

if ERRORLEVEL 1 (
  echo Cannot find Java source files in %1
  goto END
)

rem Compile Java sources
"%JAVAC%" -d "%OUTPUT%" -cp "%FRASCATI_LIB%\osoa-java-api-2.0.1.2.jar;%FRASCATI_LIB%\jaxb-api-2.1.jar;%FRASCATI_LIB%\geronimo-ws-metadata_2.0_spec-1.1.2.jar;%FRASCATI_LIB%\geronimo-jaxws_2.1_spec-1.0.jar;%FRASCATI_LIB%\jsr311-api-1.1.1.jar;%FRASCATI_LIB%\explorer-1.0.jar;%FRASCATI_LIB%\frascati-explorer-api-%FRASCATI_VERSION%.jar" @javasrc.tmp~
rem Copy composite files
for /r %1 %%X in (*.composite) do (copy /Y "%%X" "%OUTPUT%")
rem Copy Explorer files
mkdir %OUTPUT%\META-INF
for /r %1 %%X in (FraSCAti-Explorer.xml) do (copy /Y "%%X" "%OUTPUT%\META-INF")

rem Build jar file
cd %OUTPUT%
"%JAR%" cf ../%2.jar *
cd %CURRENT_DIR%
echo Library %2.jar created

rem clean up
rmdir /S/Q "%OUTPUT%"
del /Q javasrc.tmp~

goto END

:COMPILE_USAGE
echo Usage: frascati compile [src] [name]
echo [src]  = directory of the sources to compile
echo [name] = name of the jar to build
goto END

:EXPLORER
shift
set EXPLORER_LAUNCHER=org.ow2.frascati.explorer.FrascatiExplorerLauncher
set EXPLORER_CLASSPATH=%FRASCATI_LIB%,%FRASCATI_LIB%\explorer
set EXPLORER_BOOTSTRAP=

echo Running the OW2 FraSCAti Explorer ...

if "%FRASCATI_REMOTE_FLAG%" == "TRUE" (
  set EXPLORER_CLASSPATH=%EXPLORER_CLASSPATH%,%FRASCATI_LIB%\fscript,%FRASCATI_LIB%\remote
  set EXPLORER_BOOTSTRAP="-Dorg.ow2.frascati.bootstrap=org.ow2.frascati.bootstrap.FraSCAtiJDTFractalRest"
  echo -^> FraSCAti Remote plugin activated
  if "%FRASCATI_SCRIPT_FLAG%" == "TRUE" (
    set EXPLORER_CLASSPATH=%EXPLORER_CLASSPATH%,%FRASCATI_LIB%\explorer-fscript-plugin
    echo -^> FraSCAti Script plugin activated
  )
) else (
  if "%FRASCATI_SCRIPT_FLAG%" == "TRUE" (
    set EXPLORER_CLASSPATH=%EXPLORER_CLASSPATH%,%FRASCATI_LIB%\fscript,%FRASCATI_LIB%\explorer-fscript-plugin
    echo -^> FraSCAti Script plugin activated
  )
)

if exist %SCA_APPS_FOLDER% (
  rem update the classpath with user libraries
  pushd "%SCA_APPS_FOLDER%"
  for /d %%X in ("*") do (set EXPLORER_CLASSPATH=%EXPLORER_CLASSPATH%,%%~X)
  popd

  rem search for composite files
  setlocal EnableDelayedExpansion
  set COMPOSITES=
  for /r "%SCA_APPS_FOLDER%" %%X in (*.composite) do ( set COMPOSITES=!COMPOSITES! %%~nX )
  setlocal DISABLEDELAYEDEXPANSION
)

"%JAVA%" %JAVA_OPTS% %EXPLORER_BOOTSTRAP% -cp "%LAUNCHER_LIB%" %LAUNCHER_MAIN% %EXPLORER_LAUNCHER% -lib "%EXPLORER_CLASSPATH%" %COMPOSITES%

echo Exiting OW2 FraSCAti Explorer ...
goto END

:VERSION
echo OW2 FraSCAti version %FRASCATI_VERSION%
GOTO END

:END

@echo off

rem OW2 FraSCAti distribution
rem Copyright (C) 2008-2009 INRIA, USTL
rem
rem This library is free software; you can redistribute it and/or
rem modify it under the terms of the GNU Lesser General Public
rem License as published by the Free Software Foundation; either
rem version 2 of the License, or (at your option) any later version.
rem
rem This library is distributed in the hope that it will be useful,
rem but WITHOUT ANY WARRANTY; without even the implied warranty of
rem MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
rem Lesser General Public License for more details.
rem
rem You should have received a copy of the GNU Lesser General Public
rem License along with this library; if not, write to the Free Software
rem Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307
rem USA

@setlocal

if defined JAVA_HOME (
	set JAVA=%JAVA_HOME%\bin\java
	set JAVAC=%JAVA_HOME%\bin\javac
	set JAR=%JAVA_HOME%\bin\jar
	set JAVA_OPTS=-Xms16m -Xmx32m
) else (
	echo The JAVA_HOME variable is not set. Please initialize it in your environment
)

if exist "%FRASCATI_HOME%" goto CONFIG

set FRASCATI_HOME=%~dp0
rem Removes the "/bin/" string at the end of this script path
set FRASCATI_HOME=%FRASCATI_HOME:~0,-5%
echo The FRASCATI_HOME variable is not set. Using %FRASCATI_HOME% as default value.

:CONFIG
set FRASCATI_VERSION=1.4
set FRASCATI_LIB=%FRASCATI_HOME%\lib
set FRASCATI_MAIN=org.ow2.frascati.factory.FactoryCommandLine
set FSCRIPT_CONSOLE_MAIN=org.ow2.frascati.fscript.console.Main
set LOGGING=%FRASCATI_HOME%\conf\logging.properties
set LAUNCHER_MAIN=org.ow2.frascati.Launcher
set LAUNCHER_LIB=%FRASCATI_LIB%\frascati-runtime-%FRASCATI_VERSION%.jar
set SCA_APPS_FOLDER=%FRASCATI_HOME%\sca-apps

set FRASCATI_CMD=%1
set PARAMS=%*

rem Test if an option -s is specified or not
rem WARNING: This code can only work if there is one and only one option available for the frascati command

if "%1" == "-version"  goto VERSION
if "%1" == "--version"  goto VERSION
if "%1" == "-v"  goto VERSION

if "%2" == "-s"  set FRASCATI_SCRIPT_FLAG=TRUE
if "%3" == "-s"  set FRASCATI_SCRIPT_FLAG=TRUE
if "%2" == "-r"  set FRASCATI_REMOTE_FLAG=TRUE
if "%3" == "-r"  set FRASCATI_REMOTE_FLAG=TRUE

if "%1" == "wsdl2java" (
	echo Compiling ...
		goto WSDL2JAVA
) else if "%1" == "compile" (
	echo Compiling ...
		goto COMPILE
) else if "%1" == "compile-libs" (
	echo Compiling with libs ...
		goto COMPILELIBS
) else if "%1" == "run" (
	echo Running OW2 FraSCAti ...
	"%JAVA%" %JAVA_OPTS% -Djava.security.policy="%FRASCATI_HOME%\conf\java.policy" -Djava.util.logging.config.file="%LOGGING%" -Dlog4j.configuration=logging.properties -cp "%FRASCATI_HOME%"\conf;"%LAUNCHER_LIB%" %LAUNCHER_MAIN% %FRASCATI_MAIN% -lib "%FRASCATI_LIB%" %PARAMS:~4%
	echo Exiting OW2 FraSCAti ...
	goto END
) else if "%1" == "explorer" (
	goto EXPLORER
) else if "%1" == "console" (
	echo Running the OW2 FraSCAti FScript console ...
	"%JAVA%" %JAVA_OPTS% -Djava.security.policy="%FRASCATI_HOME%\conf\java.policy" -Djava.util.logging.config.file="%LOGGING%" -Dlog4j.configuration=logging.properties -cp "%FRASCATI_HOME%"\conf;"%LAUNCHER_LIB%" %LAUNCHER_MAIN% %FSCRIPT_CONSOLE_MAIN% -lib "%FRASCATI_LIB%","%FRASCATI_LIB%"\fscript %PARAMS:~4%
	echo Exiting OW2 FraSCAti FScript console ...
	goto END
) else (
	echo "Usage: frascati {wsdl2java|compile|run|explorer|console}"
	echo frascati -?     print this message
	echo frascati -v     OW2 FraSCAti version
	goto END
)

:WSDL2JAVA
set FRASCATI_MAIN=org.ow2.frascati.factory.WebServiceCommandLine
"%JAVA%" -Djava.util.logging.config.file="%LOGGING%" -Dlog4j.configuration=logging.properties -cp "%FRASCATI_HOME%\conf;%LAUNCHER_LIB%" "%LAUNCHER_MAIN%" "%FRASCATI_MAIN%" -lib "%FRASCATI_LIB%" %PARAMS:~4%
goto END

:COMPILE
shift
if "%1"=="" goto COMPILE_USAGE
if "%2"=="" goto COMPILE_USAGE

set CURRENT_DIR=%CD%
set OUTPUT=tmp
mkdir %OUTPUT%

rem Search java sources in .\src\...
setlocal ENABLEDELAYEDEXPANSION
IF ERRORLEVEL 1 (
	echo Impossible d'activer les extensions
	goto END
)
set SRC_FILES=
for /r %1 %%X in (*.java) do (set SRC_FILES=!SRC_FILES! "%%X")
setlocal DISABLEDELAYEDEXPANSION
set SRC_FILES=%SRC_FILES:\=/%
echo %SRC_FILES% > javasrc.tmp~

if ERRORLEVEL 1 (
	echo Cannot find Java source files in %1
	goto END
)

rem Compile Java sources
"%JAVAC%" -d "%OUTPUT%" -cp "%FRASCATI_LIB%\osoa-java-api-2.0.1.2.jar;%FRASCATI_LIB%\jaxb-api-2.1.jar;%FRASCATI_LIB%\geronimo-ws-metadata_2.0_spec-1.1.2.jar;%FRASCATI_LIB%\geronimo-jaxws_2.1_spec-1.0.jar;%FRASCATI_LIB%\jsr311-api-1.1.1.jar;%FRASCATI_LIB%\explorer-1.0.jar;%FRASCATI_LIB%\frascati-explorer-api-%FRASCATI_VERSION%.jar" @javasrc.tmp~
rem Copy composite files
for /r %1 %%X in (*.composite) do (copy /Y "%%X" "%OUTPUT%")
rem Copy Explorer files
mkdir %OUTPUT%\META-INF
for /r %1 %%X in (FraSCAti-Explorer.xml) do (copy /Y "%%X" "%OUTPUT%\META-INF")

rem Build jar file
cd %OUTPUT%
"%JAR%" cf ../%2.jar *
cd %CURRENT_DIR%
echo Library %2.jar created

rem clean up
rmdir /S/Q "%OUTPUT%"
del /Q javasrc.tmp~

goto END

:COMPILE_USAGE
echo Usage: frascati compile-libs [src] [name]
echo [src]  = directory of the sources to compile
echo [name] = name of the jar to build
goto END

:COMPILELIBS
for /f "usebackq tokens=3*" %%i in (`echo %*`) DO @ set LIBPARAMS=%%j
shift
if "%1"=="" goto COMPILELIBS_USAGE
if "%2"=="" goto COMPILELIBS_USAGE

set CURRENT_DIR=%CD%
set OUTPUT=tmp
mkdir %OUTPUT%

rem Search java sources in .\src\...
setlocal ENABLEDELAYEDEXPANSION
IF ERRORLEVEL 1 (
	echo Impossible d'activer les extensions
	goto END
)
set SRC_FILES=
for /r %1 %%X in (*.java) do (set SRC_FILES=!SRC_FILES! "%%X")
setlocal DISABLEDELAYEDEXPANSION
set SRC_FILES=%SRC_FILES:\=/%
echo %SRC_FILES% > javasrc.tmp~

if ERRORLEVEL 1 (
	echo Cannot find Java source files in %1
	goto END
)

rem Compile Java sources
"%JAVAC%" -d "%OUTPUT%" -cp "%FRASCATI_LIB%\osoa-java-api-2.0.1.2.jar;%FRASCATI_LIB%\jaxb-api-2.1.jar;%FRASCATI_LIB%\geronimo-ws-metadata_2.0_spec-1.1.2.jar;%FRASCATI_LIB%\geronimo-jaxws_2.1_spec-1.0.jar;%FRASCATI_LIB%\jsr311-api-1.1.1.jar;%FRASCATI_LIB%\explorer-1.0.jar;%FRASCATI_LIB%\frascati-explorer-api-%FRASCATI_VERSION%.jar;%LIBPARAMS%" @javasrc.tmp~
rem Copy composite files
for /r %1 %%X in (*.composite) do (copy /Y "%%X" "%OUTPUT%")
rem Copy Explorer files
mkdir %OUTPUT%\META-INF
for /r %1 %%X in (FraSCAti-Explorer.xml) do (copy /Y "%%X" "%OUTPUT%\META-INF")

rem Build jar file
cd %OUTPUT%
"%JAR%" cf ../%2.jar *
cd %CURRENT_DIR%
echo Library %2.jar created

rem clean up
rmdir /S/Q "%OUTPUT%"
del /Q javasrc.tmp~

goto END

:COMPILELIBS_USAGE
echo Usage: frascati compile-libs [src] [name] [jar-files]
echo [src]  = directory of the sources to compile
echo [name] = name of the jar to build
echo [jar-files] =  comma-separated jar libraries to include in the CLASSPATH
goto END

:EXPLORER
shift
set EXPLORER_LAUNCHER=org.ow2.frascati.explorer.FrascatiExplorerLauncher
set EXPLORER_CLASSPATH=%FRASCATI_LIB%,%FRASCATI_LIB%\explorer
set EXPLORER_BOOTSTRAP=

echo Running the OW2 FraSCAti Explorer ...

if "%FRASCATI_REMOTE_FLAG%" == "TRUE" (
	set EXPLORER_CLASSPATH=%EXPLORER_CLASSPATH%,%FRASCATI_LIB%\fscript,%FRASCATI_LIB%\remote
	set EXPLORER_BOOTSTRAP="-Dorg.ow2.frascati.bootstrap=org.ow2.frascati.bootstrap.FraSCAtiJDTFractalRest"
	echo -^> FraSCAti Remote plugin activated
	if "%FRASCATI_SCRIPT_FLAG%" == "TRUE" (
		set EXPLORER_CLASSPATH=%EXPLORER_CLASSPATH%,%FRASCATI_LIB%\explorer-fscript-plugin
		echo -^> FraSCAti Script plugin activated
	)
) else (
	if "%FRASCATI_SCRIPT_FLAG%" == "TRUE" (
		set EXPLORER_CLASSPATH=%EXPLORER_CLASSPATH%,%FRASCATI_LIB%\fscript,%FRASCATI_LIB%\explorer-fscript-plugin
		echo -^> FraSCAti Script plugin activated
	)
)

if exist %SCA_APPS_FOLDER% (
	rem update the classpath with user libraries
	pushd "%SCA_APPS_FOLDER%"
	for /d %%X in ("*") do (set EXPLORER_CLASSPATH=%EXPLORER_CLASSPATH%,%%~X)
	popd

	rem search for composite files
	setlocal EnableDelayedExpansion
	set COMPOSITES=
	for /r "%SCA_APPS_FOLDER%" %%X in (*.composite) do ( set COMPOSITES=!COMPOSITES! %%~nX )
	setlocal DISABLEDELAYEDEXPANSION
)

"%JAVA%" %JAVA_OPTS% %EXPLORER_BOOTSTRAP% -cp "%LAUNCHER_LIB%" %LAUNCHER_MAIN% %EXPLORER_LAUNCHER% -lib "%EXPLORER_CLASSPATH%" %COMPOSITES%

echo Exiting OW2 FraSCAti Explorer ...
goto END

:VERSION
echo OW2 FraSCAti version %FRASCATI_VERSION%
GOTO END

:END

Allow to compile with dependencies (Windows)


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

::
:: build_proton.bat
:: Version 1.5 2015-07-09
:: Version 1.6 2016-03-08 Add VS2015
::
:: Usage: build_proton.bat INSTALL_ROOT_PATH [2008|2010|2012|2013|2015 x64|x86 [any         [any]]]
::                         %1                 %2                       %3       %4           %5
::                                                                              keep build  keep install
:: A script to cmake/make/install proton on windows.
::
:: This script expects to execute from the root of a proton checkout,
:: the directory that holds proton-c and proton-j.
::
:: It produces an installed directory that qpid can share to get 1.0 support.
::
:: Cmake and the compiles will be in subfolder of the current directory:
::      .\build_2008_x86
::      .\build_2010_x86
::      .\build_2008_x64
::      .\build_2010_x64
::
:: Installs are steered to sub directories under INSTALL_ROOT_PATH in %1.
::      %1%\install_2008_x86
::      %1%\install_2010_x86
::      %1%\install_2008_x64
::      %1%\install_2010_x64
::
::   The install directories are suitable to be consumed in a
::   qpid\cpp build:
::      cmake ... -DCMAKE_INSTALL_PREFIX=<INSTALL_ROOT_PATH>\install_2010_x86 ...
::   where the qpid build does not know nor care if proton is installed.
::   If proton is present then it is included, otherwise not.
::
:: Note: This script blindly tries to compile proton whether the requested
:: compiler is installed or not. Don't call build_proton with args that
:: your computer can't satisfy.
::
:: Hacky external CR_UNATTENDED inhibits pause before each build.

:: Check that CD is a proton checkout
IF NOT exist .\proton-c (echo This script must execute from a proton checkout root && pause && goto :eof)
IF NOT exist .\proton-j (echo This script must execute from a proton checkout root && pause && goto :eof)

:: Check that the INSTALL_ROOT_PATH is specified
IF "%1"=="" (echo You must specify an INSTALL_ROOT_PATH && GOTO :Usage)

:: Check for help
IF "%1"=="help"  GOTO :Usage
IF "%1"=="/help" GOTO :Usage
IF "%1"=="?"     GOTO :Usage
IF "%1"=="/?"    GOTO :Usage
IF "%1"=="-?"    GOTO :Usage
set xx=%1
IF "%xx:~0,2%"=="-h"    GOTO :Usage
IF "%xx:~0,3%"=="--h"   GOTO :Usage

SET INSTALL_ROOT=%~f1%
::set INSTALL_ROOT=d:\users\crolke\git\rh-qpid-proton\install_022
:: Forgive a trailing slash
IF "%INSTALL_ROOT:~-1%"=="\" SET INSTALL_ROOT=%INSTALL_ROOT:~0,-1%
ECHO Installing to %INSTALL_ROOT%

:: See if build of specific compile/arch is specified
SET cli_compiler=%2
SET cli_arch=%3

:: Get directory flush inhibitor switches
SET keep_build=%4
SET keep_install=%5
IF DEFINED keep_build   (SET   keep_build=true) else (SET   keep_build=false)
IF DEFINED keep_install (SET keep_install=true) else (SET keep_install=false)

:: build either once from the command line setting or N times from the list below
SET cli_build=false
IF DEFINED cli_compiler IF DEFINED cli_arch (SET cli_build=true)
IF "%cli_build%"=="true" (
    call :build_proton %cli_compiler% %cli_arch% %INSTALL_ROOT% "%keep_build%" "%keep_install%"
) ELSE (
    call :build_proton 2008 x86  %INSTALL_ROOT% "%keep_build%" "%keep_install%"
    call :build_proton 2010 x86  %INSTALL_ROOT% "%keep_build%" "%keep_install%"
    call :build_proton 2012 x86  %INSTALL_ROOT% "%keep_build%" "%keep_install%"
    call :build_proton 2013 x86  %INSTALL_ROOT% "%keep_build%" "%keep_install%"
    call :build_proton 2015 x86  %INSTALL_ROOT% "%keep_build%" "%keep_install%"
    call :build_proton 2008 x64  %INSTALL_ROOT% "%keep_build%" "%keep_install%"
    call :build_proton 2010 x64  %INSTALL_ROOT% "%keep_build%" "%keep_install%"
    call :build_proton 2012 x64  %INSTALL_ROOT% "%keep_build%" "%keep_install%"
    call :build_proton 2013 x64  %INSTALL_ROOT% "%keep_build%" "%keep_install%"
    call :build_proton 2015 x64  %INSTALL_ROOT% "%keep_build%" "%keep_install%"
)
goto :eof

::
:: build a proton
::  %1 selects architecture x86 or x64
::  %2 selects studio 2008 or 2010 or 2012 or 2013
::  %3 is fully qualified install root path with no trailing slash
::  %4 true|false to keep build directory
::  %5 true|false to keep install directory
:build_proton

:: push the env
setlocal

set vsname=%1
set arch=%2
set INSTALL_ROOT_PATH=%3
set keep_build=%4
set keep_install=%5

set   build_dir=build_%vsname%_%arch%
set install_dir=%INSTALL_ROOT_PATH%\install_%vsname%_%arch%

REM VS2008 or VS2010 or VS2012 or VS2013 or VS2015, x86 or x64
if "%vsname%"=="2008" (
    if "%arch%" == "x86" (
        call "%VS90COMNTOOLS%..\..\VC\vcvarsall.bat" x86
        if ERRORLEVEL 1 exit /b 1
        set cmakegen="Visual Studio 9 2008"
        set proton_arch=Win32
    ) else (
        call "%VS90COMNTOOLS%..\..\VC\vcvarsall.bat" amd64
        if ERRORLEVEL 1 exit /b 1
        set cmakegen="Visual Studio 9 2008 Win64"
        set proton_arch=x64
    )
)
if "%vsname%"=="2010" (
    if "%arch%" == "x86" (
        call "%VS100COMNTOOLS%..\..\VC\vcvarsall.bat" x86
        if ERRORLEVEL 1 exit /b 1
        set cmakegen="Visual Studio 10"
        set proton_arch=Win32
    ) else (
        call "%VS100COMNTOOLS%..\..\VC\vcvarsall.bat" amd64
        if ERRORLEVEL 1 exit /b 1
        set cmakegen="Visual Studio 10 Win64"
        set proton_arch=x64
    )
)
if "%vsname%"=="2012" (
    if "%arch%" == "x86" (
        call "%VS110COMNTOOLS%..\..\VC\vcvarsall.bat" x86
        if ERRORLEVEL 1 exit /b 1
        set cmakegen="Visual Studio 11"
        set proton_arch=Win32
    ) else (
        call "%VS110COMNTOOLS%..\..\VC\vcvarsall.bat" amd64
        if ERRORLEVEL 1 exit /b 1
        set cmakegen="Visual Studio 11 Win64"
        set proton_arch=x64
    )
)
if "%vsname%"=="2013" (
    if "%arch%" == "x86" (
        call "%VS120COMNTOOLS%..\..\VC\vcvarsall.bat" x86
        if ERRORLEVEL 1 exit /b 1
        set cmakegen="Visual Studio 12"
        set proton_arch=Win32
    ) else (
        call "%VS120COMNTOOLS%..\..\VC\vcvarsall.bat" amd64
        if ERRORLEVEL 1 exit /b 1
        set cmakegen="Visual Studio 12 Win64"
        set proton_arch=x64
    )
)
if "%vsname%"=="2015" (
    if "%arch%" == "x86" (
        call "%VS140COMNTOOLS%..\..\VC\vcvarsall.bat" x86
        if ERRORLEVEL 1 exit /b 1
        set cmakegen="Visual Studio 14 2015"
        set proton_arch=Win32
    ) else (
        call "%VS140COMNTOOLS%..\..\VC\vcvarsall.bat" amd64
        if ERRORLEVEL 1 exit /b 1
        set cmakegen="Visual Studio 14 2015 Win64"
        set proton_arch=x64
    )
)
if "%proton_arch%"=="" (
    echo Arch not recognized : %arch%
    goto :eof
)

@echo off
echo.
echo ===================================================================
echo Ready to build.
echo Using visual studio : %vsname%
echo Architecture        : %arch%
echo Build directory     : %build_dir%
echo Install directory   : %install_dir%
echo Keep build dir      : %keep_build%
echo Keep install dir    : %keep_install%
echo .
IF NOT DEFINED CR_UNATTENDED (echo Press Enter to continue, Ctrl-C to abort && pause)
@echo on

:: fresh build/install areas
if   %keep_build%=="false" call :MakeNewDir   %build_dir%
if %keep_install%=="false" call :MakeNewDir %install_dir%

:: descend into build area
pushd %build_dir%

:: run cmake
cmake -G %cmakegen% -DCMAKE_INSTALL_PREFIX=%install_dir% -DGEN_JAVA=No -DBUILD_JAVA=No ..

:: build/install proton
devenv proton.sln /build "Debug|%proton_arch%"          /project INSTALL
if ERRORLEVEL 1 (
    echo FAIL FAIL FAIL: Studio failure building DEBUG %build_dir%
    exit /b 1
)

devenv proton.sln /build "RelWithDebInfo|%proton_arch%" /project INSTALL
if ERRORLEVEL 1 (
    echo FAIL FAIL FAIL: Studio failure building RELWITHDEBINFO %build_dir%
    exit /b 1
)

:: ascend from build area
popd

:: restore path and environment
endlocal

:: done
goto :eof

REM
REM MakeNewDir dirname
REM
:MakeNewDir
echo MakeNewDir: Start recreating %1. Delete %1
rmdir /s /q %1
timeout /t 1 /nobreak > nul
echo MakeNewDir: Checking if %1 still exists
if exist %1\nul (echo "%1 still exists. Type Ctrl-C to exit and fix %1" && pause && goto :eof)
echo MakeNewDir: Create %1
mkdir       %1
echo MakeNewDIr: Done  recreating %1
goto :eof

REM
REM Usage
REM
:Usage
echo Usage: build_proton.bat INSTALL_ROOT_PATH [2008,2010,2012,2013,2015 x64,x86 [any         [any]]]
echo                         arg1               arg2                     arg3     arg4         arg5
echo                                                                              keep build  keep install
echo     arg1 INSTALL_ROOT_PATH [required] may be any absolute or relative path including '.' .
echo     arg2 CLI_COMPILER      [optional] may be 2008, 2010, 2012, 2013, or 2015. If absent the all are compiled.
echo     arg3 CLI_ARCH                     may be x86 or x64. If absent then all are compied.
echo     arg4 KEEP_BUILD        [optional] any text. If present then build directory is used and not flushed.
echo     arg5 KEEP_INSTALL      [optional] any text. If present then install directory is used and not flushed.
echo.
echo     Build and Install directories for {2010, x86} will 'build_2010_x86' and 'install_2010_x86'.
echo     Other {compiler, arch} combinations follow the same pattern.
echo.
echo     Define environment variable CR_UNATTENDED to skip pausing between build steps.
goto :eof

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

::
:: build_proton.bat
:: Version 1.5 2015-07-09
:: Version 1.6 2016-03-08 Add VS2015
:: Version 1.7 2017-10-25 Add VS2017, Remove VS2008
::
:: Usage: build_proton.bat INSTALL_ROOT_PATH [2010|2012|2013|2015|2017 x64|x86 [any         [any]]]
::                         %1                 %2                       %3       %4           %5
::                                                                              keep build  keep install
:: A script to cmake/make/install proton on windows.
::
:: This script expects to execute from the root of a proton checkout,
:: the directory that holds proton-c and proton-j.
::
:: It produces an installed directory that qpid can share to get 1.0 support.
::
:: Cmake and the compiles will be in subfolder of the current directory:
::      .\build_2010_x86
::      .\build_2010_x64
::
:: Installs are steered to sub directories under INSTALL_ROOT_PATH in %1.
::      %1%\install_2010_x86
::      %1%\install_2010_x64
::
::   The install directories are suitable to be consumed in a
::   qpid\cpp build:
::      cmake ... -DCMAKE_INSTALL_PREFIX=<INSTALL_ROOT_PATH>\install_2010_x86 ...
::   where the qpid build does not know nor care if proton is installed.
::   If proton is present then it is included, otherwise not.
::
:: Note: This script blindly tries to compile proton whether the requested
:: compiler is installed or not. Don't call build_proton with args that
:: your computer can't satisfy.
::
:: Hacky external CR_UNATTENDED inhibits pause before each build.

:: Check that CD is a proton checkout
IF NOT exist .\proton-c (echo This script must execute from a proton checkout root && pause && goto :eof)
IF NOT exist .\proton-j (echo This script must execute from a proton checkout root. If this is a distribution kit then proton-j is absent. Just 'mkdir proton-j' and build again. && pause && goto :eof)

:: Check that the INSTALL_ROOT_PATH is specified
IF "%1"=="" (echo You must specify an INSTALL_ROOT_PATH && GOTO :Usage)

:: Check for help
IF "%1"=="help"  GOTO :Usage
IF "%1"=="/help" GOTO :Usage
IF "%1"=="?"     GOTO :Usage
IF "%1"=="/?"    GOTO :Usage
IF "%1"=="-?"    GOTO :Usage
set xx=%1
IF "%xx:~0,2%"=="-h"    GOTO :Usage
IF "%xx:~0,3%"=="--h"   GOTO :Usage

SET INSTALL_ROOT=%~f1%
::set INSTALL_ROOT=d:\users\crolke\git\rh-qpid-proton\install_022
:: Forgive a trailing slash
IF "%INSTALL_ROOT:~-1%"=="\" SET INSTALL_ROOT=%INSTALL_ROOT:~0,-1%
ECHO Installing to %INSTALL_ROOT%

:: See if build of specific compile/arch is specified
SET cli_compiler=%2
SET cli_arch=%3

:: Get directory flush inhibitor switches
SET keep_build=%4
SET keep_install=%5
IF DEFINED keep_build   (SET   keep_build=true) else (SET   keep_build=false)
IF DEFINED keep_install (SET keep_install=true) else (SET keep_install=false)

:: build either once from the command line setting or N times from the list below
SET cli_build=false
IF DEFINED cli_compiler IF DEFINED cli_arch (SET cli_build=true)
IF "%cli_build%"=="true" (
    call :build_proton %cli_compiler% %cli_arch% %INSTALL_ROOT% "%keep_build%" "%keep_install%"
) ELSE (
    call :build_proton 2010 x86  %INSTALL_ROOT% "%keep_build%" "%keep_install%"
    call :build_proton 2012 x86  %INSTALL_ROOT% "%keep_build%" "%keep_install%"
    call :build_proton 2013 x86  %INSTALL_ROOT% "%keep_build%" "%keep_install%"
    call :build_proton 2015 x86  %INSTALL_ROOT% "%keep_build%" "%keep_install%"
    call :build_proton 2017 x86  %INSTALL_ROOT% "%keep_build%" "%keep_install%"
    call :build_proton 2010 x64  %INSTALL_ROOT% "%keep_build%" "%keep_install%"
    call :build_proton 2012 x64  %INSTALL_ROOT% "%keep_build%" "%keep_install%"
    call :build_proton 2013 x64  %INSTALL_ROOT% "%keep_build%" "%keep_install%"
    call :build_proton 2015 x64  %INSTALL_ROOT% "%keep_build%" "%keep_install%"
    call :build_proton 2017 x64  %INSTALL_ROOT% "%keep_build%" "%keep_install%"
)
goto :eof

::
:: build a proton
::  %1 selects architecture x86 or x64
::  %2 selects studio  2010 or 2012 or 2013 or 2015 or 2017
::  %3 is fully qualified install root path with no trailing slash
::  %4 true|false to keep build directory
::  %5 true|false to keep install directory
:build_proton

:: push the env
setlocal

set vsname=%1
set arch=%2
set INSTALL_ROOT_PATH=%3
set keep_build=%4
set keep_install=%5

set   build_dir=build_%vsname%_%arch%
set install_dir=%INSTALL_ROOT_PATH%\install_%vsname%_%arch%

REM VS2010 or VS2012 or VS2013 or VS2015 or VS2017, x86 or x64
if "%vsname%"=="2010" (
    if "%arch%" == "x86" (
        call "%VS100COMNTOOLS%..\..\VC\vcvarsall.bat" x86
        if ERRORLEVEL 1 exit /b 1
        set cmakegen="Visual Studio 10"
        set proton_arch=Win32
    ) else (
        call "%VS100COMNTOOLS%..\..\VC\vcvarsall.bat" amd64
        if ERRORLEVEL 1 exit /b 1
        set cmakegen="Visual Studio 10 Win64"
        set proton_arch=x64
    )
)
if "%vsname%"=="2012" (
    if "%arch%" == "x86" (
        call "%VS110COMNTOOLS%..\..\VC\vcvarsall.bat" x86
        if ERRORLEVEL 1 exit /b 1
        set cmakegen="Visual Studio 11"
        set proton_arch=Win32
    ) else (
        call "%VS110COMNTOOLS%..\..\VC\vcvarsall.bat" amd64
        if ERRORLEVEL 1 exit /b 1
        set cmakegen="Visual Studio 11 Win64"
        set proton_arch=x64
    )
)
if "%vsname%"=="2013" (
    if "%arch%" == "x86" (
        call "%VS120COMNTOOLS%..\..\VC\vcvarsall.bat" x86
        if ERRORLEVEL 1 exit /b 1
        set cmakegen="Visual Studio 12"
        set proton_arch=Win32
    ) else (
        call "%VS120COMNTOOLS%..\..\VC\vcvarsall.bat" amd64
        if ERRORLEVEL 1 exit /b 1
        set cmakegen="Visual Studio 12 Win64"
        set proton_arch=x64
    )
)
if "%vsname%"=="2015" (
    if "%arch%" == "x86" (
        call "%VS140COMNTOOLS%..\..\VC\vcvarsall.bat" x86
        if ERRORLEVEL 1 exit /b 1
        set cmakegen="Visual Studio 14 2015"
        set proton_arch=Win32
    ) else (
        call "%VS140COMNTOOLS%..\..\VC\vcvarsall.bat" amd64
        if ERRORLEVEL 1 exit /b 1
        set cmakegen="Visual Studio 14 2015 Win64"
        set proton_arch=x64
    )
)
if "%vsname%"=="2017" (
    if "%arch%" == "x86" (
        call "%VS150COMNTOOLS%..\..\VC\Auxiliary\build\vcvarsall.bat" x86
        if ERRORLEVEL 1 exit /b 1
        set cmakegen="Visual Studio 15 2017"
        set proton_arch=Win32
    ) else (
        call "%VS150COMNTOOLS%..\..\VC\Auxiliary\build\vcvarsall.bat" amd64
        if ERRORLEVEL 1 exit /b 1
        set cmakegen="Visual Studio 15 2017 Win64"
        set proton_arch=x64
    )
)
if "%proton_arch%"=="" (
    echo Arch not recognized : %arch%
    goto :eof
)

@echo off
echo.
echo ===================================================================
echo Ready to build.
echo Using visual studio : %vsname%
echo Architecture        : %arch%
echo Build directory     : %build_dir%
echo Install directory   : %install_dir%
echo Keep build dir      : %keep_build%
echo Keep install dir    : %keep_install%
echo .
IF NOT DEFINED CR_UNATTENDED (echo Press Enter to continue, Ctrl-C to abort && pause)
@echo on

:: fresh build/install areas
if   %keep_build%=="false" call :MakeNewDir   %build_dir%
if %keep_install%=="false" call :MakeNewDir %install_dir%

:: descend into build area
pushd %build_dir%

:: run cmake
cmake -G %cmakegen% -DCMAKE_INSTALL_PREFIX=%install_dir% -DGEN_JAVA=No -DBUILD_JAVA=No ..

:: build/install proton
devenv proton.sln /build "Debug|%proton_arch%"          /project INSTALL
if ERRORLEVEL 1 (
    echo FAIL FAIL FAIL: Studio failure building DEBUG %build_dir%
    exit /b 1
)

devenv proton.sln /build "RelWithDebInfo|%proton_arch%" /project INSTALL
if ERRORLEVEL 1 (
    echo FAIL FAIL FAIL: Studio failure building RELWITHDEBINFO %build_dir%
    exit /b 1
)

:: ascend from build area
popd

:: restore path and environment
endlocal

:: done
goto :eof

REM
REM MakeNewDir dirname
REM
:MakeNewDir
echo MakeNewDir: Start recreating %1. Delete %1
rmdir /s /q %1
timeout /t 1 /nobreak > nul
echo MakeNewDir: Checking if %1 still exists
if exist %1\nul (echo "%1 still exists. Type Ctrl-C to exit and fix %1" && pause && goto :eof)
echo MakeNewDir: Create %1
mkdir       %1
echo MakeNewDIr: Done  recreating %1
goto :eof

REM
REM Usage
REM
:Usage
echo Usage: build_proton.bat INSTALL_ROOT_PATH [2008,2010,2012,2013,2015 x64,x86 [any         [any]]]
echo                         arg1               arg2                     arg3     arg4         arg5
echo                                                                              keep build  keep install
echo     arg1 INSTALL_ROOT_PATH [required] may be any absolute or relative path including '.' .
echo     arg2 CLI_COMPILER      [optional] may be 2008, 2010, 2012, 2013, or 2015. If absent the all are compiled.
echo     arg3 CLI_ARCH                     may be x86 or x64. If absent then all are compied.
echo     arg4 KEEP_BUILD        [optional] any text. If present then build directory is used and not flushed.
echo     arg5 KEEP_INSTALL      [optional] any text. If present then install directory is used and not flushed.
echo.
echo     Build and Install directories for {2010, x86} will 'build_2010_x86' and 'install_2010_x86'.
echo     Other {compiler, arch} combinations follow the same pattern.
echo.
echo     Define environment variable CR_UNATTENDED to skip pausing between build steps.
goto :eof

Add support for VS 2017

Add support for VS 2017


echo OFF

set GITHUB_USERNAME=StatisKit
set GITHUB_REPOSITORY=Misc
set DEFAULT_ANACONDA_BUILD_RECIPES=libboost python-scons python-gitpython
set DEFAULT_ANACONDA_CHANNELS=statiskit conda-forge

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

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

if "%ANACONDA_BUILD_RECIPES%" == "" (
    set ANACONDA_BUILD_RECIPES=%DEFAULT_ANACONDA_BUILD_RECIPES%
) else (
    echo "Recipes to build: "%ANACONDA_BUILD_RECIPES%
)

echo ON

if not exist ..\..\%GITHUB_REPOSITORY% (
    if exist %GITHUB_REPOSITORY% (
        rmdir %GITHUB_REPOSITORY% /s /q
    )
    git clone https://github.com/%GITHUB_USERNAME%/%GITHUB_REPOSITORY%.git
    if %errorlevel% neq 0 (
        exit /b %errorlevel%
    )
    cd %GITHUB_REPOSITORY%/conda
)

git clone https://gist.github.com/c491cb08d570beeba2c417826a50a9c3.git toolchain
if %errorlevel% neq 0 (
    if exist %GITHUB_REPOSITORY% (
        rmdir %GITHUB_REPOSITORY% /s /q
    )
    exit /b %errorlevel%
)
cd toolchain
call config.bat
if %errorlevel% neq 0 (
    cd ..
    if exist %GITHUB_REPOSITORY% (
        rmdir %GITHUB_REPOSITORY% /s /q
    )
    rmdir toolchain /s /q
    exit /b %errorlevel%
)
cd ..
rmdir toolchain /s /q

for %%ANACONDA_BUILD_RECIPE in (%ANACONDA_BUILD_RECIPES%) do (
    conda build %%ANACONDA_BUILD_RECIPE %ANACONDA_CHANNEL_FLAGS% %ANACONDA_BUILD_FLAGS%
    if %errorlevel% neq 0 (
        if exist %GITHUB_REPOSITORY% (
            rmdir %GITHUB_REPOSITORY% /s /q
        )
        exit /b %errorlevel%
    )
)

if exist %GITHUB_REPOSITORY% (
    rmdir %GITHUB_REPOSITORY% /s /q
)

ECHO OFF

echo OFF

set GITHUB_USERNAME=StatisKit
set GITHUB_REPOSITORY=Misc
set DEFAULT_ANACONDA_BUILD_RECIPES=libboost python-scons python-gitpython
set DEFAULT_ANACONDA_CHANNELS=statiskit conda-forge

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

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

if "%ANACONDA_BUILD_RECIPES%" == "" (
    set ANACONDA_BUILD_RECIPES=%DEFAULT_ANACONDA_BUILD_RECIPES%
) else (
    echo "Recipes to build: "%ANACONDA_BUILD_RECIPES%
)

echo ON

if not exist ..\..\%GITHUB_REPOSITORY% (
    if exist %GITHUB_REPOSITORY% (
        rmdir %GITHUB_REPOSITORY% /s /q
    )
    git clone https://github.com/%GITHUB_USERNAME%/%GITHUB_REPOSITORY%.git
    if %errorlevel% neq 0 (
        exit /b %errorlevel%
    )
    cd %GITHUB_REPOSITORY%/conda
)

git clone https://gist.github.com/c491cb08d570beeba2c417826a50a9c3.git toolchain
if %errorlevel% neq 0 (
    if exist %GITHUB_REPOSITORY% (
        rmdir %GITHUB_REPOSITORY% /s /q
    )
    exit /b %errorlevel%
)
cd toolchain
call config.bat
if %errorlevel% neq 0 (
    cd ..
    if exist %GITHUB_REPOSITORY% (
        rmdir %GITHUB_REPOSITORY% /s /q
    )
    rmdir toolchain /s /q
    exit /b %errorlevel%
)
cd ..
rmdir toolchain /s /q

for %%i in (%ANACONDA_BUILD_RECIPES%) do (
    conda build %%i %ANACONDA_CHANNEL_FLAGS% %ANACONDA_BUILD_FLAGS%
    if %errorlevel% neq 0 (
        if exist %GITHUB_REPOSITORY% (
            rmdir %GITHUB_REPOSITORY% /s /q
        )
        exit /b %errorlevel%
    )
)

if exist %GITHUB_REPOSITORY% (
    rmdir %GITHUB_REPOSITORY% /s /q
)

ECHO OFF

Update bld.bat

Update bld.bat


@echo off
REM docker login -u="%DOCKER_USER%" -p="%DOCKER_PASS%"
REM @echo on
REM docker push acemulator/ace
@echo off

git config --global user.email "%GIT_A%"
git config --global user.name "%GIT_B%"

@echo on
git add -f Source\ACE.Server\ServerBuildInfo_Dynamic.cs
git commit -m "[ci skip] Updating ServerBuildInfo_Dynamic with latest build and version information"
git push origin master

@echo off
REM docker login -u="%DOCKER_USER%" -p="%DOCKER_PASS%"
REM @echo on
REM docker push acemulator/ace
@echo off

git config --global user.email "%GIT_A%"
git config --global user.name "%GIT_B%"

@echo on
git checkout master
git add -f Source\ACE.Server\ServerBuildInfo_Dynamic.cs
git commit -m "[ci skip] Updating ServerBuildInfo_Dynamic with latest build and version information"
git push origin master

Update AppVeyorAfterDeploy.bat

Update AppVeyorAfterDeploy.bat