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

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

SET BASEFOLDER=C:\tmp

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

REM Open folder:
start "" %BASEFOLDER%

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

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

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

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

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

REM for some reason, this didn't create a start menu shortcut it seems for SQL Server Management Studio

REM press any key to continue....
pause

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

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

SET BASEFOLDER=C:\tmp

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

REM Open folder:
start "" %BASEFOLDER%

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

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

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

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

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

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

REM for some reason, this didn't create a start menu shortcut it seems for SQL Server Management Studio

REM press any key to continue....
pause

Update bigfix_setup_root_eval.bat

Update bigfix_setup_root_eval.bat

added download for fixlet debugger


@ECHO OFF
REM $Id$

REM Bat script for building Discount automatically
REM Author: Peter Nordin peter.nordin@liu.se

set basedir=%~dp0
set codedir=%basedir%\discount
set builddir=%codedir%_build
set installdir=%codedir%_install

call setHopsanBuildPaths.bat

REM Copy code to build dir, not sure if out-of-source build is possible
mkdir %builddir%
cd %builddir%
xcopy %codedir%\* .

REM Build with mingw patches

REM The first patch was taken from https://github.com/Alexpux/MINGW-packages/tree/master/mingw-w64-discount
REM It was however modified to grep for Msys instead of MINGW (from uname -a)
bash.exe -c "patch -p0 < ../discount-mingw-building.patch; patch -p1 < ../discount-2.1.8-msys.patch; CC=gcc ./configure.sh --shared --prefix=%installdir% --confdir=%installdir%/etc; make -j4; make install"
REM Note! We use msys make here as mingw32-make is to strict since 4.9.2

cd %basedir%
echo.
echo setupDiscount.sh done
pause

@ECHO OFF
REM $Id$

REM Bat script for building Discount automatically
REM Author: Peter Nordin peter.nordin@liu.se

set basedir=%~dp0
set codedir=%basedir%\discount
set builddir=%codedir%_build
set installdir=%codedir%_install

REM This path is needed for bash / posix compatibility inside the bash shell
REM TODO it would be nice if we could auto generate the bash path from the windows install dir path
set installdir_bash=../discount_install

call setHopsanBuildPaths.bat

REM Copy code to build dir, not sure if out-of-source build is possible
mkdir %builddir%
cd %builddir%
xcopy %codedir%\* . /Y

REM Build with mingw patches

REM The first patch was taken from https://github.com/Alexpux/MINGW-packages/tree/master/mingw-w64-discount
REM It was however modified to grep for Msys instead of MINGW (from uname -a)
bash.exe -c "patch -p0 < ../discount-mingw-building.patch; patch -p1 < ../discount-2.1.8-msys.patch; CC=gcc ./configure.sh --shared --prefix=%installdir_bash% --confdir=%installdir_bash%/etc; make -j4; make install"
REM Note! We use msys make here as mingw32-make is to strict since 4.9.2

cd %basedir%
echo.
echo setupDiscount.sh done
pause

Fix discount build script

Fix discount build script


@echo off
rem # SCRIPT FOR RUNNING TA.GUI FRAMEWORK ~ TEBEL.ORG #

rem enable windows for loop advanced flow control
setlocal enableextensions enabledelayedexpansion

if "%~1"=="" (
echo tagui v1.0: use following syntax and below options to run ./tagui flow_filename option^(s^)
echo.
echo firefox - run on visible Firefox web browser instead of invisible browser ^(first install Firefox^)
echo report - generate a web report for easy sharing of run results ^(default is only a text log file^)
echo debug - show run-time backend messages from PhantomJS for detailed tracing and logging
echo quiet - run without output except for explicit output ^(echo / show / check / api / errors etc^)
echo test - professional testing using CasperJS assertions ^(TA.Gui dynamic tx^('selector'^) usable^)
echo input^(s^) - add your own parameter^(s^) to be used in your automation flow as variables p1 to p9
echo.
echo TA.Gui is a tool for non-developers and business users to automate web ~ http://tebel.org
echo.
exit /b 1
)

rem check whether specified automation flow file exists
if not exist "%~1" (
	echo ERROR - cannot find %~1
	exit /b 1
)

rem get and set absolute filename of automation flow file
set "flow_file=%~dpnx1"

rem save location of initial directory where tagui is called
set "initial_dir=%cd%"

rem change current directory to TA.GUI directory
cd /d "%~dp0"

rem below 3 blocks dynamically set up dependencies paths for different setups
rem first set dependencies to local symbolic links (for manual installation)
rem symbolic links not standard setup on windows, only for macos and linux

rem then set to node.js dependencies if they exist (for npm install tagui)
if exist "%~dp0..\..\casperjs\bin\casperjs" set "path=%~dp0..\..\casperjs\bin;%path%"
if exist "%~dp0..\..\phantomjs-prebuilt\lib\phantom\bin\phantomjs.exe" set "path=%~dp0..\..\phantomjs-prebuilt\lib\phantom\bin;%path%"
if exist "%~dp0..\..\slimerjs\src\slimerjs.bat" set "SLIMERJS_EXECUTABLE=%~dp0..\..\slimerjs\src\slimerjs.bat"

rem finally set to packaged dependencies if they exist (for packaged installation)
if exist "%~dp0casperjs\bin\casperjs" set "path=%~dp0casperjs\bin;%path%"
if exist "%~dp0phantomjs\bin\phantomjs.exe" set "path=%~dp0phantomjs\bin;%path%"
if exist "%~dp0slimerjs\slimerjs.bat" set "SLIMERJS_EXECUTABLE=%~dp0slimerjs\slimerjs.bat"
if exist "%~dp0php\php.exe" set "path=%~dp0php;%path%"
if exist "%~dp0unx\gawk.exe" set "path=%~dp0unx;%path%"

rem additional windows section for parameters handling using windows way
set arg2=%2
set arg3=%3
set arg4=%4
set arg5=%5
set arg6=%6
set arg7=%7
set arg8=%8
set arg9=%9

rem check firefox parameter to run on visible firefox browser through slimerjs
if "%arg2%"=="firefox" set arg2=--engine=slimerjs
if "%arg3%"=="firefox" set arg3=--engine=slimerjs
if "%arg4%"=="firefox" set arg4=--engine=slimerjs
if "%arg5%"=="firefox" set arg5=--engine=slimerjs
if "%arg6%"=="firefox" set arg6=--engine=slimerjs
if "%arg7%"=="firefox" set arg7=--engine=slimerjs
if "%arg8%"=="firefox" set arg8=--engine=slimerjs
if "%arg9%"=="firefox" set arg9=--engine=slimerjs

rem check debug parameter to show run-time backend messages from phantomjs
if "%arg2%"=="debug" set arg2=--verbose
if "%arg3%"=="debug" set arg3=--verbose
if "%arg4%"=="debug" set arg4=--verbose
if "%arg5%"=="debug" set arg5=--verbose
if "%arg6%"=="debug" set arg6=--verbose
if "%arg7%"=="debug" set arg7=--verbose
if "%arg8%"=="debug" set arg8=--verbose
if "%arg9%"=="debug" set arg9=--verbose

set tagui_test_mode=false
rem check test parameter to run flow as casperjs test automation script
if "%arg2%"=="test" (
	set arg2=
	set tagui_test_mode=true
)
if "%arg3%"=="test" (
	set arg3=
	set tagui_test_mode=true
)
if "%arg4%"=="test" (
	set arg4=
	set tagui_test_mode=true
)
if "%arg5%"=="test" (
	set arg5=
	set tagui_test_mode=true
)
if "%arg6%"=="test" (
	set arg6=
	set tagui_test_mode=true
)
if "%arg7%"=="test" (
	set arg7=
	set tagui_test_mode=true
)
if "%arg8%"=="test" (
	set arg8=
	set tagui_test_mode=true
)
if "%arg9%"=="test" (
	set arg9=
	set tagui_test_mode=true
)

set tagui_quiet_mode=false
rem check quiet parameter to run flow quietly by only showing explicit output
if "%arg2%"=="quiet" (
	set arg2=
	set tagui_quiet_mode=true
)
if "%arg3%"=="quiet" (
	set arg3=
	set tagui_quiet_mode=true
)
if "%arg4%"=="quiet" (
	set arg4=
	set tagui_quiet_mode=true
)
if "%arg5%"=="quiet" (
	set arg5=
	set tagui_quiet_mode=true
)
if "%arg6%"=="quiet" (
	set arg6=
	set tagui_quiet_mode=true
)
if "%arg7%"=="quiet" (
	set arg7=
	set tagui_quiet_mode=true
)
if "%arg8%"=="quiet" (
	set arg8=
	set tagui_quiet_mode=true
)
if "%arg9%"=="quiet" (
	set arg9=
	set tagui_quiet_mode=true
)

set tagui_html_report=false
rem check report parameter to generate html formatted automation log
if "%arg2%"=="report" (
	set arg2=
	set tagui_html_report=true
)
if "%arg3%"=="report" (
	set arg3=
	set tagui_html_report=true
)
if "%arg4%"=="report" (
	set arg4=
	set tagui_html_report=true
)
if "%arg5%"=="report" (
	set arg5=
	set tagui_html_report=true
)
if "%arg6%"=="report" (
	set arg6=
	set tagui_html_report=true
)
if "%arg7%"=="report" (
	set arg7=
	set tagui_html_report=true
)
if "%arg8%"=="report" (
	set arg8=
	set tagui_html_report=true
)
if "%arg9%"=="report" (
	set arg9=
	set tagui_html_report=true
)

rem concatenate parameters in order to fix issue when calling casperjs test
rem $1 left out - filenames with spaces have issue when casperjs $params
set params=%arg2% %arg3% %arg4% %arg5% %arg6% %arg7% %arg8% %arg9%

rem initialise log file and set permissions to protect user data
rem skip permissions setting for windows, only done for macos and linux
type nul > "%flow_file%.log"

rem check if api call is made in automation flow file to set appropriate setting for phantomjs to work
set api=
if exist "%flow_file%" (
	find /i /c "api http" "%flow_file%" > nul
	if not errorlevel 1 set api= --web-security=false
)

rem check datatable csv file for batch automation
set tagui_data_set_size=1
if not exist "%flow_file%.csv" goto no_datatable
	for /f "tokens=* usebackq" %%c in (`gawk -F"," "{print NF}" "%flow_file%.csv" ^| sort -nu ^| head -n 1`) do set min_column=%%c
	for /f "tokens=* usebackq" %%c in (`gawk -F"," "{print NF}" "%flow_file%.csv" ^| sort -nu ^| tail -n 1`) do set max_column=%%c

	if %min_column% neq %max_column% (
		echo ERROR - %flow_file%.csv has inconsistent # of columns | tee -a "%flow_file%.log"
	) else if %min_column% lss 2 (
		echo ERROR - %flow_file%.csv has has lesser than 2 columns | tee -a "%flow_file%.log"
	) else (
		set /a tagui_data_set_size=%min_column% - 1
	)
:no_datatable

rem default exit code 0 to mean no error parsing automation flow file
set tagui_error_code=0

rem loop for managing multiple data sets in datatable
for /l %%n in (1,1,%tagui_data_set_size%) do (
set tagui_data_set=%%n

rem parse automation flow file and check for initial parse error before calling casperjs
php -q tagui_parse.php "%flow_file%" | tee -a "%flow_file%.log"
for /f "usebackq" %%f in ('%flow_file%.log') do set file_size=%%~zf
if !file_size! gtr 0 (
	if !tagui_data_set! equ 1 (
		echo ERROR - automation aborted due to above | tee -a "%flow_file%.log"
		set tagui_error_code=1
		goto break_for_loop
	)
)

if %tagui_test_mode%==false (
	casperjs "%flow_file%.js" %params%%api% | tee -a "%flow_file%.log"
) else (
	casperjs test "%flow_file%.js" %params%%api% --xunit="%flow_file%.xml" | tee -a "%flow_file%.log"
)

)
:break_for_loop

rem additional windows section to convert unix to windows file format
gawk "sub(\"$\", \"\")" "%flow_file%.js" > "%flow_file%.js.tmp"
move "%flow_file%.js.tmp" "%flow_file%.js" > nul
gawk "sub(\"$\", \"\")" "%flow_file%.log" > "%flow_file%.log.tmp"
move "%flow_file%.log.tmp" "%flow_file%.log" > nul

rem check report option to generate html automation log
for /f "usebackq" %%f in ('%flow_file%.log') do set file_size=%%~zf
if %file_size% gtr 0 if %tagui_html_report%==true (
	php -q tagui_report.php "%flow_file%"
	gawk "sub(\"$\", \"\")" "%flow_file%.html" > "%flow_file%.html.tmp"
	move "%flow_file%.html.tmp" "%flow_file%.html" > nul
)

rem change back to initial directory where tagui is called
cd /d "%initial_dir%"

rem returns 0 if no error parsing flow file, otherwise return 1
exit /b %tagui_error_code%

@echo off
rem # SCRIPT FOR RUNNING TA.GUI FRAMEWORK ~ TEBEL.ORG #

rem enable windows for loop advanced flow control
setlocal enableextensions enabledelayedexpansion

if "%~1"=="" (
echo tagui v1.0: use following syntax and below options to run - tagui flow_filename option^(s^)
echo.
echo firefox - run on visible Firefox web browser instead of invisible browser ^(first install Firefox^)
echo report - generate a web report for easy sharing of run results ^(default is only a text log file^)
echo debug - show run-time backend messages from PhantomJS for detailed tracing and logging
echo quiet - run without output except for explicit output ^(echo / show / check / api / errors etc^)
echo test - professional testing using CasperJS assertions ^(TA.Gui dynamic tx^('selector'^) usable^)
echo input^(s^) - add your own parameter^(s^) to be used in your automation flow as variables p1 to p9
echo.
echo TA.Gui is a tool for non-developers and business users to automate web ~ http://tebel.org
echo.
exit /b 1
)

rem check whether specified automation flow file exists
if not exist "%~1" (
	echo ERROR - cannot find %~1
	exit /b 1
)

