rem Script to build SciTE for Windows with all the different
rem compilers and exercise all the projects and makefiles.
rem Current directory must be scite\scripts before running.
rem Contains references to local install directories on Neil's
rem machine so must be modified for other installations.
rem Assumes environment set up so gcc and MSVC can be called.
rem
cd ..\..
set MSDEV_BASE=C:\Program Files (x86)\Microsoft Visual Studio\Common\MSDev98\Bin
set MSDEV71_BASE=C:\Program Files\Microsoft Visual Studio .NET 2003\Common7\Tools
set WINSDK_BASE=C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin
rem
rem ************************************************************
rem Target 1: basic unit tests with gcc
call scite\scripts\clearboth
cd scintilla\test\unit
make -j
if ERRORLEVEL 2 goto ERROR
.\unitTest
if ERRORLEVEL 2 goto ERROR
cd ..\..\..
rem
rem ************************************************************
rem Target 2: Normal gcc build
call scite\scripts\clearboth
cd scintilla\win32
make -j
if ERRORLEVEL 2 goto ERROR
cd ..\test
pythonw simpleTests.py
pythonw lexTests.py
pythonw performanceTests.py
cd ..\..\scite\win32
make -j
if ERRORLEVEL 2 goto ERROR
cd ..\..
rem
rem ************************************************************
rem Target 3: Microsoft VC++ build
call scite\scripts\clearboth
cd scintilla\win32
cl
nmake -f scintilla.mak QUIET=1
if ERRORLEVEL 2 goto ERROR
cd ..\..\scite\win32
nmake -f scite.mak QUIET=1
if ERRORLEVEL 2 goto ERROR
cd ..\..
rem
rem ************************************************************
rem Target 4: Visual C++ Express using scite\boundscheck\SciTE.sln
REM ~ call scite\scripts\clearboth
REM ~ cd scite\boundscheck
vcexpress scite.sln /rebuild release
REM ~ if ERRORLEVEL 2 goto ERROR
REM ~ cd ..\..
rem
rem ************************************************************
rem Target 5: GTK+ version using gcc on scintilla\gtk\makefile
call scite\scripts\clearboth
cd scintilla\gtk
make -j CXXFLAGS=-Wno-long-long
if ERRORLEVEL 2 goto ERROR
cd ..\..
rem Visual C++ builds
REM ~ call "%MSDEV_BASE%\..\..\..\VC98\bin\vcvars32.bat"
REM ~ echo on
rem
rem ************************************************************
rem Target 6: Visual C++ 98 using scintilla\win32\scintilla_vc6.mak
REM ~ call scite\scripts\clearboth
REM ~ cd scintilla\win32
REM ~ nmake -f scintilla_vc6.mak QUIET=1
REM ~ if ERRORLEVEL 2 goto ERROR
REM ~ cd ..\..
rem
rem ************************************************************
rem Removed: Target 7
rem
rem ************************************************************
rem Removed: Target 8
rem
rem ************************************************************
rem Target 9: Visual C++ using scite\boundscheck\SciTE.dsp
REM ~ call scite\scripts\clearboth
REM ~ cd scite\boundscheck
REM ~ msdev SciTE.dsp /MAKE "SciTE - Win32 Release" /REBUILD
REM ~ if ERRORLEVEL 2 goto ERROR
REM ~ cd ..\..
rem
rem ************************************************************
rem Target 10: SDK 64 bit compiler
call scite\scripts\clearboth
call "%WINSDK_BASE%\SetEnv.Cmd" /Release /x64 /vista
cd scintilla\win32
nmake -f scintilla.mak
if ERRORLEVEL 2 goto ERROR
cd ..\..\scite\win32
nmake -f scite.mak
if ERRORLEVEL 2 goto ERROR
cd ..\..
rem
rem ************************************************************
rem Target 11: Clang analyze
REM ~ call scite\scripts\clearboth
REM ~ set PATH=c:\mingw32-dw2\bin;%PATH%
REM ~ cd scintilla\win32
REM ~ mingw32-make analyze
REM ~ if ERRORLEVEL 2 goto ERROR
REM ~ cd ..\..\scite\win32
REM ~ mingw32-make analyze
REM ~ if ERRORLEVEL 2 goto ERROR
REM ~ cd ..\..
rem
rem ************************************************************
rem Target 12: cppcheck
REM ~ call scite\scripts\clearboth
REM ~ cppcheck -j 8 --enable=all --suppressions scintilla/cppcheck.suppress --max-configs=100 -I scintilla/src -I scintilla/include -I scintilla/lexlib -I scintilla/qt/ScintillaEditBase --template=gcc --quiet scintilla
REM ~ cppcheck -j 8 --enable=all --max-configs=100 -I scite/src -I scintilla/include -I scite/lua/include --template=gcc --quiet scite
rem
rem Finished
call scite\scripts\clearboth
goto CLEANUP
:ERROR
@echo checkbuilds.bat:1: Failed %ERRORLEVEL%
:CLEANUP
set SAVE_PATH=
set SAVE_INCLUDE=
set MSDEV_BASE=

rem Script to build SciTE for Windows with all the different
rem compilers and exercise all the projects and makefiles.
rem Current directory must be scite\scripts before running.
rem Contains references to local install directories on Neil's
rem machine so must be modified for other installations.
rem Assumes environment set up so gcc and MSVC can be called.
rem
cd ..\..
set MSDEV_BASE=C:\Program Files (x86)\Microsoft Visual Studio\Common\MSDev98\Bin
set MSDEV71_BASE=C:\Program Files\Microsoft Visual Studio .NET 2003\Common7\Tools
set WINSDK_BASE=C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin
rem
rem ************************************************************
rem Target 1: basic unit tests with gcc
call scite\scripts\clearboth
cd scintilla\test\unit
make -j
if ERRORLEVEL 2 goto ERROR
.\unitTest
if ERRORLEVEL 2 goto ERROR
cd ..\..\..
rem
rem ************************************************************
rem Target 2: Normal gcc build
call scite\scripts\clearboth
cd scintilla\win32
make -j
if ERRORLEVEL 2 goto ERROR
cd ..\test
pythonw simpleTests.py
pythonw lexTests.py
pythonw performanceTests.py
cd ..\..\scite\win32
make -j
if ERRORLEVEL 2 goto ERROR
cd ..\..
rem
rem ************************************************************
rem Target 3: Microsoft VC++ build
call scite\scripts\clearboth
cd scintilla\win32
cl
nmake -f scintilla.mak QUIET=1
if ERRORLEVEL 2 goto ERROR
cd ..\..\scite\win32
nmake -f scite.mak QUIET=1
if ERRORLEVEL 2 goto ERROR
cd ..\..
rem
rem ************************************************************
rem Target 4: Visual C++ Express using scite\boundscheck\SciTE.sln
REM ~ call scite\scripts\clearboth
REM ~ cd scite\boundscheck
vcexpress scite.sln /rebuild release
REM ~ if ERRORLEVEL 2 goto ERROR
REM ~ cd ..\..
rem
rem ************************************************************
rem Target 5: GTK+ version using gcc on scintilla\gtk\makefile
call scite\scripts\clearboth
cd scintilla\gtk
make -j CXXFLAGS=-Wno-long-long
if ERRORLEVEL 2 goto ERROR
cd ..\..
rem Visual C++ builds
rem
rem ************************************************************
rem Removed:  Target 6
rem
rem ************************************************************
rem Removed: Target 7
rem
rem ************************************************************
rem Removed: Target 8
rem
rem ************************************************************
rem Target 9: Visual C++ using scite\boundscheck\SciTE.dsp
REM ~ call scite\scripts\clearboth
REM ~ cd scite\boundscheck
REM ~ msdev SciTE.dsp /MAKE "SciTE - Win32 Release" /REBUILD
REM ~ if ERRORLEVEL 2 goto ERROR
REM ~ cd ..\..
rem
rem ************************************************************
rem Target 10: SDK 64 bit compiler
call scite\scripts\clearboth
call "%WINSDK_BASE%\SetEnv.Cmd" /Release /x64 /vista
cd scintilla\win32
nmake -f scintilla.mak
if ERRORLEVEL 2 goto ERROR
cd ..\..\scite\win32
nmake -f scite.mak
if ERRORLEVEL 2 goto ERROR
cd ..\..
rem
rem ************************************************************
rem Target 11: Clang analyze
REM ~ call scite\scripts\clearboth
REM ~ set PATH=c:\mingw32-dw2\bin;%PATH%
REM ~ cd scintilla\win32
REM ~ mingw32-make analyze
REM ~ if ERRORLEVEL 2 goto ERROR
REM ~ cd ..\..\scite\win32
REM ~ mingw32-make analyze
REM ~ if ERRORLEVEL 2 goto ERROR
REM ~ cd ..\..
rem
rem ************************************************************
rem Target 12: cppcheck
REM ~ call scite\scripts\clearboth
REM ~ cppcheck -j 8 --enable=all --suppressions scintilla/cppcheck.suppress --max-configs=100 -I scintilla/src -I scintilla/include -I scintilla/lexlib -I scintilla/qt/ScintillaEditBase --template=gcc --quiet scintilla
REM ~ cppcheck -j 8 --enable=all --max-configs=100 -I scite/src -I scintilla/include -I scite/lua/include --template=gcc --quiet scite
rem
rem Finished
call scite\scripts\clearboth
goto CLEANUP
:ERROR
@echo checkbuilds.bat:1: Failed %ERRORLEVEL%
:CLEANUP
set SAVE_PATH=
set SAVE_INCLUDE=
set MSDEV_BASE=

Remove Visual C++ 98 check.

Remove Visual C++ 98 check.


@echo off

setlocal enableextensions enabledelayedexpansion

set SPLUNKHOME=%SPLUNK_HOME%
set SCRIPTPATH=%CD%
set SPLUNKHOME_FILE="!SCRIPTPATH!\.splunkhome"

if exist !SPLUNKHOME_FILE! (
    set /p HOMEPATH=<!SPLUNKHOME_FILE!
) else (
    set HOMEPATH=
)

if not exist "!HOMEPATH!" (
    set /P HOMEPATH="Where is Splunk installed (version 5.0 or later is required)? [!SPLUNKHOME!]: "

    if "!HOMEPATH!" == "" (
        if "!SPLUNKHOME!" == "" (
            echo "Must supply a 'SPLUNK_HOME' value"
            goto :eof
        ) else (
            set HOMEPATH=!SPLUNKHOME!
        )
    )

    if not exist "!HOMEPATH!" (
        echo "!HOMEPATH! does not exist. Please provide a valid SPLUNK_HOME value"
        goto :eof
    )

    echo !HOMEPATH! > !SPLUNKHOME_FILE!
)
(
    endlocal
    set SPLUNK_HOME=%HOMEPATH%
    set SCRIPTPATH=%SCRIPTPATH%
)

@rem Trim the SPLUNK_HOME variable of spaces
setlocal enabledelayedexpansion
for /f "tokens=* delims= " %%a in ("%SPLUNK_HOME%") do set SPLUNK_HOME=%%a
for /l %%a in (1,1,100) do if "!SPLUNK_HOME:~-1!"==" " set SPLUNK_HOME=!SPLUNK_HOME:~0,-1!
(
    endlocal
    set SPLUNK_HOME=%SPLUNK_HOME:"=%
)

@rem Add the node_modules bin directory to the PATH
set PATH="%SCRIPTPATH%\node_modules\.bin;%SPLUNK_HOME%\bin"

@rem Add our base Python packages to PYTHONPATH
set PYTHONPATH=";%SCRIPTPATH%\contrib\splunk-sdk-python;%SCRIPTPATH%\contrib\envoy;%SCRIPTPATH%\contrib\argh;%SCRIPTPATH%\contrib\django;%PYTHONPATH%"

@rem We have to make the contrib/django directory to make sure
@rem Python sees it in the PYTHONPATH
mkdir %SCRIPTPATH%\contrib\django 2> nul

@rem Run the actual CLI environment
"%SPLUNK_HOME%"\bin\splunk cmd python "%SCRIPTPATH%\cli\appdo.py" %*

@echo off

setlocal enableextensions enabledelayedexpansion

set SPLUNKHOME=%SPLUNK_HOME%
set SCRIPTPATH=%CD%
set SPLUNKHOME_FILE="!SCRIPTPATH!\.splunkhome"

if exist !SPLUNKHOME_FILE! (
    set /p HOMEPATH=<!SPLUNKHOME_FILE!
) else (
    set HOMEPATH=
)

if not exist "!HOMEPATH!" (
    set /P HOMEPATH="Where is Splunk installed (version 5.0 or later is required)? [!SPLUNKHOME!]: "

    if "!HOMEPATH!" == "" (
        if "!SPLUNKHOME!" == "" (
            echo "Must supply a 'SPLUNK_HOME' value"
            goto :eof
        ) else (
            set HOMEPATH=!SPLUNKHOME!
        )
    )

    if not exist "!HOMEPATH!" (
        echo "!HOMEPATH! does not exist. Please provide a valid SPLUNK_HOME value"
        goto :eof
    )

    echo !HOMEPATH! > !SPLUNKHOME_FILE!
)
(
    endlocal
    set SPLUNK_HOME=%HOMEPATH%
    set SCRIPTPATH=%SCRIPTPATH%
)

@rem Trim the SPLUNK_HOME variable of spaces
setlocal enabledelayedexpansion enableextensions
for /f "tokens=* delims= " %%a in ("!SPLUNK_HOME!") do set SPLUNK_HOME=%%a
for /l %%a in (1,1,100) do if "!SPLUNK_HOME:~-1!"==" " set SPLUNK_HOME=!SPLUNK_HOME:~0,-1!
(
    endlocal
    set "SPLUNK_HOME=%SPLUNK_HOME:"=%"
)

@rem Add the node_modules bin directory to the PATH
set PATH="%SCRIPTPATH%\node_modules\.bin;%SPLUNK_HOME%\bin"

@rem Add our base Python packages to PYTHONPATH
set PYTHONPATH=";%SCRIPTPATH%\contrib\splunk-sdk-python;%SCRIPTPATH%\contrib\envoy;%SCRIPTPATH%\contrib\argh;%SCRIPTPATH%\contrib\django;%PYTHONPATH%"

@rem We have to make the contrib/django directory to make sure
@rem Python sees it in the PYTHONPATH
mkdir %SCRIPTPATH%\contrib\django 2> nul

@rem Run the actual CLI environment
"%SPLUNK_HOME%"\bin\splunk cmd python "%SCRIPTPATH%\cli\appdo.py" %*

Fix for Splunk 32-bit on Windows

Fix for Splunk 32-bit on Windows


set VM_NAME=base
set LOG_FILE=build.log

if exist output-virtualbox-iso\ rmdir /s /q output-virtualbox-iso
if exist "%USERPROFILE%\VirtualBox VMs\%VM_NAME%" rmdir /s /q "%USERPROFILE%\VirtualBox VMs\%VM_NAME%"