rem get and set absolute filename of automation flow file
set "flow_file=%~dpnx1"

rem save location of initial directory where tagui is called
set "initial_dir=%cd%"

rem change current directory to TA.GUI directory
cd /d "%~dp0"

rem below 3 blocks dynamically set up dependencies paths for different setups
rem first set dependencies to local symbolic links (for manual installation)
rem symbolic links not standard setup on windows, only for macos and linux

rem then set to node.js dependencies if they exist (for npm install tagui)
if exist "%~dp0..\..\casperjs\bin\casperjs" set "path=%~dp0..\..\casperjs\bin;%path%"
if exist "%~dp0..\..\phantomjs-prebuilt\lib\phantom\bin\phantomjs.exe" set "path=%~dp0..\..\phantomjs-prebuilt\lib\phantom\bin;%path%"
if exist "%~dp0..\..\slimerjs\src\slimerjs.bat" set "SLIMERJS_EXECUTABLE=%~dp0..\..\slimerjs\src\slimerjs.bat"

rem finally set to packaged dependencies if they exist (for packaged installation)
if exist "%~dp0casperjs\bin\casperjs" set "path=%~dp0casperjs\bin;%path%"
if exist "%~dp0phantomjs\bin\phantomjs.exe" set "path=%~dp0phantomjs\bin;%path%"
if exist "%~dp0slimerjs\slimerjs.bat" set "SLIMERJS_EXECUTABLE=%~dp0slimerjs\slimerjs.bat"
if exist "%~dp0php\php.exe" set "path=%~dp0php;%path%"
if exist "%~dp0unx\gawk.exe" set "path=%~dp0unx;%path%"

rem additional windows section for parameters handling using windows way
set arg2=%2
set arg3=%3
set arg4=%4
set arg5=%5
set arg6=%6
set arg7=%7
set arg8=%8
set arg9=%9

rem check firefox parameter to run on visible firefox browser through slimerjs
if "%arg2%"=="firefox" set arg2=--engine=slimerjs
if "%arg3%"=="firefox" set arg3=--engine=slimerjs
if "%arg4%"=="firefox" set arg4=--engine=slimerjs
if "%arg5%"=="firefox" set arg5=--engine=slimerjs
if "%arg6%"=="firefox" set arg6=--engine=slimerjs
if "%arg7%"=="firefox" set arg7=--engine=slimerjs
if "%arg8%"=="firefox" set arg8=--engine=slimerjs
if "%arg9%"=="firefox" set arg9=--engine=slimerjs

rem check debug parameter to show run-time backend messages from phantomjs
if "%arg2%"=="debug" set arg2=--verbose
if "%arg3%"=="debug" set arg3=--verbose
if "%arg4%"=="debug" set arg4=--verbose
if "%arg5%"=="debug" set arg5=--verbose
if "%arg6%"=="debug" set arg6=--verbose
if "%arg7%"=="debug" set arg7=--verbose
if "%arg8%"=="debug" set arg8=--verbose
if "%arg9%"=="debug" set arg9=--verbose

set tagui_test_mode=false
rem check test parameter to run flow as casperjs test automation script
if "%arg2%"=="test" (
	set arg2=
	set tagui_test_mode=true
)
if "%arg3%"=="test" (
	set arg3=
	set tagui_test_mode=true
)
if "%arg4%"=="test" (
	set arg4=
	set tagui_test_mode=true
)
if "%arg5%"=="test" (
	set arg5=
	set tagui_test_mode=true
)
if "%arg6%"=="test" (
	set arg6=
	set tagui_test_mode=true
)
if "%arg7%"=="test" (
	set arg7=
	set tagui_test_mode=true
)
if "%arg8%"=="test" (
	set arg8=
	set tagui_test_mode=true
)
if "%arg9%"=="test" (
	set arg9=
	set tagui_test_mode=true
)

set tagui_quiet_mode=false
rem check quiet parameter to run flow quietly by only showing explicit output
if "%arg2%"=="quiet" (
	set arg2=
	set tagui_quiet_mode=true
)
if "%arg3%"=="quiet" (
	set arg3=
	set tagui_quiet_mode=true
)
if "%arg4%"=="quiet" (
	set arg4=
	set tagui_quiet_mode=true
)
if "%arg5%"=="quiet" (
	set arg5=
	set tagui_quiet_mode=true
)
if "%arg6%"=="quiet" (
	set arg6=
	set tagui_quiet_mode=true
)
if "%arg7%"=="quiet" (
	set arg7=
	set tagui_quiet_mode=true
)
if "%arg8%"=="quiet" (
	set arg8=
	set tagui_quiet_mode=true
)
if "%arg9%"=="quiet" (
	set arg9=
	set tagui_quiet_mode=true
)

set tagui_html_report=false
rem check report parameter to generate html formatted automation log
if "%arg2%"=="report" (
	set arg2=
	set tagui_html_report=true
)
if "%arg3%"=="report" (
	set arg3=
	set tagui_html_report=true
)
if "%arg4%"=="report" (
	set arg4=
	set tagui_html_report=true
)
if "%arg5%"=="report" (
	set arg5=
	set tagui_html_report=true
)
if "%arg6%"=="report" (
	set arg6=
	set tagui_html_report=true
)
if "%arg7%"=="report" (
	set arg7=
	set tagui_html_report=true
)
if "%arg8%"=="report" (
	set arg8=
	set tagui_html_report=true
)
if "%arg9%"=="report" (
	set arg9=
	set tagui_html_report=true
)

rem concatenate parameters in order to fix issue when calling casperjs test
rem $1 left out - filenames with spaces have issue when casperjs $params
set params=%arg2% %arg3% %arg4% %arg5% %arg6% %arg7% %arg8% %arg9%

rem initialise log file and set permissions to protect user data
rem skip permissions setting for windows, only done for macos and linux
type nul > "%flow_file%.log"

rem check if api call is made in automation flow file to set appropriate setting for phantomjs to work
set api=
if exist "%flow_file%" (
	find /i /c "api http" "%flow_file%" > nul
	if not errorlevel 1 set api= --web-security=false
)

rem check datatable csv file for batch automation
set tagui_data_set_size=1
if not exist "%flow_file%.csv" goto no_datatable
	for /f "tokens=* usebackq" %%c in (`gawk -F"," "{print NF}" "%flow_file%.csv" ^| sort -nu ^| head -n 1`) do set min_column=%%c
	for /f "tokens=* usebackq" %%c in (`gawk -F"," "{print NF}" "%flow_file%.csv" ^| sort -nu ^| tail -n 1`) do set max_column=%%c

	if %min_column% neq %max_column% (
		echo ERROR - %flow_file%.csv has inconsistent # of columns | tee -a "%flow_file%.log"
	) else if %min_column% lss 2 (
		echo ERROR - %flow_file%.csv has has lesser than 2 columns | tee -a "%flow_file%.log"
	) else (
		set /a tagui_data_set_size=%min_column% - 1
	)
:no_datatable

rem default exit code 0 to mean no error parsing automation flow file
set tagui_error_code=0

rem loop for managing multiple data sets in datatable
for /l %%n in (1,1,%tagui_data_set_size%) do (
set tagui_data_set=%%n

rem parse automation flow file and check for initial parse error before calling casperjs
php -q tagui_parse.php "%flow_file%" | tee -a "%flow_file%.log"
for /f "usebackq" %%f in ('%flow_file%.log') do set file_size=%%~zf
if !file_size! gtr 0 (
	if !tagui_data_set! equ 1 (
		echo ERROR - automation aborted due to above | tee -a "%flow_file%.log"
		set tagui_error_code=1
		goto break_for_loop
	)
)

if %tagui_test_mode%==false (
	casperjs "%flow_file%.js" %params%%api% | tee -a "%flow_file%.log"
) else (
	casperjs test "%flow_file%.js" %params%%api% --xunit="%flow_file%.xml" | tee -a "%flow_file%.log"
)

)
:break_for_loop

rem additional windows section to convert unix to windows file format
gawk "sub(\"$\", \"\")" "%flow_file%.js" > "%flow_file%.js.tmp"
move "%flow_file%.js.tmp" "%flow_file%.js" > nul
gawk "sub(\"$\", \"\")" "%flow_file%.log" > "%flow_file%.log.tmp"
move "%flow_file%.log.tmp" "%flow_file%.log" > nul

rem check report option to generate html automation log
for /f "usebackq" %%f in ('%flow_file%.log') do set file_size=%%~zf
if %file_size% gtr 0 if %tagui_html_report%==true (
	php -q tagui_report.php "%flow_file%"
	gawk "sub(\"$\", \"\")" "%flow_file%.html" > "%flow_file%.html.tmp"
	move "%flow_file%.html.tmp" "%flow_file%.html" > nul
)

rem change back to initial directory where tagui is called
cd /d "%initial_dir%"

rem returns 0 if no error parsing flow file, otherwise return 1
exit /b %tagui_error_code%

Update tagui.cmd

Update tagui.cmd


@echo off

rem $Id$
rem
rem In addition to the other parameter options for the standalone server
rem pass -j or --jmx to enable JMX agent.  The port for it can be specified
rem with optional port number e.g. -j1099 or --jmx=1099.
rem

set JMX_ENABLED=0
set JMX_PORT=1099
set JAVA_ARGS=

set JAVA_RUN="java"

if not "%JAVA_HOME%" == "" (
    set JAVA_RUN="%JAVA_HOME%\bin\java"
    goto gotJavaHome
)

rem @WINDOWS_INSTALLER_1@

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

rem :gotJavaHome
rem @WINDOWS_INSTALLER_2@

if not "%EXIST_HOME%" == "" goto gotExistHome

rem try to guess (will be set by the installer)
set EXIST_HOME=.

if exist "%EXIST_HOME%\start.jar" goto gotExistHome
set EXIST_HOME=..
if exist "%EXIST_HOME%\start.jar" goto gotExistHome

echo EXIST_HOME not found. Please set your
echo EXIST_HOME environment variable to the
echo home directory of eXist.
goto :eof

:gotExistHome
set MX=1024
rem @WINDOWS_INSTALLER_3@

set JAVA_ENDORSED_DIRS="%EXIST_HOME%\lib\endorsed"
set JAVA_OPTS="-Xms128m -Xmx%MX%m -Dfile.encoding=UTF-8 -Djava.endorsed.dirs=%JAVA_ENDORSED_DIRS%"

set BATCH.D="%EXIST_HOME%\bin\batch.d"
call %BATCH.D%\get_opts.bat %*
call %BATCH.D%\check_jmx_status.bat

%JAVA_RUN% "%JAVA_OPTS%" -Dexist.home="%EXIST_HOME%" -jar "%EXIST_HOME%\start.jar" standalone %JAVA_ARGS%
:eof

@echo off

rem $Id$
rem
rem In addition to the other parameter options for the standalone server
rem pass -j or --jmx to enable JMX agent.  The port for it can be specified
rem with optional port number e.g. -j1099 or --jmx=1099.
rem

set JMX_ENABLED=0
set JMX_PORT=1099
set JAVA_ARGS=

set JAVA_RUN="java"

if not "%JAVA_HOME%" == "" (
    set JAVA_RUN="%JAVA_HOME%\bin\java"
    goto gotJavaHome
)

rem @WINDOWS_INSTALLER_1@

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

:gotJavaHome
rem @WINDOWS_INSTALLER_2@

if not "%EXIST_HOME%" == "" goto gotExistHome

rem try to guess (will be set by the installer)
set EXIST_HOME=.

if exist "%EXIST_HOME%\start.jar" goto gotExistHome
set EXIST_HOME=..
if exist "%EXIST_HOME%\start.jar" goto gotExistHome

echo EXIST_HOME not found. Please set your
echo EXIST_HOME environment variable to the
echo home directory of eXist.
goto :eof

:gotExistHome
set MX=1024
rem @WINDOWS_INSTALLER_3@

set JAVA_ENDORSED_DIRS="%EXIST_HOME%\lib\endorsed"
set JAVA_OPTS="-Xms128m -Xmx%MX%m -Dfile.encoding=UTF-8 -Djava.endorsed.dirs=%JAVA_ENDORSED_DIRS%"

set BATCH.D="%EXIST_HOME%\bin\batch.d"
call %BATCH.D%\get_opts.bat %*
call %BATCH.D%\check_jmx_status.bat

%JAVA_RUN% "%JAVA_OPTS%" -Dexist.home="%EXIST_HOME%" -jar "%EXIST_HOME%\start.jar" standalone %JAVA_ARGS%
:eof

Fix typo in server.bat

Fix typo in server.bat

Uncomment rem :gotJavaHome (line 29) to allow goto gotJavaHome (line 18)


@echo off
echo Try editing the markdown file in samples/welcome and see the
echo results instantly in the browser at http://localhost:3000/
.\algernon.exe --dev --conf serverconf.lua --dir algernon-1.10\samples --httponly --debug --autorefresh --bolt --server

@echo off
echo Try editing the markdown file in samples/welcome and see the
echo results instantly in the browser at http://localhost:3000/
.\algernon.exe --dev --conf serverconf.lua --dir samples/welcome --httponly --debug --autorefresh --bolt --server

Update bat file

Update bat file


@ECHO OFF
setlocal enableDelayedExpansion

:: the deploy target folder
SET FOLDER=deploy

:: the deploy target suffix, i.e. <projectName>[suffix]
SET SUFFIX= - %date% - %time%

:: remove spaces, convert / : to _, convert . to ~
set SUFFIX=%SUFFIX: =%
set SUFFIX=%SUFFIX:/=-%
set SUFFIX=%SUFFIX::=-%
set SUFFIX=%SUFFIX:.=~%

:: enyo location
SET ENYO=..\enyo

:: the grandparent folder for this batch file
SET SOURCE=%~dp0..\

:: extract project folder name
FOR /D %%I IN ("%SOURCE%\.") DO SET NAME=%%~nxI

:: prepare target name
SET DEPLOY=%NAME%%SUFFIX%

:: make sure (deploy) FOLDER exists
SET TARGETROOT="%SOURCE%%FOLDER%"
IF NOT EXIST %TARGETROOT% mkdir %TARGETROOT%

:: pull path for this deploy
IF NOT DEFINED TARGET SET TARGET="%SOURCE%%FOLDER%\%DEPLOY%"

:: quotes around path that might have spaces
SET SOURCE="%SOURCE%"

IF NOT EXIST %TARGET% GOTO deploy

ECHO "%TARGET%" folder already exists, please rename or remove it and try again.
ECHO.

PAUSE
GOTO end

:DEPLOY

SET USAGE="Usage: deploy.bat [-h] [-c] [-o output_dir]"

:: Parse options
:: Thanks to http://stackoverflow.com/questions/3973824/windows-bat-file-optional-argument-parsing
set "options=-o:"" -h: -c:"
for %%O in (%options%) do for /f "tokens=1,* delims=:" %%A in ("%%O") do set "%%A=%%~B"
:parseloop
if not "%~1"=="" (
  set "test=!options:*%~1:=! "
  if "!test!"=="!options! " (
  	echo %USAGE%
  	goto end
  ) else if "!test:~0,1!"==" " (
    set "%~1=1"
  ) else (
    set "%~1=%~2"
    shift
  )
  shift
  goto :parseloop
)

:: Handle options
IF DEFINED -h (
	ECHO %USAGE%
	GOTO end
)
IF DEFINED -c (
	SET NO_LESS="-no-less"
) else (
	SET NO_LESS=""
)
IF DEFINED -o (
	SET TARGET=%-o%
)
IF DEFINED -o (
	RMDIR /S /Q %TARGET%
)

ECHO This script can create a deployment in %TARGET%
ECHO.

ECHO ==========
ECHO build step
ECHO ==========
ECHO.

REM build enyo
CALL %ENYO%\minify\minify.bat

REM build app
CALL %ENYO%\tools\minify.bat package.js -output ..\build\app

ECHO =========
ECHO copy step
ECHO =========
ECHO.

:: make deploy folder
MKDIR %TARGET%

:: copy root folder files
COPY %SOURCE%index.html %TARGET% >NUL
COPY %SOURCE%icon.png %TARGET% >NUL

:: copy assets and build
XCOPY %SOURCE%assets\*.* %TARGET%\assets\ /Q /E >NUL
XCOPY %SOURCE%build\*.* %TARGET%\build\ /Q /E >NUL

:: copy library items
MKDIR %TARGET%\lib

FOR /D %%G in (%SOURCE%lib\*) DO IF EXIST "%%G\deploy.bat" ECHO deploying "%%~nxG"
FOR /D %%G in (%SOURCE%lib\*) DO IF EXIST "%%G\deploy.bat" CALL "%%G\deploy.bat" %TARGET%\lib\"%%~nxG"

FOR /D %%G in (%SOURCE%lib\*) DO IF NOT EXIST "%%G\deploy.bat" ECHO copying "%%~nxG"
FOR /D %%G in (%SOURCE%lib\*) DO IF NOT EXIST "%%G\deploy.bat" XCOPY "%%G" %TARGET%\lib\"%%~nxG"\ /Q /E >NUL

ECHO.

PAUSE
:end

@ECHO OFF
setlocal enableDelayedExpansion

:: the deploy target folder
SET FOLDER=deploy

:: the deploy target suffix, i.e. <projectName>[suffix]
SET SUFFIX= - %date% - %time%

:: remove spaces, convert / : to _, convert . to ~
set SUFFIX=%SUFFIX: =%
set SUFFIX=%SUFFIX:/=-%
set SUFFIX=%SUFFIX::=-%
set SUFFIX=%SUFFIX:.=~%

:: enyo location
SET ENYO=..\enyo

:: the grandparent folder for this batch file
SET SOURCE=%~dp0..\

:: extract project folder name
FOR /D %%I IN ("%SOURCE%\.") DO SET NAME=%%~nxI

:: prepare target name
SET DEPLOY=%NAME%%SUFFIX%

:: make sure (deploy) FOLDER exists
SET TARGETROOT="%SOURCE%%FOLDER%"
IF NOT EXIST %TARGETROOT% mkdir %TARGETROOT%

:: pull path for this deploy
IF NOT DEFINED TARGET SET TARGET="%SOURCE%%FOLDER%\%DEPLOY%"

:: quotes around path that might have spaces
SET SOURCE="%SOURCE%"

IF NOT EXIST %TARGET% GOTO deploy

ECHO "%TARGET%" folder already exists, please rename or remove it and try again.
ECHO.

PAUSE
GOTO end

:DEPLOY

SET USAGE="Usage: deploy.bat [-h] [-c] [-o output_dir]"

:: Parse options
:: Thanks to http://stackoverflow.com/questions/3973824/windows-bat-file-optional-argument-parsing
set "options=-o:"" -h: -c:"
for %%O in (%options%) do for /f "tokens=1,* delims=:" %%A in ("%%O") do set "%%A=%%~B"
:parseloop
if not "%~1"=="" (
  set "test=!options:*%~1:=! "
  if "!test!"=="!options! " (
  	echo %USAGE%
  	goto end
  ) else if "!test:~0,1!"==" " (
    set "%~1=1"
  ) else (
    set "%~1=%~2"
    shift
  )
  shift
  goto :parseloop
)

:: Handle options
IF DEFINED -h (
	ECHO %USAGE%
	GOTO end
)
IF DEFINED -c (
	SET NO_LESS="-no-less"
) else (
	SET NO_LESS=""
)
IF DEFINED -o (
	SET TARGET=%-o%
)
IF DEFINED -o (
	RMDIR /S /Q %TARGET%
)

ECHO This script can create a deployment in %TARGET%
ECHO.

ECHO ==========
ECHO build step
ECHO ==========
ECHO.

REM build enyo
CALL "%ENYO%\minify\minify.bat"

REM build app
CALL "%ENYO%\tools\minify.bat" package.js -output ..\build\app

ECHO =========
ECHO copy step
ECHO =========
ECHO.

:: make deploy folder
MKDIR %TARGET%

:: copy root folder files
COPY %SOURCE%index.html %TARGET% >NUL
COPY %SOURCE%icon.png %TARGET% >NUL

:: copy assets and build
XCOPY %SOURCE%assets\*.* %TARGET%\assets\ /Q /E >NUL
XCOPY %SOURCE%build\*.* %TARGET%\build\ /Q /E >NUL

:: copy library items
MKDIR %TARGET%\lib

FOR /D %%G in (%SOURCE%lib\*) DO IF EXIST "%%G\deploy.bat" ECHO deploying "%%~nxG"
FOR /D %%G in (%SOURCE%lib\*) DO IF EXIST "%%G\deploy.bat" CALL "%%G\deploy.bat" %TARGET%\lib\"%%~nxG"

FOR /D %%G in (%SOURCE%lib\*) DO IF NOT EXIST "%%G\deploy.bat" ECHO copying "%%~nxG"
FOR /D %%G in (%SOURCE%lib\*) DO IF NOT EXIST "%%G\deploy.bat" XCOPY "%%G" %TARGET%\lib\"%%~nxG"\ /Q /E >NUL

ECHO.

PAUSE
:end

Fix deploy.bat usage from folder with space on Windows

Enyo-DCO-1.0-Signed-Off-By: Ben Combee (ben.combee@palm.com)


@if "%SCM_TRACE_LEVEL%" NEQ "4" @echo off

:: ----------------------
:: KUDU Deployment Script
:: Version: 1.0.15
:: ----------------------

:: Prerequisites
:: -------------

:: Verify node.js installed
where node 2>nul >nul
IF %ERRORLEVEL% NEQ 0 (
  echo Missing node.js executable, please install node.js, if already installed make sure it can be reached from current environment.
  goto error
)

:: Setup
:: -----

setlocal enabledelayedexpansion

SET ARTIFACTS=%~dp0%..\artifacts

IF NOT DEFINED DEPLOYMENT_SOURCE (
  SET DEPLOYMENT_SOURCE=%~dp0%.
)

IF NOT DEFINED DEPLOYMENT_TARGET (
  SET DEPLOYMENT_TARGET=%ARTIFACTS%\wwwroot
)

IF NOT DEFINED NEXT_MANIFEST_PATH (
  SET NEXT_MANIFEST_PATH=%ARTIFACTS%\manifest

  IF NOT DEFINED PREVIOUS_MANIFEST_PATH (
    SET PREVIOUS_MANIFEST_PATH=%ARTIFACTS%\manifest
  )
)

IF NOT DEFINED KUDU_SYNC_CMD (
  :: Install kudu sync
  echo Installing Kudu Sync
  call npm install kudusync -g --silent
  IF !ERRORLEVEL! NEQ 0 goto error

  :: Locally just running "kuduSync" would also work
  SET KUDU_SYNC_CMD=%appdata%\npm\kuduSync.cmd
)
goto Deployment

:: Utility Functions
:: -----------------

:SelectNodeVersion

IF DEFINED KUDU_SELECT_NODE_VERSION_CMD (
  :: The following are done only on Windows Azure Websites environment
  call %KUDU_SELECT_NODE_VERSION_CMD% "%DEPLOYMENT_SOURCE%" "%DEPLOYMENT_TARGET%" "%DEPLOYMENT_TEMP%"
  IF !ERRORLEVEL! NEQ 0 goto error

  IF EXIST "%DEPLOYMENT_TEMP%\__nodeVersion.tmp" (
    SET /p NODE_EXE=<"%DEPLOYMENT_TEMP%\__nodeVersion.tmp"
    IF !ERRORLEVEL! NEQ 0 goto error
  )

  IF EXIST "%DEPLOYMENT_TEMP%\__npmVersion.tmp" (
    SET /p NPM_JS_PATH=<"%DEPLOYMENT_TEMP%\__npmVersion.tmp"
    IF !ERRORLEVEL! NEQ 0 goto error
  )

  IF NOT DEFINED NODE_EXE (
    SET NODE_EXE=node
  )

  SET NPM_CMD="!NODE_EXE!" "!NPM_JS_PATH!"
) ELSE (
  SET NPM_CMD=npm
  SET NODE_EXE=node
)

goto :EOF

::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: Deployment
:: ----------

:Deployment
echo Handling node.js deployment.

:: 1. KuduSync
IF /I "%IN_PLACE_DEPLOYMENT%" NEQ "1" (
  call :ExecuteCmd "%KUDU_SYNC_CMD%" -v 50 -f "%DEPLOYMENT_SOURCE%" -t "%DEPLOYMENT_TARGET%" -n "%NEXT_MANIFEST_PATH%" -p "%PREVIOUS_MANIFEST_PATH%" -i ".git;.hg;.deployment;deploy.cmd"
  IF !ERRORLEVEL! NEQ 0 goto error
)

:: 2. Select node version
call :SelectNodeVersion