echo --- build start at %time% --- >> %LOG_FILE%
packer build template.json >> %LOG_FILE%
echo --- build finished at %time% --- >> %LOG_FILE%

set VM_NAME=base
set LOG_FILE=build.log

if exist %LOG_FILE% del %LOG_FILE%
if exist %VM_NAME%.box del %VM_NAME%.box
if exist output-virtualbox-iso\ rmdir /s /q output-virtualbox-iso
if exist "%USERPROFILE%\VirtualBox VMs\%VM_NAME%" rmdir /s /q "%USERPROFILE%\VirtualBox VMs\%VM_NAME%"

echo --- build start at %time% --- >> %LOG_FILE%
packer build template.json >> %LOG_FILE%
echo --- build finished at %time% --- >> %LOG_FILE%

delete logfile and *.box before build

delete logfile and *.box before build


@echo off
cls

.paket\paket.bootstrapper.exe
if errorlevel 1 (
  exit /b %errorlevel%
)

.paket\paket.exe restore
if errorlevel 1 (
  exit /b %errorlevel%
)

IF NOT EXIST build.fsx (
  .paket\paket.exe update
  packages\FAKE\tools\FAKE.exe init.fsx
)
packages\FAKE\tools\FAKE.exe build.fsx %*

PAUSE

remove PAUE from build.cmd

remove PAUE from build.cmd


@echo off
if exist bootstrap.cmd (
  call bootstrap.cmd
  if %ERRORLEVEL% NEQ 0 exit /b %ERRORLEVEL%
)

set buildFile=build.fsx
"packages/AIT.Build/content/build.cmd" %*

@echo off
rem Printf environment info
set

if exist bootstrap.cmd (
  call bootstrap.cmd
  if %ERRORLEVEL% NEQ 0 exit /b %ERRORLEVEL%
)

set buildFile=build.fsx
"packages/AIT.Build/content/build.cmd" %*

print environment.

print environment.


set GOPATH=%BuildFolder%
go get -v
set GOARCH=386
go build -a -v -o sc_386.exe
set GOARCH=amd46
go build -a -v -o sc_amd64.exe

set GOPATH=%BuildFolder%
go get -v
go build -a -v -o sc.exe

Fix appveyor, 64bit only.

Fix appveyor, 64bit only.


@call ts
@set _t=%CD%
@call jake local
@popd
@node --inspect-brk %_t%\built\local\tsc.js %*

Add btsci

Add btsci


@echo off

setlocal EnableDelayedExpansion

for /f "usebackq tokens=1,2 delims=,=- " %%i in (`wmic os get LocalDateTime /value`) do @if %%i==LocalDateTime (
     set CURR_DATE_TIME=%%j
)

set curr_year=%CURR_DATE_TIME:~0,4%
set curr_month=%CURR_DATE_TIME:~4,2%

:: Make sure this is a decent name and not generic
set exe_name=odin.exe

:: Debug = 0, Release = 1
if "%1" == "1" (
	set release_mode=1
) else if "%1" == "release" (
	set release_mode=1
) else (
	set release_mode=0
)

:: Normal = 0, CI Nightly = 1
if "%2" == "1" (
    set nightly=1
) else (
    set nightly=0
)

set odin_version_raw="dev-%curr_year%-%curr_month%"

set compiler_flags= -nologo -Oi -TP -fp:precise -Gm- -MP -FC -EHsc- -GR- -GF
set compiler_defines= -DODIN_VERSION_RAW=\"%odin_version_raw%\"

for /f %%i in ('git rev-parse --short HEAD') do set GIT_SHA=%%i
if %ERRORLEVEL% equ 0 set compiler_defines=%compiler_defines% -DGIT_SHA=\"%GIT_SHA%\"
if %nightly% equ 1 set compiler_defines=%compiler_defines% -DNIGHTLY

if %release_mode% EQU 0 ( rem Debug
	set compiler_flags=%compiler_flags% -Od -MDd -Z7
) else ( rem Release
	set compiler_flags=%compiler_flags% -O2 -MT -Z7
	set compiler_defines=%compiler_defines% -DNO_ARRAY_BOUNDS_CHECK
)

set compiler_warnings= ^
	-W4 -WX ^
	-wd4100 -wd4101 -wd4127 -wd4146 ^
	-wd4456 -wd4457

set compiler_includes=
set libs= ^
	kernel32.lib ^
	bin\llvm\windows\LLVM-C.lib

set linker_flags= -incremental:no -opt:ref -subsystem:console

if %release_mode% EQU 0 ( rem Debug
	set linker_flags=%linker_flags% -debug
) else ( rem Release
	set linker_flags=%linker_flags% -debug
)

set compiler_settings=%compiler_includes% %compiler_flags% %compiler_warnings% %compiler_defines%
set linker_settings=%libs% %linker_flags%

del *.pdb > NUL 2> NUL
del *.ilk > NUL 2> NUL

cl %compiler_settings% "src\main.cpp" "src\libtommath.cpp" /link %linker_settings% -OUT:%exe_name%

if %errorlevel% neq 0 goto end_of_build
if %release_mode% EQU 0 odin check examples/all

del *.obj > NUL 2> NUL

:end_of_build

@echo off

setlocal EnableDelayedExpansion

for /f "usebackq tokens=1,2 delims=,=- " %%i in (`wmic os get LocalDateTime /value`) do @if %%i==LocalDateTime (
     set CURR_DATE_TIME=%%j
)

set curr_year=%CURR_DATE_TIME:~0,4%
set curr_month=%CURR_DATE_TIME:~4,2%

:: Make sure this is a decent name and not generic
set exe_name=odin.exe

:: Debug = 0, Release = 1
if "%1" == "1" (
	set release_mode=1
) else if "%1" == "release" (
	set release_mode=1
) else (
	set release_mode=0
)

:: Normal = 0, CI Nightly = 1
if "%2" == "1" (
    set nightly=1
) else (
    set nightly=0
)

set odin_version_raw="dev-%curr_year%-%curr_month%"

set compiler_flags= -nologo -Oi -TP -fp:precise -Gm- -MP -FC -EHsc- -GR- -GF
set compiler_defines= -DODIN_VERSION_RAW=\"%odin_version_raw%\"

for /f %%i in ('git rev-parse --short HEAD') do set GIT_SHA=%%i
if %ERRORLEVEL% equ 0 set compiler_defines=%compiler_defines% -DGIT_SHA=\"%GIT_SHA%\"
if %nightly% equ 1 set compiler_defines=%compiler_defines% -DNIGHTLY

if %release_mode% EQU 0 ( rem Debug
	set compiler_flags=%compiler_flags% -Od -MDd -Z7
) else ( rem Release
	set compiler_flags=%compiler_flags% -O2 -MT -Z7
	set compiler_defines=%compiler_defines% -DNO_ARRAY_BOUNDS_CHECK
)

set compiler_warnings= ^
	-W4 -WX ^
	-wd4100 -wd4101 -wd4127 -wd4146 ^
	-wd4456 -wd4457

set compiler_includes=
set libs= ^
	kernel32.lib ^
	bin\llvm\windows\LLVM-C.lib

set linker_flags= -incremental:no -opt:ref -subsystem:console

if %release_mode% EQU 0 ( rem Debug
	set linker_flags=%linker_flags% -debug
) else ( rem Release
	set linker_flags=%linker_flags% -debug
)

set compiler_settings=%compiler_includes% %compiler_flags% %compiler_warnings% %compiler_defines%
set linker_settings=%libs% %linker_flags%

del *.pdb > NUL 2> NUL
del *.ilk > NUL 2> NUL

cl %compiler_settings% "src\main.cpp" "src\libtommath.cpp" /link %linker_settings% -OUT:%exe_name%

if %errorlevel% neq 0 goto end_of_build
if %release_mode% EQU 0 odin run examples/demo

del *.obj > NUL 2> NUL

:end_of_build

Correct build.bat

Correct build.bat


@ECHO OFF
@setlocal

::
:: Edit this line to run the batch file for Qt environment.
::
::call "C:\Qt\Qt5.4.2-MinGW\5.4\mingw491_32\bin\qtenv2.bat"
::call "C:\Qt\Qt5.5.1-MinGW\5.5\mingw492_32\bin\qtenv2.bat"
::call "C:\Qt\Qt5.4.0-msvc2013_64\5.4\msvc2013_64_opengl\bin\qtenv2.bat"
::call "C:\Qt\Qt5.5.1\5.5\msvc2013_64\bin\qtenv2.bat"

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

cd /D %~dp0
call compile_install.bat

pause
exit /b

@ECHO OFF
@setlocal

::
:: Edit this line to run the batch file for Qt environment.
::
::call "C:\Qt\Qt5.4.2-MinGW\5.4\mingw491_32\bin\qtenv2.bat"
::call "C:\Qt\Qt5.5.1-MinGW\5.5\mingw492_32\bin\qtenv2.bat"
::call "C:\Qt\Qt5.4.0-msvc2013_64\5.4\msvc2013_64_opengl\bin\qtenv2.bat"
call "C:\Qt\Qt5.5.1\5.5\msvc2013_64\bin\qtenv2.bat"

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

cd /D %~dp0
call compile_install.bat

pause
exit /b

update build.bat

update build.bat


:: the windows shell, so amazing

:: options
@echo Off
cd %~dp0
setlocal

:: determine cache dir
set NUGET_CACHE_DIR=%LocalAppData%\.nuget\v3.4.4

:: download nuget to cache dir
set NUGET_URL=https://dist.nuget.org/win-x86-commandline/v3.4.4/NuGet.exe
if not exist %NUGET_CACHE_DIR%\NuGet.exe (
  if not exist %NUGET_CACHE_DIR% md %NUGET_CACHE_DIR%
  echo Downloading '%NUGET_URL%'' to '%NUGET_CACHE_DIR%\NuGet.exe'...
  @powershell -NoProfile -ExecutionPolicy unrestricted -Command "$ProgressPreference = 'SilentlyContinue'; Invoke-WebRequest '%NUGET_URL%' -OutFile '%NUGET_CACHE_DIR%\NuGet.exe'"
)

:: copy nuget locally
if not exist .nuget\NuGet.exe (
  if not exist .nuget md .nuget
  copy %NUGET_CACHE_DIR%\NuGet.exe .nuget\NuGet.exe > nul
)

:: restore packages
.nuget\NuGet.exe restore .\Xbehave.sln -MSBuildVersion 14

:: run script
"%ProgramFiles(x86)%\MSBuild\14.0\Bin\csi.exe" .\build.csx %*

:: the windows shell, so amazing

:: options
@echo Off
cd %~dp0
setlocal

:: determine cache dir
set NUGET_CACHE_DIR=%LocalAppData%\.nuget\v3.5.0-rc1

:: download nuget to cache dir
set NUGET_URL=https://dist.nuget.org/win-x86-commandline/v3.5.0-rc1/NuGet.exe
if not exist %NUGET_CACHE_DIR%\NuGet.exe (
  if not exist %NUGET_CACHE_DIR% md %NUGET_CACHE_DIR%
  echo Downloading '%NUGET_URL%'' to '%NUGET_CACHE_DIR%\NuGet.exe'...
  @powershell -NoProfile -ExecutionPolicy unrestricted -Command "$ProgressPreference = 'SilentlyContinue'; Invoke-WebRequest '%NUGET_URL%' -OutFile '%NUGET_CACHE_DIR%\NuGet.exe'"
)

:: copy nuget locally
if not exist .nuget\NuGet.exe (
  if not exist .nuget md .nuget
  copy %NUGET_CACHE_DIR%\NuGet.exe .nuget\NuGet.exe > nul
)

:: restore packages
.nuget\NuGet.exe restore .\Xbehave.sln -MSBuildVersion 14

:: run script
"%ProgramFiles(x86)%\MSBuild\14.0\Bin\csi.exe" .\build.csx %*

Upgrade nuget.exe to v3.5.0-rc1

Upgrade nuget.exe to v3.5.0-rc1


@ECHO OFF
PowerShell -NoProfile -NoLogo -ExecutionPolicy unrestricted -Command "[System.Threading.Thread]::CurrentThread.CurrentCulture = ''; [System.Threading.Thread]::CurrentThread.CurrentUICulture = '';& '%~dp0build.ps1' %*"

@ECHO OFF
PowerShell -NoProfile -NoLogo -ExecutionPolicy unrestricted -Command "[System.Threading.Thread]::CurrentThread.CurrentCulture = ''; [System.Threading.Thread]::CurrentThread.CurrentUICulture = '';& '%~dp0build.ps1' %*; exit $LASTEXITCODE"

Return the error code from build.cmd

Return the error code from build.cmd


Return the error code from build.cmd

Return the error code from build.cmd


REM Monero Simplewallet Launcher, (c) 2016 bigreddmachine.
REM https://github.com/Monero-Monitor/monero-wallet-chrome
REM
REM This script allows simplewallet to be run in rpc mode easily and quickly. User passwords
REM are secured by passing them as a terminal input, rather than requiring them to be stored
REM as clear text in the script.
REM
REM This script is released under the MIT License.

@echo off
cls
set FILE=ChromeWallet.bin

echo.
echo ====================================================================================
echo                             Monero Simplewallet Launcher
echo.
echo Copyright (c) 2016 bigreddmachine.
echo Released under the MIT License as part of Monero Wallet for Chrome.
echo https://github.com/monero-monitor/monero-wallet-chrome
echo ====================================================================================
echo.

if exist %FILE% (
    REM If this script has been run previously, a wallet should already exist. Start it in RPC mode.

    echo Launching simplewallet in RPC mode, listening on localhost (127.0.0.1), port 18082.
    echo.
    set /p PASS=Please enter your password:

    start "simplewallet --wallet-file %FILE% --password %PASS% --rpc-bind-ip 127.0.0.1 --rpc-bind-port 18082"

    echo Launching simplewallet...
    echo.
    sleep 3
    echo ----------------------

    echo.
    echo Returning wallet address:

    if (curl --fail -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"getaddress"}' -H 'Content-Type: application/json'; then

        echo.
        echo.
        echo Simplewallet is now running in RPC mode. To shutdown simplewallet, choose 'Stop Wallet' in the extension's menu.
        echo.
        echo Thank you for using Monero Wallet for Chrome! You may now close this window.
        echo.

    ) else (

        echo.
        echo Please check if your extension shows that simplewallet online. If not,
        echo please check your password and try again.
        echo.

    )
) else (
    REM The first time this script is run, open the command line wallet.

    echo You have not created a wallet yet. This script will help you do that.
    echo.
    echo To create a wallet, follow the prompts. Enter a password, then pick a
    echo language for your wallet.
    echo.
    echo Once you have created a wallet, simplewallet will open and a prompt
    echo line will appear. Type 'refresh', then once it is done type 'exit'.
    echo You are then ready to use Monero Wallet for Chrome.
    echo.

    set /p userinput=When you are ready to begin, press enter...

    echo.
    echo ----------
    set /p NEWPASS=Please pick a password for your new wallet:
    echo ----------
    echo.

    simplewallet --generate-new-wallet %FILE% --password $NEWPASS

    echo.
    echo ----------
    echo.

    if exist %FILE% (
        echo   Everything looks good. You can now start your wallet in RPC mode at any time by re-running this script.
        echo.
        echo   Closing Monero Simplewallet Launcher...
        echo.
        echo.
    )
)

REM Monero Simplewallet Launcher, (c) 2016 bigreddmachine.
REM https://github.com/Monero-Monitor/monero-wallet-chrome
REM
REM This script allows simplewallet to be run in rpc mode easily and quickly. User passwords
REM are secured by passing them as a terminal input, rather than requiring them to be stored
REM as clear text in the script.
REM
REM This script is released under the MIT License.

@echo off
cls
set FILE=ChromeWallet.bin

echo.
echo ====================================================================================
echo                             Monero Simplewallet Launcher
echo.
echo Copyright (c) 2016 bigreddmachine.
echo Released under the MIT License as part of Monero Wallet for Chrome.
echo https://github.com/monero-monitor/monero-wallet-chrome
echo ====================================================================================
echo.

if exist %FILE% (
    REM If this script has been run previously, a wallet should already exist. Start it in RPC mode.

    echo Launching simplewallet in RPC mode, listening on localhost (127.0.0.1), port 18082.
    echo.
    set /p PASS=Please enter your password:

    start "simplewallet --wallet-file %FILE% --password %PASS% --rpc-bind-ip 127.0.0.1 --rpc-bind-port 18082"

    echo Launching simplewallet...
    echo.
    sleep 3
    echo ----------------------

    echo.
    echo Returning wallet address:

    if (curl --fail -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"getaddress"}' -H 'Content-Type: application/json'; then

        echo.
        echo.
        echo Simplewallet is now running in RPC mode. To shutdown simplewallet, choose 'Stop Wallet' in the extension's menu.
        echo.
        echo Thank you for using Monero Wallet for Chrome! You may now close this window.
        echo.

    ) else (

        echo.
        echo Please check if your extension shows that simplewallet online. If not,
        echo please check your password and try again.
        echo.

    )
) else (
    REM The first time this script is run, open the command line wallet.

    echo You have not created a wallet yet. This script will help you do that.
    echo.
    echo To create a wallet, follow the prompts. Enter a password, then pick a
    echo language for your wallet.
    echo.
    echo Once you have created a wallet, simplewallet will open and a prompt
    echo line will appear. Type 'refresh', then once it is done type 'exit'.
    echo You are then ready to use Monero Wallet for Chrome.
    echo.

    set /p userinput=When you are ready to begin, press enter...

    echo.
    echo ----------
    set /p NEWPASS=Please pick a password for your new wallet:
    echo ----------
    echo.

    simplewallet --generate-new-wallet %FILE% --password %NEWPASS%

    echo.
    echo ----------
    echo.

    if exist %FILE% (
        echo   Everything looks good. You can now start your wallet in RPC mode at any time by re-running this script.
        echo.
        echo   Closing Monero Simplewallet Launcher...
        echo.
        echo.
    )
)

fix new password handling, windows batch file


cd C:\RServerGit
rmdir RServer /s /q
git clone https://github.com/bgweber/RServer

Create Update.bat

Create Update.bat


set SCRIPT=%0

rem determine Elasticsearch home; to do this, we strip from the path until we
rem find bin, and then strip bin (there is an assumption here that there is no
rem nested directory under bin also named bin)
for %%I in (%SCRIPT%) do set ES_HOME=%%~dpI

:es_home_loop
for %%I in ("%ES_HOME:~1,-1%") do set DIRNAME=%%~nxI
if not "%DIRNAME%" == "bin" (
  for %%I in ("%ES_HOME%..") do set ES_HOME=%%~dpfI
  goto es_home_loop
)
for %%I in ("%ES_HOME%..") do set ES_HOME=%%~dpfI

rem now set the classpath
set ES_CLASSPATH=!ES_HOME!\lib\*

rem now set the path to java
if defined JAVA_HOME (
  set JAVA="%JAVA_HOME%\bin\java.exe"
) else (
  for %%I in (java.exe) do set JAVA="%%~$PATH:I"
)

if not exist %JAVA% (
  echo could not find java; set JAVA_HOME or ensure java is in PATH 1>&2
  exit /b 1
)

rem do not let JAVA_TOOL_OPTIONS slip in (as the JVM does by default)
if not "%JAVA_TOOL_OPTIONS%" == "" (
  echo "warning: ignoring JAVA_TOOL_OPTIONS=%JAVA_TOOL_OPTIONS%"
  set JAVA_TOOL_OPTIONS=
)

rem JAVA_OPTS is not a built-in JVM mechanism but some people think it is so we
rem warn them that we are not observing the value of %JAVA_OPTS%
if not "%JAVA_OPTS%" == "" (
  echo|set /p="warning: ignoring JAVA_OPTS=%JAVA_OPTS%; "
  echo pass JVM parameters via ES_JAVA_OPTS
)

rem check the Java version
%JAVA% -cp "%ES_CLASSPATH%" "org.elasticsearch.tools.JavaVersionChecker" || exit /b 1

if "%ES_PATH_CONF%" == "" (
  set ES_PATH_CONF=!ES_HOME!\config
)

set SCRIPT=%0

rem determine Elasticsearch home; to do this, we strip from the path until we
rem find bin, and then strip bin (there is an assumption here that there is no
rem nested directory under bin also named bin)
for %%I in (%SCRIPT%) do set ES_HOME=%%~dpI

:es_home_loop
for %%I in ("%ES_HOME:~1,-1%") do set DIRNAME=%%~nxI
if not "%DIRNAME%" == "bin" (
  for %%I in ("%ES_HOME%..") do set ES_HOME=%%~dpfI
  goto es_home_loop
)
for %%I in ("%ES_HOME%..") do set ES_HOME=%%~dpfI

rem now set the classpath
set ES_CLASSPATH=!ES_HOME!\lib\*

rem now set the path to java
if defined JAVA_HOME (
  set JAVA="%JAVA_HOME%\bin\java.exe"
) else (
  for %%I in (java.exe) do set JAVA="%%~$PATH:I"
)

if not exist %JAVA% (
  echo could not find java; set JAVA_HOME or ensure java is in PATH 1>&2
  exit /b 1
)

rem do not let JAVA_TOOL_OPTIONS slip in (as the JVM does by default)
if not "%JAVA_TOOL_OPTIONS%" == "" (
  echo warning: ignoring JAVA_TOOL_OPTIONS=%JAVA_TOOL_OPTIONS%
  set JAVA_TOOL_OPTIONS=
)

rem JAVA_OPTS is not a built-in JVM mechanism but some people think it is so we
rem warn them that we are not observing the value of %JAVA_OPTS%
if not "%JAVA_OPTS%" == "" (
  (echo|set /p=warning: ignoring JAVA_OPTS=%JAVA_OPTS%; )
  echo pass JVM parameters via ES_JAVA_OPTS
)

rem check the Java version
%JAVA% -cp "%ES_CLASSPATH%" "org.elasticsearch.tools.JavaVersionChecker" || exit /b 1

if "%ES_PATH_CONF%" == "" (
  set ES_PATH_CONF=!ES_HOME!\config
)

Remove extraneous quotes from Windows env script

We quoted some strings in the Windows elasticsearch-env script but echo
on Windows includes these quotes in the output. This commit removes
these quotes, they do not need to be output and are noise. Note that one
of the commands is wrapped in parentheses, this is to make obvious that
the space at the end of the corresponding line is intentionally there.


@ECHO OFF
:: do not run this script manually

SETLOCAL
:: todo: support for authtentication

IF DEFINED YAWDS_CONF_GENERAL_CONSOLE_COLOR (
	COLOR %YAWDS_CONF_GENERAL_CONSOLE_COLOR%
)

IF [%YAWDS_CONF_UPDATE_ENABLED%]==[0] (
	ECHO Environment update is disabled
	GOTO END
)

IF NOT DEFINED YAWDS_CONF_UPDATE_CHECK_URL (
	ECHO Missing update.check_url config value in environment.ini
	ECHO Cannot checkout for new versions
	GOTO END
)

IF [%1]==[--confirm] (
	GOTO SET_NOCONFIRM
)
GOTO ASK_CONFIRMATION

:SET_NOCONFIRM
SET yawds_from_start=1
GOTO UPDATE

:ASK_CONFIRMATION
SET /P confirm_update=Do you want to check for updates? [y/n]:
IF NOT [%confirm_update%]==[y] (
	ECHO Canceled
	GOTO END
)
ECHO.

:UPDATE

IF NOT EXIST "%TEMP%" MKDIR "%TEMP%"

IF [%YAWDS_CONF_UPDATE_CHECK_URL_AUTH%]==[1] (
	:: exit if it was called from start.cmd
	IF DEFINED yawds_from_start (
		GOTO END
	)
	ECHO Authentication is required to update
	CALL node "%YAWDS_STACK_PATH%\scripts\node_scripts\prompt\update_auth" "%TEMP%\yawds_update.bat" "update"
	IF NOT ERRORLEVEL 0 (
		ECHO Error setting authtentication credentials
		GOTO END_ERROR
	)
	GOTO CHECK_AUTH_HTTP
) ELSE (
	GOTO CHECK_HTTP
)

:CHECK_AUTH_HTTP
CALL "%TEMP%\yawds_update.bat"
IF NOT DEFINED YAWDS_UPDATE_USER (
	ECHO Authentication required
	GOTO END_ERROR
)
CALL wget -q -nv "--http-user=%YAWDS_UPDATE_USER%" "--http-passwd=%YAWDS_UPDATE_PASSWORD%" -O "%TEMP%\yawds_latest.ini" "%YAWDS_CONF_UPDATE_CHECK_URL%"
GOTO CONTINUE

:CHECK_HTTP
CALL wget -q -nv -O "%TEMP%\yawds_latest.ini" "%YAWDS_CONF_UPDATE_CHECK_URL%"

:CONTINUE
IF NOT ERRORLEVEL 0 (
	ECHO Cannot check out remote version for updates
	ECHO Be sure you have network connection and try again
	GOTO END_ERROR
)

CALL node "%YAWDS_STACK_PATH%\scripts\node_scripts\ini2batch" "%TEMP%\yawds_latest.ini" "update" > "%TEMP%\yawds_update.bat"
CALL "%TEMP%\yawds_update.bat"
IF NOT ERRORLEVEL 0 GOTO CONFIG_ERROR

IF NOT DEFINED YAWDS_UPDATE_VERSION (
	ECHO Cannot check the latest version
	GOTO END_ERROR
)

IF NOT DEFINED YAWDS_UPDATE_DOWNLOAD (
	ECHO Download URL not defined. Cannot update
	GOTO END
)

IF [%YAWDS_VERSION%]==[0.1.2] (
	IF DEFINED yawds_from_start (
		GOTO END
	)
	ECHO You are on the latest version: %YAWDS_VERSION%
	ECHO Nothing to update
	GOTO END
)

IF DEFINED yawds_from_start ECHO.
ECHO There is a new version available: %YAWDS_UPDATE_VERSION%
ECHO.

IF DEFINED YAWDS_UPDATE_RELEASE_NOTES (
	ECHO.
	ECHO Release notes:
	ECHO "%YAWDS_UPDATE_RELEASE_NOTES%"
	ECHO.
)
IF DEFINED YAWDS_UPDATE_RELEASE_NOTES_URL (
	IF [%YAWDS_CONF_UPDATE_CHECK_URL_AUTH%]==[1] (
		CALL wget -q "--http-user=%YAWDS_UPDATE_USER%" "--http-passwd=%YAWDS_UPDATE_PASSWORD%" -O "%TEMP%\release_notes" %YAWDS_UPDATE_RELEASE_NOTES_URL%
	) ELSE (
		CALL wget -q -O "%TEMP%\release_notes" "%YAWDS_UPDATE_RELEASE_NOTES_URL%"
	)
	IF EXIST "%TEMP%\release_notes" (
		ECHO.
		ECHO Release notes
		ECHO ---------------------------------------------
		TYPE "%TEMP%\release_notes"
		ECHO.
		ECHO ---------------------------------------------
		ECHO.
	)
)

:: require to run from update.cmd (due to windows files blocking issues)
IF DEFINED yawds_from_start (
	ECHO.
	ECHO To proceed with the update, you must run update.cmd
	ECHO.
	PAUSE
	GOTO END
)

SET /P confirm_update=Do you want to process with the update? [y/n]:
IF NOT [%confirm_update%]==[y] (
	ECHO Canceled
	GOTO END
)

ECHO.
ECHO IMPORTANT:
ECHO You must close all the running processes before continue
ECHO You can use stack\tools\cprocess.exe to see the running processes
ECHO.

PAUSE

ECHO Downloading latest version...

IF [%YAWDS_UPDATE_DOWNLOAD_AUTH%]==[1] SET require_auth=1
IF [%YAWDS_CONF_UPDATE_CHECK_URL_AUTH%]==[1] SET require_auth=1

IF [%require_auth%]==[1] (
	CALL wget --progress=bar "--http-user=%YAWDS_UPDATE_USER%" "--http-passwd=%YAWDS_UPDATE_PASSWORD%" -O "%TEMP%\yawds-latest-win32.zip" "%YAWDS_UPDATE_DOWNLOAD%"
) ELSE (
	CALL wget --progress=bar -O "%TEMP%\yawds-latest-win32.zip" "%YAWDS_UPDATE_DOWNLOAD%"
)
IF NOT ERRORLEVEL 0 (
	ECHO Download error
	GOTO END
)
IF NOT EXIST "%TEMP%\yawds-latest-win32.zip" (
	ECHO File do not exist
	GOTO END
)

ECHO.
ECHO Download completed!
ECHO.

:: backup filename
FOR /F "tokens=* delims= " %%a IN ("%TIME:~0,2%") DO SET hour=%%a
FOR /F "tokens=* delims= " %%a IN ("%TIME:~3,2%") DO SET minute=%%a
SET backup_file=stack-%YAWDS_VERSION%-%date:~6,4%-%date:~3,2%-%date:~0,2%-%hour%%minute%.zip

:: backup the current stack environment
SET /P backup=Do you want to backup the current environment? [Y/n]:
IF [%backup%]==[y] (
	IF NOT EXIST "%YAWDS_HOME%\backup" MKDIR "%YAWDS_HOME%\backup"
	CD "%YAWDS_HOME%\stack"
	:: create tarball
	CALL 7za -mx7 -y a "%backup_file%" *
	IF NOT ERRORLEVEL 0 (
		ECHO.
		ECHO Error while creating the backup...
		GOTO END_ERROR
	)
	:: move to backup folder
	MOVE /Y "%backup_file%" "%YAWDS_HOME%\backup"

	ECHO.
	ECHO Backup created succesfully in:
	ECHO %YAWDS_HOME%\backup\
	ECHO.
	CD "%YAWDS_HOME%"
	PAUSE
)