:: 3. Install NPM packages
IF EXIST "%DEPLOYMENT_TARGET%\package.json" (
  pushd "%DEPLOYMENT_TARGET%"
  eval $NPM_CMD install --production
  exitWithMessageOnError "npm failed"
  cd - > /dev/null
fi

:: 4. Run Gulp Task
IF EXIST "%DEPLOYMENT_TARGET%\gulpfile.js" (
  pushd "%DEPLOYMENT_TARGET%"
  eval ./node_modules/.bin/gulp imagemin
  exitWithMessageOnError "gulp failed"
  cd - > /dev/null
fi

::5. Unzip file
IF EXIST "%DEPLOYMENT_TARGET%"
eval unzip -o Archive.zip
cd - > /dev/null

::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
goto end

:: Execute command routine that will echo out when error
:ExecuteCmd
setlocal
set _CMD_=%*
call %_CMD_%
if "%ERRORLEVEL%" NEQ "0" echo Failed exitCode=%ERRORLEVEL%, command=%_CMD_%
exit /b %ERRORLEVEL%

:error
endlocal
echo An error has occurred during web site deployment.
call :exitSetErrorLevel
call :exitFromFunction 2>nul

:exitSetErrorLevel
exit /b 1

:exitFromFunction
()

:end
endlocal
echo Finished successfully.

@if "%SCM_TRACE_LEVEL%" NEQ "4" @echo off

:: ----------------------
:: KUDU Deployment Script
:: Version: 1.0.15
:: ----------------------

:: Prerequisites
:: -------------

:: Verify node.js installed
where node 2>nul >nul
IF %ERRORLEVEL% NEQ 0 (
  echo Missing node.js executable, please install node.js, if already installed make sure it can be reached from current environment.
  goto error
)

:: Setup
:: -----

setlocal enabledelayedexpansion

SET ARTIFACTS=%~dp0%..\artifacts

IF NOT DEFINED DEPLOYMENT_SOURCE (
  SET DEPLOYMENT_SOURCE=%~dp0%.
)

IF NOT DEFINED DEPLOYMENT_TARGET (
  SET DEPLOYMENT_TARGET=%ARTIFACTS%\wwwroot
)

IF NOT DEFINED NEXT_MANIFEST_PATH (
  SET NEXT_MANIFEST_PATH=%ARTIFACTS%\manifest

  IF NOT DEFINED PREVIOUS_MANIFEST_PATH (
    SET PREVIOUS_MANIFEST_PATH=%ARTIFACTS%\manifest
  )
)

IF NOT DEFINED KUDU_SYNC_CMD (
  :: Install kudu sync
  echo Installing Kudu Sync
  call npm install kudusync -g --silent
  IF !ERRORLEVEL! NEQ 0 goto error

  :: Locally just running "kuduSync" would also work
  SET KUDU_SYNC_CMD=%appdata%\npm\kuduSync.cmd
)
goto Deployment

:: Utility Functions
:: -----------------

:SelectNodeVersion

IF DEFINED KUDU_SELECT_NODE_VERSION_CMD (
  :: The following are done only on Windows Azure Websites environment
  call %KUDU_SELECT_NODE_VERSION_CMD% "%DEPLOYMENT_SOURCE%" "%DEPLOYMENT_TARGET%" "%DEPLOYMENT_TEMP%"
  IF !ERRORLEVEL! NEQ 0 goto error

  IF EXIST "%DEPLOYMENT_TEMP%\__nodeVersion.tmp" (
    SET /p NODE_EXE=<"%DEPLOYMENT_TEMP%\__nodeVersion.tmp"
    IF !ERRORLEVEL! NEQ 0 goto error
  )

  IF EXIST "%DEPLOYMENT_TEMP%\__npmVersion.tmp" (
    SET /p NPM_JS_PATH=<"%DEPLOYMENT_TEMP%\__npmVersion.tmp"
    IF !ERRORLEVEL! NEQ 0 goto error
  )

  IF NOT DEFINED NODE_EXE (
    SET NODE_EXE=node
  )

  SET NPM_CMD="!NODE_EXE!" "!NPM_JS_PATH!"
) ELSE (
  SET NPM_CMD=npm
  SET NODE_EXE=node
)

goto :EOF

::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: Deployment
:: ----------

:Deployment
echo Handling node.js deployment.

:: 1. KuduSync
IF /I "%IN_PLACE_DEPLOYMENT%" NEQ "1" (
  call :ExecuteCmd "%KUDU_SYNC_CMD%" -v 50 -f "%DEPLOYMENT_SOURCE%" -t "%DEPLOYMENT_TARGET%" -n "%NEXT_MANIFEST_PATH%" -p "%PREVIOUS_MANIFEST_PATH%" -i ".git;.hg;.deployment;deploy.cmd"
  IF !ERRORLEVEL! NEQ 0 goto error
)

:: 2. Select node version
call :SelectNodeVersion

:: 3. Install NPM packages
IF EXIST "%DEPLOYMENT_TARGET%\package.json" (
  pushd "%DEPLOYMENT_TARGET%"
  call :ExecuteCmd !NPM_CMD! install
  IF !ERRORLEVEL! NEQ 0 goto error
  popd
)

:: 4. Run gulp transformations
IF EXIST "%DEPLOYMENT_TARGET%\gulpfile.js" (
  pushd "%DEPLOYMENT_TARGET%"
  call :ExecuteCmd .\node_modules\.bin\gulp
  IF !ERRORLEVEL! NEQ 0 goto error
  popd
)

::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
goto end

:: Execute command routine that will echo out when error
:ExecuteCmd
setlocal
set _CMD_=%*
call %_CMD_%
if "%ERRORLEVEL%" NEQ "0" echo Failed exitCode=%ERRORLEVEL%, command=%_CMD_%
exit /b %ERRORLEVEL%

:error
endlocal
echo An error has occurred during web site deployment.
call :exitSetErrorLevel
call :exitFromFunction 2>nul

:exitSetErrorLevel
exit /b 1

:exitFromFunction
()

:end
endlocal
echo Finished successfully.

edit deployment script

edit deployment script


@ECHO OFF

:: setup my variables
set OLDDIR=%CD%
SET "dir="D:\Archive\arccasperdeploy""
SET url=git@github.com:kaveh096/ArcCASPER.git
SET msg=""

:: clean enviroment
IF NOT EXIST %dir% ( git clone %url% %dir% )

:: update the dev branch
cd %dir%
git checkout dev
git pull

:: get hash of dev head
for /f %%i in ('git rev-parse --short HEAD') do set hash=%%i
set out=ArcCASPER-nigthly-%hash%.zip

:: TODO use 'git describe branchname' for release archive name
:: TODO create changle.log from 'git shortlog --no-merges master --not
v1.0.1'

:: check if there is new commit to be built
for /f %%i in ('d:\cygwin64\bin\bash.exe -c "/home/kshahabi/dropbox_uploader.sh list | grep %hash% | wc -l"') do set iscommit=%%i
if %iscommit%==1 (
  echo No new code is commited to dev branch
  goto :stable
)

:: build clean
set NOREG=1
del /Q Package\EvcSolver32.*
del /Q Package\EvcSolver64.*
msbuild.exe /target:build /p:Configuration=Release /p:Platform=Win32 USC.GISResearchLab.ArcCASPER.sln
msbuild.exe /target:build /p:Configuration=Release /p:Platform=x64   USC.GISResearchLab.ArcCASPER.sln

:: post to dropbox
cd Package
"c:\Program Files\7-Zip\7z.exe" a %out%  -i@file.list
if %errorlevel%==0 (
  echo Uploading to dropbox for public access
  d:\cygwin64\bin\bash.exe -c '/home/kshahabi/dropbox_uploader.sh upload `cygpath -u "%CD%\%out%"` %out%'
) else (
  echo Some of the files are not present
)

:stable
:: checkout master for stable release

:: update the dev branch
cd %dir%
git checkout master
git pull

:: get hash of dev head
for /f %%i in ('git rev-parse --short HEAD') do set hash=%%i
set out=ArcCASPER-stable-%hash%.zip

:: check if there is new commit to be built
for /f %%i in ('d:\cygwin64\bin\bash.exe -c "/home/kshahabi/dropbox_uploader.sh list | grep %hash% | wc -l"') do set iscommit=%%i
if %iscommit%==1 (
  set "msg=No new code is commited to master branch"
  goto :exit
)

:: build clean
set NOREG=1
del /Q Package\EvcSolver32.*
del /Q Package\EvcSolver64.*
msbuild.exe /target:build /p:Configuration=Release /p:Platform=Win32 USC.GISResearchLab.ArcCASPER.sln
msbuild.exe /target:build /p:Configuration=Release /p:Platform=x64   USC.GISResearchLab.ArcCASPER.sln

:: post to dropbox
cd Package
"c:\Program Files\7-Zip\7z.exe" a %out%  -i@file.list
if %errorlevel%==0 (
  echo Uploading to dropbox for public access
  d:\cygwin64\bin\bash.exe -c '/home/kshahabi/dropbox_uploader.sh upload `cygpath -u "%CD%\%out%"` %out%'
) else (
  echo Some of the files are not present
)

:: restore current directory and then exit
:exit
echo %msg%
chdir /d %OLDDIR%

@ECHO OFF

:: setup my variables
set OLDDIR=%CD%
SET "dir="D:\Archive\arccasperdeploy""
SET url=git@github.com:kaveh096/ArcCASPER.git
SET msg=""

:: clean enviroment
IF NOT EXIST %dir% ( git clone %url% %dir% )

:: update the dev branch
cd %dir%
git checkout dev
git pull

:: get hash of dev head
for /f %%i in ('git rev-parse --short HEAD') do set hash=%%i
set out=ArcCASPER-nigthly-%hash%.zip

:: TODO use 'git describe branchname' for release archive name
:: TODO create changle.log from 'git shortlog --no-merges master --not
v1.0.1'

:: check if there is new commit to be built
for /f %%i in ('d:\cygwin64\bin\bash.exe -c "/home/kshahabi/dropbox_uploader.sh list | grep %hash% | wc -l"') do set iscommit=%%i
if %iscommit%==1 (
  echo No new code is commited to dev branch
  goto :stable
)

:: build clean
set NOREG=1
del /Q Package\EvcSolver32.*
del /Q Package\EvcSolver64.*
msbuild.exe /target:build /p:Configuration=ReleaseNoFlock /p:Platform=Win32 USC.GISResearchLab.ArcCASPER.sln
msbuild.exe /target:build /p:Configuration=ReleaseNoFlock /p:Platform=x64   USC.GISResearchLab.ArcCASPER.sln

:: post to dropbox
cd Package
"c:\Program Files\7-Zip\7z.exe" a %out%  -i@file.list
if %errorlevel%==0 (
  echo Uploading to dropbox for public access
  d:\cygwin64\bin\bash.exe -c '/home/kshahabi/dropbox_uploader.sh upload `cygpath -u "%CD%\%out%"` %out%'
) else (
  echo Some of the files are not present
)

:stable
:: checkout master for stable release

:: update the dev branch
cd %dir%
git checkout master
git pull

:: get hash of dev head
for /f %%i in ('git rev-parse --short HEAD') do set hash=%%i
set out=ArcCASPER-stable-%hash%.zip

:: check if there is new commit to be built
for /f %%i in ('d:\cygwin64\bin\bash.exe -c "/home/kshahabi/dropbox_uploader.sh list | grep %hash% | wc -l"') do set iscommit=%%i
if %iscommit%==1 (
  set "msg=No new code is commited to master branch"
  goto :exit
)

:: build clean
set NOREG=1
del /Q Package\EvcSolver32.*
del /Q Package\EvcSolver64.*
msbuild.exe /target:build /p:Configuration=ReleaseNoFlock /p:Platform=Win32 USC.GISResearchLab.ArcCASPER.sln
msbuild.exe /target:build /p:Configuration=ReleaseNoFlock /p:Platform=x64   USC.GISResearchLab.ArcCASPER.sln

:: post to dropbox
cd Package
"c:\Program Files\7-Zip\7z.exe" a %out%  -i@file.list
if %errorlevel%==0 (
  echo Uploading to dropbox for public access
  d:\cygwin64\bin\bash.exe -c '/home/kshahabi/dropbox_uploader.sh upload `cygpath -u "%CD%\%out%"` %out%'
) else (
  echo Some of the files are not present
)

:: restore current directory and then exit
:exit
echo %msg%
chdir /d %OLDDIR%

update the deploy to leave out flocking model


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

@echo "Starting Windows build"

cd /d %~dp0
cd ..

call npm install -g npm@5 || goto :error

call npm install || goto :error
call npm run test || goto :error

goto :EOF

:error
exit /b 1

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

@echo "Starting Windows build"

cd /d %~dp0
cd ..

call npm install -g npm@latest || goto :error
call npm install || goto :error
call npm run test || goto :error

goto :EOF

:error
exit /b 1

use latest npm on Windows (#509)

chore: use latest npm on Windows (#509)


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

@echo "Starting Windows build"

cd /d %~dp0
cd ..

@rem The image we're currently running has a broken version of Node.js enabled
@rem by nvm (v10.15.3), which has no npm bin. This hack uses the functional
@rem Node v8.9.1 to install npm@latest, it then uses this version of npm to
@rem install npm for v10.15.3.
call nvm use v8.9.1 || goto :error
call node C:\Users\kbuilder\AppData\Roaming\nvm-ps\versions\v8.9.1\node_modules\npm-bootstrap\bin\npm-cli.js i npm -g || goto :error
call nvm use v10.15.3 || goto :error
call node C:\Users\kbuilder\AppData\Roaming\nvm-ps\versions\v8.9.1\node_modules\npm\bin\npm-cli.js i npm -g || goto :error

@rem Plugin integration tests on Windows are skipped, because there is no known
@rem procedure to start up database docker containers for the Kokoro Windows CI.
set TRACE_TEST_EXCLUDE_INTEGRATION=1

call npm install || goto :error
call npm run test || goto :error

goto :EOF

:error
exit /b 1

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

@echo "Starting Windows build"

cd /d %~dp0
cd ..

@rem npm path is not currently set in our image, we should fix this next time
@rem we upgrade Node.js in the image:
SET PATH=%PATH%;/cygdrive/c/Program Files/nodejs/npm

call nvm use v12.14.1
call which node

@rem Plugin integration tests on Windows are skipped, because there is no known
@rem procedure to start up database docker containers for the Kokoro Windows CI.
set TRACE_TEST_EXCLUDE_INTEGRATION=1

call npm install || goto :error
call npm run test || goto :error

goto :EOF

:error
exit /b 1

build: update windows configuration to match new vm


@echo on
mkdir build
if errorlevel 1 exit /B 1
cd build
if errorlevel 1 exit /B 1

qmake QMAKE_CC=%CC% QMAKE_CXX=%CXX% ..\libQGLViewer-$PKG_VERSION.pro
if errorlevel 1 exit /B 1

jom -j%CPU_COUNT%
if errorlevel 1 exit /B 1
jom check
if errorlevel 1 exit /B 1
jom install

@echo on
mkdir build
if errorlevel 1 exit /B 1
cd build
if errorlevel 1 exit /B 1

qmake QMAKE_CC=%CC% QMAKE_CXX=%CXX% ..\libQGLViewer-%PKG_VERSION%.pro
if errorlevel 1 exit /B 1

jom -j%CPU_COUNT%
if errorlevel 1 exit /B 1
jom check
if errorlevel 1 exit /B 1
jom install

Update bld.bat

Update bld.bat


@echo off
REM This is an example script to run GisToSWMM on Windows

..\GisToSWMM5\bin\GisToSWMM5.exe ^
..\data\raster_dem.asc ^
..\data\raster_flowdir.asc ^
..\data\raster_landuse.asc ^
..\data\table_catchment_props.csv ^
..\data\table_junctions.csv ^
..\data\table_conduits.csv ^
..\data\table_outfalls.csv ^
..\data\table_header.csv ^
..\data\table_evaporation.csv ^
..\data\table_temperature.csv ^
..\data\table_snowpacks.csv ^
..\data\table_raingages.csv ^
..\data\table_inflows.csv ^
..\data\table_timeseries.csv ^
..\data\table_pumps.csv ^
..\data\table_pumpcurves.csv ^
..\data\table_storage.csv ^
..\data\table_dwf.csv ^
..\data\table_patterns.csv ^
..\data\table_losses.csv ^
..\data\table_xsections.csv ^
..\data\table_report.csv ^
..\data\table_symbols.csv ^
..\out\demo_catchment ^
1

REM Wait for user input before closing terminal
pause

@echo off
REM This is an example script to run GisToSWMM5 in adaptive mode on Windows

..\bin\GisToSWMM5.exe ^
..\demo_catchment\data\raster_dem.asc ^
..\demo_catchment\data\raster_flowdir.asc ^
..\demo_catchment\data\raster_landuse.asc ^
..\demo_catchment\data\table_catchment_props.csv ^
..\demo_catchment\data\table_junctions.csv ^
..\demo_catchment\data\table_conduits.csv ^
..\demo_catchment\data\table_outfalls.csv ^
..\demo_catchment\data\table_header.csv ^
..\demo_catchment\data\table_evaporation.csv ^
..\demo_catchment\data\table_temperature.csv ^
..\demo_catchment\data\table_snowpacks.csv ^
..\demo_catchment\data\table_raingages.csv ^
..\demo_catchment\data\table_inflows.csv ^
..\demo_catchment\data\table_timeseries.csv ^
..\demo_catchment\data\table_pumps.csv ^
..\demo_catchment\data\table_pumpcurves.csv ^
..\demo_catchment\data\table_storage.csv ^
..\demo_catchment\data\table_dwf.csv ^
..\demo_catchment\data\table_patterns.csv ^
..\demo_catchment\data\table_losses.csv ^
..\demo_catchment\data\table_xsections.csv ^
..\demo_catchment\data\table_report.csv ^
..\demo_catchment\data\table_symbols.csv ^
..\demo_catchment\out\SWMM_in\demo_catchment_adap ^
1

REM Wait for user input before closing terminal
pause

Replace run_GisToSWMM5.bat

Replace run_GisToSWMM5.bat


call "%VS100COMNTOOLS%vsvars32.bat"

mkdir libs
pushd libs
cmake -G "Visual Studio 10" ../

popd

Create build_vs10.bat

Create build_vs10.bat


#!ipxe
#dhcp
echo Starting Ubuntu x64 installer for ${mac}
set base-url http://archive.ubuntu.com/ubuntu/dists/wily/main/installer-amd64/current/images/netboot/ubuntu-installer/amd64
kernel ${base-url}/linux
initrd ${base-url}/initrd.gz
#imgargs linux auto=true url=http://yourserver/some/path/preseed.cfg
boot ||
# If everything failed, give the user some options
echo Boot from ${base-url} failed
prompt --key 0x197e --timeout 2000 Press F12 to investigate || exit
shell

Create ubuntuboot.bat

Create ubuntuboot.bat


${FC} leparagliding.f
mkdir -p %LIBRARY_PREFIX%\bin
COPY a.exe %LIBRARY_PREFIX%\bin\leparagliding.exe

%FC% leparagliding.f
mkdir -p %LIBRARY_PREFIX%\bin
COPY a.exe %LIBRARY_PREFIX%\bin\leparagliding.exe

Update bld.bat

Update bld.bat


@setlocal
@set PROMPT=$G$S

@if exist "%~dp0version.cmd" call "%~dp0version.cmd"

@if not "%1" == "" goto %1

:build
        @set "VERSION=%DATE:/=%"
        @set X_VERSION=
        @goto _build

:release
        for /F %%I in (version.txt) do set VERSION=%%I
        set "X_VERSION=-X main.version %VERSION%"

:_build
        if not exist nyagos.syso for %%I in (windres.exe) do if not "%%~$PATH:I" == "" windres.exe --output-format=coff -o nyagos.syso nyagos.rc
        for /F %%V in ('git log -1 --pretty^=format:%%H') do go build -ldflags "-X main.stamp %DATE% -X main.commit %%V %X_VERSION%"
        goto end

:fmt
        for /R . %%I IN (*.go) do go fmt %%I
        for /R . %%I in (*~) do del %%I
        goto end

:clean
        for %%I in (nyagos.exe nyagos.syso version.now) do if exist %%I del %%I
        goto end

:sweep
        for /R %%I in (*~) do del %%I
        goto end

:get
        go get github.com/mattn/go-runewidth
        go get github.com/shiena/ansicolor
        go get github.com/atotto/clipboard
        goto end

:package
        zip -9 "nyagos-%VERSION%%2.zip" nyagos.exe lua52.dll nyagos.lua nyagos_ja.md nyagos_en.md readme.md .nyagos specialfolders.vbs lnk.vbs makeicon.cmd nyagos.d\*.lua
        goto end

:install
        @echo off
        if not "%2" == "" set "INSTALLDIR=%2"
        if "%INSTALLDIR%" == "" (
            @echo Please %0.cmd install PATH\TO\BIN, once
            goto end
        )
        if not exist "%INSTALLDIR%" (
            @echo Please %0.cmd install EXIST\PATH\TO\BIN,  once
            goto end
        )
        start %~0 install.
        goto end

:install.
        robocopy nyagos.d "%INSTALLDIR%\nyagos.d" /E
        taskkill /im nyagos.exe
        copy nyagos.exe "%INSTALLDIR%\."
        copy nyagos.lua "%INSTALLDIR%\."
        if not exist "%INSTALLDIR%\lua52.dll" copy lua52.dll "%INSTALLDIR%\."
        goto end

:upgrade
        for %%I in (mattn\go-runewidth shiena\ansicolor atotto\clipboard ) do (
            cd %GOPATH%\Src\github.com\%%I
            git pull origin master:master
            go build
        )
        goto end

:icon
        makeicon.cmd
        goto end

:help
        @echo off
        echo Usage for make.cmd
        echo  %0          : Equals to '%0 build'
        echo  %0 build    : Build nyagos.exe as snapshot (ignore version.txt)
        echo  %0 release  : Build nyagos.exe as release  (see version.txt)
        echo  %0 fmt      : Format all source files with 'go fmt'
        echo  %0 clean    : Delete nyagos.exe and nyagos.syso
        echo  %0 package  : Make the package zip-file
        echo  %0 get      : Do 'go get' for each github library
        echo  %0 upgrade  : Do 'git pull' for each github library
        echo  %0 help     : Print help
        echo  %0 install INSTALLDIR
        echo     : Copy binaries to INSTALLDIR
        echo  %0 install
        echo     : Copy binaries to last INSTALLDIR
:end
        ( echo set "VERSION=%VERSION%"
          echo set "X_VERSION=%X_VERSION%"
          echo set "INSTALLDIR=%INSTALLDIR%"
        ) > "%~dp0version.cmd"

@setlocal
@set PROMPT=$G$S

@if exist "%~dp0version.cmd" call "%~dp0version.cmd"

@if not "%1" == "" goto %1

:build
        @set "VERSION=%DATE:/=%"
        @set X_VERSION=
        @goto _build

:release
        for /F %%I in (version.txt) do set VERSION=%%I
        set "X_VERSION=-X main.version %VERSION%"

:_build
        if not exist nyagos.syso for %%I in (windres.exe) do if not "%%~$PATH:I" == "" windres.exe --output-format=coff -o nyagos.syso nyagos.rc
        for /F %%V in ('git log -1 --pretty^=format:%%H') do go build -o nyagos.exe -ldflags "-X main.stamp %DATE% -X main.commit %%V %X_VERSION%"
        goto end

:fmt
        for /R . %%I IN (*.go) do go fmt %%I
        for /R . %%I in (*~) do del %%I
        goto end

:clean
        for %%I in (nyagos.exe nyagos.syso version.now) do if exist %%I del %%I
        goto end

:sweep
        for /R %%I in (*~) do del %%I
        goto end

:get
        go get github.com/mattn/go-runewidth
        go get github.com/shiena/ansicolor
        go get github.com/atotto/clipboard
        goto end

:package
        zip -j9 "nyagos-%VERSION%%2.zip" %~dp0..\readme.md  %~dp0..\nyagos_ja.md %~dp0..\nyagos_en.md
        zip -9 "nyagos-%VERSION%%2.zip" nyagos.exe lua52.dll nyagos.lua .nyagos specialfolders.vbs lnk.vbs makeicon.cmd nyagos.d\*.lua
        goto end

:install
        @echo off
        if not "%2" == "" set "INSTALLDIR=%2"
        if "%INSTALLDIR%" == "" (
            @echo Please %0.cmd install PATH\TO\BIN, once
            goto end
        )
        if not exist "%INSTALLDIR%" (
            @echo Please %0.cmd install EXIST\PATH\TO\BIN,  once
            goto end
        )
        start %~0 install.
        goto end

:install.
        robocopy nyagos.d "%INSTALLDIR%\nyagos.d" /E
        taskkill /im nyagos.exe
        copy nyagos.exe "%INSTALLDIR%\."
        copy nyagos.lua "%INSTALLDIR%\."
        if not exist "%INSTALLDIR%\lua52.dll" copy lua52.dll "%INSTALLDIR%\."
        goto end

:upgrade
        for %%I in (mattn\go-runewidth shiena\ansicolor atotto\clipboard ) do (
            cd %GOPATH%\Src\github.com\%%I
            git pull origin master:master
            go build
        )
        goto end

:icon
        makeicon.cmd
        goto end

:help
        @echo off
        echo Usage for make.cmd
        echo  %0          : Equals to '%0 build'
        echo  %0 build    : Build nyagos.exe as snapshot (ignore version.txt)
        echo  %0 release  : Build nyagos.exe as release  (see version.txt)
        echo  %0 fmt      : Format all source files with 'go fmt'
        echo  %0 clean    : Delete nyagos.exe and nyagos.syso
        echo  %0 package  : Make the package zip-file
        echo  %0 get      : Do 'go get' for each github library
        echo  %0 upgrade  : Do 'git pull' for each github library
        echo  %0 help     : Print help
        echo  %0 install INSTALLDIR
        echo     : Copy binaries to INSTALLDIR
        echo  %0 install
        echo     : Copy binaries to last INSTALLDIR
:end
        ( echo set "VERSION=%VERSION%"
          echo set "X_VERSION=%X_VERSION%"
          echo set "INSTALLDIR=%INSTALLDIR%"
        ) > "%~dp0version.cmd"

Fix make.cmd for new tree.

Fix make.cmd for new tree.


echo ">>> install"
cmake --version
echo "<<< install"

echo ">>> install"
cmake --version
moc --version
uic /?
echo "<<< install"

test qt

update: test qt


@echo off

SETLOCAL

if NOT DEFINED JAVA_HOME goto err

set SCRIPT_DIR=%~dp0
for %%I in ("%SCRIPT_DIR%..") do set ES_HOME=%%~dpfI

REM ***** JAVA options *****

set JAVA_OPTS=^
 -Xms256m^
 -Xmx1G^
 -Djline.enabled=false^
 -XX:+AggressiveOpts^
 -XX:+UseParNewGC^
 -XX:+UseConcMarkSweepGC^
 -XX:+CMSParallelRemarkEnabled^
 -XX:+HeapDumpOnOutOfMemoryError

set ES_CLASSPATH=$CLASSPATH;%ES_HOME%/lib/elasticsearch-@ES_VERSION@.jar;%ES_HOME%/lib/*;%ES_HOME%/lib/sigar/*
set ES_PARAMS=-Delasticsearch -Des-foreground=yes -Des.path.home="%ES_HOME%"

"%JAVA_HOME%\bin\java" %JAVA_OPTS% %ES_JAVA_OPTS% %ES_PARAMS% -cp "%ES_CLASSPATH%" "org.elasticsearch.bootstrap.Bootstrap"
goto finally

:err
echo JAVA_HOME environment variable must be set!
pause

:finally

ENDLOCAL

@echo off

SETLOCAL

if NOT DEFINED JAVA_HOME goto err

set SCRIPT_DIR=%~dp0
for %%I in ("%SCRIPT_DIR%..") do set ES_HOME=%%~dpfI

REM ***** JAVA options *****

set JAVA_OPTS=^
 -Xms256m^
 -Xmx1G^
 -Djline.enabled=false^
 -XX:+AggressiveOpts^
 -XX:+UseParNewGC^
 -XX:+UseConcMarkSweepGC^
 -XX:+CMSParallelRemarkEnabled^
 -XX:+HeapDumpOnOutOfMemoryError

set ES_CLASSPATH=%CLASSPATH%;%ES_HOME%/lib/elasticsearch-@ES_VERSION@.jar;%ES_HOME%/lib/*;%ES_HOME%/lib/sigar/*
set ES_PARAMS=-Delasticsearch -Des-foreground=yes -Des.path.home="%ES_HOME%"

"%JAVA_HOME%\bin\java" %JAVA_OPTS% %ES_JAVA_OPTS% %ES_PARAMS% -cp "%ES_CLASSPATH%" "org.elasticsearch.bootstrap.Bootstrap"
goto finally

:err
echo JAVA_HOME environment variable must be set!
pause

:finally

ENDLOCAL

fix classpath env var in windows

fix classpath env var in windows


@echo off
REM ##########################################################################################
REM # Build SDK with (msvc or clang) + CMake + (MSBuild or Ninja).                           #
REM #                                                                                #
REM # CMake arguments may be passed as parameters to this script.                            #
REM # If Visual Studio is not installed, then this script falls back to LLVM-CLang,          #
REM # Emscripten or any other C++ compiler of your choice.                                   #
REM #                                                                                #
REM ##########################################################################################
REM #                                                                                #
REM # Options passed as environment variables:                                               #
REM #                                                                                #
REM # BUILDTOOLS_VERSION - specify build tools version. See `vcvars.cmd` for details.        #
REM # CMAKE_GEN          - specify CMake generator.                                          #
REM # VCPKG_ROOT         - path to vcpkg root                                                #
REM # ARCH               - architecture to build for (default: x64)                          #
REM #                                                                                #
REM ##########################################################################################
set "PATH=%PATH%;%ProgramFiles%\CMake\bin"
pushd %~dp0
setlocal enableextensions
setlocal enabledelayedexpansion
if not defined BUILDTOOLS_VERSION (
  set BUILDTOOLS_VERSION=vs2019
)

REM ##########################################################################################
REM Set up CMake generator. Use Ninja if available.
REM ##########################################################################################
for /f "tokens=*" %%F in ('where ninja') do (
  set NINJA=%%F
)

if defined VCPKG_ROOT (
  if not defined NINJA (
    for /f "tokens=*" %%F in ('where /R %VCPKG_ROOT%\vcpkg\downloads\tools ninja') do (
      set NINJA=%%F
    )
    popd
  )
)

if not defined NINJA (
  for /f "tokens=*" %%F in ('where /R %CD%\vcpkg\downloads\tools ninja') do (
    set NINJA=%%F
  )
)

if defined NINJA (
  echo Found ninja: !NINJA!
  if not defined CMAKE_GEN (
    set CMAKE_GEN=Ninja
  )
)

if not defined CMAKE_GEN (
  set CMAKE_GEN=Visual Studio 16 2019
)

set "ROOT=%~dp0\.."
if not defined ARCH (
  set ARCH=x64
)

REM ##########################################################################################
REM Use preinstalled vcpkg from %VCPKG_ROOT% if installed or use our local snapshot of it.
REM ##########################################################################################
if defined VCPKG_ROOT (
  set "VCPKG_CMAKE=%VCPKG_ROOT%\scripts\buildsystems\vcpkg.cmake"
) else (
  set "VCPKG_CMAKE=%CD%\vcpkg\scripts\buildsystems\vcpkg.cmake"
)

REM ##########################################################################################
REM Setup Microsoft Visual C++ compiler environment (if found, if not - fallback to alternate)
REM ##########################################################################################
call "%~dp0\vcvars.cmd"

REM Prefer Visual Studio C++ compiler if found
for /f "tokens=*" %%F in ('where cl.exe') do (
  set CONFIG=!CONFIG! -DCMAKE_C_COMPILER:FILEPATH="%%F" -DCMAKE_CXX_COMPILER:FILEPATH="%%F"
  echo !CONFIG!
)

REM ##########################################################################################
REM The following two configurations are built below:
REM - nostd            - build with OpenTelemetry C++ Template library
REM - stl              - build with Standard Template Library
REM ##########################################################################################
REM Build with nostd implementation.
REM ##########################################################################################
set CONFIG=-DWITH_STL:BOOL=OFF %*
set "OUTDIR=%ROOT%\out\%BUILDTOOLS_VERSION%\nostd"
call :build_config

REM ##########################################################################################
REM Build with STL implementation. This option does not yield benefits for vs2015 build.
REM ##########################################################################################
if "%BUILDTOOLS_VERSION%" neq "vs2015" (
  set CONFIG=-DWITH_STL:BOOL=ON %*
  set "OUTDIR=%ROOT%\out\%BUILDTOOLS_VERSION%\stl"
  call :build_config
)

popd
exit
REM ##########################################################################################
REM Function that allows to build given build configuration with MSBuild or Ninja
REM ##########################################################################################
:build_config
REM TODO: consider rmdir for clean builds
if not exist "%OUTDIR%" mkdir "%OUTDIR%"
cd "%OUTDIR%"

REM Prefer ninja if available
if "!CMAKE_GEN!" == "Ninja" (
  call :build_config_ninja
  exit /b
)

if "!BUILDTOOLS_VERSION!" == "vs2015" (
  cmake -G "!CMAKE_GEN!" -A !ARCH! -DCMAKE_TOOLCHAIN_FILE="!VCPKG_CMAKE!" !CONFIG! "!ROOT!"
  call :build_msbuild
  exit /b
)

if "!BUILDTOOLS_VERSION!" == "vs2017" (
  cmake -G "!CMAKE_GEN!" -A !ARCH! -DCMAKE_TOOLCHAIN_FILE="!VCPKG_CMAKE!" !CONFIG! "!ROOT!"
  call :build_msbuild
  exit /b
)

if "!BUILDTOOLS_VERSION!" == "vs2019" (
  cmake -G "!CMAKE_GEN!" -A !ARCH! -DCMAKE_TOOLCHAIN_FILE="!VCPKG_CMAKE!" !CONFIG! "!ROOT!"
  call :build_msbuild
  exit /b
)

REM ##########################################################################################
REM Exotic CMake generators, like MSYS and MinGW MAY work, but untested
REM ##########################################################################################
cmake -G "!CMAKE_GEN!" -DCMAKE_TOOLCHAIN_FILE="!VCPKG_CMAKE!" !CONFIG! "!ROOT!"

:build_msbuild
set "SOLUTION=%OUTDIR%\opentelemetry-cpp.sln"
msbuild "%SOLUTION%" /p:Configuration=Release /p:VcpkgEnabled=true
exit /b

REM ##########################################################################################
REM Build using CMake+ninja: vs2019 is known to work well. vs2017 was not tested.
REM ##########################################################################################
REM
REM Optional parameters may be passed to `build.cmd ARG1 ARG2 .. ARGN`.
REM
REM These arguments get appended to CONFIG and passed to CMake.
REM
REM To build for Debug:
REM -DCMAKE_BUILD_TYPE:STRING="Debug"
REM
REM To specify alternate installation path:
REM -DCMAKE_INSTALL_PREFIX:PATH=C:\path\to\install
REM
REM To specify alternate toolchain version:
REM -DCMAKE_C_COMPILER:FILEPATH="C:/Program Files (x86)/Microsoft Visual Studio/2019/Enterprise/VC/Tools/MSVC/14.28.29910/bin/Hostx64/x64/cl.exe"
REM -DCMAKE_CXX_COMPILER:FILEPATH="C:/Program Files (x86)/Microsoft Visual Studio/2019/Enterprise/VC/Tools/MSVC/14.28.29910/bin/Hostx64/x64/cl.exe"
REM
REM To specify alternate version of Ninja.exe:
REM -DCMAKE_MAKE_PROGRAM="C:\PROGRAM FILES (X86)\MICROSOFT VISUAL STUDIO\2019\ENTERPRISE\COMMON7\IDE\COMMONEXTENSIONS\MICROSOFT\CMAKE\Ninja\ninja.exe"
REM
REM ##########################################################################################
:build_config_ninja
cmake -G "Ninja" -DCMAKE_MAKE_PROGRAM="!NINJA!" -DCMAKE_TOOLCHAIN_FILE="!VCPKG_CMAKE!" !CONFIG! "!ROOT!"
%NINJA%
exit /b

@echo off
REM ##########################################################################################
REM # Build SDK with (msvc or clang) + CMake + (MSBuild or Ninja).                           #
REM #                                                                                #
REM # CMake arguments may be passed as parameters to this script.                            #
REM # If Visual Studio is not installed, then this script falls back to LLVM-CLang,          #
REM # Emscripten or any other C++ compiler of your choice.                                   #
REM #                                                                                #
REM ##########################################################################################
REM #                                                                                #
REM # Options passed as environment variables:                                               #
REM #                                                                                #
REM # BUILDTOOLS_VERSION - specify build tools version. See `vcvars.cmd` for details.        #
REM # CMAKE_GEN          - specify CMake generator.                                          #
REM # VCPKG_ROOT         - path to vcpkg root                                                #
REM # ARCH               - architecture to build for (default: x64)                          #
REM #                                                                                #
REM ##########################################################################################
set "PATH=%PATH%;%ProgramFiles%\CMake\bin"
pushd %~dp0
setlocal enableextensions
setlocal enabledelayedexpansion
if not defined BUILDTOOLS_VERSION (
  set BUILDTOOLS_VERSION=vs2019
)

REM ##########################################################################################
REM Set up CMake generator. Use Ninja if available.
REM ##########################################################################################
for /f "tokens=*" %%F in ('where ninja') do (
  set NINJA=%%F
)

if defined VCPKG_ROOT (
  if not defined NINJA (
    for /f "tokens=*" %%F in ('where /R %VCPKG_ROOT%\vcpkg\downloads\tools ninja') do (
      set NINJA=%%F
    )
    popd
  )
)

if not defined NINJA (
  for /f "tokens=*" %%F in ('where /R %CD%\vcpkg\downloads\tools ninja') do (
    set NINJA=%%F
  )
)

if defined NINJA (
  echo Found ninja: !NINJA!
  if not defined CMAKE_GEN (
    set CMAKE_GEN=Ninja
  )
)

if not defined CMAKE_GEN (
  set CMAKE_GEN=Visual Studio 16 2019
)

set "ROOT=%~dp0\.."
if not defined ARCH (
  set ARCH=x64
)

REM ##########################################################################################
REM Use preinstalled vcpkg from %VCPKG_ROOT% if installed or use our local snapshot of it.
REM ##########################################################################################
if defined VCPKG_ROOT (
  set "VCPKG_CMAKE=%VCPKG_ROOT%\scripts\buildsystems\vcpkg.cmake"
) else (
  set "VCPKG_CMAKE=%CD%\vcpkg\scripts\buildsystems\vcpkg.cmake"
)

REM ##########################################################################################
REM Setup Microsoft Visual C++ compiler environment (if found, if not - fallback to alternate)
REM ##########################################################################################
call "%~dp0\vcvars.cmd"

REM Prefer Visual Studio C++ compiler if found
for /f "tokens=*" %%F in ('where cl.exe') do (
  set CONFIG=!CONFIG! -DCMAKE_C_COMPILER:FILEPATH="%%F" -DCMAKE_CXX_COMPILER:FILEPATH="%%F"
  echo !CONFIG!
)

REM ##########################################################################################
REM The following two configurations are built below:
REM - nostd            - build with OpenTelemetry C++ Template library
REM - stl              - build with Standard Template Library
REM ##########################################################################################
REM Build with nostd implementation.
REM ##########################################################################################
set CONFIG=-DWITH_STL:BOOL=OFF %*
set "OUTDIR=%ROOT%\out\%BUILDTOOLS_VERSION%\nostd"
call :build_config

REM ##########################################################################################
REM Build with STL implementation. This option does not yield benefits for vs2015 build.
REM ##########################################################################################
if "%BUILDTOOLS_VERSION%" neq "vs2015" (
  set CONFIG=-DWITH_STL:BOOL=ON %*
  set "OUTDIR=%ROOT%\out\%BUILDTOOLS_VERSION%\stl"
  call :build_config
)

popd
exit
REM ##########################################################################################
REM Function that allows to build given build configuration with MSBuild or Ninja
REM ##########################################################################################
:build_config
REM TODO: consider rmdir for clean builds
if not exist "%OUTDIR%" mkdir "%OUTDIR%"
cd "%OUTDIR%"

REM Prefer ninja if available
if "!CMAKE_GEN!" == "Ninja" (
  call :build_config_ninja
  exit /b
)

if "!BUILDTOOLS_VERSION!" == "vs2015" (
  cmake -G "!CMAKE_GEN!" -A !ARCH! -DCMAKE_TOOLCHAIN_FILE="!VCPKG_CMAKE!" !CONFIG! "!ROOT!"
  call :build_msbuild
  exit /b
)

if "!BUILDTOOLS_VERSION!" == "vs2017" (
  cmake -G "!CMAKE_GEN!" -A !ARCH! -DCMAKE_TOOLCHAIN_FILE="!VCPKG_CMAKE!" !CONFIG! "!ROOT!"
  call :build_msbuild
  exit /b
)

if "!BUILDTOOLS_VERSION!" == "vs2019" (
  cmake -G "!CMAKE_GEN!" -A !ARCH! -DCMAKE_TOOLCHAIN_FILE="!VCPKG_CMAKE!" !CONFIG! "!ROOT!"
  call :build_msbuild
  exit /b
)

REM ##########################################################################################
REM Exotic CMake generators, like MSYS and MinGW MAY work, but untested
REM ##########################################################################################
cmake -G "!CMAKE_GEN!" -DCMAKE_TOOLCHAIN_FILE="!VCPKG_CMAKE!" !CONFIG! "!ROOT!"

:build_msbuild
set "SOLUTION=%OUTDIR%\opentelemetry-cpp.sln"
msbuild "%SOLUTION%" /p:Configuration=Release /p:VcpkgEnabled=true
exit /b

REM ##########################################################################################
REM Build using CMake+ninja: vs2019 is known to work well. vs2017 was not tested.
REM ##########################################################################################
REM
REM Optional parameters may be passed to `build.cmd ARG1 ARG2 .. ARGN`.
REM
REM These arguments get appended to CONFIG and passed to CMake.
REM
REM To build for Debug:
REM -DCMAKE_BUILD_TYPE:STRING="Debug"
REM
REM To specify alternate installation path:
REM -DCMAKE_INSTALL_PREFIX:PATH=C:\path\to\install
REM
REM To specify alternate toolchain version:
REM -DCMAKE_C_COMPILER:FILEPATH="C:/Program Files (x86)/Microsoft Visual Studio/2019/Enterprise/VC/Tools/MSVC/14.28.29910/bin/Hostx64/x64/cl.exe"
REM -DCMAKE_CXX_COMPILER:FILEPATH="C:/Program Files (x86)/Microsoft Visual Studio/2019/Enterprise/VC/Tools/MSVC/14.28.29910/bin/Hostx64/x64/cl.exe"
REM
REM To specify alternate version of Ninja.exe:
REM -DCMAKE_MAKE_PROGRAM="C:\PROGRAM FILES (X86)\MICROSOFT VISUAL STUDIO\2019\ENTERPRISE\COMMON7\IDE\COMMONEXTENSIONS\MICROSOFT\CMAKE\Ninja\ninja.exe"
REM
REM ##########################################################################################
:build_config_ninja
cmake -G "Ninja" -DCMAKE_MAKE_PROGRAM="!NINJA!" -DCMAKE_TOOLCHAIN_FILE="!VCPKG_CMAKE!" !CONFIG! "!ROOT!"
"%NINJA%"
exit /b

Fix for #1292 (#1326)

Fix for #1292 (#1326)


@echo off

set LEIN_VERSION=1.4.0-SNAPSHOT

setLocal EnableDelayedExpansion

rem LEIN_JAR and LEIN_HOME variables can be set manually.

if "x%LEIN_JAR%" == "x" (
    set LEIN_DIR=%~dp0
    set LEIN_JAR=!LEIN_DIR!leiningen-%LEIN_VERSION%-standalone.jar
)

if "x%1" == "xself-install" goto SELF_INSTALL
if "x%1" == "xupgrade"      goto NO_UPGRADE

if "x%LEIN_HOME%" == "x" (
    set LEIN_HOME=%HOMEDRIVE%%HOMEPATH%\.lein
)

set ORIGINAL_PWD=%CD%
call :FIND_DIR_CONTAINING_UPWARDS project.clj
if "%DIR_CONTAINING%" neq "" cd "%DIR_CONTAINING%"

set LEIN_PLUGINS="
for %%j in (".\lib\dev\*.jar") do (
    set LEIN_PLUGINS=!LEIN_PLUGINS!;%%~fj
)
set LEIN_PLUGINS=!LEIN_PLUGINS!"

set LEIN_USER_PLUGINS="
for %%j in ("%LEIN_HOME%\plugins\*.jar") do (
    set LEIN_USER_PLUGINS=!LEIN_USER_PLUGINS!;%%~fj
)
set LEIN_USER_PLUGINS=!LEIN_USER_PLUGINS!"

set CLASSPATH=%LEIN_USER_PLUGINS%;%LEIN_PLUGINS%;test;src;"%CLASSPATH%"

if exist "%~f0\..\..\src\leiningen\core.clj" (
    rem Running from source checkout.
    call :SET_LEIN_ROOT "%~f0\..\.."

    set LEIN_LIBS="
    for %%j in ("!LEIN_ROOT!\lib\*") do set LEIN_LIBS=!LEIN_LIBS!;%%~fj
    set LEIN_LIBS=!LEIN_LIBS!"

    if "x!LEIN_LIBS!" == "x" if not exist "%LEIN_JAR%" goto NO_DEPENDENCIES

    set CLASSPATH="!LEIN_ROOT!\src";"!LEIN_ROOT!\resources";!LEIN_LIBS!;%CLASSPATH%;"%LEIN_JAR%"
) else (
    rem Not running from a checkout.
    if not exist "%LEIN_JAR%" goto NO_LEIN_JAR
    set CLASSPATH="%LEIN_JAR%";%CLASSPATH%
)

if not "x%DEBUG%" == "x" echo CLASSPATH=%CLASSPATH%
rem ##################################################

if not "x%INSIDE_EMACS%" == "x" goto SKIP_JLINE
if "x%1" == "xrepl"             goto SET_JLINE
if "x%1" == "xinteractive"      goto SET_JLINE
if "x%1" == "xint"              goto SET_JLINE
goto :SKIP_JLINE

:SET_JLINE
set JLINE=jline.ConsoleRunner
:SKIP_JLINE

if "x%JAVA_CMD%" == "x" set JAVA_CMD="java"

%JAVA_CMD% -client %JAVA_OPTS% -Dleiningen.original.pwd="%ORIGINAL_PWD%" ^
 -cp %CLASSPATH% %JLINE% clojure.main -e "(use 'leiningen.core)(-main)" NUL %*
goto EOF

:NO_LEIN_JAR
echo.
echo "%LEIN_JAR%" can not be found.
echo You can try running "lein self-install"
echo or change LEIN_JAR environment variable
echo or edit lein.bat to set appropriate LEIN_JAR path.
echo.
goto EOF

:NO_DEPENDENCIES
echo.
echo Leiningen is missing its dependencies.
echo Please see "Building" in the README.
echo.
goto EOF

:SELF_INSTALL
if exist "%LEIN_JAR%" (
    echo %LEIN_JAR% already exists. Delete and retry.
    goto EOF
)
set HTTP_CLIENT=wget -O
wget>nul 2>&1
if ERRORLEVEL 9009 (
    curl>nul 2>&1
    if ERRORLEVEL 9009 goto NO_HTTP_CLIENT
    set HTTP_CLIENT=curl --insecure -f -L -o
)
set LEIN_JAR_URL=http://github.com/downloads/technomancy/leiningen/leiningen-%LEIN_VERSION%-standalone.jar
%HTTP_CLIENT% "%LEIN_JAR%" %LEIN_JAR_URL%
if ERRORLEVEL 1 (
    del "%LEIN_JAR%">nul 2>&1
    goto DOWNLOAD_FAILED
)
goto EOF

:DOWNLOAD_FAILED
echo.
echo *** DOWNLOAD FAILED! Check URL/Version. ***
echo.
goto EOF

:NO_HTTP_CLIENT
echo.
echo ERROR: Wget/Curl not found. Make sure at least either of Wget and Curl is
echo        installed and is in PATH. You can get them from URLs below:
echo.
echo Wget: "http://users.ugent.be/~bpuype/wget/"
echo Curl: "http://curl.haxx.se/dlwiz/?type=bin&os=Win32&flav=-&ver=2000/XP"
echo.
goto EOF

:NO_UPGRADE
echo.
echo Upgrade feature is not available on Windows. Please edit the value of
echo variable LEIN_VERSION in file %~f0
echo then run "lein self-install".
echo.
goto EOF

:SET_LEIN_ROOT
set LEIN_ROOT=%~f1
goto EOF

rem Find directory containing filename supplied in first argument
rem looking in current directory, and looking up the parent
rem chain until we find it, or run out
rem returns result in %DIR_CONTAINING%
rem empty string if we don't find it
:FIND_DIR_CONTAINING_UPWARDS
set DIR_CONTAINING=%CD%
set LAST_DIR=

:LOOK_AGAIN
if "%DIR_CONTAINING%" == "%LAST_DIR%" (
    rem didn't find it
    set DIR_CONTAINING=
    goto :EOF
)

if EXIST "%DIR_CONTAINING%\%1" (
    rem found it - use result in DIR_CONTAINING
    goto :EOF
)

set LAST_DIR=%DIR_CONTAINING%
call :GET_PARENT_PATH "%DIR_CONTAINING%\.."
set DIR_CONTAINING=%PARENT_PATH%
goto :LOOK_AGAIN

:GET_PARENT_PATH
set PARENT_PATH=%~f1
goto :EOF

:EOF

@echo off

set LEIN_VERSION=1.4.0-SNAPSHOT

setLocal EnableDelayedExpansion

rem LEIN_JAR and LEIN_HOME variables can be set manually.

if "x%LEIN_JAR%" == "x" (
    set LEIN_DIR=%~dp0
    set LEIN_JAR=!LEIN_DIR!leiningen-%LEIN_VERSION%-standalone.jar
)

if "x%1" == "xself-install" goto SELF_INSTALL
if "x%1" == "xupgrade"      goto NO_UPGRADE

if "x%LEIN_HOME%" == "x" (
    set LEIN_HOME=%USERPROFILE%\.lein
)

set ORIGINAL_PWD=%CD%
call :FIND_DIR_CONTAINING_UPWARDS project.clj
if "%DIR_CONTAINING%" neq "" cd "%DIR_CONTAINING%"

set LEIN_PLUGINS="
for %%j in (".\lib\dev\*.jar") do (
    set LEIN_PLUGINS=!LEIN_PLUGINS!;%%~fj
)
set LEIN_PLUGINS=!LEIN_PLUGINS!"

set LEIN_USER_PLUGINS="
for %%j in ("%LEIN_HOME%\plugins\*.jar") do (
    set LEIN_USER_PLUGINS=!LEIN_USER_PLUGINS!;%%~fj
)
set LEIN_USER_PLUGINS=!LEIN_USER_PLUGINS!"

set CLASSPATH=%LEIN_USER_PLUGINS%;%LEIN_PLUGINS%;test;src;"%CLASSPATH%"

if exist "%~f0\..\..\src\leiningen\core.clj" (
    rem Running from source checkout.
    call :SET_LEIN_ROOT "%~f0\..\.."

    set LEIN_LIBS="
    for %%j in ("!LEIN_ROOT!\lib\*") do set LEIN_LIBS=!LEIN_LIBS!;%%~fj
    set LEIN_LIBS=!LEIN_LIBS!"

    if "x!LEIN_LIBS!" == "x" if not exist "%LEIN_JAR%" goto NO_DEPENDENCIES

    set CLASSPATH="!LEIN_ROOT!\src";"!LEIN_ROOT!\resources";!LEIN_LIBS!;%CLASSPATH%;"%LEIN_JAR%"
) else (
    rem Not running from a checkout.
    if not exist "%LEIN_JAR%" goto NO_LEIN_JAR
    set CLASSPATH="%LEIN_JAR%";%CLASSPATH%
)

if not "x%DEBUG%" == "x" echo CLASSPATH=%CLASSPATH%
rem ##################################################

if not "x%INSIDE_EMACS%" == "x" goto SKIP_JLINE
if "x%1" == "xrepl"             goto SET_JLINE
if "x%1" == "xinteractive"      goto SET_JLINE
if "x%1" == "xint"              goto SET_JLINE
goto :SKIP_JLINE

:SET_JLINE
set JLINE=jline.ConsoleRunner
:SKIP_JLINE

if "x%JAVA_CMD%" == "x" set JAVA_CMD="java"

%JAVA_CMD% -client %JAVA_OPTS% -Dleiningen.original.pwd="%ORIGINAL_PWD%" ^
 -cp %CLASSPATH% %JLINE% clojure.main -e "(use 'leiningen.core)(-main)" NUL %*
goto EOF

:NO_LEIN_JAR
echo.
echo "%LEIN_JAR%" can not be found.
echo You can try running "lein self-install"
echo or change LEIN_JAR environment variable
echo or edit lein.bat to set appropriate LEIN_JAR path.
echo.
goto EOF

:NO_DEPENDENCIES
echo.
echo Leiningen is missing its dependencies.
echo Please see "Building" in the README.
echo.
goto EOF

:SELF_INSTALL
if exist "%LEIN_JAR%" (
    echo %LEIN_JAR% already exists. Delete and retry.
    goto EOF
)
set HTTP_CLIENT=wget -O
wget>nul 2>&1
if ERRORLEVEL 9009 (
    curl>nul 2>&1
    if ERRORLEVEL 9009 goto NO_HTTP_CLIENT
    set HTTP_CLIENT=curl --insecure -f -L -o
)
set LEIN_JAR_URL=http://github.com/downloads/technomancy/leiningen/leiningen-%LEIN_VERSION%-standalone.jar
%HTTP_CLIENT% "%LEIN_JAR%" %LEIN_JAR_URL%
if ERRORLEVEL 1 (
    del "%LEIN_JAR%">nul 2>&1
    goto DOWNLOAD_FAILED
)
goto EOF

:DOWNLOAD_FAILED
echo.
echo *** DOWNLOAD FAILED! Check URL/Version. ***
echo.
goto EOF

:NO_HTTP_CLIENT
echo.
echo ERROR: Wget/Curl not found. Make sure at least either of Wget and Curl is
echo        installed and is in PATH. You can get them from URLs below:
echo.
echo Wget: "http://users.ugent.be/~bpuype/wget/"
echo Curl: "http://curl.haxx.se/dlwiz/?type=bin&os=Win32&flav=-&ver=2000/XP"
echo.
goto EOF

:NO_UPGRADE
echo.
echo Upgrade feature is not available on Windows. Please edit the value of
echo variable LEIN_VERSION in file %~f0
echo then run "lein self-install".
echo.
goto EOF

:SET_LEIN_ROOT
set LEIN_ROOT=%~f1
goto EOF

rem Find directory containing filename supplied in first argument
rem looking in current directory, and looking up the parent
rem chain until we find it, or run out
rem returns result in %DIR_CONTAINING%
rem empty string if we don't find it
:FIND_DIR_CONTAINING_UPWARDS
set DIR_CONTAINING=%CD%
set LAST_DIR=

:LOOK_AGAIN
if "%DIR_CONTAINING%" == "%LAST_DIR%" (
    rem didn't find it
    set DIR_CONTAINING=
    goto :EOF
)

if EXIST "%DIR_CONTAINING%\%1" (
    rem found it - use result in DIR_CONTAINING
    goto :EOF
)

set LAST_DIR=%DIR_CONTAINING%
call :GET_PARENT_PATH "%DIR_CONTAINING%\.."
set DIR_CONTAINING=%PARENT_PATH%
goto :LOOK_AGAIN

:GET_PARENT_PATH
set PARENT_PATH=%~f1
goto :EOF

:EOF

Replace homedrive + homepath with userprofile.


Write launch script

Write launch script

For now, i assume that the atom-shell exe is two levels above the code.
Eventually i'll use the recommended grunt-download-atom-shell script.


@echo off
rem --- batchfile for test ---
set PROMPT=$e[32;40;1m[$P]$_$$ $e[37;1m
go run nyagos.go

add batchfile for test-run

add batchfile for test-run


Rem Simple Batch File to copy ring DLL files and libraries to the bin folder
Rem 2016-2020, Mahmoud Fayed <msfclipper@yahoo.com>

cd ..

copy lib\*.dll bin
copy extensions\libdepwin\allegro5.2.4\bin\*.dll bin
copy extensions\libdepwin\freeglut\bin\*.dll bin
copy extensions\libdepwin\glew\bin\Release\Win32\*.dll bin
copy extensions\libdepwin\libcurl\bin\*.dll bin
copy extensions\libdepwin\libsdl\SDL2_vc\lib\x86\*.dll bin
copy extensions\libdepwin\libsdl\SDL2_image\lib\x86\*.dll bin
copy extensions\libdepwin\libsdl\SDL2_mixer\lib\x86\*.dll bin
copy extensions\libdepwin\libsdl\SDL2_net\lib\x86\*.dll bin
copy extensions\libdepwin\libsdl\SDL2_ttf\lib\x86\*.dll bin
copy extensions\libdepwin\libuv\*.dll bin
copy extensions\libdepwin\mysql\lib\*.dll bin
copy extensions\libdepwin\openssl\bin\*.dll bin
copy extensions\libdepwin\pgsql\lib\*.dll bin
copy extensions\libdepwin\raylib2.5\bin\*.dll bin
cd bin
rem Delete Allegro Dlls (Debug Version)
del allegro*debug-5.2.dll
call installqt515.bat

Update bin/install.bat

Update bin/install.bat


@echo off
rem Build Picol on Windows with MinGW.
set PATH=%PATH%;C:\mingw\bin
make
make examples
pause

@echo off
rem Build Picol on Windows with MinGW.
set PATH=C:\MinGW\bin;C:\MinGW\msys\1.0\bin
set CC=gcc
make
make examples
pause

build-mingw.cmd: Include the path to MSYS binaries in %PATH%. Set %CC%.


npm install --user "%USERNAME%"  ^
            --python=python2.7   ^
            --loglevel warn      ^
            .
npm start
npm prune --production
del /s /q %PREFIX%\share\man\man1\gulp.1
robocopy build %PREFIX%/static /s /e
:: OS X installs node-gyp globally for some reason which means it ends up in ${PREFIX}
if exist %PREFIX%\lib\node_modules del /s /q %PREFIX%\lib\node_modules
:: Seems some other cruft is left lying around ..
if exist %PREFIX%\build\tmp del /s /q %PREFIX%\build\tmp

Create bld.bat

Create bld.bat


REM bat script for running netcat receiver - for netconsole
@echo off
title Netconsole Receiver
set logfile="netcon_14jun17.txt"
ECHO "Running: nc64.exe -luv -p 6666 >> %logfile%"
nc64.exe -luv -p 6666 >> %logfile%

add netcon_rcv_win.bat

add netcon_rcv_win.bat


del /Q out\*.msi
@"%WIX%\bin\candle.exe" Product.wxs -dSourceFiles="..\MarkdownEdit\bin\Release" -out out\
@if NOT ERRORLEVEL 1 "%WIX%\bin\light.exe" -ext WiXNetFxExtension -ext WixUIExtension out\Product.wixobj -out out\MarkdownEditSetup.msi -sice:ICE61
@if NOT ERRORLEVEL 1 mv out\*.msi ..\..
exit /b errorlevel

del /Q "out\*.msi"
@"%WIX%\bin\candle.exe" Product.wxs -dSourceFiles="..\MarkdownEdit\bin\Release" -out out\
@if NOT ERRORLEVEL 1 "%WIX%\bin\light.exe" -ext WiXNetFxExtension -ext WixUIExtension out\Product.wixobj -out out\MarkdownEditSetup.msi -sice:ICE61
@if NOT ERRORLEVEL 1 mv "out\*.msi" "..\.."
exit /b errorlevel

fix build command to work on appveyor'

fix build command to work on appveyor'


echo ON

set DEFAULT_ANACONDA_BUILD_RECIPES=libboost python-scons python-gitpython
set DEFAULT_ANACONDA_CHANNELS=statiskit conda-forge
set DEFAULT_ANACONDA_CHANNEL=statiskit

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

if "%ANACONDA_CHANNEL%" == "" (
    set ANACONDA_CHANNEL=%DEFAULT_ANACONDA_CHANNEL%
) else (
    echo "Channel used: "%ANACONDA_CHANNEL%
)

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%
)

if "%ANACONDA_USERNAME%" == "" (
    set /p ANACONDA_USERNAME="Username: "
) else (
    echo Username: %ANACONDA_USERNAME%;
)

if "%ANACONDA_PASSWORD%" == "" (
    set /p ANACONDA_USERNAME=%ANACONDA_USERNAME%%"'s password: "
) else (
    echo %ANACONDA_USERNAME%'s password: [secure];
)

echo ON

conda install -n root anaconda-client
if %errorlevel% neq 0 (
    exit /b %errorlevel%
)

echo OFF

echo y|anaconda login --username %ANACONDA_USERNAME% --password %ANACONDA_PASSWORD%
if %errorlevel% neq 0 (
    exit /b %errorlevel%
)

echo ON

if "%TOOLCHAIN%" == "" (
    git clone https://gist.github.com/c491cb08d570beeba2c417826a50a9c3.git toolchain
    if %errorlevel% neq 0 (
        anaconda logout
        exit /b %errorlevel%
    )
    cd toolchain
    call config.bat
    if %errorlevel% neq 0 (
        cd ..
        anaconda logout
        rmdir toolchain /s /q
        exit /b %errorlevel%
    )
    cd ..
    rmdir toolchain /s /q
)

for %%i in (%ANACONDA_BUILD_RECIPES%) do (
    for /f %%j in ('conda build %%i %ANACONDA_CHANNEL_FLAGS% %ANACONDA_BUILD_FLAGS% --output') do set ANACONDA_UPLOAD_RECIPE=%%j
    anaconda upload %ANACONDA_UPLOAD_RECIPE% --user %ANACONDA_CHANNEL% %ANACONDA_UPLOAD_FLAGS%
)

anaconda logout

ECHO OFF

echo ON

set DEFAULT_ANACONDA_BUILD_RECIPES=libboost python-scons python-gitpython
set DEFAULT_ANACONDA_CHANNELS=statiskit conda-forge
set DEFAULT_ANACONDA_CHANNEL=statiskit

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

if "%ANACONDA_CHANNEL%" == "" (
    set ANACONDA_CHANNEL=%DEFAULT_ANACONDA_CHANNEL%
) else (
    echo "Channel used: "%ANACONDA_CHANNEL%
)

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%
)

if "%ANACONDA_USERNAME%" == "" (
    set /p ANACONDA_USERNAME="Username: "
) else (
    echo Username: %ANACONDA_USERNAME%;
)

if "%ANACONDA_PASSWORD%" == "" (
    set /p ANACONDA_USERNAME=%ANACONDA_USERNAME%%"'s password: "
) else (
    echo %ANACONDA_USERNAME%'s password: [secure];
)

echo ON

conda install -n root anaconda-client
if %errorlevel% neq 0 (
    exit /b %errorlevel%
)

echo OFF

echo y|anaconda login --username %ANACONDA_USERNAME% --password %ANACONDA_PASSWORD%
if %errorlevel% neq 0 (
    exit /b %errorlevel%
)

echo ON

if "%TOOLCHAIN%" == "" (
    git clone https://gist.github.com/c491cb08d570beeba2c417826a50a9c3.git toolchain
    if %errorlevel% neq 0 (
        anaconda logout
        exit /b %errorlevel%
    )
    cd toolchain
    call config.bat
    if %errorlevel% neq 0 (
        cd ..
        anaconda logout
        rmdir toolchain /s /q
        exit /b %errorlevel%
    )
    cd ..
    rmdir toolchain /s /q
)

for %%i in (%ANACONDA_BUILD_RECIPES%) do (
    for /f %%j in ('conda build %%i %ANACONDA_CHANNEL_FLAGS% %ANACONDA_BUILD_FLAGS% --output') do set ANACONDA_UPLOAD_RECIPE=%%j
    anaconda upload %ANACONDA_UPLOAD_RECIPE% --user %ANACONDA_CHANNEL% %ANACONDA_UPLOAD_FLAGS%
)

anaconda logout

ECHO OFF

Correct bld.bat and upload.bat

Correct bld.bat and upload.bat


echo ON

set DEFAULT_ANACONDA_BUILD_RECIPES=libboost python-scons python-gitpython
set DEFAULT_ANACONDA_CHANNELS=statiskit conda-forge
set DEFAULT_ANACONDA_CHANNEL=statiskit

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

if "%ANACONDA_CHANNEL%" == "" (
    set ANACONDA_CHANNEL=%DEFAULT_ANACONDA_CHANNEL%
) else (
    echo "Channel used: "%ANACONDA_CHANNEL%
)

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%
)

if "%ANACONDA_USERNAME%" == "" (
    set /p ANACONDA_USERNAME="Username: "
) else (
    echo Username: %ANACONDA_USERNAME%;
)

if "%ANACONDA_PASSWORD%" == "" (
    set /p ANACONDA_USERNAME=%ANACONDA_USERNAME%%"'s password: "
) else (
    echo %ANACONDA_USERNAME%'s password: [secure];
)

echo ON

conda install -n root anaconda-client
if %errorlevel% neq 0 (
    exit /b %errorlevel%
)

echo OFF

echo y|anaconda login --username %ANACONDA_USERNAME% --password %ANACONDA_PASSWORD%
if %errorlevel% neq 0 (
    exit /b %errorlevel%
)

echo ON

if "%TOOLCHAIN%" == "" (
    git clone https://gist.github.com/c491cb08d570beeba2c417826a50a9c3.git toolchain
    if %errorlevel% neq 0 (
        anaconda logout
        exit /b %errorlevel%
    )
    cd toolchain
    call config.bat
    if %errorlevel% neq 0 (
        cd ..
        anaconda logout
        rmdir toolchain /s /q
        exit /b %errorlevel%
    )
    cd ..
    rmdir toolchain /s /q
)

for %%i in (%ANACONDA_BUILD_RECIPES%) do (
    for /f %%j in ('conda build %%i %ANACONDA_CHANNEL_FLAGS% %ANACONDA_BUILD_FLAGS% --output') do set ANACONDA_UPLOAD_RECIPE=%%j
    anaconda upload %ANACONDA_UPLOAD_RECIPE% --user %ANACONDA_CHANNEL% %ANACONDA_UPLOAD_FLAGS%
)

anaconda logout

ECHO OFF

echo ON

set DEFAULT_ANACONDA_BUILD_RECIPES=libboost python-scons python-gitpython
set DEFAULT_ANACONDA_CHANNELS=statiskit conda-forge
set DEFAULT_ANACONDA_CHANNEL=statiskit

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

if "%ANACONDA_CHANNEL%" == "" (
    set ANACONDA_CHANNEL=%DEFAULT_ANACONDA_CHANNEL%
) else (
    echo "Channel used: "%ANACONDA_CHANNEL%
)

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%
)

if "%ANACONDA_USERNAME%" == "" (
    set /p ANACONDA_USERNAME="Username: "
) else (
    echo Username: %ANACONDA_USERNAME%;
)

if "%ANACONDA_PASSWORD%" == "" (
    set /p ANACONDA_USERNAME=%ANACONDA_USERNAME%%"'s password: "
) else (
    echo %ANACONDA_USERNAME%'s password: [secure];
)

echo ON

conda install -n root anaconda-client
if %errorlevel% neq 0 (
    exit /b %errorlevel%
)

echo OFF

echo y|anaconda login --username %ANACONDA_USERNAME% --password %ANACONDA_PASSWORD%
if %errorlevel% neq 0 (
    exit /b %errorlevel%
)

echo ON

if "%TOOLCHAIN%" == "" (
    git clone https://gist.github.com/c491cb08d570beeba2c417826a50a9c3.git toolchain
    if %errorlevel% neq 0 (
        anaconda logout
        exit /b %errorlevel%
    )
    cd toolchain
    call config.bat
    if %errorlevel% neq 0 (
        cd ..
        anaconda logout
        rmdir toolchain /s /q
        exit /b %errorlevel%
    )
    cd ..
    rmdir toolchain /s /q
)

set ANACONDA_BUILD_FLAGS=%ANACONDA_CHANNEL_FLAGS% %ANACONDA_BUILD_FLAGS%
for %%i in (%ANACONDA_BUILD_RECIPES%) do (
    for /f %%j in ('conda build %%i %ANACONDA_BUILD_FLAGS% --output') do set ANACONDA_UPLOAD_RECIPE=%%j
    anaconda upload %ANACONDA_UPLOAD_RECIPE% --user %ANACONDA_CHANNEL% %ANACONDA_UPLOAD_FLAGS%
)

anaconda logout

ECHO OFF

Test anaconda upload

Test anaconda upload


@rem Open "Visual Studio .NET Command Prompt" to run this script

@setlocal
@set LUA=../../luajit-2.0
@set LSCOMPILE=cl /nologo /c /LD /MD /O2 /W3 /D_CRT_SECURE_NO_DEPRECATE /I%LUA%/src
@set LSLINK=link /nologo

%LSCOMPILE% /DLUA_BUILD_AS_DLL /DWIN32_VISTA luasys.c sock/sys_sock.c isa/isapi/isapi_dll.c
@if errorlevel 1 goto :END
%LSLINK% /DLL /OUT:sys.dll /DEF:isa/isapi/isapi_dll.def *.obj %LUA%/src/lua*.lib kernel32.lib user32.lib winmm.lib shell32.lib advapi32.lib ws2_32.lib
@if errorlevel 1 goto :END

@del *.obj *.manifest *.lib *.exp

:END

@rem Open "Visual Studio .NET Command Prompt" to run this script

@setlocal
@set LUA=../../luajit-2.0
@set LSCOMPILE=cl /nologo /c /LD /MD /O2 /W3 /D_CRT_SECURE_NO_DEPRECATE /I%LUA%/src
@set LSLINK=link /nologo

%LSCOMPILE% /DLUA_BUILD_AS_DLL /DWIN32_VISTA_ luasys.c sock/sys_sock.c isa/isapi/isapi_dll.c
@if errorlevel 1 goto :END
%LSLINK% /DLL /OUT:sys.dll /DEF:isa/isapi/isapi_dll.def *.obj %LUA%/src/lua*.lib kernel32.lib user32.lib winmm.lib shell32.lib advapi32.lib ws2_32.lib
@if errorlevel 1 goto :END

@del *.obj *.manifest *.lib *.exp

:END

Win32: Disable compiling for Vista+ by default.


REM other targets are:
REM 'build'
REM 'test'
REM 'test-integration'

@ECHO OFF
cls

@echo Building from script Common.Logging.build...
@echo .
@echo .
@echo .

rem tools\nant\bin\nant.exe -f:Common.Logging.build build package-zip package-nuget -D:project.sign=true -D:package.version=3.1.0 -D:nuget.version.suffix=Alpha1 -D:project.releasetype=release > buildlog.txt
tools\nant\bin\nant.exe -f:Common.Logging.build build package-zip package-nuget -D:project.sign=true -D:package.version=3.3.1 -D:project.releasetype=release > buildlog.txt

@echo ...complete!
@echo .
@echo .
@echo .

@echo Launching text file viewer to display buildlog.txt contents...
start "ignored but required placeholder window title argument" buildlog.txt

REM other targets are:
REM 'build'
REM 'test'
REM 'test-integration'

@ECHO OFF
cls

@echo Building from script Common.Logging.build...
@echo .
@echo .
@echo .

tools\nant\bin\nant.exe -f:Common.Logging.build build package-zip package-nuget -D:project.sign=true -D:package.version=3.3.2 -D:nuget.version.suffix=Alpha1 -D:project.releasetype=release > buildlog.txt
rem tools\nant\bin\nant.exe -f:Common.Logging.build build package-zip package-nuget -D:project.sign=true -D:package.version=3.3.1 -D:project.releasetype=release > buildlog.txt

@echo ...complete!
@echo .
@echo .
@echo .

@echo Launching text file viewer to display buildlog.txt contents...
start "ignored but required placeholder window title argument" buildlog.txt

update build-release command file to reflect 3.3.2-Alpha1 release