MOVE /Y "%YAWDS_HOME%\stack" "%YAWDS_HOME%\stack_old" > nul
IF NOT EXIST "%YAWDS_HOME%\stack_old" (
	ECHO.
	ECHO ERROR: cannot write new files
	ECHO Be sure there is not any blocking process still running
	ECHO You can exec stack\tools\cprocess.exe in to see the running processes
	ECHO.
	GOTO END_ERROR
)

ECHO.
ECHO Installing new version...
ECHO.

MKDIR "%YAWDS_HOME%\stack"
CD "%YAWDS_HOME%\stack"

:: install new version
CALL "%YAWDS_HOME%\stack_old\tools\7za.exe" -y e "%TEMP%\yawds-latest-win32.zip"
IF NOT EXIST "%YAWDS_HOME%\stack" (
	ECHO.
	ECHO ERROR: cannot extract and write new files
	ECHO Restoring old stack environment version...
	ECHO.
	MOVE /Y "%YAWDS_HOME%\stack_old" "%YAWDS_HOME%\stack"
	GOTO END_ERROR
)

:: removing old version
DEL /F /Q /S "%YAWDS_HOME%\stack_old"

ECHO.
ECHO %YAWDS_CONF_GENERA_SHORTNAME% was updated succesfully!
ECHO.
GOTO END

:VERSION_ERROR
ECHO Cannot check the latest version: error while reading the ini file
ECHO Cannot update. Try it again

:END
ECHO.
GOTO CLEAN

:END_ERROR
ECHO Cannot update. Try it again

:CLEAN
IF EXIST "%TEMP%\yawds_update.bat" DEL /Q /F "%TEMP%\yawds_update.bat"
IF EXIST "%TEMP%\yawds_latest.ini" DEL /Q /F "%TEMP%\yawds_latest.ini"
IF EXIST "%TEMP%\release_notes" DEL /Q /F "%TEMP%\release_notes"
IF EXIST "%TEMP%\yawds-latest-win32.zip" DEL /Q /F "%TEMP%\yawds-latest-win32.zip"
IF DEFINED yawds_from_start CLS

ENDLOCAL

@ECHO OFF
:: do not run this script manually

SETLOCAL
:: todo: support for authtentication

IF DEFINED YAWDS_CONF_GENERAL_CONSOLE_COLOR (
	COLOR %YAWDS_CONF_GENERAL_CONSOLE_COLOR%
)

IF [%YAWDS_CONF_UPDATE_ENABLED%]==[0] (
	ECHO Environment update is disabled
	GOTO END
)

IF NOT DEFINED YAWDS_CONF_UPDATE_CHECK_URL (
	ECHO Missing update.check_url config value in environment.ini
	ECHO Cannot checkout for new versions
	GOTO END
)

IF [%1]==[--confirm] (
	GOTO SET_NOCONFIRM
)
GOTO ASK_CONFIRMATION

:SET_NOCONFIRM
SET yawds_from_start=1
GOTO UPDATE

:ASK_CONFIRMATION
SET /P confirm_update=Do you want to check for updates? [y/n]:
IF NOT [%confirm_update%]==[y] (
	ECHO Canceled
	GOTO END
)
ECHO.

:UPDATE

IF NOT EXIST "%TEMP%" MKDIR "%TEMP%"

IF [%YAWDS_CONF_UPDATE_CHECK_URL_AUTH%]==[1] (
	:: exit if it was called from start.cmd
	IF DEFINED yawds_from_start (
		GOTO END
	)
	ECHO Authentication is required to update
	CALL node "%YAWDS_STACK_PATH%\scripts\node_scripts\prompt\update_auth" "%TEMP%\yawds_update.bat" "update"
	IF NOT ERRORLEVEL 0 (
		ECHO Error setting authtentication credentials
		GOTO END_ERROR
	)
	GOTO CHECK_AUTH_HTTP
) ELSE (
	GOTO CHECK_HTTP
)

:CHECK_AUTH_HTTP
CALL "%TEMP%\yawds_update.bat"
IF NOT DEFINED YAWDS_UPDATE_USER (
	ECHO Authentication required
	GOTO END_ERROR
)
CALL wget -q -nv "--http-user=%YAWDS_UPDATE_USER%" "--http-passwd=%YAWDS_UPDATE_PASSWORD%" -O "%TEMP%\yawds_latest.ini" "%YAWDS_CONF_UPDATE_CHECK_URL%"
GOTO CONTINUE

:CHECK_HTTP
CALL wget -q -nv -O "%TEMP%\yawds_latest.ini" "%YAWDS_CONF_UPDATE_CHECK_URL%"

:CONTINUE
IF NOT ERRORLEVEL 0 (
	ECHO Cannot check out remote version for updates
	ECHO Be sure you have network connection and try again
	GOTO END_ERROR
)

CALL node "%YAWDS_STACK_PATH%\scripts\node_scripts\ini2batch" "%TEMP%\yawds_latest.ini" "update" > "%TEMP%\yawds_update.bat"
CALL "%TEMP%\yawds_update.bat"
IF NOT ERRORLEVEL 0 GOTO CONFIG_ERROR

IF NOT DEFINED YAWDS_UPDATE_VERSION (
	ECHO Cannot check the latest version
	GOTO END_ERROR
)

IF NOT DEFINED YAWDS_UPDATE_DOWNLOAD (
	ECHO Download URL not defined. Cannot update
	GOTO END
)

IF [%YAWDS_VERSION%]==[0.1.2] (
	IF DEFINED yawds_from_start (
		GOTO END
	)
	ECHO You are on the latest version: %YAWDS_VERSION%
	ECHO Nothing to update
	GOTO END
)

IF DEFINED yawds_from_start ECHO.
ECHO There is a new version available: %YAWDS_UPDATE_VERSION%

IF DEFINED YAWDS_UPDATE_RELEASE_NOTES (
	ECHO.
	ECHO Release notes:
	ECHO "%YAWDS_UPDATE_RELEASE_NOTES%"
	ECHO.
)
IF DEFINED YAWDS_UPDATE_RELEASE_NOTES_URL (
	IF [%YAWDS_CONF_UPDATE_CHECK_URL_AUTH%]==[1] (
		CALL wget -q "--http-user=%YAWDS_UPDATE_USER%" "--http-passwd=%YAWDS_UPDATE_PASSWORD%" -O "%TEMP%\release_notes" %YAWDS_UPDATE_RELEASE_NOTES_URL%
	) ELSE (
		CALL wget -q -O "%TEMP%\release_notes" "%YAWDS_UPDATE_RELEASE_NOTES_URL%"
	)
	IF EXIST "%TEMP%\release_notes" (
		ECHO.
		ECHO Release notes
		ECHO ---------------------------------------------
		TYPE "%TEMP%\release_notes"
		ECHO.
		ECHO ---------------------------------------------
		ECHO.
	)
)

:: require to run from update.cmd (due to windows files blocking issues)
IF DEFINED yawds_from_start (
	ECHO.
	ECHO To proceed with the update, you must run update.cmd
	ECHO.
	PAUSE
	GOTO END
)

SET /P confirm_update=Do you want to process with the update? [y/n]:
IF NOT [%confirm_update%]==[y] (
	ECHO Canceled
	GOTO END
)

ECHO.
ECHO IMPORTANT:
ECHO You must close all the running processes before continue
ECHO You can use stack\tools\cprocess.exe to see the running processes
ECHO.

PAUSE

ECHO Downloading latest version...

IF [%YAWDS_UPDATE_DOWNLOAD_AUTH%]==[1] SET require_auth=1
IF [%YAWDS_CONF_UPDATE_CHECK_URL_AUTH%]==[1] SET require_auth=1

IF [%require_auth%]==[1] (
	CALL wget --progress=bar "--http-user=%YAWDS_UPDATE_USER%" "--http-passwd=%YAWDS_UPDATE_PASSWORD%" -O "%TEMP%\yawds-latest-win32.zip" "%YAWDS_UPDATE_DOWNLOAD%"
) ELSE (
	CALL wget --progress=bar -O "%TEMP%\yawds-latest-win32.zip" "%YAWDS_UPDATE_DOWNLOAD%"
)
IF NOT ERRORLEVEL 0 (
	ECHO Download error
	GOTO END
)
IF NOT EXIST "%TEMP%\yawds-latest-win32.zip" (
	ECHO File do not exist
	GOTO END
)

ECHO.
ECHO Download completed!
ECHO.

:: backup filename
FOR /F "tokens=* delims= " %%a IN ("%TIME:~0,2%") DO SET hour=%%a
FOR /F "tokens=* delims= " %%a IN ("%TIME:~3,2%") DO SET minute=%%a
SET backup_file=stack-%YAWDS_VERSION%-%date:~6,4%-%date:~3,2%-%date:~0,2%-%hour%%minute%.zip

:: backup the current stack environment
SET /P backup=Do you want to backup the current environment? [Y/n]:
IF [%backup%]==[y] (
	IF NOT EXIST "%YAWDS_HOME%\backup" MKDIR "%YAWDS_HOME%\backup"
	CD "%YAWDS_HOME%\stack"
	:: create tarball
	CALL 7za -mx7 -y a "%backup_file%" *
	IF NOT ERRORLEVEL 0 (
		ECHO.
		ECHO Error while creating the backup...
		GOTO END_ERROR
	)
	:: move to backup folder
	MOVE /Y "%backup_file%" "%YAWDS_HOME%\backup"

	ECHO.
	ECHO Backup created succesfully in:
	ECHO %YAWDS_HOME%\backup\
	ECHO.
	CD "%YAWDS_HOME%"
	PAUSE
)

MOVE /Y "%YAWDS_HOME%\stack" "%YAWDS_HOME%\stack_old" > nul
IF NOT EXIST "%YAWDS_HOME%\stack_old" (
	ECHO.
	ECHO ERROR: cannot write new files
	ECHO Be sure there is not any blocking process still running
	ECHO You can exec stack\tools\cprocess.exe in to see the running processes
	ECHO.
	GOTO END_ERROR
)

ECHO.
ECHO Installing new version...
ECHO.

MKDIR "%YAWDS_HOME%\stack"
CD "%YAWDS_HOME%\stack"

:: install new version
CALL "%YAWDS_HOME%\stack_old\tools\7za.exe" -y e "%TEMP%\yawds-latest-win32.zip"
IF NOT EXIST "%YAWDS_HOME%\stack" (
	ECHO.
	ECHO ERROR: cannot extract and write new files
	ECHO Restoring old stack environment version...
	ECHO.
	MOVE /Y "%YAWDS_HOME%\stack_old" "%YAWDS_HOME%\stack"
	GOTO END_ERROR
)

:: removing old version
DEL /F /Q /S "%YAWDS_HOME%\stack_old"

ECHO.
ECHO %YAWDS_CONF_GENERA_SHORTNAME% was updated succesfully!
ECHO.
GOTO END

:VERSION_ERROR
ECHO Cannot check the latest version: error while reading the ini file
ECHO Cannot update. Try it again

:END
ECHO.
GOTO CLEAN

:END_ERROR
ECHO Cannot update. Try it again

:CLEAN
IF EXIST "%TEMP%\yawds_update.bat" DEL /Q /F "%TEMP%\yawds_update.bat"
IF EXIST "%TEMP%\yawds_latest.ini" DEL /Q /F "%TEMP%\yawds_latest.ini"
IF EXIST "%TEMP%\release_notes" DEL /Q /F "%TEMP%\release_notes"
IF EXIST "%TEMP%\yawds-latest-win32.zip" DEL /Q /F "%TEMP%\yawds-latest-win32.zip"
IF DEFINED yawds_from_start CLS

ENDLOCAL

update script

update script


@if not defined _echo @echo off
setlocal EnableDelayedExpansion

echo Running clean.cmd

set bin=false
set packages=false
set tools = false

if [%1]==[] (
  set bin=true
  set packages=true
  set tools=true
  goto Begin
)

:Loop
if [%1]==[] goto Begin

if /I [%1] == [-?] goto Usage
if /I [%1] == [-help] goto Usage

if /I [%1] == [-p] (
    set packages=true
    set thisArgs=!thisArgs!%1
    goto Next
)

if /I [%1] == [-b] (
    set bin=true
    set thisArgs=!thisArgs!%1
    goto Next
)

if /I [%1] == [-t] (
    set tools=true
    set thisArgs=!thisArgs!%1
    goto Next
)

if /I [%1] == [-all] (
    set tools=true
    set bin=true
    set packages=true
    goto Begin
)

:Next
shift /1
goto Loop

:Begin
:: Set __ProjectDir to be the directory of this script
set "__ProjectDir=%~dp0"
:: remove trailing slash
if %__ProjectDir:~-1%==\ set "__ProjectDir=%__ProjectDir:~0,-1%"
set "__RootBinDir=%__ProjectDir%\bin"

if [%bin%] == [true] (
	if exist "%__RootBinDir%" (
		echo Deleting bin directory
		rd /s /q "%__RootBinDir%"
		if NOT [!ERRORLEVEL!]==[0] (
  			echo ERROR: An error occurred while deleting the bin directory - error code is !ERRORLEVEL!
  			exit /b 1
  		)
	)
)

if [%tools%] == [true] (
	if exist "%__ProjectDir%\Tools" (
		echo Deleting tools directory
		rd /s /q "%__ProjectDir%\Tools"
		if NOT [!ERRORLEVEL!]==[0] (
  			echo ERROR: An error occurred while deleting the Tools directory - error code is !ERRORLEVEL!
  			exit /b 1
  		)
  	)
)

if [%packages%] == [true] (
	if exist "%__ProjectDir%\packages" (
		echo Deleting packages directory
		rd /s /q "%__ProjectDir%\packages"
		if NOT [!ERRORLEVEL!]==[0] (
  			echo ERROR: An error occurred while deleting the packages directory - error code is !ERRORLEVEL!
  			exit /b 1
  		)
  	)
)

echo Clean was successful
exit /b 0

:Usage
echo.
echo Repository cleaning script.
echo Options:
echo     -b     - Cleans the bin directory
echo     -p     - Cleans the packages directory
echo     -t     - Cleans the tools directory
echo     -all   - Cleans everything
echo.
echo If no option is specified then clean.cmd -b -p -t is implied.
exit /b

@if not defined _echo @echo off
setlocal EnableDelayedExpansion

echo Running clean.cmd

set bin=false
set packages=false
set tools = false

if [%1]==[] (
  set bin=true
  set packages=true
  set tools=true
  set all=false
  goto Begin
)

:Loop
if [%1]==[] goto Begin

if /I [%1] == [-?] goto Usage
if /I [%1] == [-help] goto Usage

if /I [%1] == [-p] (
    set packages=true
    set thisArgs=!thisArgs!%1
    goto Next
)

if /I [%1] == [-b] (
    set bin=true
    set thisArgs=!thisArgs!%1
    goto Next
)

if /I [%1] == [-t] (
    set tools=true
    set thisArgs=!thisArgs!%1
    goto Next
)

if /I [%1] == [-all] (
    set tools=true
    set bin=true
    set packages=true
	set all=true
    goto Begin
)

:Next
shift /1
goto Loop

:Begin
:: Set __ProjectDir to be the directory of this script
set "__ProjectDir=%~dp0"
:: remove trailing slash
if %__ProjectDir:~-1%==\ set "__ProjectDir=%__ProjectDir:~0,-1%"
set "__RootBinDir=%__ProjectDir%\bin"

:: Check if VBCSCompiler.exe is running and stop it
tasklist /fi "imagename eq VBCSCompiler.exe" |find ":" > nul
if errorlevel 1 (
	echo Stop VBCSCompiler.exe execution.
	for /f "tokens=2 delims=," %%F in ('tasklist /nh /fi "imagename eq VBCSCompiler.exe" /fo csv') do taskkill /f /PID %%~F
)

if [%bin%] == [true] (
	if exist "%__RootBinDir%" (
		echo Deleting bin directory
		rd /s /q "%__RootBinDir%"
		if NOT [!ERRORLEVEL!]==[0] (
  			echo ERROR: An error occurred while deleting the bin directory - error code is !ERRORLEVEL!
  			exit /b 1
  		)
	)
)

if [%tools%] == [true] (
	if exist "%__ProjectDir%\Tools" (
		echo Deleting tools directory
		rd /s /q "%__ProjectDir%\Tools"
		if NOT [!ERRORLEVEL!]==[0] (
  			echo ERROR: An error occurred while deleting the Tools directory - error code is !ERRORLEVEL!
  			exit /b 1
  		)
  	)
)

if [%packages%] == [true] (
	if exist "%__ProjectDir%\packages" (
		echo Deleting packages directory
		rd /s /q "%__ProjectDir%\packages"
		if NOT [!ERRORLEVEL!]==[0] (
  			echo ERROR: An error occurred while deleting the packages directory - error code is !ERRORLEVEL!
  			exit /b 1
  		)
  	)
)

if [%all%] == [true] (
  echo Cleaning entire working directory ...
  call git clean -xdf
  exit /b !ERRORLEVEL!
)

echo Clean was successful
exit /b 0

:Usage
echo.
echo Repository cleaning script.
echo Options:
echo     -b     - Cleans the bin directory
echo     -p     - Cleans the packages directory
echo     -t     - Cleans the tools directory
echo     -all   - Cleans everything and restores repository to pristine state
echo.
echo If no option is specified then clean.cmd -b -p -t is implied.
exit /b

Improve clean.cmd by adding VBCScompiler.exe kill logic and git clean -xdf cleanup


start /MIN dbserver\bin\openmole-dbserver.bat

mkdir "%UserProfile%\.openmole\.tmp"

set ran="%UserProfile%\.openmole\.tmp\%random%"

set PWD=%~dp0

java -d64 -version >nul 2>&1
if errorlevel 1 goto is32bit
set FLAG="-XX:+UseCompressedOops"
:is32bit

java -Dosgi.locking=none -Dopenmole.location="%PWD%\" -Dosgi.classloader.singleThreadLoads=true -Dosgi.configuration.area=%ran% -splash:splashscreen.png -XX:MaxPermSize=128M -XX:+UseG1GC -Xmx1G  -XX:MaxPermSize=128M %FLAG% -jar ./plugins/org.eclipse.equinox.launcher.jar -cp ./openmole-plugins -gp ./openmole-plugins-gui %*

rmdir /s /q %ran%

set PWD=%~dp0

start /MIN %PWD%\dbserver\bin\openmole-dbserver.bat

mkdir "%UserProfile%\.openmole\.tmp"

set ran="%UserProfile%\.openmole\.tmp\%random%"

java -d64 -version >nul 2>&1
if errorlevel 1 goto is32bit
set FLAG="-XX:+UseCompressedOops"
:is32bit

java -Dosgi.locking=none -Dopenmole.location="%PWD%\" -Dosgi.classloader.singleThreadLoads=true -Dosgi.configuration.area=%ran% -splash:splashscreen.png -XX:MaxPermSize=128M -XX:+UseG1GC -Xmx1G  -XX:MaxPermSize=128M %FLAG% -jar ./plugins/org.eclipse.equinox.launcher.jar -cp ./openmole-plugins -gp ./openmole-plugins-gui %*

rmdir /s /q %ran%

Fix windows script.

Fix windows script.


@echo off
SETLOCAL
chcp 65001 >nul 2>nul
for /F %%a in (account.txt) do set "CI_TEACHER_ACCOUNT=%%a" && npm run -s start

@echo off
SETLOCAL
chcp 65001 >nul 2>nul

(where env.exe && (
	goto :RUN
)) >nul 2>nul

rem add the unix commands at the end to not shadow windows commands like more
:: check if git is in registry...
for /F "tokens=1,2,*" %%i in ('reg query HKLM\SOFTWARE\GitForWindows /v InstallPath /reg:64 2^>nul ^| find "InstallPath"') do (
	set "Path=%Path%;%%k\mingw64;%%k\usr\bin;%%k\usr\share\vim\vim74"
	goto :RUN
)
for /F "tokens=1,2,*" %%i in ('reg query HKLM\SOFTWARE\GitForWindows /v InstallPath 2^>nul ^| find "InstallPath"') do (
	set "Path=%Path%;%%k\mingw32;%%k\usr\bin;%%k\usr\share\vim\vim74"
	goto :RUN
)

for /F %%a in (account.txt) do set "CI_TEACHER_ACCOUNT=%%a" && npm run -s start
exit /b

:RUN
env.exe ./run.sh

use git bash as shell for windows (#74)

use git bash as shell for windows (#74)


set /p versionNumber=

REM clean up
del builds\im-only-resting-%versionNumber%.zip
rd /q /s builds\im-only-resting-%versionNumber%
rd /q /s builds\im-only-resting

REM preparing staging dir
mkdir staging
copy LICENSE staging
copy NOTICE staging
copy Ior\bin\Release\im-only-resting.exe staging
copy Ior\bin\Release\libtidy.dll staging
copy Ior\bin\Release\Newtonsoft.Json.dll staging
copy Ior\bin\Release\PropertyGridEx.dll staging
copy Ior\bin\Release\RestSharp.dll staging
copy Ior\bin\Release\TidyManaged.dll staging
copy Ior\bin\Release\Utils.dll staging
copy Ior\bin\Release\NLog.config staging
copy Ior\bin\Release\NLog.dll staging

REM zip staging files
cd staging
"..\tools\7z\7za.exe" a -tzip "..\builds\im-only-resting-%versionNumber%.zip" *
cd ..

REM extract build
"tools\7z\7za.exe" e "builds\im-only-resting-%versionNumber%.zip" -o"builds\im-only-resting-%versionNumber%"
"tools\7z\7za.exe" e "builds\im-only-resting-%versionNumber%.zip" -o"builds\im-only-resting"

REM clean up
rd /q /s staging

pause

set /p versionNumber=

REM clean up
del builds\im-only-resting-%versionNumber%.zip
rd /q /s builds\im-only-resting-%versionNumber%
rd /q /s builds\im-only-resting

REM preparing staging dir
mkdir staging
copy LICENSE staging
copy NOTICE staging
copy Ior\bin\Release\im-only-resting.exe staging
copy Ior\bin\Release\libtidy.dll staging
copy Ior\bin\Release\Newtonsoft.Json.dll staging
copy Ior\bin\Release\PropertyGridEx.dll staging
copy Ior\bin\Release\RestSharp.dll staging
copy Ior\bin\Release\TidyManaged.dll staging
copy Ior\bin\Release\Utils.dll staging
copy Ior\bin\Release\NLog.config staging
copy Ior\bin\Release\NLog.dll staging
copy Ior\bin\Release\System.Net.Http.dll staging
copy Ior\bin\Release\System.Net.Http.WebRequest.dll staging

REM zip staging files
cd staging
"..\tools\7z\7za.exe" a -tzip "..\builds\im-only-resting-%versionNumber%.zip" *
cd ..

REM extract build
"tools\7z\7za.exe" e "builds\im-only-resting-%versionNumber%.zip" -o"builds\im-only-resting-%versionNumber%"
"tools\7z\7za.exe" e "builds\im-only-resting-%versionNumber%.zip" -o"builds\im-only-resting"

REM clean up
rd /q /s staging

pause

update archive-release.bat

update archive-release.bat


:: Copyright (c) 2011, Jon Maken
:: License: 3-clause BSD (see project LICENSE file)
:: Revision: 01/29/2011 10:20:16 AM

@echo off
setlocal
:: echo initial:
:: echo   %%0 = %0
:: echo   %%* = %*
:: fix ruby.exe invocation when explicitly disabling RubyGems
if "x%1" == "x--disable-gems" (
  set NOGEM=%1
  for /F "tokens=1*" %%i in ("%*") do set RB_ARGS=%%j
) else (
  set NOGEM=
  set RB_ARGS=%*
)

:: echo pre call ruby:
:: echo   NOGEM = %NOGEM%
:: echo   RB_ARGS = %RB_ARGS%
ruby.exe %NOGEM% -x %~f0 %RB_ARGS%

endlocal
exit /b
#!ruby
__DIR__ = File.expand_path(File.dirname(__FILE__))
$LOAD_PATH.unshift(File.join(__DIR__, 'lib'))
$LOAD_PATH.unshift(File.join(__DIR__))

require 'inquisitor'

Inquisitor.run

:: Copyright (c) 2011, Jon Maken
:: License: 3-clause BSD (see project LICENSE file)
:: Revision: 01/29/2011 10:20:16 AM

@echo off
setlocal
:: echo initial:
:: echo   %%0 = %0
:: echo   %%* = %*
:: fix ruby.exe invocation when explicitly disabling RubyGems
if "x%1" == "x--disable-gems" (
  set NOGEM=%1
  for /F "tokens=1*" %%i in ("%*") do set RB_ARGS=%%j
) else (
  set NOGEM=
  set RB_ARGS=%*
)

:: echo pre call ruby:
:: echo   NOGEM = %NOGEM%
:: echo   RB_ARGS = %RB_ARGS%
ruby.exe %NOGEM% -x %~f0 %RB_ARGS%

endlocal
exit /b
#!ruby
RCI_CONFIG = 'config.yml'
RCI_ROOT = File.expand_path(File.dirname(__FILE__))
$LOAD_PATH.unshift(File.join(RCI_ROOT, 'lib'))
$LOAD_PATH.unshift(File.join(RCI_ROOT))

require 'inquisitor'

Inquisitor.run

Add core project constants.

Add core project constants.


Fix bat

Fix bat


@echo off
setlocal

REM Be careful !!!
set /p input="Is coverage achieve 100%?    [Y/N]:"
if not "%input%" == "Y" goto EXIT
set /p input="Did you increase version?    [Y/N]:"
if not "%input%" == "Y" goto EXIT
set /p input="Did you re-build project?    [Y/N]:"
if not "%input%" == "Y" goto EXIT
set /p input="Did you write release notes? [Y/N]:"
if not "%input%" == "Y" goto EXIT
set /p input="Did you commit all changes?  [Y/N]:"
if not "%input%" == "Y" goto EXIT

REM Prepare semver.exe
make clean
make

REM Set VERSION_STR variable
call semverenv.bat src/version.h

REM If VERSION_STR is NULL, then go to EXIT
if %VERSION_STR% == "" goto EXIT

REM Tag and push to remote server
git tag %VERSION_STR%
git push origin --tags

:EXIT
endlocal
@echo on

@echo off
setlocal

REM Be careful !!!
set /p input="Is coverage achieve 100%%?    [Y/N]:"
if not "%input%" == "Y" goto EXIT
set /p input="Did you increase version?    [Y/N]:"
if not "%input%" == "Y" goto EXIT
set /p input="Did you re-build project?    [Y/N]:"
if not "%input%" == "Y" goto EXIT
set /p input="Did you write release notes? [Y/N]:"
if not "%input%" == "Y" goto EXIT
set /p input="Did you commit all changes?  [Y/N]:"
if not "%input%" == "Y" goto EXIT

REM Prepare semver.exe
make clean
make

REM Set VERSION_STR variable
call semverenv.bat src/version.h

REM If VERSION_STR is NULL, then go to EXIT
if %VERSION_STR% == "" goto EXIT

REM Tag and push to remote server
git tag %VERSION_STR%
git push origin --tags

:EXIT
endlocal
@echo on

update tag.bat

[SemVer] update tag.bat


@if "%DEBUG%" == "" @echo off
@rem ##########################################################################
@rem
@rem  Gradle startup script for Windows
@rem
@rem ##########################################################################

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

set DIRNAME=%~dp0
if "%DIRNAME%" == "" set DIRNAME=.
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%

@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS=

@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome

set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if "%ERRORLEVEL%" == "0" goto init

echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.

goto fail

:findJavaFromJavaHome
set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe

if exist "%JAVA_EXE%" goto init

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

goto fail

:init
@rem Get command-line arguments, handling Windows variants

if not "%OS%" == "Windows_NT" goto win9xME_args

:win9xME_args
@rem Slurp the command line arguments.
set CMD_LINE_ARGS=
set _SKIP=2

:win9xME_args_slurp
if "x%~1" == "x" goto execute

set CMD_LINE_ARGS=%*

:execute
@rem Setup the command line

set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar

@rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%

:end
@rem End local scope for the variables with windows NT shell
if "%ERRORLEVEL%"=="0" goto mainEnd

:fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code!
if  not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
exit /b 1

:mainEnd
if "%OS%"=="Windows_NT" endlocal

:omega

add missing gradle script for windows

add missing gradle script for windows

Summary: Pull Request resolved: https://github.com/facebook/yoga/pull/885

Differential Revision: D15334309

Pulled By: davidaurelio

fbshipit-source-id: c594c0216a967c776606443a50f14e81da228d64


REM Set variables for Microsoft Visual Studio for Python 2.7
REM @call "C:\Users\michaelh3\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0\vcvarsall.bat" amd64
REM Set environ as workaround for bugs (See http://stackoverflow.com/questions/2817869/error-unable-to-find-vcvarsall-bat and http://bugs.python.org/issue23246)
REM SET DISTUTILS_USE_SDK=1
REM SET MSSdk=1

REM Set variables for Microsoft Visual Studio for Python 3.6
@call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" x86_amd64

REM Test build
python setup.py sdist bdist_wheel
REM Upload to PyPi
REM python setup.py sdist bdist_wheel upload

REM Set variables for Microsoft Visual Studio for Python 2.7
REM @call "C:\Users\michaelh3\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0\vcvarsall.bat" amd64
REM Set environ as workaround for bugs (See http://stackoverflow.com/questions/2817869/error-unable-to-find-vcvarsall-bat and http://bugs.python.org/issue23246)
REM SET DISTUTILS_USE_SDK=1
REM SET MSSdk=1

REM Set variables for Microsoft Visual Studio for Python 3.6
REM @call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" x86_amd64

REM Cythonize pyx file to cpp (for users without Cython installed)
cython pyoctree\pyoctree.pyx --cplus

REM Test build
REM python setup.py sdist bdist_wheel

REM Upload to PyPi
REM twine upload dist/*

Update build method

Update build method


@ECHO OFF

:BEGIN
IF [%1]==[boot] GOTO :BOOT
IF [%1]==[clean] GOTO :CLEAN
IF [%1]==[describe] GOTO :DESCRIBE
IF [%1]==[/?] GOTO :HELP
IF [%1]==[help] GOTO :HELP
IF [%1]==[version] GOTO :VERSION

java --module-path .bach\cache --module com.github.sormuras.bach %*
GOTO :END

:BOOT
jshell https://github.com/sormuras/bach/raw/HEAD/.bach/boot.jsh
GOTO :END

:CLEAN
IF EXIST .bach\workspace rmdir /q/s .bach\workspace
SHIFT
IF [%1]==[] GOTO :END
GOTO :BEGIN

:VERSION
IF [%2]==[] GOTO :DESCRIBE
jshell -R-Dversion=%2 https://github.com/sormuras/bach/raw/HEAD/.bach/pull.jsh
GOTO :END

:DESCRIBE
java --module-path .bach\cache --describe-module com.github.sormuras.bach
GOTO :END

:HELP
ECHO.
ECHO Usage: %0 [action] [args...]
ECHO.
ECHO Where actions include:
ECHO.
ECHO   boot
ECHO     Launch an interactive JShell session with Bach's module on the module-path.
ECHO.
ECHO   describe
ECHO     Describe module com.github.sormuras.bach and exit.
ECHO.
ECHO   version [tag]
ECHO     Download Bach for the specified version tag.
ECHO     Find released version tags at https://github.com/sormuras/bach/releases
ECHO     If no tag is given a description of the current module is printed.
ECHO     Example: %0 version 15-ea+2
ECHO.

:END

Add Bach's DOS launch batch script

Add Bach's DOS launch batch script


echo @off

rem FIXME: vcvarsall should work to set the vars below:
rem  call "%VSSHELL2010INSTALLDIR%VC\vcvarsall.bat"
set PROCESSOR_ARCHITECTURE=AMD64
set VSSHELL2010INSTALLDIR=C:\Program Files\Microsoft Visual Studio 10.0\
set VS100COMNTOOLS=%VSSHELL2010INSTALLDIR%\Common7\Tools\
set VS100COMNTOOLSDIR=%VS100COMNTOOLS%
set VSINSTALLDIR=%VSSHELL2010INSTALLDIR%
set WindowsSdkDir=C:\Program Files\Microsoft SDKs\Windows\v7.0A\
set DevEnvDir=%VSINSTALLDIR%Common7\IDE\
set INCLUDE=%VSINSTALLDIR%VC\INCLUDE;%INCLUDE%
set INCLUDE=%WindowsSdkDir%\Include;%INCLUDE%
set LIB=%VSINSTALLDIR%VC\LIB;%LIB%
set LIB=%WindowsSdkDir%Lib;%LIB%
set PATH=%VSINSTALLDIR%Common7\Tools;%PATH%
set PATH=%VSINSTALLDIR%VC\bin;%PATH%
set PATH=%DevEnvDir%;%PATH%
set PATH=%WindowsSdkDir%bin;%PATH%

echo @off

rem FIXME: "%VSSHELL2010INSTALLDIR%VC\bin\vcvars32.bat
rem fails: reg query "HKLM\Software\Microsoft\VisualStudio\SxS\VS7" /v "10.0"
rem https://bugs.winehq.org/show_bug.cgi?id=24017

set VSSHELL2010INSTALLDIR=C:\Program Files\Microsoft Visual Studio 10.0\
set VS100COMNTOOLS=%VSSHELL2010INSTALLDIR%\Common7\Tools\
set VS100COMNTOOLSDIR=%VS100COMNTOOLS%
set VSINSTALLDIR=%VSSHELL2010INSTALLDIR%
set WindowsSdkDir=C:\Program Files\Microsoft SDKs\Windows\v7.0A\
set DevEnvDir=%VSINSTALLDIR%Common7\IDE\
set INCLUDE=%VSINSTALLDIR%VC\INCLUDE;%INCLUDE%
set INCLUDE=%WindowsSdkDir%\Include;%INCLUDE%
set LIB=%VSINSTALLDIR%VC\LIB;%LIB%
set LIB=%WindowsSdkDir%Lib;%LIB%
set PATH=%VSINSTALLDIR%Common7\Tools;%PATH%
set PATH=%VSINSTALLDIR%VC\bin;%PATH%
set PATH=%DevEnvDir%;%PATH%
set PATH=%WindowsSdkDir%bin;%PATH%

comment on bug #24017

comment on bug #24017


REM @file    CI/appveyor/install_dependencies.bat
REM @date    nov. 2015
REM @author  PhRG / opticalp.fr
REM @license MIT

REM Install dependencies:
REM  - build POCO from latest git release.

set CURRENT_DIR=%CD%
REM echo "current dir is %CURRENT_DIR%"

REM set POCO_INSTALL_PREFIX=%PROGRAMFILES%\Poco
REM echo "Poco install destination directory: %POCO_INSTALL_PREFIX%"

REM get last poco via github
echo "getting the last poco release from github"
mkdir dependencies
cd dependencies
git clone https://github.com/pocoproject/poco.git
echo "Poco is now cloned. "
cd poco

REM now using msys to make things easier (getting last release)
%SH_COMMAND% -c "POCO_TAG_NAME=$(git describe --tags) ; git checkout $POCO_TAG_NAME"

REM build using cmake
echo "building poco with cmake, configuration: %CONFIGURATION%"
cd ..
mkdir poco-build
cd poco-build

echo "Preparing to install POCO into %POCO_INSTALL_PREFIX%"
echo "CMake generator is: %GENERATOR%"
cmake ../poco -DENABLE_XML=ON -DENABLE_JSON=ON -DENABLE_MONGODB=OFF -DENABLE_PDF=OFF ^
    -DENABLE_UTIL=ON -DENABLE_NET=OFF -DENABLE_NETSSL=OFF -DENABLE_NETSSL_WIN=OFF -DENABLE_CRYPTO=OFF ^
    -DENABLE_DATA=OFF -DENABLE_DATA_SQLITE=OFF -DENABLE_DATA_MYSQL=OFF -DENABLE_DATA_ODBC=OFF ^
    -DENABLE_SEVENZIP=OFF -DENABLE_ZIP=OFF -DENABLE_APACHECONNECTOR=OFF -DENABLE_CPPPARSER=OFF ^
    -DENABLE_POCODOC=OFF -DENABLE_PAGECOMPILER=OFF -DENABLE_PAGECOMPILER_FILE2PAGE=OFF ^
    -DENABLE_REDIS=OFF ^
    -DCMAKE_INSTALL_PREFIX="%POCO_INSTALL_PREFIX%" -G"%GENERATOR%"
cmake --build . --config %CONFIGURATION%
REM echo "Poco build done. "
cmake --build . --target install --config %CONFIGURATION%
REM echo "Poco install done. "

REM %PATH% has to be modified to take into account poco .dlls
cd %CURRENT_DIR%

REM fix python configuration for 2.7.11
if "%ARCH%"=="Win64" (
  set PYTHONHOME=C:\Python27-x64
) else (
  set PYTHONHOME=C:\Python27
)

echo "Install OpenCV using chocolatey"
choco upgrade chocolatey
choco info opencv
set OPENCV=c:\jojo
choco install opencv --params="/Environment /InstallationPath:%OPENCV%" --version=2.4.13 -y
echo "OpenCV installed"

call refreshenv
echo "PATH is now: %PATH%"
echo "OPENCV_DIR is: %OPENCV_DIR%"

install opencv using chocolatey

install opencv using chocolatey

in appVeyor


echo Running Windows build and testscript  %cd%/matlab/CIBuildAndTest.m
call "C:\Program Files\MATLAB\R2015b\bin\matlab.exe" -wait -nodisplay -nosplash -nodesktop -r "try, run('%cd%/matlab/CIBuildAndTest.m'), catch ex, disp(['Exception during CIBuildAndTest.m: ' ex.message]), exit(1), end, exit(0);"

if not "%ERRORLEVEL%" == "0" (
    echo Exit Code = %ERRORLEVEL%
	exit /b 1
)

echo Running Windows build and testscript  %cd%/matlab/CIBuildAndTest.m
call "C:\Program Files\MATLAB\R2015b\bin\matlab.exe" -wait -nodisplay -nosplash -nodesktop -r "try, run('%cd%\matlab\CIBuildAndTest.m'), catch ex, disp(['Exception during CIBuildAndTest.m: ' ex.message]), exit(1), end, exit(0);"

if not "%ERRORLEVEL%" == "0" (
    echo Exit Code = %ERRORLEVEL%
	exit /b 1
)

Fix paths in CI script

Fix paths in CI script


@echo off
rem ------------------------
rem AUTOCLEAN-STARTCLEAN.BAT
rem ------------------------
chcp 65001

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

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

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

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

:gotAdmin
    if exist "%temp%\getadmin.vbs" ( del "%temp%\getadmin.vbs" )
    pushd "%CD%"
    CD /D "%~dp0"
:--------------------------------------

color 4f
    mode 100,35
	title CleanTech: Start Clean

    SETLOCAL EnableDelayedExpansion

	cls

	set horiz_line=-
	set dash=-

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

	echo %horiz_line%
	echo TechTutor's Clean Up Script - Start Clean
	echo %horiz_line%
	echo,

	echo Command running: set workingdir=c:%HOMEPATH%\Desktop\CleanTechTemp
	set workingdir=c:%HOMEPATH%\Desktop\CleanTechTemp
	echo Command running: cd %workingdir%
	cd %workingdir%
	echo,

	:boottimer
		title CleanTech: BootTimer
		echo Press any key when BootTimer has reported its number.
		echo DO NOT close the BootTimer dialog box yet!
		rem timeout 15
		rem echo Taking back the foreground...
		rem ADD test for BootTimer.exe or w/e
		rem tasklist /FI "IMAGENAME eq BootTimer.exe" 2>NUL | find /I /N "myapp.exe">NUL
		rem if "%ERRORLEVEL%"=="0" echo Program is running
		rem MIGHT actually need sysexp to test this (if ERRORLEVEL==0 when testing for WindowName then kill process)
		rem	@For /f "Delims=:" %A in ('tasklist /v /fi "WINDOWTITLE eq WINDOWS BOOT TIME UTILITY"') do @if %A==INFO echo Prog not running
		pause
		%workingdir%/nircmd/nircmd win settopmost title "CleanTech: Boottimer" 1
		echo Grabbing number from dialog box...
		echo Command running: %workingdir%\sysexp.exe /process BootTimer.exe %workingdir%\%1-%2-%3-BootTimer.txt
		%workingdir%\sysexp.exe /process boottimer.exe /stext %workingdir%\%1-%2-%3-BootTimer.txt
		echo,
		pause
		taskkill /im BootTimer.exe /t
		reg delete HKLM\Software\WOW6432Node\Microsoft\Windows\CurrentVersion\Run /v WinBooter /f
		pause
		echo Killing BootTimer.exe's chrome process
		taskkill /im chrome.exe /f
		pause
		echo Killing BootTimer.exe's command window
		taskkill /FI "WINDOWTITLE eq %workingdir%\BootTimer.exe"
		cls & color 1f

	title CleanTech: Start Clean
	:echostrings
	echo -----------------------
	echo Client Info:
	echo Last Name: %1
	echo First name: %2
	echo Date: %3
	echo AV needed?: %4
	echo -----------------------
	echo,

	pause & color 6f

	echo if EXIST autoclean-adw goto :pcd
	pause
	if EXIST autoclean-adw goto :pcd
	echo if EXIST autoclean-startclean goto :adw
	pause
	if EXIST autoclean-startclean goto :adw

	:noflagfile
	color 1f
	echo at :noflagfile
	echo copy /y NUL autoclean-startclean >NUL
	echo,
	copy /y NUL autoclean-startclean >NUL
	pause
	goto adw

	:adw
	echo At :adw
	echo Launching ADWCLeaner... NOTE: Will request reboot after a clean.
	echo Command: move %workingdir%\Tron\tron\resources\stage_9_manual_tools\adwcleaner*.exe %workingdir%\adwcleaner.exe
	move %workingdir%\Tron\tron\resources\stage_9_manual_tools\adwcleaner*.exe %workingdir%\adwcleaner.exe

	echo Command: START "" /WAIT %workingdir%\adwcleaner.exe
	START "" /WAIT %workingdir%\adwcleaner.exe
	echo,
	copy /y NUL autoclean-adw >NUL

	:pcd
	echo Command running: del autoclean-adw
	del autoclean-adw
	echo,

	echo Launching PC Decrapifier.....
	echo START "" /WAIT "%workingdir%\pc-decrapifier.exe"
	START "" /WAIT "%workingdir%\pc-decrapifier.exe"
	color 6f
	echo ---------------------------------------------------------
	echo Please use PC Decrapifier to analyze and remove bloatware
	echo ---------------------------------------------------------
	pause
	color 1f

	rem Removing autoclean-start flag file
	echo del autoclean-startclean
	echo,
	del autoclean-startclean

	rem Swapping startup batch files
	echo del "C:%HOMEPATH%\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup\autoclean-startcleantemp.bat"
	del "C:%HOMEPATH%\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup\autoclean-startcleantemp.bat"

	echo Comand running: echo %workingdir%\autoclean-tron.bat %1 %2 %3 %4>C:\autoclean-trontemp.bat
	echo %workingdir%\autoclean-tron.bat %1 %2 %3 %4>C:\autoclean-trontemp.bat
	echo Command running: reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" /v Shell /t REG_SZ /d "explorer.exe,c:\autoclean-trontemp.bat" /f
	reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" /v Shell /t REG_SZ /d "explorer.exe,c:\autoclean-trontemp.bat" /f
	pause

	bcdedit /set {default} safeboot network

	color 6f
	echo --------------------
	echo Preparing to reboot.
	echo --------------------
	echo,
	echo If tron does not start after reboot,
	echo please launch Tron using autoclean-tron.bat
	echo from the CleanTechTemp directory on the Desktop
	echo,
	pause

	shutdown /r /t 0

@echo off
rem ------------------------
rem AUTOCLEAN-STARTCLEAN.BAT
rem ------------------------
chcp 65001

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

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

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

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

:gotAdmin
    if exist "%temp%\getadmin.vbs" ( del "%temp%\getadmin.vbs" )
    pushd "%CD%"
    CD /D "%~dp0"
:--------------------------------------

color 4f
    mode 100,35
	title CleanTech: Start Clean

    SETLOCAL EnableDelayedExpansion

	cls

	set horiz_line=-
	set dash=-

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

	echo %horiz_line%
	echo TechTutor's Clean Up Script - Start Clean
	echo %horiz_line%
	echo,

	echo Command running: set workingdir=c:%HOMEPATH%\Desktop\CleanTechTemp
	set workingdir=c:%HOMEPATH%\Desktop\CleanTechTemp
	echo Command running: cd %workingdir%
	cd %workingdir%
	echo,

	:boottimer
		title CleanTech: BootTimer
		echo Press any key when BootTimer has reported its number.
		echo DO NOT close the BootTimer dialog box yet!
		rem timeout 15
		rem echo Taking back the foreground...
		rem ADD test for BootTimer.exe or w/e
		rem tasklist /FI "IMAGENAME eq BootTimer.exe" 2>NUL | find /I /N "myapp.exe">NUL
		rem if "%ERRORLEVEL%"=="0" echo Program is running
		rem MIGHT actually need sysexp to test this (if ERRORLEVEL==0 when testing for WindowName then kill process)
		rem	@For /f "Delims=:" %A in ('tasklist /v /fi "WINDOWTITLE eq WINDOWS BOOT TIME UTILITY"') do @if %A==INFO echo Prog not running
		pause
		%workingdir%/nircmd/nircmd win settopmost title "CleanTech: Boottimer" 1
		echo Grabbing number from dialog box...
		echo Command running: %workingdir%\sysexp.exe /title "WINDOWS BOOT TIME UTILTY" %workingdir%\%1-%2-%3-BootTimer.txt
		%workingdir%\sysexp.exe /title "WINDOWS BOOT TIME UTILITY" /stext %workingdir%\%1-%2-%3-BootTimer.txt
		echo,
		pause
		taskkill /im BootTimer.exe /t
		reg delete HKLM\Software\WOW6432Node\Microsoft\Windows\CurrentVersion\Run /v WinBooter /f
		pause
		echo Killing BootTimer.exe's chrome process
		taskkill /im chrome.exe /f
		pause
		echo Killing BootTimer.exe's command window
		taskkill /FI "WINDOWTITLE eq %workingdir%\BootTimer.exe"
		cls & color 1f

	title CleanTech: Start Clean
	:echostrings
	echo -----------------------
	echo Client Info:
	echo Last Name: %1
	echo First name: %2
	echo Date: %3
	echo AV needed?: %4
	echo -----------------------
	echo,

	pause & color 6f

	echo if EXIST autoclean-adw goto :pcd
	pause
	if EXIST autoclean-adw goto :pcd
	echo if EXIST autoclean-startclean goto :adw
	pause
	if EXIST autoclean-startclean goto :adw

	:noflagfile
	color 1f
	echo at :noflagfile
	echo copy /y NUL autoclean-startclean >NUL
	echo,
	copy /y NUL autoclean-startclean >NUL
	pause
	goto adw

	:adw
	echo At :adw
	echo Launching ADWCLeaner... NOTE: Will request reboot after a clean.
	echo Command: move %workingdir%\Tron\tron\resources\stage_9_manual_tools\adwcleaner*.exe %workingdir%\adwcleaner.exe
	move %workingdir%\Tron\tron\resources\stage_9_manual_tools\adwcleaner*.exe %workingdir%\adwcleaner.exe

	echo Command: START "" /WAIT %workingdir%\adwcleaner.exe
	START "" /WAIT %workingdir%\adwcleaner.exe
	echo,
	copy /y NUL autoclean-adw >NUL

	:pcd
	echo Command running: del autoclean-adw
	del autoclean-adw
	echo,

	echo Launching PC Decrapifier.....
	echo START "" /WAIT "%workingdir%\pc-decrapifier.exe"
	START "" /WAIT "%workingdir%\pc-decrapifier.exe"
	color 6f
	echo ---------------------------------------------------------
	echo Please use PC Decrapifier to analyze and remove bloatware
	echo ---------------------------------------------------------
	pause
	color 1f

	rem Removing autoclean-start flag file
	echo del autoclean-startclean
	echo,
	del autoclean-startclean

	rem Swapping startup batch files
	echo del "C:%HOMEPATH%\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup\autoclean-startcleantemp.bat"
	del "C:%HOMEPATH%\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup\autoclean-startcleantemp.bat"

	echo Comand running: echo %workingdir%\autoclean-tron.bat %1 %2 %3 %4>C:\autoclean-trontemp.bat
	echo %workingdir%\autoclean-tron.bat %1 %2 %3 %4>C:\autoclean-trontemp.bat
	echo Command running: reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" /v Shell /t REG_SZ /d "explorer.exe,c:\autoclean-trontemp.bat" /f
	reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" /v Shell /t REG_SZ /d "explorer.exe,c:\autoclean-trontemp.bat" /f
	pause

	bcdedit /set {default} safeboot network

	color 6f
	echo --------------------
	echo Preparing to reboot.
	echo --------------------
	echo,
	echo If tron does not start after reboot,
	echo please launch Tron using autoclean-tron.bat
	echo from the CleanTechTemp directory on the Desktop
	echo,
	pause

	shutdown /r /t 0

Fix Boot Timer scaper

Fix Boot Timer scaper


cls
call "C:\Program Files\Microsoft Visual Studio 12.0\VC\vcvarsall.bat" x86
cl /c /DEBUG ring_allegro.c -I"..\..\libdepwin\allegro\include" -I"..\..\include"
link /DEBUG ring_allegro.obj  ..\..\lib\ring.lib ..\..\libdepwin\allegro\lib\allegro_monolith.lib /DLL /OUT:..\..\bin\ring_allegro.dll /SUBSYSTEM:CONSOLE,"5.01"
del ring_allegro.obj

cls
call ../../src/locatevc.bat
cl /c /DEBUG ring_allegro.c -I"..\..\libdepwin\allegro\include" -I"..\..\include"
link /DEBUG ring_allegro.obj  ..\..\lib\ring.lib ..\..\libdepwin\allegro\lib\allegro_monolith.lib /DLL /OUT:..\..\bin\ring_allegro.dll /SUBSYSTEM:CONSOLE,"5.01"
del ring_allegro.obj

Update RingAllegro - buildvc.bat - use locatevc.bat


set current=%cd%

cd ..\releases\stable\features\
del *.* /q

cd ..\plugins\
del *.* /q

cd..

del *.jar /q

cd %current%

copy ..\releases\preview\features\*.* ..\releases\stable\features\
copy ..\releases\preview\plugins\*.* ..\releases\stable\plugins\
copy ..\releases\preview\*.jar ..\releases\stable\
copy ..\releases\preview\*.xml ..\releases\stable\

fix in script 3

fix in script 3


@echo off
setlocal
cls

git show-branch --list release-*
echo.
SET /P release_branch="Please enter version of release branch: release-"
echo.
echo.
echo -- Step 1:    Run Tests on release-%release_branch% branch --
git checkout release-%release_branch%
call "%M2_HOME%/bin/mvn" test
echo.
echo.
echo -- Step 2:       Change local repository to master branch --
git checkout master
echo.
echo.
echo -- Step 3:       Merge release-%release_branch% to master
git merge --no-ff release-%release_branch%
echo.
echo.
echo -- Step 4:       Create Tag from master with name v%release_branch%
git tag -a v%release_branch% -m "Creating Tag for Release %release_branch%"
echo.
echo.
echo -- Step 5:       Push changes to master branch on GitHub
git push origin master
echo -- Step 6:       Push Release Tag v%release_branch% on GitHub
git push origin v%release_branch%
echo.
echo.
echo -- Step 7:       Change local repository to develop branch --
git checkout develop
echo.
echo.
echo -- Step 8:       Merge release-%release_branch% to develop --
git merge --no-ff release-%release_branch%
echo.
echo.
echo -- Step 9:       Update versions of develop branch to next Snapshot version --
call "%M2_HOME%/bin/mvn" versions:set -DnextSnapshot=true -DprocessAllModules=true -DgenerateBackupPoms=false
echo.
echo.
echo -- Step 10:       Delete local release branch --
git branch -d release-%release_branch%
echo.
echo.
echo -- Step 11:       Commit updated pom files to develop branch
:: commit the pom file with the updated version
git commit -m "changing develop version to new version" *pom.xml
echo.
echo.
echo -- Step 12:       Push changes (POM commit) to GitHub
git push origin develop
echo.
echo.
echo -- Step 13:       Change local repository to tag v%release_branch% branch --
git checkout v%release_branch%
echo.
echo.
echo -- Step 14:       Call Maven deploy for deploying the tagged result to artifactory --
SET /P goal="Please enter maven goal to be executed [install|deploy]?"
IF /I "%goal%" == "y" goto error
call "%M2_HOME%/bin/mvn" %goal%
echo.
echo.
echo -- Step 15:       Change local repository to develop branch --
git checkout develop

@echo off
setlocal
cls

git show-branch --list release-*
echo.
SET /P release_branch="Please enter version of release branch: release-"
echo.
echo.
echo -- Step 1:    Run Tests on release-%release_branch% branch --
git checkout release-%release_branch%
call "%M2_HOME%/bin/mvn" test
echo.
echo.
echo -- Step 2:       Change local repository to master branch --
git checkout master
echo.
echo.
echo -- Step 3:       Merge release-%release_branch% to master
git merge --no-ff release-%release_branch%
echo.
echo.
echo -- Step 4:       Create Tag from master with name v%release_branch%
git tag -a v%release_branch% -m "Creating Tag for Release %release_branch%"
echo.
echo.
echo -- Step 5:       Push changes to master branch on GitHub
git push origin master
echo -- Step 6:       Push Release Tag v%release_branch% on GitHub
git push origin v%release_branch%
echo.
echo.
echo -- Step 7:       Change local repository to develop branch --
git checkout develop
echo.
echo.
echo -- Step 8:       Merge release-%release_branch% to develop --
git merge --no-ff release-%release_branch%
echo.
SET /P handwork="Do you need to do some manual merges [y/n]?"
IF /I "%handwork%" == "y" goto error
echo.
echo.
echo -- Step 9:       Update versions of develop branch to next Snapshot version --
call "%M2_HOME%/bin/mvn" versions:set -DnextSnapshot=true -DprocessAllModules=true -DgenerateBackupPoms=false
echo.
echo.
echo -- Step 10:       Delete local release branch --
git branch -d release-%release_branch%
echo.
echo.
echo -- Step 11:       Commit updated pom files to develop branch
:: commit the pom file with the updated version
git commit -m "changing develop version to new version" *pom.xml
echo.
echo.
echo -- Step 12:       Push changes (POM commit) to GitHub
git push origin develop
echo.
echo.
echo -- Step 13:       Change local repository to tag v%release_branch% branch --
git checkout v%release_branch%
echo.
echo.
echo -- Step 14:       Call Maven deploy for deploying the tagged result to artifactory --
SET /P goal="Please enter maven goal to be executed [install|deploy]?"
IF /I "%goal%" == "y" goto error
call "%M2_HOME%/bin/mvn" %goal%
echo.
echo.
echo -- Step 15:       Change local repository to develop branch --
git checkout develop

:error

update script on dev branch

update script on dev branch


@echo OFF

REM ##############################################################################
REM ##
REM ##  Continuuity Reactor start up script for WINDOWS
REM ##  Copyright 2012-2014 Continuuity,Inc. All Rights Reserved.
REM ##
REM ##############################################################################

SET ORIGPATH=%cd%
SET CONTINUUITY_HOME=%~dp0
SET CONTINUUITY_HOME=%CONTINUUITY_HOME:~0,-5%
SET JAVACMD=%JAVA_HOME%\bin\java.exe

REM Specifies Web App Path
SET WEB_APP_PATH=%CONTINUUITY_HOME%\web-app\local\server\main.js

REM %CONTINUUITY_HOME%
SET CLASSPATH=%CONTINUUITY_HOME%\lib\*;%CONTINUUITY_HOME%\conf\
SET PATH=%PATH%;%CONTINUUITY_HOME%\libexec\bin

cd %CONTINUUITY_HOME%

REM Process command line
IF "%1" == "start" GOTO START
IF "%1" == "stop" GOTO STOP
IF "%1" == "restart" GOTO RESTART
IF "%1" == "status" GOTO STATUS
IF "%1" == "reset" GOTO RESET
GOTO USAGE

:USAGE
echo Usage: %0 {start^|stop^|restart^|status^|reset}
echo Additional options with start, restart:
echo --enable-debug [ ^<port^> ] to connect to a debug port for local reactor (default port is 5005)
GOTO :FINALLY

:RESET
REM checks if there exists a PID that is already running. Alert user but still return success
attrib -h %~dsp0MyProg.pid >NUL
if exist %~dsp0MyProg.pid (
  for /F %%i in (%~dsp0MyProg.pid) do (
    for /F "TOKENS=2" %%b in ('TASKLIST /FI "PID eq %%i"') DO (
      set lastPid=%%b
    )
    if "%lastPid%" == "%%i" (
      echo %0 running as process %%i. Stop it first.
      GOTO :FINALLY
    ) else (
      REM If process not running but pid file exists, delete pid file.
      del %~dsp0MyProg.pid
    )
  )
)
attrib +h %~dsp0MyProg.pid >NUL

REM ask for confirmation from user
set /P answer="This deletes all apps, data and logs. Are you sure you want to proceed? (y/n) " %=%
if NOT "%answer%" == "y" (
  GOTO :FINALLY
)

REM delete logs and data directories
echo Resetting Continuuity Reactor ...
rmdir /S /Q %CONTINUUITY_HOME%\logs %CONTINUUITY_HOME%\data > NUL 2>&1
echo Continuuity Reactor reset successfully.
GOTO :FINALLY

:START
REM Check for 64-bit version of OS. Currently not supporting 32-bit Windows
IF NOT EXIST "%PROGRAMFILES(X86)%" (
  echo 32-bit Windows operating system is currently not supported
  GOTO :FINALLY
)

REM Check for correct setting for JAVA_HOME path
if [%JAVA_HOME%] == [] (
  echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
  echo Please set the JAVA_HOME variable in your environment to match the location of your Java installation.
  GOTO :FINALLY
)

REM Check for Java version
setlocal ENABLEDELAYEDEXPANSION
set /a counter=0
for /f "tokens=* delims= " %%f in ('%JAVACMD% -version 2^>^&1') do @(
  if "!counter!"=="0" set line=%%f
  set /a counter+=1
)
set line=%line:java version "1.=!!%
set line=%line:~0,1%
if NOT "%line%" == "6" (
  if NOT "%line%" == "7" (
    echo ERROR: Java version not supported. Please install Java 6 or 7 - other versions of Java are not yet supported.
    GOTO :FINALLY
  )
)
endlocal

REM Check if Node.js is installed
for %%x in (node.exe) do if [%%~$PATH:x]==[] (
  echo Node.js Continuuity Reactor requires nodeJS but it's either not installed or not in path. Aborting. 1>&2
  GOTO :FINALLY
)

REM Check for Node.js version
setlocal ENABLEDELAYEDEXPANSION
for /f "tokens=* delims= " %%f in ('node -v') do @(
  set line=%%f
)
set line=%line:v=!!%
set line=0.10.1

for /F "delims=. tokens=1,2,3" %%a in ('echo %line%') do (
  if %%a LSS 1 (
    if %%b LSS 9 (
      if %%c LSS 16 (
        echo Node.js version is not supported. The minimum version suported is v0.8.16.
        GOTO :FINALLY
      )
    )
  )
)
endlocal

REM checks if there exists a PID that is already running. Alert user but still return success
attrib -h %~dsp0MyProg.pid >NUL
if exist %~dsp0MyProg.pid (
  for /F %%i in (%~dsp0MyProg.pid) do (
    setlocal ENABLEDELAYEDEXPANSION
    for /F "TOKENS=2" %%b in ('TASKLIST /FI "PID eq %%i"') DO (
      set lastPid=%%b
    )
    if "!lastPid!" == "%%i" (
      echo %0 running as process %%i. Stop it first or use the restart function.
      GOTO :FINALLY
    ) else (
      REM If process not running but pid file exists, delete pid file.
      del %~dsp0MyProg.pid
    )
    endlocal
  )
)
attrib +h %~dsp0MyProg.pid >NUL

REM Check for new version of Reactor
bitsadmin /Transfer NAME http://www.continuuity.com/version %~f0_version.txt > NUL 2>&1
if exist %~f0_version.txt (
  for /f "tokens=* delims= " %%f in (%~f0_version.txt) do (
    SET new_version = %%f
  )
  for /f "tokens=* delims= " %%g in (%~f0\..\..\VERSION) do (
    SET current_version = %%g
  )
  del %~f0_version.txt > NUL 2>&1

  if not "%current_version%" == "%new_version%" (
    echo UPDATE: There is a newer version of Continuuity Developer Suite available.
    echo         Download it from your account: https://accounts.continuuity.com.
  )
)

mkdir %CONTINUUITY_HOME%\logs > NUL 2>&1

REM Log rotation
call:LOG_ROTATE reactor
call:LOG_ROTATE reactor-process
call:LOG_ROTATE reactor-debug

REM check if debugging is enabled
SET DEBUG_OPTIONS=
setlocal ENABLEDELAYEDEXPANSION
IF "%2" == "--enable-debug" (
  IF "%3" == "" (
    set port=5005
  ) ELSE (
    REM check if port is a number
    SET "check="&FOR /f "delims=0123456789" %%i IN ("%3") DO SET check="x"
    IF DEFINED check (
      echo port number must be an integer.
      ENDLOCAL
      GOTO :FINALLY
    )
    REM check if the number is in range
    set port=%3
    IF !port! LSS 1024 (
      echo port number must be between 1024 and 65535.
      ENDLOCAL
      GOTO :FINALLY
    )
    IF !port! GTR 65535 (
      echo port number must be between 1024 and 65535.
      ENDLOCAL
      GOTO :FINALLY
    )
  )
  set DEBUG_OPTIONS="-agentlib:jdwp=transport=dt_socket,address=localhost:!port!,server=y,suspend=n"
)

start /B %JAVACMD% !DEBUG_OPTIONS! -Dhadoop.security.group.mapping=org.apache.hadoop.security.JniBasedUnixGroupsMappingWithFallback -Dhadoop.home.dir=%CONTINUUITY_HOME%\libexec -classpath %CLASSPATH% com.continuuity.SingleNodeMain --web-app-path %WEB_APP_PATH% >> %CONTINUUITY_HOME%\logs\reactor-process.log 2>&1 < NUL
echo Starting Continuuity Reactor ...

for /F "TOKENS=1,2,*" %%a in ('tasklist /FI "IMAGENAME eq java.exe"') DO SET MyPID=%%b
echo %MyPID% > %~dsp0MyProg.pid
SET lastPid=%MyPID%
attrib +h %~dsp0MyProg.pid >NUL

:SearchLogs
findstr /R /C:".*Failed to start server.*" %CONTINUUITY_HOME%\logs\reactor-process.log >NUL 2>&1
if %errorlevel% == 0 GOTO :ServerError

findstr /R /C:".*Continuuity Reactor started successfully.*" %CONTINUUITY_HOME%\logs\reactor-process.log >NUL 2>&1
if not %errorlevel% == 0 GOTO :SearchLogs
if %errorlevel% == 0 GOTO :ServerSuccess
:EndSearchLogs

:ServerError
echo Failed to start, please check logs for more information
GOTO STOP

:ServerSuccess
echo Reactor started succesfully.

IF NOT "!DEBUG_OPTIONS!" == "" (
  echo Remote debugger agent started on port !port!.
)
ENDLOCAL

REM Sleep for 5 seconds to wait for node.Js startup
PING 127.0.0.1 -n 6 > NUL 2>&1

for /F "TOKENS=1,2,*" %%a in ('tasklist /FI "IMAGENAME eq node.exe"') DO SET MyNodePID=%%b
echo %MyNodePID% > %~dsp0MyProgNode.pid
attrib +h %~dsp0MyProgNode.pid >NUL

CALL :NUX
GOTO :FINALLY

:NUX
REM New user experience, enable if it is not enabled already
if not exist %CONTINUUITY_HOME%\.nux_dashboard (
  REM Deploy app
  FOR /F %%i IN ('curl -X POST -sL -w %%{http_code} -H "X-Archive-Name: LogAnalytics.jar" --data-binary @"%CONTINUUITY_HOME%\examples\ResponseCodeAnalytics\target\ResponseCodeAnalytics-1.0.jar" http://127.0.0.1:10000/v2/apps') DO SET RESPONSE=%%i
  REM IF  NOT %RESPONSE% == 200  (GOTO :EOF)
  REM Start flow
  curl -sL -X POST http://127.0.0.1:10000/v2/apps/ResponseCodeAnalytics/flows/LogAnalyticsFlow/start
  REM Start procedure
  curl -sL -X POST http://127.0.0.1:10000/v2/apps/ResponseCodeAnalytics/procedures/StatusCodeProcedure/start
)
GOTO :EOF

:STOP
echo Stopping Continuuity Reactor ...
attrib -h %~dsp0MyProg.pid >NUL
if exist %~dsp0MyProg.pid (
  for /F %%i in (%~dsp0MyProg.pid) do (
    taskkill /F /PID %%i >NUL 2>&1
    del %~dsp0MyProg.pid 1>NUL 2>&1
  )
)

REM Sleep for 5 seconds
PING 127.0.0.1 -n 6 > NUL 2>&1

attrib -h %~dsp0MyProgNode.pid >NUL
if exist %~dsp0MyProgNode.pid (
  for /F %%i in (%~dsp0MyProgNode.pid) do (
    taskkill /F /PID %%i >NUL 2>&1
    del %~dsp0MyProgNode.pid 1>NUL 2>&1
  )
)
GOTO :FINALLY

:STATUS
attrib -h %~dsp0MyProg.pid >NUL
if NOT exist %~dsp0MyProg.pid (
  echo %0 is not running
) else (
for /F %%i in (%~dsp0MyProg.pid) do (
  setlocal ENABLEDELAYEDEXPANSION
  for /F "TOKENS=2" %%b in ('TASKLIST /FI "PID eq %%i"') DO (
    set lastPid=%%b
  )
  if "!lastPid!" == "%%i" (
    echo %0 running as process !lastPid!
  ) else (
    echo pidfile exists but process does not appear to be running
  )
  endlocal
 )
)
attrib +h %~dsp0MyProg.pid >NUL
GOTO :FINALLY

:RESTART
CALL :STOP
GOTO :START

:FINALLY
cd %ORIGPATH%
GOTO:EOF

:LOG_ROTATE
setlocal ENABLEDELAYEDEXPANSION
set extension=%1.log
for /F "TOKENS=*" %%b in ('dir  /a-d %CONTINUUITY_HOME%\logs 2^>NUL ^| find /c "%extension%" 2^>NUL') DO (
  set /a num=%%b
  FOR /L %%i IN (!num!,-1,1) DO (
    set /a prev_num=%%i+1
    rename %CONTINUUITY_HOME%\logs\%extension%.%%i %extension%.!prev_num! >NUL 2>NUL
  )
  rename %CONTINUUITY_HOME%\logs\%extension% %extension%.1 >NUL 2>NUL
)
endlocal

Add back EOF

Add back EOF


Create PuppetAgentWindowsInit.bat

Create PuppetAgentWindowsInit.bat


@echo off

rem Displayed buttons.
set MB_ABORTRETRYIGNORE=2
set MB_CANCELTRYCONTINUE=6
set MB_OK=0
set MB_OKCANCEL=1
set MB_RETRYCANCEL=5
set MB_YESNO=4
set MB_YESNOCANCEL=3

rem Icon.
set MB_ICONEXCLAMATION=48
set MB_ICONWARNING=48
set MB_ICONINFORMATION=64
set MB_ICONASTERISK=64
set MB_ICONQUESTION=32
set MB_ICONSTOP=16
set MB_ICONERROR=16
set MB_ICONHAND=16

rem Default button.
set MB_DEFBUTTON1=0
set MB_DEFBUTTON2=256
set MB_DEFBUTTON3=512
set MB_DEFBUTTON4=768

rem Other options.
set MB_SETFOREGROUND=65536

rem Result ERRORLEVELs.
set IDOK=1
set IDCANCEL=2
set IDRETRY=4
set IDABORT=3
set IDIGNORE=5
set IDYES=6
set IDNO=7
set IDTRYAGAIN=10
set IDCONTINUE=11

rem ----------------------------------------------------------------------------

setlocal ENABLEDELAYEDEXPANSION

set /a type=!MB_YESNO! + !MB_ICONQUESTION! + !MB_DEFBUTTON2!
messagebox "Enough message boxes?" "A serious question" !type!
rem The following is less error-prone than 'if errorlevel "!IDNO!"'.
if "!ERRORLEVEL!"=="!IDYES!" (
    echo No more message boxes for you, then.
    pause > nul
) else (
    set /a type=!MB_OK! + !MB_ICONINFORMATION!
    messagebox "Okay, here's another one^!" "MessageBox the Second" !type!
)

@echo off

rem Displayed buttons.
set MB_ABORTRETRYIGNORE=2
set MB_CANCELTRYCONTINUE=6
set MB_OK=0
set MB_OKCANCEL=1
set MB_RETRYCANCEL=5
set MB_YESNO=4
set MB_YESNOCANCEL=3

rem Icon.
set MB_ICONEXCLAMATION=48
set MB_ICONWARNING=48
set MB_ICONINFORMATION=64
set MB_ICONASTERISK=64
set MB_ICONQUESTION=32
set MB_ICONSTOP=16
set MB_ICONERROR=16
set MB_ICONHAND=16

rem Default button.
set MB_DEFBUTTON1=0
set MB_DEFBUTTON2=256
set MB_DEFBUTTON3=512
set MB_DEFBUTTON4=768

rem Other options.
set MB_SETFOREGROUND=65536

rem Result ERRORLEVELs.
set IDOK=1
set IDCANCEL=2
set IDRETRY=4
set IDABORT=3
set IDIGNORE=5
set IDYES=6
set IDNO=7
set IDTRYAGAIN=10
set IDCONTINUE=11

rem ----------------------------------------------------------------------------

rem See http://ss64.com/nt/delayedexpansion.html
setlocal ENABLEDELAYEDEXPANSION

set /a type=!MB_YESNO! + !MB_ICONQUESTION! + !MB_DEFBUTTON2!
messagebox "Enough message boxes?" "A serious question" !type!
rem The following is less error-prone than 'if errorlevel "!IDYES!"'.
if "!ERRORLEVEL!"=="!IDYES!" (
    echo No message boxes for you, then.
    pause > nul
) else (
    set /a type=!MB_OK! + !MB_ICONINFORMATION!
    messagebox "Okay, here's another one^!" "MessageBox the Second" !type!
)

Improve comments and messages

demo.cmd: Improve comments and messages


rem @echo off

set hydro_basins_name=hybas_au_lev03_v1c
set base=..\data\OpenStreetMaps\australia-oceania-latest
set basin=5030073410
set poly=..\output\hybas_au_lev03_v1c_5030073410.poly

set pbf=%base%.osm.pbf

set base_name=%base%-%basin%
set current_basin="-B=%poly%"
rem set base_name=%base%
rem set current_basin=

set o5m=%base_name%.o5m
set osm_water=%base_name%-water.osm
set pbf_water=%base_name%-water.osm.pbf
set db_water=%base_name%-water.db

cd ..\output

rem convert basin SHP to POLY
rem python ..\src\ogr2poly.py ..\data\HydroBASINS\without_lakes\%hydro_basins_name%.shp -f HYBAS_ID -b 0.05 -s 0.01

rem filter by basin
..\bin\osmconvert %pbf% --complex-ways %current_basin% -o=%o5m%

rem or: include all region
rem ..\bin\osmconvert %pbf% --complex-ways -o=%o5m%

rem filter water
..\bin\osmfilter %o5m% --parameter-file=..\config\water.osmfilter.params > "%osm_water%"

rem convert back to PBF
..\bin\osmconvert "%osm_water%" -o="%pbf_water%"

rem convert to SpatiaLite
copy /Y ..\config\osmconf.ini .\osmconf.ini
del /Q "%db_water%"

ogr2ogr -f SQLite -dsco OGR_SQLITE_SYNCHRONOUS=OFF -dsco SPATIALITE=YES "%db_water%" "%pbf_water%"

rem convert to KML
ogr2ogr -sql "select * from lines" -f "KML" "%base_name%-water-lines.kml" "%db_water%"
ogr2ogr -sql "select * from multipolygons" -f "KML" "%base_name%-water-multipolygons.kml" "%db_water%"

rem convert to SHP
ogr2ogr -sql "select * from lines" -f "ESRI Shapefile" "%base_name%-water-lines.shp" "%db_water%"
ogr2ogr -sql "select * from multipolygons" -f "ESRI Shapefile" "%base_name%-water-multipolygons.shp" "%db_water%"

add script to convert OSM data to KML

add script to convert OSM data to KML