if "%1"=="" goto default_value_python:
set pythonexe="%1"
%pythonexe% setup.py write_version
goto custom_python:

:default_value_python:
set pythonexe="c:\Python35_x64\python"
:custom_python:
%pythonexe% -u setup.py build_script
if %errorlevel% neq 0 exit /b %errorlevel%

if "%1"=="" goto default_value_python:
set pythonexe="%1"
%pythonexe% setup.py write_version
goto custom_python:

:default_value_python:
set pythonexe="c:\Python36_x64\python"
:custom_python:
%pythonexe% -u setup.py build_script
if %errorlevel% neq 0 exit /b %errorlevel%

update script

update script


rem Display settings at startup
set CATALINA_OPTS=%CATALINA_OPTS% -XX:+PrintCommandLineFlags

rem Discourage address map swapping by setting Xms and Xmx to the same value
rem http://confluence.atlassian.com/display/DOC/Garbage+Collector+Performance+Issues

rem Prevent "Unrecognized Name" SSL warning
set CATALINA_OPTS=%CATALINA_OPTS% -Djsse.enableSNIExtension=false

rem Checking if anyother garbage collectors have been defined. If no other garbage
rem collector is present, default to G1GC
rem List of options taken from:
rem http://www.oracle.com/webfolder/technetwork/tutorials/obe/java/gc01/index.html
rem Help with findstr and envir vars:
rem https://stackoverflow.com/questions/5491383/find-out-whether-an-environment-variable-contains-a-substring
echo.%CATALINA_OPTS%|findstr /C:"-XX:+UseSerialGC" /C:"-XX:+UseParallelGC" /C:"-XX:ParallelGCThreads" /C:"-XX:+UseParallelOldGC" /C:"-XX:+UseConcMarkSweepGC" /C:"-XX:+UseParNewGC" /C:"-XX:+CMSParallelRemarkEnabled" /C:"-XX:CMSInitiatingOccupancyFraction" /C:"-XX:+UseCMSInitiatingOccupancyOnly" /C:"-XX:+UseG1GC" >nul 2>&1
if not errorlevel 1 (
    echo Already declared a garbage collector
) else (
    set CATALINA_OPTS=%CATALINA_OPTS% -XX:+UseG1GC
)

rem Check if heap space allocation is already set
rem If it is, leave it be
echo.%CATALINA_OPTS%|findstr /C:"-Xms"
if not errorlevel 1 (
    echo Already declared a garbage collector
) else (
    set CATALINA_OPTS=%CATALINA_OPTS% -Xms64m
)

echo.%CATALINA_OPTS%|findstr /C:"-Xmx"
if not errorlevel 1 (
    echo Already declared a garbage collector
) else (
    set CATALINA_OPTS=%CATALINA_OPTS% -Xmx512m
)

rem We need to send a 'portal.home' system property to the JVM;  use the value of PORTAL_HOME, if
rem present, or fall back to a value calculated from %CATALINA_BASE%
if not "%PORTAL_HOME%" == "" goto gotPortalHome
set "PORTAL_HOME=%CATALINA_BASE%\portal"
:gotPortalHome
set CATALINA_OPTS=%CATALINA_OPTS% -Dportal.home=%PORTAL_HOME%

rem Display settings at startup
set CATALINA_OPTS=%CATALINA_OPTS% -XX:+PrintCommandLineFlags

rem Discourage address map swapping by setting Xms and Xmx to the same value
rem http://confluence.atlassian.com/display/DOC/Garbage+Collector+Performance+Issues

rem Prevent "Unrecognized Name" SSL warning
set CATALINA_OPTS=%CATALINA_OPTS% -Djsse.enableSNIExtension=false

rem Checking if anyother garbage collectors have been defined. If no other garbage
rem collector is present, default to G1GC
rem List of options taken from:
rem http://www.oracle.com/webfolder/technetwork/tutorials/obe/java/gc01/index.html
rem Help with findstr and envir vars:
rem https://stackoverflow.com/questions/5491383/find-out-whether-an-environment-variable-contains-a-substring
echo.%CATALINA_OPTS%|findstr /C:"-XX:+UseSerialGC" /C:"-XX:+UseParallelGC" /C:"-XX:ParallelGCThreads" /C:"-XX:+UseParallelOldGC" /C:"-XX:+UseConcMarkSweepGC" /C:"-XX:+UseParNewGC" /C:"-XX:+CMSParallelRemarkEnabled" /C:"-XX:CMSInitiatingOccupancyFraction" /C:"-XX:+UseCMSInitiatingOccupancyOnly" /C:"-XX:+UseG1GC" >nul 2>&1
if not errorlevel 1 (
    echo Already declared a garbage collector
) else (
    set CATALINA_OPTS=%CATALINA_OPTS% -XX:+UseG1GC
)

rem Check if heap space allocation is already set
rem If it is, leave it be
echo.%CATALINA_OPTS%|findstr /C:"-Xms"
if not errorlevel 1 (
    echo Already declared a minimum value for heap space
) else (
    set CATALINA_OPTS=%CATALINA_OPTS% -Xms64m
)

echo.%CATALINA_OPTS%|findstr /C:"-Xmx"
if not errorlevel 1 (
    echo Already declared a maximum value for heap space
) else (
    set CATALINA_OPTS=%CATALINA_OPTS% -Xmx512m
)

rem We need to send a 'portal.home' system property to the JVM;  use the value of PORTAL_HOME, if
rem present, or fall back to a value calculated from %CATALINA_BASE%
if not "%PORTAL_HOME%" == "" goto gotPortalHome
set "PORTAL_HOME=%CATALINA_BASE%\portal"
:gotPortalHome
set CATALINA_OPTS=%CATALINA_OPTS% -Dportal.home=%PORTAL_HOME%

Edit echo commands

Edit echo commands

changed "garbage collector" to "min/max value for heap space"


@echo on

set "VSCMD_START_DIR=%CD%"
call "vcvars64.bat"
mkdir build
cd build
cmake .. -G"Visual Studio 15 2017 Win64" %CMAKE_OPT% -DCMAKE_CXX_FLAGS="-D_CRT_SECURE_NO_DEPRECATE /MT /EHsc %CFLAGS%"
if %ERRORLEVEL% neq 0 exit /B %ERRORLEVEL%
devenv /build Release aff3ct.sln
if %ERRORLEVEL% neq 0 exit /B %ERRORLEVEL%

mkdir %NAME%
mkdir %NAME%\bin\
mkdir %NAME%\lib\
mkdir %NAME%\inc\

 copy bin\Release\aff3ct.exe %NAME%\bin\
 copy lib\Release\aff3ct.lib %NAME%\lib\
xcopy ..\src\*               %NAME%\inc\ /s /e

move %NAME% ..\

@echo on
VS_PATH

set "VSCMD_START_DIR=%CD%"
call "%VS_PATH%\VC\Auxiliary\Build\vcvars64.bat"

mkdir build
cd build
cmake .. -G"Visual Studio 15 2017 Win64" %CMAKE_OPT% -DCMAKE_CXX_FLAGS="-D_CRT_SECURE_NO_DEPRECATE /MT /EHsc %CFLAGS%"
if %ERRORLEVEL% neq 0 exit /B %ERRORLEVEL%
devenv /build Release aff3ct.sln
if %ERRORLEVEL% neq 0 exit /B %ERRORLEVEL%

mkdir %NAME%
mkdir %NAME%\bin\
mkdir %NAME%\lib\
mkdir %NAME%\inc\

 copy bin\Release\aff3ct.exe %NAME%\bin\
 copy lib\Release\aff3ct.lib %NAME%\lib\
xcopy ..\src\*               %NAME%\inc\ /s /e

move %NAME% ..\

CI: add full the path to vcvars64.bat script.


@echo on

set "VSCMD_START_DIR=%CD%"
call "%VS_PATH%\VC\Auxiliary\Build\vcvars64.bat"

mkdir build
cd build
cmake .. -G"Visual Studio 15 2017 Win64" %CMAKE_OPT% -DCMAKE_CXX_FLAGS="-D_CRT_SECURE_NO_DEPRECATE /MT /EHsc %CFLAGS%"
if %ERRORLEVEL% neq 0 exit /B %ERRORLEVEL%
rem devenv /build Release aff3ct.sln
msbuild aff3ct.sln /maxcpucount:%THREADS% /t:Build /p:Configuration=Release
if %ERRORLEVEL% neq 0 exit /B %ERRORLEVEL%

mkdir %NAME%
mkdir %NAME%\bin\
mkdir %NAME%\lib\
mkdir %NAME%\inc\

 copy bin\Release\aff3ct.exe %NAME%\bin\
 copy lib\Release\aff3ct.lib %NAME%\lib\
xcopy ..\src\*               %NAME%\inc\ /s /e

move %NAME% ..\

@echo on

set "VSCMD_START_DIR=%CD%"
call "%VS_PATH%\VC\Auxiliary\Build\vcvars64.bat"

mkdir build
cd build
cmake .. -G"Visual Studio 15 2017 Win64" %CMAKE_OPT% -DCMAKE_CXX_FLAGS="-D_CRT_SECURE_NO_DEPRECATE /MT /EHsc /MP%THREADS% %CFLAGS%"
if %ERRORLEVEL% neq 0 exit /B %ERRORLEVEL%
rem devenv /build Release aff3ct.sln
msbuild aff3ct.sln /t:Build /p:Configuration=Release
if %ERRORLEVEL% neq 0 exit /B %ERRORLEVEL%

mkdir %NAME%
mkdir %NAME%\bin\
mkdir %NAME%\lib\
mkdir %NAME%\inc\

 copy bin\Release\aff3ct.exe %NAME%\bin\
 copy lib\Release\aff3ct.lib %NAME%\lib\
xcopy ..\src\*               %NAME%\inc\ /s /e

move %NAME% ..\

fix multithreaded compilation on MSVC.

CI: fix multithreaded compilation on MSVC.


echo OFF

DEFAULT_INSTALL_TARGETS=python-parse python-pkgtk

set ANACONDA_FLAGS="-c conda-forge "%ANACONDA_FLAGS%
if "%ANACONDA_CHANNEL%" == "" (
  set ANACONDA_CHANNEL="statiskit"
) else (
  echo "Using anaconda channel: "%ANACONDA_CHANNEL%
set ANACONDA_FLAGS="-c statiskit "%ANACONDA_FLAGS%
)

if "%INSTALL_TARGETS%" == "" (
  set INSTALL_TARGETS=%DEFAULT_INSTALL_TARGETS%
) else (
  echo "Targets to install: "%INSTALL_TARGETS%
)

echo ON

for %%x in (%INSTALL_TARGETS%) do (
  conda install %%x --use-local -c %ANACONDA_CHANNEL% %ANACONDA_FLAGG%
  if %errorlevel% neq 0 (
    exit /b %errorlevel%
  )
)

echo OFF

set DEFAULT_INSTALL_TARGETS=python-parse python-pkgtk

set ANACONDA_FLAGS="-c conda-forge "%ANACONDA_FLAGS%
if "%ANACONDA_CHANNEL%" == "" (
  set ANACONDA_CHANNEL="statiskit"
) else (
  echo "Using anaconda channel: "%ANACONDA_CHANNEL%
set ANACONDA_FLAGS="-c statiskit "%ANACONDA_FLAGS%
)

if "%INSTALL_TARGETS%" == "" (
  set INSTALL_TARGETS=%DEFAULT_INSTALL_TARGETS%
) else (
  echo "Targets to install: "%INSTALL_TARGETS%
)

echo ON

for %%x in (%INSTALL_TARGETS%) do (
  conda install %%x --use-local -c %ANACONDA_CHANNEL% %ANACONDA_FLAGG%
  if %errorlevel% neq 0 (
    exit /b %errorlevel%
  )
)

Update Travis CI

Update Travis CI


set conda_env="fc_env"
set copy_dir="FreeCAD_Conda_Build"

mkdir %copy_dir%

conda create ^
 -p %conda_env% ^
 freecad libredwg calculix gitpython gmsh netgen=6.2.1808 ^
 numpy matplotlib-base scipy=1.4.1 sympy pandas six ^
 pyyaml opencamlib ifcopenshell ^
 freecad.asm3 libredwg pycollada ^
 lxml xlutils olefile requests ^
 blinker opencv qt.py nine docutils ^
 --copy ^
 -c freecad/label/dev ^
 -c conda-forge ^
 -y

REM Copy Conda's Python and (U)CRT to FreeCAD/bin
robocopy %conda_env%\DLLs %copy_dir%\bin\DLLs /S /MT:%NUMBER_OF_PROCESSORS% > nul
robocopy %conda_env%\Lib %copy_dir%\bin\Lib /XD __pycache__ /S /MT:%NUMBER_OF_PROCESSORS% > nul
robocopy %conda_env%\Scripts %copy_dir%\bin\Scripts /S /MT:%NUMBER_OF_PROCESSORS% > nul
robocopy %conda_env%\ python*.* %copy_dir%\bin\ /XF *.pdb /MT:%NUMBER_OF_PROCESSORS% > nul
robocopy %conda_env%\ msvc*.* %copy_dir%\bin\ /XF *.pdb /MT:%NUMBER_OF_PROCESSORS% > nul
robocopy %conda_env%\ ucrt*.* %copy_dir%\bin\ /XF *.pdb /MT:%NUMBER_OF_PROCESSORS% > nul
REM Copy gmsh and calculix
robocopy %conda_env%\Library\bin %copy_dir%\bin\ ccx.exe /MT:%NUMBER_OF_PROCESSORS% > nul
robocopy %conda_env%\Library\bin %copy_dir%\bin\ gmsh.exe /MT:%NUMBER_OF_PROCESSORS% > nul
robocopy %conda_env%\Library\mingw-w64\bin * %copy_dir%\bin\ /MT:%NUMBER_OF_PROCESSORS% > nul
REM Copy Conda's QT5/plugins to FreeCAD/bin
robocopy %conda_env%\Library\plugins %copy_dir%\bin\ /S /MT:%NUMBER_OF_PROCESSORS% > nul
robocopy %conda_env%\Library\bin\ QtWebEngineProces* %copy_dir%\bin\ /MT:%NUMBER_OF_PROCESSORS% > nul
robocopy %conda_env%\Library\resources %copy_dir%\resources /MT:%NUMBER_OF_PROCESSORS% > nul
robocopy %conda_env%\Library\translations %copy_dir%\translations /MT:%NUMBER_OF_PROCESSORS% > nul
echo [Paths] > %copy_dir%\bin\qt.conf
echo Prefix =.. >> "%copy_dir%\bin\qt.conf"
REM get all the dependency .dlls
robocopy %conda_env%\Library\bin *.dll %copy_dir%\bin /XF *.pdb /XF api*.* /MT:%NUMBER_OF_PROCESSORS% > nul
REM Copy FreeCAD build
robocopy %conda_env%\Library\bin FreeCAD* %copy_dir%\bin /XF *.pdb /MT:%NUMBER_OF_PROCESSORS% > nul
robocopy %conda_env%\Library\data %copy_dir%\data /XF *.txt /S /MT:%NUMBER_OF_PROCESSORS% > nul
REM robocopy %conda_env%\Library\doc\ *.html %copy_dir%\doc MT:%NUMBER_OF_PROCESSORS% > nul
robocopy %conda_env%\Library\Ext %copy_dir%\Ext /S /XD __pycache__ /MT:%NUMBER_OF_PROCESSORS% > nul
robocopy %conda_env%\Library\lib %copy_dir%\lib /XF *.lib /XF *.prl /XF *.sh /MT:%NUMBER_OF_PROCESSORS% > nul
robocopy %conda_env%\Library\Mod %copy_dir%\Mod /S /XD __pycache__ /MT:%NUMBER_OF_PROCESSORS% > nul
rename %copy_dir%\bin\Lib\ssl.py ssl-orig.py
copy ssl-patch.py %copy_dir%\bin\Lib\ssl.py
%copy_dir%\bin\python.exe -c "import FreeCAD;print((FreeCAD.Version()[0]) +'.' + (FreeCAD.Version()[1]) +'.' + (FreeCAD.Version()[2]))" > tempver.txt
set /p fcver=<tempver.txt
echo %fcver%
cd %copy_dir%\..
ren %copy_dir% FreeCAD_%fcver:~0,10%-Win-Conda_vc14.x-x86_64
"%ProgramFiles%\7-Zip\7z.exe" a -t7z -mmt=%NUMBER_OF_PROCESSORS% FreeCAD_%fcver:~0,10%-Win-Conda_vc14.x-x86_64.7z FreeCAD_%fcver:~0,10%-Win-Conda_vc14.x-x86_64\
certutil -hashfile "FreeCAD_%fcver:~0,10%-Win-Conda_vc14.x-x86_64.7z" SHA256 > "FreeCAD_%fcver:~0,10%-Win-Conda_vc14.x-x86_64.7z"-SHA256.txt
echo  %date%-%time% >>"FreeCAD_%fcver:~0,10%-Win-Conda_vc14.x-x86_64.7z"-SHA256.txt

set conda_env="fc_env"
set copy_dir="FreeCAD_Conda_Build"

mkdir %copy_dir%

conda create ^
 -p %conda_env% ^
 freecad libredwg calculix gitpython gmsh netgen=6.2.1808 ^
 numpy matplotlib-base scipy=1.4.1 sympy pandas six ^
 pyyaml opencamlib ifcopenshell ^
 freecad.asm3 libredwg pycollada ^
 lxml xlutils olefile requests ^
 blinker opencv qt.py nine docutils ^
 --copy ^
 -c freecad/label/dev ^
 -c conda-forge ^
 -y

REM Copy Conda's Python and (U)CRT to FreeCAD/bin
robocopy %conda_env%\DLLs %copy_dir%\bin\DLLs /S /MT:%NUMBER_OF_PROCESSORS% > nul
robocopy %conda_env%\Lib %copy_dir%\bin\Lib /XD __pycache__ /S /MT:%NUMBER_OF_PROCESSORS% > nul
robocopy %conda_env%\Scripts %copy_dir%\bin\Scripts /S /MT:%NUMBER_OF_PROCESSORS% > nul
robocopy %conda_env%\ python*.* %copy_dir%\bin\ /XF *.pdb /MT:%NUMBER_OF_PROCESSORS% > nul
robocopy %conda_env%\ msvc*.* %copy_dir%\bin\ /XF *.pdb /MT:%NUMBER_OF_PROCESSORS% > nul
robocopy %conda_env%\ ucrt*.* %copy_dir%\bin\ /XF *.pdb /MT:%NUMBER_OF_PROCESSORS% > nul
REM Copy gmsh and calculix
robocopy %conda_env%\Library\bin %copy_dir%\bin\ ccx.exe /MT:%NUMBER_OF_PROCESSORS% > nul
robocopy %conda_env%\Library\bin %copy_dir%\bin\ gmsh.exe /MT:%NUMBER_OF_PROCESSORS% > nul
robocopy %conda_env%\Library\mingw-w64\bin * %copy_dir%\bin\ /MT:%NUMBER_OF_PROCESSORS% > nul
REM Copy Conda's QT5/plugins to FreeCAD/bin
robocopy %conda_env%\Library\plugins %copy_dir%\bin\ /S /MT:%NUMBER_OF_PROCESSORS% > nul
robocopy %conda_env%\Library\bin\ QtWebEngineProces* %copy_dir%\bin\ /MT:%NUMBER_OF_PROCESSORS% > nul
robocopy %conda_env%\Library\resources %copy_dir%\resources /MT:%NUMBER_OF_PROCESSORS% > nul
robocopy %conda_env%\Library\translations %copy_dir%\translations /MT:%NUMBER_OF_PROCESSORS% > nul
echo [Paths] > %copy_dir%\bin\qt.conf
echo Prefix =.. >> "%copy_dir%\bin\qt.conf"
REM get all the dependency .dlls
robocopy %conda_env%\Library\bin *.dll %copy_dir%\bin /XF *.pdb /XF api*.* /MT:%NUMBER_OF_PROCESSORS% > nul
REM Copy FreeCAD build
robocopy %conda_env%\Library\bin FreeCAD* %copy_dir%\bin /XF *.pdb /MT:%NUMBER_OF_PROCESSORS% > nul
robocopy %conda_env%\Library\data %copy_dir%\data /XF *.txt /S /MT:%NUMBER_OF_PROCESSORS% > nul
REM robocopy %conda_env%\Library\doc\ *.html %copy_dir%\doc MT:%NUMBER_OF_PROCESSORS% > nul
robocopy %conda_env%\Library\Ext %copy_dir%\Ext /S /XD __pycache__ /MT:%NUMBER_OF_PROCESSORS% > nul
robocopy %conda_env%\Library\lib %copy_dir%\lib /XF *.lib /XF *.prl /XF *.sh /MT:%NUMBER_OF_PROCESSORS% > nul
robocopy %conda_env%\Library\Mod %copy_dir%\Mod /S /XD __pycache__ /MT:%NUMBER_OF_PROCESSORS% > nul
rename %copy_dir%\bin\Lib\ssl.py ssl-orig.py
copy ssl-patch.py %copy_dir%\bin\Lib\ssl.py
%copy_dir%\bin\python.exe -c "import FreeCAD;print((FreeCAD.Version()[0]) +'.' + (FreeCAD.Version()[1]) +'.' + (FreeCAD.Version()[2]))" > tempver.txt
set /p fcver=<tempver.txt
echo %fcver%
cd %copy_dir%\..
ren %copy_dir% FreeCAD_%fcver:~0,10%-Win-Conda_vc14.x-x86_64
"%ProgramFiles%\7-Zip\7z.exe" a -t7z -mmt=%NUMBER_OF_PROCESSORS% FreeCAD_%fcver:~0,10%-Win-Conda_vc14.x-x86_64.7z FreeCAD_%fcver:~0,10%-Win-Conda_vc14.x-x86_64\ -bb
certutil -hashfile "FreeCAD_%fcver:~0,10%-Win-Conda_vc14.x-x86_64.7z" SHA256 > "FreeCAD_%fcver:~0,10%-Win-Conda_vc14.x-x86_64.7z"-SHA256.txt
echo  %date%-%time% >>"FreeCAD_%fcver:~0,10%-Win-Conda_vc14.x-x86_64.7z"-SHA256.txt

Add logging to avoid timeout on Travis

Add logging to avoid timeout on Travis


cl /c /Ox /Os /GL /GF /GS- /Wall /EHsc ../src/msspi.cpp
link /DLL /LTCG msspi.obj crypt32.lib /OUT:msspi.dll

cl /c /Ox /Os /GL /GF /GS- /Wall /EHsc ../src/msspi.cpp
link /DLL /LTCG msspi.obj crypt32.lib advapi32.lib /OUT:msspi.dll

fix windows build

fix windows build


start nodemon SimulationManager/server.js
start nodemon FloodSim/server.js
start nodemon CriticalObjectSim/server.js
start nodemon ElectricalNetworkSim/server.js
start nodemon HazardousObjectSim/server.js
start nodemon RoadSim/server.js
start nodemon CommunicationSim/server.js

Add script to start all services at once.


echo OFF

set UPLOAD_TARGETS=python-parse python-pkgtk

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

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

set ANACONDA_UPLOAD_FLAGS=-c conda-forge %ANACONDA_UPLOAD_FLAGS%
if "%ANACONDA_CHANNEL%" == "" (
    set ANACONDA_CHANNEL=statiskit
) else (
    echo Using anaconda channel: %ANACONDA_CHANNEL%
    set ANACONDA_UPLOAD_FLAGS=-c statiskit "%ANACONDA_UPLOAD_FLAGS%
)

echo ON

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

echo OFF

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

echo ON

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

for %%x in (%UPLOAD_TARGETS%) do (
  set UPLOAD_TARGET=%%x
::  for /f %%i in ('conda build %%x -c %ANACONDA_CHANNEL% %ANACONDA_UPLOAD_FLAGS% --output') do (set UPLOAD_FILE=%%i)
::    anaconda upload --user %ANACONDA_CHANNEL% %UPLOAD_FILE%
::    if %errorlevel% neq 0 (
::      echo "upload failed"
::    )
)

anaconda logout

echo OFF

set UPLOAD_TARGETS=python-parse python-pkgtk

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

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

set ANACONDA_UPLOAD_FLAGS=-c conda-forge %ANACONDA_UPLOAD_FLAGS%
if "%ANACONDA_CHANNEL%" == "" (
    set ANACONDA_CHANNEL=statiskit
) else (
    echo Using anaconda channel: %ANACONDA_CHANNEL%
    set ANACONDA_UPLOAD_FLAGS=-c statiskit "%ANACONDA_UPLOAD_FLAGS%
)

echo ON

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

echo OFF

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

echo ON

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

for %%x in (%UPLOAD_TARGETS%) do (
  set UPLOAD_TARGET=%%x
)

anaconda logout

Update upload.bat

Update upload.bat


@ECHO OFF
set GO_ROOT=%~dp0\..\..\..
set JRUBY_BASE=%GO_ROOT%\tools\jruby-1.7.11
set SERVER_ROOT=%GO_ROOT%\server
set RAILS_ROOT=%SERVER_ROOT%\webapp\WEB-INF\rails.new
set GEM_HOME=%RAILS_ROOT%\vendor\bundle\jruby\1.9
set GEM_PATH=%JRUBY_BASE%\lib\ruby\gems\shared;%GEM_HOME%
set PATH=%JRUBY_BASE%\bin;%PATH%

set JRUBY_OPTS='-J-XX:+TieredCompilation -J-XX:TieredStopAtLevel=1 -J-Djruby.compile.invokedynamic=false -J-Djruby.compile.mode=OFF'
%JRUBY_BASE%\bin\jruby.bat %*

@ECHO OFF
set GO_ROOT=%~dp0\..\..\..
set JRUBY_BASE=%GO_ROOT%\tools\jruby-1.7.11
set SERVER_ROOT=%GO_ROOT%\server
set RAILS_ROOT=%SERVER_ROOT%\webapp\WEB-INF\rails.new
set GEM_HOME=%RAILS_ROOT%\vendor\bundle\jruby\1.9
set GEM_PATH=%JRUBY_BASE%\lib\ruby\gems\shared;%GEM_HOME%
set PATH=%JRUBY_BASE%\bin;%PATH%

set JRUBY_OPTS='-J-XX:+TieredCompilation -J-XX:TieredStopAtLevel=1 -J-Djruby.compile.invokedynamic=false -J-Djruby.compile.mode=OFF %JRUBY_OPTS%'
%JRUBY_BASE%\bin\jruby.bat %*

Append to JRUBY_OPTS instead of overriding it


setlocal
set MYDIRBLOCK=%~dp0
call %MYDIRBLOCK%..\..\..\config_env_base.bat

%HIDEWINDOW% h

set EPICS_CAS_INTF_ADDR_LIST=127.0.0.1
set EPICS_CAS_BEACON_ADDR_LIST=127.255.255.255

set PYTHONUNBUFFERED=TRUE

%PYTHON% %MYDIRBLOCK%ArchiverAccess\archiver_access.py

@echo off
setlocal
set MYDIRBLOCK=%~dp0
call %MYDIRBLOCK%..\..\..\config_env_base.bat

%HIDEWINDOW% h

set EPICS_CAS_INTF_ADDR_LIST=127.0.0.1
set EPICS_CAS_BEACON_ADDR_LIST=127.255.255.255

set PYTHONUNBUFFERED=TRUE

%PYTHONW% %MYDIRBLOCK%ArchiverAccess\archiver_access.py

Put back echo and python

Put back echo and python


@set SRC=src
@set DIST=dist

@if not exist %DIST% mkdir %DIST%
@if not exist %DIST%\lib mkdir %DIST%\lib
@if not exist %DIST%\shaders mkdir %DIST%\shaders

@rem build
@pushd %SRC%
@call tsc
@popd

@rem copy web client files

@call cp water.html %DIST%\index.html > nul
@call cp %SRC%\lib\*.js %DIST%\lib\ > nul
@call cp %SRC%\renderer\shaders\* %DIST%\shaders\ > nul

@rem copy server files
@call echo a | xcopy server\* %DIST%\ > nul
@pushd %DIST% && npm install && @popd

@set SRC=src
@set DIST=dist

@if not exist %DIST% mkdir %DIST%
@if not exist %DIST%\lib mkdir %DIST%\lib
@if not exist %DIST%\shaders mkdir %DIST%\shaders

@rem build
@pushd %SRC%
@call dir /b /s *.ts > src.txt
@call tsc @src.txt --target ES5 --sourceMap --out ../dist/app.js
@call rm src.txt
@popd

@rem copy web client files

@call cp water.html %DIST%\index.html > nul
@call cp %SRC%\lib\*.js %DIST%\lib\ > nul
@call cp %SRC%\renderer\shaders\* %DIST%\shaders\ > nul

@rem copy server files
@call echo a | xcopy server\* %DIST%\ > nul
@pushd %DIST% && npm install && @popd

build on windows

build on windows


@echo off

if '%1'=='/?' goto help
if '%1'=='-help' goto help
if '%1'=='-h' goto help

powershell -NoProfile -ExecutionPolicy Bypass -Command "& '%~dp0\psake.ps1' %*; if ($psake.build_success -eq $false) { exit 1 } else { exit 0 }"
exit /B %errorlevel%

:help
powershell -NoProfile -ExecutionPolicy Bypass -Command "& '%~dp0\psake.ps1' -help"

add .cmd runner for psake

add .cmd runner for psake


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

:: race.bash tests the standard library under the race detector.
:: http://golang.org/doc/articles/race_detector.html

@echo off

setlocal

if exist make.bat goto ok
echo race.bat must be run from go\src
:: cannot exit: would kill parent command interpreter
goto end
:ok

call make.bat --dist-tool >NUL
if errorlevel 1 goto fail
.\cmd\dist\dist env -wp >env.bat
if errorlevel 1 goto fail
call env.bat
del env.bat

if %GOHOSTARCH% == amd64 goto continue
echo Race detector is only supported on windows/amd64.
goto fail

:continue
call make.bat --no-banner --no-local
if %GOBUILDFAIL%==1 goto end
echo # go install -race std
go install -race std
if errorlevel 1 goto fail
echo # go test -race -short -std
go test -race -short std
if errorlevel 1 goto fail
echo # go test -race -run=nothingplease -bench=.* -benchtime=.1s -cpu=4 std
go test -race -run=nothingplease -bench=.* -benchtime=.1s -cpu=4 std
if errorlevel 1 goto fail
goto succ

:fail
set GOBUILDFAIL=1
echo Fail.
goto end

:succ
echo All tests passed.

:end

add race.bat

src: add race.bat

R=golang-dev, dave, alex.brainman
CC=golang-dev
https://codereview.appspot.com/7133064


@echo off

if not exist tmp mkdir tmp

set /p NAME="Username: "
/* TODO: Make files with newlines. This would add a newline. echo %NAME% > tmp/user-name.txt */
echo|set /p=%NAME% > tmp/user-name.txt

set /p FULL_NAME="Full name: "
echo|set /p=%FULL_NAME% > tmp/full-name.txt

set /p DOMAIN="Domain: "
echo|set /p=%DOMAIN% > tmp/domain.txt

@echo off

if not exist tmp mkdir tmp

set /p USER_NAME="User name: "
:: TODO: Make files with newlines. This would add a newline.
::echo %USER_NAME% > tmp/user-name.txt
echo|set /p=%USER_NAME% > tmp/user-name.txt

set /p FULL_NAME="Full name: "
echo|set /p=%FULL_NAME% > tmp/full-name.txt

set /p DOMAIN="Domain: "
echo|set /p=%DOMAIN% > tmp/domain.txt

vagrant up

fix comment syntax, add vagrant up command


@echo off
REM Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
REM for details. All rights reserved. Use of this source code is governed by a
REM BSD-style license that can be found in the LICENSE file.

setlocal
rem Handle the case where dart-sdk/bin has been symlinked to.
set DIR_NAME_WITH_SLASH=%~dp0
set DIR_NAME=%DIR_NAME_WITH_SLASH:~0,-1%%
call :follow_links "%DIR_NAME%", RETURNED_BIN_DIR
rem Get rid of surrounding quotes.
for %%i in ("%RETURNED_BIN_DIR%") do set BIN_DIR=%%~fi

rem Get absolute full name for SDK_DIR.
for %%i in ("%BIN_DIR%\..\") do set SDK_DIR=%%~fi

rem Remove trailing backslash if there is one
IF %SDK_DIR:~-1%==\ set SDK_DIR=%SDK_DIR:~0,-1%

set DART2JS=%SDK_DIR%\lib\_internal\compiler\implementation\dart2js.dart
set DART=%BIN_DIR%\dart
set SNAPSHOT=%BIN_DIR%\snapshots\dart2js.dart.snapshot

set EXTRA_OPTIONS=
set EXTRA_VM_OPTIONS=

if _%DART2JS_DEVELOPER_MODE%_ == _1_ (
  set EXTRA_VM_OPTIONS=%EXTRA_VM_OPTIONS% --checked
)

if exist "%SNAPSHOT%" (
  set EXTRA_OPTIONS=%EXTRA_OPTIONS% "--library-root=%SDK_DIR%"
)

rem See comments regarding options below in dart2js shell script.
set EXTRA_VM_OPTIONS=%EXTRA_VM_OPTIONS% --heap_growth_rate=512

rem We allow extra vm options to be passed in through an environment variable.
if not _%DART_VM_OPTIONS%_ == __ (
  set EXTRA_VM_OPTIONS=%EXTRA_VM_OPTIONS% %DART_VM_OPTIONS%
)

if exist "%SNAPSHOT%" (
  "%DART%" %EXTRA_VM_OPTIONS% "%SNAPSHOT%" %EXTRA_OPTIONS% %*
) else (
  "%DART%" %EXTRA_VM_OPTIONS% "%DART2JS%" %EXTRA_OPTIONS% %*
)

endlocal

exit /b %errorlevel%

:follow_links
setlocal
for %%i in (%1) do set result=%%~fi
set current=
for /f "tokens=2 delims=[]" %%i in ('dir /a:l ^"%~dp1^" 2^>nul ^
                                     ^| find ">     %~n1 ["') do (
  set current=%%i
)
if not "%current%"=="" call :follow_links "%current%", result
endlocal & set %~2=%result%
goto :eof

:end

@echo off
REM Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
REM for details. All rights reserved. Use of this source code is governed by a
REM BSD-style license that can be found in the LICENSE file.

setlocal
rem Handle the case where dart-sdk/bin has been symlinked to.
set DIR_NAME_WITH_SLASH=%~dp0
set DIR_NAME=%DIR_NAME_WITH_SLASH:~0,-1%%
call :follow_links "%DIR_NAME%", RETURNED_BIN_DIR
rem Get rid of surrounding quotes.
for %%i in ("%RETURNED_BIN_DIR%") do set BIN_DIR=%%~fi

rem Get absolute full name for SDK_DIR.
for %%i in ("%BIN_DIR%\..\") do set SDK_DIR=%%~fi

rem Remove trailing backslash if there is one
IF %SDK_DIR:~-1%==\ set SDK_DIR=%SDK_DIR:~0,-1%

set DART2JS=%SDK_DIR%\lib\_internal\compiler\implementation\dart2js.dart
set DART=%BIN_DIR%\dart
set SNAPSHOT=%BIN_DIR%\snapshots\dart2js.dart.snapshot

set EXTRA_OPTIONS=
set EXTRA_VM_OPTIONS=

if _%DART2JS_DEVELOPER_MODE%_ == _1_ (
  set EXTRA_VM_OPTIONS=%EXTRA_VM_OPTIONS% --checked
)

if exist "%SNAPSHOT%" (
  set EXTRA_OPTIONS=%EXTRA_OPTIONS% "--library-root=%SDK_DIR%"
)

rem See comments regarding options below in dart2js shell script.
set EXTRA_VM_OPTIONS=%EXTRA_VM_OPTIONS% --heap_growth_rate=512

rem We allow extra vm options to be passed in through an environment variable.
if not _%DART_VM_OPTIONS%_ == __ (
  set EXTRA_VM_OPTIONS=%EXTRA_VM_OPTIONS% %DART_VM_OPTIONS%
)

if exist "%SNAPSHOT%" (
  "%DART%" %EXTRA_VM_OPTIONS% "%SNAPSHOT%" %EXTRA_OPTIONS% %*
) else (
  "%DART%" %EXTRA_VM_OPTIONS% "%DART2JS%" %EXTRA_OPTIONS% %*
)

endlocal

exit /b %errorlevel%

:follow_links
setlocal
for %%i in (%1) do set result=%%~fi
set current=
for /f "usebackq tokens=2 delims=[]" %%i in (`dir /a:l "%~dp1" 2^>nul ^
                                             ^| find ">     %~n1 ["`) do (
  set current=%%i
)
if not "%current%"=="" call :follow_links "%current%", result
endlocal & set %~2=%result%
goto :eof

:end

Fix dart2js bat to support paths with parenthesis in
Review URL: https://chromiumcodereview.appspot.com//57483004

git-svn-id: c93d8a2297af3b929165606efe145742a534bc71@29799 260f80e4-7a28-3924-810f-c04153c831b5


:: Start with bootstrap
cd tools\build
dir .
CALL .\bootstrap.bat
IF errorlevel 1 exit 1
dir .
CALL .\bootstrap.bat mingw
IF errorlevel 1 exit 1
dir .
CALL .\b2.exe install toolset=gcc --prefix=..\..\b2_for_mingw
cd ..\..
dir .
set PATH=%PATH%;.\b2_for_mingw\bin

:: Build step
CALL b2 install ^
    --build-dir=buildboost ^
    --prefix=%LIBRARY_PREFIX% ^
    toolset=gcc ^
    address-model=%ARCH% ^
    variant=release ^
    threading=multi ^
    link=shared ^
    -j%CPU_COUNT% ^
    -s ZLIB_INCLUDE="%LIBRARY_INC%" ^
    -s ZLIB_LIBPATH="%LIBRARY_LIB%" ^
    --with-python
IF errorlevel 1 exit 1

:: Install fix-up for a non version-specific boost include
move %LIBRARY_INC%\boost-1_61\boost %LIBRARY_INC%
IF errorlevel 1 exit 1

:: Move dll's to LIBRARY_BIN
move %LIBRARY_LIB%\*vc%LIB_VER%-mt-1_61.dll "%LIBRARY_BIN%"
IF errorlevel 1 exit 1
Status API Training Shop Blog About

:: Start with bootstrap
cd tools\build
dir .
CALL .\bootstrap.bat
IF errorlevel 1 exit 1
dir .
CALL .\bootstrap.bat mingw
IF errorlevel 1 exit 1
dir .
CALL .\b2.exe install toolset=gcc --prefix=%LIBRARY_PREFIX%
cd ..\..
dir .
set PATH=%PATH%;%LIBRARY_BIN%

:: Build step
CALL b2 install ^
    --build-dir=buildboost ^
    --prefix=%LIBRARY_PREFIX% ^
    toolset=gcc ^
    address-model=%ARCH% ^
    variant=release ^
    threading=multi ^
    link=shared ^
    -j%CPU_COUNT% ^
    -s ZLIB_INCLUDE="%LIBRARY_INC%" ^
    -s ZLIB_LIBPATH="%LIBRARY_LIB%" ^
    --with-python
IF errorlevel 1 exit 1

:: Install fix-up for a non version-specific boost include
move %LIBRARY_INC%\boost-1_61\boost %LIBRARY_INC%
IF errorlevel 1 exit 1

:: Move dll's to LIBRARY_BIN
move %LIBRARY_LIB%\*vc%LIB_VER%-mt-1_61.dll "%LIBRARY_BIN%"
IF errorlevel 1 exit 1
Status API Training Shop Blog About

Update bld.bat

Update bld.bat


:: builds
set PATH=C:\Python36-x64;C:\projects\;%PATH%

if "%PLATFORM%" == "mingw53_32" (
	call %~dp0\build-mingw.bat || exit /B 1
) else (
	:: prepare vcvarsall
	if "%APPVEYOR_BUILD_WORKER_IMAGE%" == "Visual Studio 2017" (
		set VC_DIR="C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvarsall.bat"
	)
	if "%APPVEYOR_BUILD_WORKER_IMAGE%" == "Visual Studio 2015" (
		set VC_DIR="C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat"
	)

	:: winrt: skip tests
	echo %PLATFORM% | findstr /C:"winrt" > nul && (
		set NO_TESTS=true
	)

	:: find the varsall parameters
	if "%PLATFORM%" == "msvc2017_64" set VC_VARSALL=amd64
	if "%PLATFORM%" == "winrt_x64_msvc2017" set VC_VARSALL=amd64_x86
	if "%PLATFORM%" == "winrt_x86_msvc2017" set VC_VARSALL=amd64_x86
	if "%PLATFORM%" == "winrt_armv7_msvc2017" set VC_VARSALL=amd64_x86
	if "%PLATFORM%" == "msvc2015_64" set VC_VARSALL=amd64
	if "%PLATFORM%" == "msvc2015" set VC_VARSALL=amd64_x86
	if "%PLATFORM%" == "static" (
		set VC_VARSALL=amd64
		set NO_TESTS=true
		echo CONFIG += static_host_build >> .qmake.conf
	)

	:: build
	call %~dp0\build-msvc.bat || exit /B 1
)

Create build.bat

Create build.bat


@echo off
setlocal EnableDelayedExpansion

set "WD=%__CD__%"
if NOT EXIST "%WD%msys-2.0.dll" set "WD=%~dp0usr\bin\"
set "LOGINSHELL=bash"
set /a msys2_shiftCounter=0

rem To activate windows native symlinks uncomment next line
rem set MSYS=winsymlinks:nativestrict

rem Set debugging program for errors
rem set MSYS=error_start:%WD%../../mingw64/bin/qtcreator.exe^|-debug^|^<process-id^>

rem To export full current PATH from environment into MSYS2 use '-use-full-path' parameter
rem or uncomment next line
rem set MSYS2_PATH_TYPE=inherit

:checkparams
rem Help option
if "x%~1" == "x-help" (
  call :printhelp "%~nx0"
  exit /b %ERRORLEVEL%
)
if "x%~1" == "x--help" (
  call :printhelp "%~nx0"
  exit /b %ERRORLEVEL%
)
if "x%~1" == "x-?" (
  call :printhelp "%~nx0"
  exit /b %ERRORLEVEL%
)
if "x%~1" == "x/?" (
  call :printhelp "%~nx0"
  exit /b %ERRORLEVEL%
)
rem Shell types
if "x%~1" == "x-msys" shift& set /a msys2_shiftCounter+=1& set MSYSTEM=MSYS& goto :checkparams
if "x%~1" == "x-msys2" shift& set /a msys2_shiftCounter+=1& set MSYSTEM=MSYS& goto :checkparams
if "x%~1" == "x-mingw32" shift& set /a msys2_shiftCounter+=1& set MSYSTEM=MINGW32& goto :checkparams
if "x%~1" == "x-mingw64" shift& set /a msys2_shiftCounter+=1& set MSYSTEM=MINGW64& goto :checkparams
if "x%~1" == "x-mingw" shift& set /a msys2_shiftCounter+=1& (if exist "%WD%..\..\mingw64" (set MSYSTEM=MINGW64) else (set MSYSTEM=MINGW32))& goto :checkparams
rem Console types
if "x%~1" == "x-mintty" shift& set /a msys2_shiftCounter+=1& set MSYSCON=mintty.exe& goto :checkparams
if "x%~1" == "x-conemu" shift& set /a msys2_shiftCounter+=1& set MSYSCON=conemu& goto :checkparams
if "x%~1" == "x-defterm" shift& set /a msys2_shiftCounter+=1& set MSYSCON=defterm& goto :checkparams
rem Other parameters
if "x%~1" == "x-full-path" shift& set /a msys2_shiftCounter+=1& set MSYS2_PATH_TYPE=inherit& goto :checkparams
if "x%~1" == "x-use-full-path" shift& set /a msys2_shiftCounter+=1& set MSYS2_PATH_TYPE=inherit& goto :checkparams
if "x%~1" == "x-here" shift& set /a msys2_shiftCounter+=1& set CHERE_INVOKING=enabled_from_arguments& goto :checkparams
if "x%~1" == "x-where" (
  if "x%~2" == "x" (
    echo Working directory is not specified for -where parameter. 1>&2
    exit /b 2
  )
  cd /d "%~2" || (
    echo Cannot set specified working diretory "%~2". 1>&2
    exit /b 2
  )
  set CHERE_INVOKING=enabled_from_arguments

  rem Ensure parentheses in argument do not interfere with FOR IN loop below.
  set msys2_arg="%~2"
  call :substituteparens msys2_arg
  call :removequotes msys2_arg

  rem Increment msys2_shiftCounter by number of words in argument (as cmd.exe saw it).
  rem (Note that this form of FOR IN loop uses same delimiters as parameters.)
  for %%a in (!msys2_arg!) do set /a msys2_shiftCounter+=1
)& shift& shift& set /a msys2_shiftCounter+=1& goto :checkparams
if "x%~1" == "x-no-start" shift& set /a msys2_shiftCounter+=1& set MSYS2_NOSTART=yes& goto :checkparams
if "x%~1" == "x-shell" (
  if "x%~2" == "x" (
    echo Shell not specified for -shell parameter. 1>&2
    exit /b 2
  )
  set LOGINSHELL="%~2"
  call :removequotes LOGINSHELL

  set msys2_arg="%~2"
  call :substituteparens msys2_arg
  call :removequotes msys2_arg
  for %%a in (!msys2_arg!) do set /a msys2_shiftCounter+=1
)& shift& shift& set /a msys2_shiftCounter+=1& goto :checkparams

rem Collect remaining command line arguments to be passed to shell
if %msys2_shiftCounter% equ 0 set SHELL_ARGS=%* & goto cleanvars
set msys2_full_cmd=%*
for /f "tokens=%msys2_shiftCounter%,* delims=,;=	 " %%i in ("!msys2_full_cmd!") do set SHELL_ARGS=%%j

:cleanvars
set msys2_arg=
set msys2_shiftCounter=
set msys2_full_cmd=

rem Setup proper title
if "%MSYSTEM%" == "MINGW32" (
  set "CONTITLE=MinGW x32"
) else if "%MSYSTEM%" == "MINGW64" (
  set "CONTITLE=MinGW x64"
) else (
  set "CONTITLE=MSYS2 MSYS"
)

if "x%MSYSCON%" == "xmintty.exe" goto startmintty
if "x%MSYSCON%" == "xconemu" goto startconemu
if "x%MSYSCON%" == "xdefterm" goto startsh

if NOT EXIST "%WD%mintty.exe" goto startsh
set MSYSCON=mintty.exe
:startmintty
if not defined MSYS2_NOSTART (
  start "%CONTITLE%" "%WD%mintty" -i /msys2.ico -t "%CONTITLE%" "/usr/bin/%LOGINSHELL%" --login !SHELL_ARGS!
) else (
  "%WD%mintty" -i /msys2.ico -t "%CONTITLE%" "/usr/bin/%LOGINSHELL%" --login !SHELL_ARGS!
)
exit /b %ERRORLEVEL%

:startconemu
call :conemudetect || (
  echo ConEmu not found. Exiting. 1>&2
  exit /b 1
)
if not defined MSYS2_NOSTART (
  start "%CONTITLE%" "%ComEmuCommand%" /Here /Icon "%WD%..\..\msys2.ico" /cmd "%WD%\%LOGINSHELL%" --login !SHELL_ARGS!
) else (
  "%ComEmuCommand%" /Here /Icon "%WD%..\..\msys2.ico" /cmd "%WD%\%LOGINSHELL%" --login !SHELL_ARGS!
)
exit /b %ERRORLEVEL%

:startsh
set MSYSCON=
if not defined MSYS2_NOSTART (
  start "%CONTITLE%" "%WD%\%LOGINSHELL%" --login !SHELL_ARGS!
) else (
  "%WD%\%LOGINSHELL%" --login !SHELL_ARGS!
)
exit /b %ERRORLEVEL%

:EOF
exit /b 0

:conemudetect
set ComEmuCommand=
if defined ConEmuDir (
  if exist "%ConEmuDir%\ConEmu64.exe" (
    set "ComEmuCommand=%ConEmuDir%\ConEmu64.exe"
    set MSYSCON=conemu64.exe
  ) else if exist "%ConEmuDir%\ConEmu.exe" (
    set "ComEmuCommand=%ConEmuDir%\ConEmu.exe"
    set MSYSCON=conemu.exe
  )
)
if not defined ComEmuCommand (
  ConEmu64.exe /Exit 2>nul && (
    set ComEmuCommand=ConEmu64.exe
    set MSYSCON=conemu64.exe
  ) || (
    ConEmu.exe /Exit 2>nul && (
      set ComEmuCommand=ConEmu.exe
      set MSYSCON=conemu.exe
    )
  )
)
if not defined ComEmuCommand (
  FOR /F "tokens=*" %%A IN ('reg.exe QUERY "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\ConEmu64.exe" /ve 2^>nul ^| find "REG_SZ"') DO (
    set "ComEmuCommand=%%A"
  )
  if defined ComEmuCommand (
    call set "ComEmuCommand=%%ComEmuCommand:*REG_SZ    =%%"
    set MSYSCON=conemu64.exe
  ) else (
    FOR /F "tokens=*" %%A IN ('reg.exe QUERY "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\ConEmu.exe" /ve 2^>nul ^| find "REG_SZ"') DO (
      set "ComEmuCommand=%%A"
    )
    if defined ComEmuCommand (
      call set "ComEmuCommand=%%ComEmuCommand:*REG_SZ    =%%"
      set MSYSCON=conemu.exe
    )
  )
)
if not defined ComEmuCommand exit /b 2
exit /b 0

:printhelp
echo Usage:
echo     %~1 [options] [login shell parameters]
echo.
echo Options:
echo     -mingw32 ^| -mingw64 ^| -msys[2]   Set shell type
echo     -defterm ^| -mintty ^| -conemu     Set terminal type
echo     -here                            Use current directory as working
echo                                      directory
echo     -where DIRECTORY                 Use specified DIRECTORY as working
echo                                      directory
echo     -[use-]full-path                 Use full current PATH variable
echo                                      instead of trimming to minimal
echo     -no-start                        Do not use "start" command and
echo                                      return login shell resulting
echo                                      errorcode as this batch file
echo                                      resulting errorcode
echo     -shell SHELL                     Set login shell
echo     -help ^| --help ^| -? ^| /?         Display this help and exit
echo.
echo Any parameter that cannot be treated as valid option and all
echo following parameters are passed as login shell command parameters.
echo.
exit /b 0

:removequotes
FOR /F "delims=" %%A IN ('echo %%%1%%') DO set %1=%%~A
GOTO :eof

:substituteparens
SETLOCAL
FOR /F "delims=" %%A IN ('echo %%%1%%') DO (
    set value=%%A
    set value=!value:^(=x!
    set value=!value:^)=x!
)
ENDLOCAL & set %1=%value%
GOTO :eof

@echo off
setlocal EnableDelayedExpansion

set "WD=%__CD__%"
if NOT EXIST "%WD%msys-2.0.dll" set "WD=%~dp0usr\bin\"
set "LOGINSHELL=bash"
set /a msys2_shiftCounter=0

rem To activate windows native symlinks uncomment next line
rem set MSYS=winsymlinks:nativestrict

rem Set debugging program for errors
rem set MSYS=error_start:%WD%../../mingw64/bin/qtcreator.exe^|-debug^|^<process-id^>

rem To export full current PATH from environment into MSYS2 use '-use-full-path' parameter
rem or uncomment next line
rem set MSYS2_PATH_TYPE=inherit

:checkparams
rem Help option
if "x%~1" == "x-help" (
  call :printhelp "%~nx0"
  exit /b %ERRORLEVEL%
)
if "x%~1" == "x--help" (
  call :printhelp "%~nx0"
  exit /b %ERRORLEVEL%
)
if "x%~1" == "x-?" (
  call :printhelp "%~nx0"
  exit /b %ERRORLEVEL%
)
if "x%~1" == "x/?" (
  call :printhelp "%~nx0"
  exit /b %ERRORLEVEL%
)
rem Shell types
if "x%~1" == "x-msys" shift& set /a msys2_shiftCounter+=1& set MSYSTEM=MSYS& goto :checkparams
if "x%~1" == "x-msys2" shift& set /a msys2_shiftCounter+=1& set MSYSTEM=MSYS& goto :checkparams
if "x%~1" == "x-mingw32" shift& set /a msys2_shiftCounter+=1& set MSYSTEM=MINGW32& goto :checkparams
if "x%~1" == "x-mingw64" shift& set /a msys2_shiftCounter+=1& set MSYSTEM=MINGW64& goto :checkparams
if "x%~1" == "x-mingw" shift& set /a msys2_shiftCounter+=1& (if exist "%WD%..\..\mingw64" (set MSYSTEM=MINGW64) else (set MSYSTEM=MINGW32))& goto :checkparams
rem Console types
if "x%~1" == "x-mintty" shift& set /a msys2_shiftCounter+=1& set MSYSCON=mintty.exe& goto :checkparams
if "x%~1" == "x-conemu" shift& set /a msys2_shiftCounter+=1& set MSYSCON=conemu& goto :checkparams
if "x%~1" == "x-defterm" shift& set /a msys2_shiftCounter+=1& set MSYSCON=defterm& goto :checkparams
rem Other parameters
if "x%~1" == "x-full-path" shift& set /a msys2_shiftCounter+=1& set MSYS2_PATH_TYPE=inherit& goto :checkparams
if "x%~1" == "x-use-full-path" shift& set /a msys2_shiftCounter+=1& set MSYS2_PATH_TYPE=inherit& goto :checkparams
if "x%~1" == "x-here" shift& set /a msys2_shiftCounter+=1& set CHERE_INVOKING=enabled_from_arguments& goto :checkparams
if "x%~1" == "x-where" (
  if "x%~2" == "x" (
    echo Working directory is not specified for -where parameter. 1>&2
    exit /b 2
  )
  cd /d "%~2" || (
    echo Cannot set specified working diretory "%~2". 1>&2
    exit /b 2
  )
  set CHERE_INVOKING=enabled_from_arguments

  rem Ensure parentheses in argument do not interfere with FOR IN loop below.
  set msys2_arg="%~2"
  call :substituteparens msys2_arg
  call :removequotes msys2_arg

  rem Increment msys2_shiftCounter by number of words in argument (as cmd.exe saw it).
  rem (Note that this form of FOR IN loop uses same delimiters as parameters.)
  for %%a in (!msys2_arg!) do set /a msys2_shiftCounter+=1
)& shift& shift& set /a msys2_shiftCounter+=1& goto :checkparams
if "x%~1" == "x-no-start" shift& set /a msys2_shiftCounter+=1& set MSYS2_NOSTART=yes& goto :checkparams
if "x%~1" == "x-shell" (
  if "x%~2" == "x" (
    echo Shell not specified for -shell parameter. 1>&2
    exit /b 2
  )
  set LOGINSHELL="%~2"
  call :removequotes LOGINSHELL

  set msys2_arg="%~2"
  call :substituteparens msys2_arg
  call :removequotes msys2_arg
  for %%a in (!msys2_arg!) do set /a msys2_shiftCounter+=1
)& shift& shift& set /a msys2_shiftCounter+=1& goto :checkparams

rem Collect remaining command line arguments to be passed to shell
if %msys2_shiftCounter% equ 0 set SHELL_ARGS=%* & goto cleanvars
set msys2_full_cmd=%*
for /f "tokens=%msys2_shiftCounter%,* delims=,;=	 " %%i in ("!msys2_full_cmd!") do set SHELL_ARGS=%%j

:cleanvars
set msys2_arg=
set msys2_shiftCounter=
set msys2_full_cmd=

rem Setup proper title and icon
if "%MSYSTEM%" == "MINGW32" (
  set "CONTITLE=MinGW x32"
  set "CONICON=mingw32.ico"
) else if "%MSYSTEM%" == "MINGW64" (
  set "CONTITLE=MinGW x64"
  set "CONICON=mingw64.ico"
) else (
  set "CONTITLE=MSYS2 MSYS"
  set "CONICON=msys2.ico"
)

if "x%MSYSCON%" == "xmintty.exe" goto startmintty
if "x%MSYSCON%" == "xconemu" goto startconemu
if "x%MSYSCON%" == "xdefterm" goto startsh

if NOT EXIST "%WD%mintty.exe" goto startsh
set MSYSCON=mintty.exe
:startmintty
if not defined MSYS2_NOSTART (
  start "%CONTITLE%" "%WD%mintty" -i "/%CONICON%" -t "%CONTITLE%" "/usr/bin/%LOGINSHELL%" --login !SHELL_ARGS!
) else (
  "%WD%mintty" -i "/%CONICON%" -t "%CONTITLE%" "/usr/bin/%LOGINSHELL%" --login !SHELL_ARGS!
)
exit /b %ERRORLEVEL%

:startconemu
call :conemudetect || (
  echo ConEmu not found. Exiting. 1>&2
  exit /b 1
)
if not defined MSYS2_NOSTART (
  start "%CONTITLE%" "%ComEmuCommand%" /Here /Icon "%WD%..\..\%CONICON%" /cmd "%WD%\%LOGINSHELL%" --login !SHELL_ARGS!
) else (
  "%ComEmuCommand%" /Here /Icon "%WD%..\..\%CONICON%" /cmd "%WD%\%LOGINSHELL%" --login !SHELL_ARGS!
)
exit /b %ERRORLEVEL%

:startsh
set MSYSCON=
if not defined MSYS2_NOSTART (
  start "%CONTITLE%" "%WD%\%LOGINSHELL%" --login !SHELL_ARGS!
) else (
  "%WD%\%LOGINSHELL%" --login !SHELL_ARGS!
)
exit /b %ERRORLEVEL%

:EOF
exit /b 0

:conemudetect
set ComEmuCommand=
if defined ConEmuDir (
  if exist "%ConEmuDir%\ConEmu64.exe" (
    set "ComEmuCommand=%ConEmuDir%\ConEmu64.exe"
    set MSYSCON=conemu64.exe
  ) else if exist "%ConEmuDir%\ConEmu.exe" (
    set "ComEmuCommand=%ConEmuDir%\ConEmu.exe"
    set MSYSCON=conemu.exe
  )
)
if not defined ComEmuCommand (
  ConEmu64.exe /Exit 2>nul && (
    set ComEmuCommand=ConEmu64.exe
    set MSYSCON=conemu64.exe
  ) || (
    ConEmu.exe /Exit 2>nul && (
      set ComEmuCommand=ConEmu.exe
      set MSYSCON=conemu.exe
    )
  )
)
if not defined ComEmuCommand (
  FOR /F "tokens=*" %%A IN ('reg.exe QUERY "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\ConEmu64.exe" /ve 2^>nul ^| find "REG_SZ"') DO (
    set "ComEmuCommand=%%A"
  )
  if defined ComEmuCommand (
    call set "ComEmuCommand=%%ComEmuCommand:*REG_SZ    =%%"
    set MSYSCON=conemu64.exe
  ) else (
    FOR /F "tokens=*" %%A IN ('reg.exe QUERY "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\ConEmu.exe" /ve 2^>nul ^| find "REG_SZ"') DO (
      set "ComEmuCommand=%%A"
    )
    if defined ComEmuCommand (
      call set "ComEmuCommand=%%ComEmuCommand:*REG_SZ    =%%"
      set MSYSCON=conemu.exe
    )
  )
)
if not defined ComEmuCommand exit /b 2
exit /b 0

:printhelp
echo Usage:
echo     %~1 [options] [login shell parameters]
echo.
echo Options:
echo     -mingw32 ^| -mingw64 ^| -msys[2]   Set shell type
echo     -defterm ^| -mintty ^| -conemu     Set terminal type
echo     -here                            Use current directory as working
echo                                      directory
echo     -where DIRECTORY                 Use specified DIRECTORY as working
echo                                      directory
echo     -[use-]full-path                 Use full current PATH variable
echo                                      instead of trimming to minimal
echo     -no-start                        Do not use "start" command and
echo                                      return login shell resulting
echo                                      errorcode as this batch file
echo                                      resulting errorcode
echo     -shell SHELL                     Set login shell
echo     -help ^| --help ^| -? ^| /?         Display this help and exit
echo.
echo Any parameter that cannot be treated as valid option and all
echo following parameters are passed as login shell command parameters.
echo.
exit /b 0

:removequotes
FOR /F "delims=" %%A IN ('echo %%%1%%') DO set %1=%%~A
GOTO :eof

:substituteparens
SETLOCAL
FOR /F "delims=" %%A IN ('echo %%%1%%') DO (
    set value=%%A
    set value=!value:^(=x!
    set value=!value:^)=x!
)
ENDLOCAL & set %1=%value%
GOTO :eof

use matching icon for console

filesystem: use matching icon for console

Helps identifying window thumbnails when switching between MSYS and MINGW64 consoles


mklink %USERPROFILE%\.vimrc %USERPROFILE%\dotfiles\.vimrc
mklink %USERPROFILE%\.gvimrc %USERPROFILE%\dotfiles\.gvimrc
mklink %USERPROFILE%\.gitignore %USERPROFILE%\dotfiles\.gitignore
mklink %USERPROFILE%\.gitconfig %USERPROFILE%\dotfiles\.gitconfig
mklink /d %USERPROFILE%\.vim %USERPROFILE%\dotfiles\.vim

pause

add setting for windows

add setting for windows


@ECHO OFF
SETLOCAL

SET build_dir=build
SET src_dir=src
SET obj_dir=%build_dir%\obj

SET cc=clang
SET cflags=-Wall -Wextra -Wno-deprecated-declarations -pedantic -Werror -std=c11 -Os

RMDIR /S /Q %build_dir%
MKDIR %obj_dir%

%cc% %cflags%  -iquote%src_dir% -c %src_dir%\ciny.c -o %obj_dir%\ciny.o -v
IF "%ERRORLEVEL%" NEQ "0" GOTO end

:end
ENDLOCAL
EXIT /B %ERRORLEVEL%

add windows build bat file

add windows build bat file


@setlocal
@SET PROMPT=$$$S

pushd "%~dp0"

if exist "%~dp0Misc\version.cmd" call "%~dp0Misc\version.cmd"

if exist goarch.txt for /F %%I in (goarch.txt) do set "GOARCH=%%I"
if "%GOARCH%" == "" for /F "delims=/ tokens=2" %%I in ('go version') do set "GOARCH=%%I"

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

goto build

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

:build
        for /F %%I IN ('dir /s /b /aa *.go') do go fmt "%%I" & attrib -A "%%I"
        powershell -ExecutionPolicy RemoteSigned "cd '%~dp0main' ; . '%~dp0main\makesyso.ps1'"
        for /F "delims=" %%V in ('git log -1 --date^=short --pretty^=format:"-X main.stamp=%%ad -X main.commit=%%H"') do go build -o nyagos.exe -ldflags "%%V %X_VERSION%" .\main
        goto end

:fmt
        for /F %%I IN ('dir /s /b /aa *.go') do go fmt "%%I" & attrib -A "%%I"
        goto end

:status
        nyagos -e "print(nyagos.version or 'Snapshot on '..nyagos.stamp)"
        goto end

:clean
        for %%I in (nyagos.exe nyagos.syso version.now) do if exist %%I del %%I
        for %%I in (alias commands completion conio dos history interpreter lua main) do (cd "%%I" & go clean & cd ..)
        for /R %%I in (*~ *.bak) do if exist %%I del %%I
        goto end

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

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

:package
        for /F %%I in ('nyagos -e "print(nyagos.version or (string.gsub(nyagos.stamp,[[/]],[[]])))"') do set VERSION=%%I
        zip -9 "nyagos-%VERSION%-%GOARCH%.zip" nyagos.exe lua53.dll nyole.dll nyagos.lua .nyagos specialfolders.js lnk.js makeicon.cmd nyagos.d\*.lua nyagos.d\catalog\*.lua license.txt readme_ja.md readme.md Doc\*.md
        goto end

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

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

:icon
        makeicon.cmd
        goto end

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

@setlocal
@SET PROMPT=$$$S

pushd "%~dp0"

if exist "%~dp0Misc\version.cmd" call "%~dp0Misc\version.cmd"

if exist goarch.txt for /F %%I in (goarch.txt) do set "GOARCH=%%I"
if "%GOARCH%" == "" for /F "delims=/ tokens=2" %%I in ('go version') do set "GOARCH=%%I"

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

goto build

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

:build
        for /F %%I IN ('dir /s /b /aa *.go') do go fmt "%%I" & attrib -A "%%I"
        powershell -ExecutionPolicy RemoteSigned "cd '%~dp0main' ; . '%~dp0main\makesyso.ps1'"
        for /F "delims=" %%V in ('git log -1 --date^=short --pretty^=format:"-X main.stamp=%%ad -X main.commit=%%H"') do go build -o nyagos.exe -ldflags "%%V %X_VERSION%" .\main
        goto end

:fmt
        for /F %%I IN ('dir /s /b /aa *.go') do go fmt "%%I" & attrib -A "%%I"
        goto end

:status
        nyagos -e "print(nyagos.version or 'Snapshot on '..nyagos.stamp)"
        goto end

:clean
        for %%I in (nyagos.exe nyagos.syso version.now) do if exist %%I del %%I
        for %%I in (alias commands completion conio dos history interpreter lua main) do (cd "%%I" & go clean & cd ..)
        for /R %%I in (*~ *.bak) do if exist %%I del %%I
        goto end

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

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

:package
        for /F %%I in ('nyagos -e "print(nyagos.version or (string.gsub(nyagos.stamp,[[/]],[[]])))"') do set VERSION=%%I
        zip -9 "nyagos-%VERSION%-%GOARCH%.zip" nyagos.exe lua53.dll nyole.dll nyagos.lua .nyagos specialfolders.js lnk.js makeicon.cmd nyagos.d\*.lua nyagos.d\catalog\*.lua license.txt readme_ja.md readme.md Doc\*.md
        goto end

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

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

:icon
        makeicon.cmd
        goto end

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

Add `make get`: `go get -u github.com/mattn/go-isatty`


@echo off

.\packages\coveralls.io.1.3.4\tools\coveralls.net.exe --opencover .\Artefacts\Coverage\output.xml

IF "%SONARQUBE_NEMO_TOKEN%" == "" goto TheEnd

IF "%appveyor_build_version%" == "" set appveyor_build_version=1.0.0

.\tools\sonarqube\runner\MSBuild.SonarQube.Runner.exe begin /d:sonar.login=%SONARQUBE_NEMO_TOKEN% /d:sonar.host.url=https://nemo.sonarqube.org /d:sonar.cs.opencover.reportsPaths=".\Artefacts\Coverage\output.xml" /n:"myob-sdk" /k:"myob-sdk" /v:"%appveyor_build_version%"
@IF ERRORLEVEL 1 exit /b

"%programfiles(x86)%\MSBuild\12.0\Bin\MSBuild.exe" MYOB.API.SDK.sln /p:Configuration=release /t:rebuild
@IF ERRORLEVEL 1 exit /b

.\tools\sonarqube\runner\MSBuild.SonarQube.Runner.exe end
@IF ERRORLEVEL 1 exit /b

:TheEnd

@echo off

.\packages\coveralls.io.1.3.4\tools\coveralls.net.exe --opencover .\Artefacts\Coverage\output.xml

IF "%SONARQUBE_NEMO_TOKEN%" == "" goto TheEnd

IF "%appveyor_build_version%" == "" set appveyor_build_version=1.0.0

.\tools\sonarqube\runner\MSBuild.SonarQube.Runner.exe begin /d:sonar.login=%SONARQUBE_NEMO_TOKEN% /d:sonar.host.url=https://nemo.sonarqube.org /d:sonar.cs.opencover.reportsPaths=".\Artefacts\Coverage\output.xml" /n:"myob-ar-dotnet-sdk" /k:"myob-ar-dotnet-sdk" /v:"%appveyor_build_version%"
@IF ERRORLEVEL 1 exit /b

"%programfiles(x86)%\MSBuild\12.0\Bin\MSBuild.exe" MYOB.API.SDK.sln /p:Configuration=release /t:rebuild
@IF ERRORLEVEL 1 exit /b

.\tools\sonarqube\runner\MSBuild.SonarQube.Runner.exe end
@IF ERRORLEVEL 1 exit /b

:TheEnd

change sonar keyname

change sonar keyname


Add pause to start.cmd

Add pause to start.cmd


@echo on
choco install -y --allowEmptyChecksum firefox googlechrome wget notepadplusplus sublimetext3 mono monodevelop gtksharp visualstudiocode p4merge dotnet4.5 nodejs.install conemu dejavufonts ag golang
call refreshenv

wget -c https://cygwin.com/setup-x86_64.exe
setup-x86_64.exe -R "C:\cygwin64" -s http://mirror.switch.ch/ftp/mirror/cygwin/ -q -g -P curl,zsh,git,vim,wget,xz,tar,gawk,bzip2,subversion,zlib,fontconfig,clang,cmake,lua,perl,the_silver_searcher,gnupg,patch,zlib-devel,openssl-devel,libyaml-devel,libyaml0_2,sqlite3,make,libtool,autoconf,automake,bison,m4,mingw64-i686-gcc-core,mingw64-x86_64-gcc-core,patch,cygwin32-readline,libcrypt-devel,libcrypt0,ncurses,libncurses-devel,python-devel,libxslt,libxslt-devel,libjpeg-devel

copy /Y conemu.xml %appdata%\Roaming\ConEmu.xml

set script_path=%~dp0
set repo_path=%script_path%\..\
set bash=c:\cygwin64\bin\bash.exe --login -c

for /f "delims=" %%A in ('%bash% "cd `cygpath $HOMEPATH`/dev/dotfiles && git rev-parse --abbrev-ref HEAD"') do set "branch=%%A"
%bash% 'echo "branch is $branch"'
%bash% "cp -vr `cygpath $HOMEPATH`/.ssh $HOME/"
%bash% "export OUTER_CLONE=`cygpath $repo_path` && $script_path/build_insider.sh"

@echo on
choco install -y --allowEmptyChecksum firefox googlechrome wget notepadplusplus sublimetext3 mono monodevelop gtksharp visualstudiocode p4merge dotnet4.5 nodejs.install conemu dejavufonts ag golang windows-adk-all
call refreshenv

wget -c https://cygwin.com/setup-x86_64.exe
setup-x86_64.exe -R "C:\cygwin64" -s http://mirror.switch.ch/ftp/mirror/cygwin/ -q -g -P curl,zsh,git,vim,wget,xz,tar,gawk,bzip2,subversion,zlib,fontconfig,clang,cmake,lua,perl,the_silver_searcher,gnupg,patch,zlib-devel,openssl-devel,libyaml-devel,libyaml0_2,sqlite3,make,libtool,autoconf,automake,bison,m4,mingw64-i686-gcc-core,mingw64-x86_64-gcc-core,patch,cygwin32-readline,libcrypt-devel,libcrypt0,ncurses,libncurses-devel,python-devel,libxslt,libxslt-devel,libjpeg-devel

copy /Y conemu.xml %appdata%\Roaming\ConEmu.xml

set script_path=%~dp0
set repo_path=%script_path%\..\
set bash=c:\cygwin64\bin\bash.exe --login -c

for /f "delims=" %%A in ('%bash% "cd `cygpath $HOMEPATH`/dev/dotfiles && git rev-parse --abbrev-ref HEAD"') do set "branch=%%A"
%bash% 'echo "branch is $branch"'
%bash% "cp -vr `cygpath $HOMEPATH`/.ssh $HOME/"
%bash% "export OUTER_CLONE=`cygpath $repo_path` && $script_path/build_insider.sh"

Add Windows ADK

Add Windows ADK


@echo off
setlocal
pushd %~dp0
cd ..
goto :start

:help
echo Usage: build [debug|release] [x64|x86] [nosync] [clean|noclean]
echo nosync - do not update the git submodules.
echo clean - only clean the build
echo noclean - do not clean the build, so do incemental build

goto :exit

:start
echo ============= Building P SDK on %COMPUTERNAME% ===============

set MSBuildPath=
for /F "usebackq tokens=1,2* delims= " %%i in (`reg query HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSBuild\ToolsVersions\14.0 -v MSBuildToolsPath`) do (
   if "%%i" == "MSBuildToolsPath" set MSBuildPath=%%k
)

if not "%MSBuildPath%"=="" goto :step2

echo MSBUILD 14.0 does not appear to be installed.
echo No info found in HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSBuild\ToolsVersions\14.0
goto :eof

:step2
set TAIL=%MSBuildPath:~-6%
if "[%TAIL%]" == "[amd64\]" set MSBuildPath=%MSBuildPath:~0,-6%"
set PATH=%PATH%;%MSBuildPath%
set Configuration=Debug
set Platform=x86
set NoSync=
set CleanOnly=
set NoClean=

:parseargs
if /I "%1"=="debug" set Configuration=Debug
if /I "%1"=="release" set Configuration=Release
if /I "%1"=="x86" set Platform=x86
if /I "%1"=="x64" set Platform=x64
if /I "%1"=="nosync" set NoSync=true
if /I "%1"=="clean" set CleanOnly=true
if /I "%1"=="noclean" set NoClean=true
if /I "%1"=="" goto :step2
if /I "%1"=="/?" goto :help
if /I "%1"=="/h" goto :help
if /I "%1"=="/help" goto :help
if /I "%1"=="help" goto :help
shift
goto :parseargs

:step2

if "%NoSync%"=="true" goto :nosync

git submodule init
git submodule update

:nosync
cd ext\zing

echo msbuild  Zing.sln /p:Platform=%Platform% /p:Configuration=Release
msbuild  Zing.sln /p:Platform=%Platform% /p:Configuration=Release
if ERRORLEVEL 1 goto :exit

set BinaryDrop=..\..\Bld\Drops\%Configuration%\%Platform%\Binaries
if NOT exist %BinaryDrop% mkdir %BinaryDrop%

for %%i in (zc\bin\%Platform%\Release\zc.exe
             ZingExplorer\bin\%Platform%\Release\ZingExplorer.dll
             Zinger\bin\%Platform%\Release\Zinger.exe
             Microsoft.Zing\bin\%Platform%\Release\Microsoft.Zing.dll
             Microsoft.Zing.Runtime\bin\%Platform%\Release\Microsoft.Zing.Runtime.dll
             Microsoft.Zing\bin\%Platform%\Release\Microsoft.Comega.dll
             Microsoft.Zing\bin\%Platform%\Release\Microsoft.Comega.Runtime.dll
             Resources\external\CCI\System.Compiler.dll
             Resources\external\CCI\System.Compiler.Framework.dll
             Resources\external\CCI\System.Compiler.Runtime.dll
             DelayingSchedulers\CustomDelayingScheduler\bin\%Platform%\Release\CustomDelayingScheduler.dll
             DelayingSchedulers\RandomDelayingScheduler\bin\%Platform%\Release\RandomDelayingScheduler.dll
             DelayingSchedulers\RoundRobinDelayingScheduler\bin\%Platform%\Release\RoundRobinDelayingScheduler.dll
             DelayingSchedulers\RunToCompletionDelayingScheduler\bin\%Platform%\Release\RunToCompletionDelayingScheduler.dll
	     DelayingSchedulers\SealingScheduler\bin\%Platform%\Release\SealingScheduler.dll) do (

    copy %%i %BinaryDrop%
)

cd ..\..
REM this code fixes a problem in MIDL compile by forcing recompile of these files for each configuration.
del Src\PrtDist\Core\NodeManager_c.c
del Src\PrtDist\Core\NodeManager_s.c

if "%NoClean%"=="true" goto :build
echo msbuild P.sln /p:Platform=%Platform% /p:Configuration=%Configuration%
msbuild  P.sln /p:Platform=%Platform% /p:Configuration=%Configuration% /t:Clean

:build
if "%CleanOnly%"=="true" goto :exit
msbuild P.sln /p:Platform=%Platform% /p:Configuration=%Configuration% /p:SOLVER=NOSOLVER

:exit
popd

@echo off
setlocal
pushd %~dp0
cd ..
goto :start

:help
echo Usage: build [debug|release] [x64|x86] [nosync] [clean|noclean]
echo nosync - do not update the git submodules.
echo clean - only clean the build
echo noclean - do not clean the build, so do incemental build

goto :exit

:start
echo ============= Building P SDK on %COMPUTERNAME% ===============

set MSBuildPath=
for /F "usebackq tokens=1,2* delims= " %%i in (`reg query HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSBuild\ToolsVersions\14.0 -v MSBuildToolsPath`) do (
   if "%%i" == "MSBuildToolsPath" set MSBuildPath=%%k
)

if not "%MSBuildPath%"=="" goto :step2

echo MSBUILD 14.0 does not appear to be installed.
echo No info found in HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSBuild\ToolsVersions\14.0
goto :eof

:step2
set TAIL=%MSBuildPath:~-6%
if "[%TAIL%]" == "[amd64\]" set MSBuildPath=%MSBuildPath:~0,-6%"
set PATH=%PATH%;%MSBuildPath%
set Configuration=Debug
set Platform=x86
set NoSync=
set CleanOnly=
set NoClean=
set SubmoduleOutOfDate=false

:parseargs
if /I "%1"=="debug" set Configuration=Debug
if /I "%1"=="release" set Configuration=Release
if /I "%1"=="x86" set Platform=x86
if /I "%1"=="x64" set Platform=x64
if /I "%1"=="nosync" set NoSync=true
if /I "%1"=="clean" set CleanOnly=true
if /I "%1"=="noclean" set NoClean=true
if /I "%1"=="" goto :step2
if /I "%1"=="/?" goto :help
if /I "%1"=="/h" goto :help
if /I "%1"=="/help" goto :help
if /I "%1"=="help" goto :help
shift
goto :parseargs

:checksubmodule
for /f "usebackq tokens=1,2*" %%i in (`git submodule summary %1`) do (
  if "%%j"=="%1" echo #### Submodule is out of date: %1 & set SubmoduleOutOfDate=true
)

goto :eof

:step2

if "%NoSync%"=="true" goto :nosync

call :checksubmodule Ext/Formula
call :checksubmodule Ext/Zing

if "%SubmoduleOutOfDate%"=="false" goto :nosync

:sync
echo ### Fixing your submodules so they are up to date...
git submodule sync --recursive
git submodule update --init --recursive

:nosync
cd ext\zing

echo msbuild  Zing.sln /p:Platform=%Platform% /p:Configuration=Release
msbuild  Zing.sln /p:Platform=%Platform% /p:Configuration=Release
if ERRORLEVEL 1 goto :exit

set BinaryDrop=..\..\Bld\Drops\%Configuration%\%Platform%\Binaries
if NOT exist %BinaryDrop% mkdir %BinaryDrop%

for %%i in (zc\bin\%Platform%\Release\zc.exe
             ZingExplorer\bin\%Platform%\Release\ZingExplorer.dll
             Zinger\bin\%Platform%\Release\Zinger.exe
             Microsoft.Zing\bin\%Platform%\Release\Microsoft.Zing.dll
             Microsoft.Zing.Runtime\bin\%Platform%\Release\Microsoft.Zing.Runtime.dll
             Microsoft.Zing\bin\%Platform%\Release\Microsoft.Comega.dll
             Microsoft.Zing\bin\%Platform%\Release\Microsoft.Comega.Runtime.dll
             Resources\external\CCI\System.Compiler.dll
             Resources\external\CCI\System.Compiler.Framework.dll
             Resources\external\CCI\System.Compiler.Runtime.dll
             DelayingSchedulers\CustomDelayingScheduler\bin\%Platform%\Release\CustomDelayingScheduler.dll
             DelayingSchedulers\RandomDelayingScheduler\bin\%Platform%\Release\RandomDelayingScheduler.dll
             DelayingSchedulers\RoundRobinDelayingScheduler\bin\%Platform%\Release\RoundRobinDelayingScheduler.dll
             DelayingSchedulers\RunToCompletionDelayingScheduler\bin\%Platform%\Release\RunToCompletionDelayingScheduler.dll
	     DelayingSchedulers\SealingScheduler\bin\%Platform%\Release\SealingScheduler.dll) do (

    copy %%i %BinaryDrop%
)

cd ..\..
REM this code fixes a problem in MIDL compile by forcing recompile of these files for each configuration.
del Src\PrtDist\Core\NodeManager_c.c
del Src\PrtDist\Core\NodeManager_s.c

if "%NoClean%"=="true" goto :build
echo msbuild P.sln /p:Platform=%Platform% /p:Configuration=%Configuration%
msbuild  P.sln /p:Platform=%Platform% /p:Configuration=%Configuration% /t:Clean

:build
if "%CleanOnly%"=="true" goto :exit
msbuild P.sln /p:Platform=%Platform% /p:Configuration=%Configuration% /p:SOLVER=NOSOLVER

:exit
popd

fix submodule checking.

fix submodule checking.


start "" /B /D "%~dp0bin" "%~dp0bin\%~n0.exe" %*

Set working directory of app shortcuts on Windows to current directory


@echo OFF
:: in case DelayedExpansion is on and a path contains !
setlocal DISABLEDELAYEDEXPANSION
php "%~dp0satis" %*

add satis.bat

add satis.bat


msbuild.exe /m /nologo /t:CI /v:m /fl xunit.performance.msbuild /p:BuildAssemblyVersion=0.1.0.0 /p:BuildSemanticVersion=0.1.0-dev0001

Add FullBuild.cmd

Add FullBuild.cmd


@echo off

rem Copyright 2015 - 2017 AZYVA INC. INC.
rem
rem This file is part of Dragom.
rem
rem Dragom is free software: you can redistribute it and/or modify
rem it under the terms of the GNU Affero General Public License as published by
rem the Free Software Foundation, either version 3 of the License, or
rem (at your option) any later version.
rem
rem Dragom is distributed in the hope that it will be useful,
rem but WITHOUT ANY WARRANTY; without even the implied warranty of
rem MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
rem GNU Afferp General Public License for more details.
rem
rem You should have received a copy of the GNU Affero General Public License
rem along with Dragom.  If not, see <http://www.gnu.org/licenses/>.

rem Main start script for Dragom tools. It launches the JVM starting
rem org.azyva.dragom.tool.DragomToolInvoker.
rem
rem This script calls set-env.cmd, or set-env.cmd if the former does not exist,
rem which can set various variables to configure the Dragom execution environment.
rem See the comments in set-env.sh for more information.
rem
rem Additional parameters can be passed to the JVM with one or more --jvm-option
rem cli option specified as the first arguments to the script, before the Dragom
rem tool name.
rem
rem Synopsis:
rem
rem dragom [ [ --jvm-option <jvm-option> ] ... ] <dragom-tool> [argument] ...

setlocal EnableDelayedExpansion

set DRAGOM_HOME_DIR=%~dp0%..

rem We handle the --jvm-option cli option before sourcing dragom-set-env.cmd
rem or set-env.cmd since we want to set the Dragom tool.

rem Extracting and handling some arguments, while leaving the remaining arguments
rem as is is difficult for various reasons, including:
rem - %* does not take into account shifted-out arguments
rem - Windows interprets = as an argument separator when parsing a command line
rem   into the positional variables %1, %2, etc.
rem The solution is to take the whole command line (%*) and parse it explicitly.
rem Here again, this is difficult since a for loop breaks on lines, not tokens. So
rem we replace spaces with newlines.

set STATE=
set CLI_JVM_OPTIONS=
set ARGS=

set "ORG_ARGS=%*"

rem The 2 empty lines after this set are important. This solution was found here:
rem http://stackovervlow.com/questions/2524928/dos-batch-iterate-through-a-delimited-string
set NEWLINE=^

rem When a variable is empty, its evaluation with replacement (see below in for)
rem does not work correctly.
if "%ORG_ARGS%" == "" goto continue1

for /f %%A in ("%ORG_ARGS: =!NEWLINE!%") do (
  if "!STATE!" == "" (
    if "%%A" == "--jvm-option" (
      set STATE=jvm-option
    ) else (
      rem This state is encountered only for the very first non-option argument which
      rem corresponds to the Dragom tool.

      set "ARGS=%%A"
      set "DRAGOM_TOOL=%%A"
      set STATE=arg
    )
  ) else if "!STATE!" == "jvm-option" (
    set CLI_JVM_OPTIONS=!CLI_JVM_OPTIONS! %%A
    set STATE=
  ) else if "!STATE!" == "arg" (
    set "ARGS=!ARGS! %%A"
  )
)

:continue1

set DRAGOM_TOOL=

if exist %DRAGOM_HOME_DIR%\bin\dragom-set-env.cmd (
  call %DRAGOM_HOME_DIR%\bin\dragom-set-env.cmd
) else (
  call %DRAGOM_HOME_DIR%\bin\set-env.cmd
)

if "%JAVA_HOME%" == "" (
  echo JAVA_HOME not set.
  exit /b 1
)

rem We use a temporary file for getting variable lists in order to redirect errors
rem (when a variable does not exist) in nul, which is not possible with the
rem "for /f" command.

:retry-temp-file
set TEMP_FILE=%TEMP%\dragom-temp-%RANDOM%.tmp
if exist %TEMP_FILE% goto retry-temp-file

set SYSTEM_PROPERTIES_JVM_OPTIONS=

set SYSTEM_PROPERTY_ 2>nul 1>%TEMP_FILE%

for /f "tokens=1* delims==" %%P in (%TEMP_FILE%) do (
  set PROPERTY=%%P
  set PROPERTY=!PROPERTY:SYSTEM_PROPERTY_=!
  set SYSTEM_PROPERTIES_JVM_OPTIONS=!SYSTEM_PROPERTIES_JVM_OPTIONS! -D!PROPERTY!=%%Q
)

del %TEMP_FILE%

set DRAGOM_SYSTEM_PROPERTIES_JVM_OPTIONS=

set DRAGOM_SYSTEM_PROPERTY_ 2>nul 1>%TEMP_FILE%

for /f "tokens=1* delims==" %%P in (%TEMP_FILE%) do (
  set PROPERTY=%%P
  set PROPERTY=!PROPERTY:DRAGOM_SYSTEM_PROPERTY_=!
  set DRAGOM_SYSTEM_PROPERTIES_JVM_OPTIONS=!DRAGOM_SYSTEM_PROPERTIES_JVM_OPTIONS! -Dorg.azyva.dragom.!PROPERTY!=%%Q
)

del %TEMP_FILE%

set INIT_PROPERTIES_JVM_OPTIONS=

set INIT_PROPERTY_ 2>nul 1>%TEMP_FILE%

for /f "tokens=1* delims==" %%P in (%TEMP_FILE%) do (
  set PROPERTY=%%P
  set PROPERTY=!PROPERTY:INIT_PROPERTY_=!
  set INIT_PROPERTIES_JVM_OPTIONS=!INIT_PROPERTIES_JVM_OPTIONS! -Dorg.azyva.dragom.init-property.!PROPERTY!=%%Q
)

del %TEMP_FILE%

rem The computed arguments and options could very well include reserved characters
rem which would need to be escaped. We neglect handling them, except for ARGS
rem which could include a --reference-path-matcher option that includes ">".

if "%ARGS%" == "" goto continue2

set "ARGS=%ARGS:>=^>%"

:continue2

%JAVA_HOME%/bin/java ^
  %JVM_OPTIONS% ^
  %SYSTEM_PROPERTIES_JVM_OPTIONS% ^
  %DRAGOM_SYSTEM_PROPERTIES_JVM_OPTIONS% ^
  %INIT_PROPERTIES_JVM_OPTIONS% ^
  %CLI_JVM_OPTIONS% ^
  -classpath "%DRAGOM_HOME_DIR%\classpath;%DRAGOM_HOME_DIR%\lib\*" ^
  org.azyva.dragom.tool.DragomToolInvoker %ARGS%

@echo off

rem Copyright 2015 - 2017 AZYVA INC. INC.
rem
rem This file is part of Dragom.
rem
rem Dragom is free software: you can redistribute it and/or modify
rem it under the terms of the GNU Affero General Public License as published by
rem the Free Software Foundation, either version 3 of the License, or
rem (at your option) any later version.
rem
rem Dragom is distributed in the hope that it will be useful,
rem but WITHOUT ANY WARRANTY; without even the implied warranty of
rem MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
rem GNU Afferp General Public License for more details.
rem
rem You should have received a copy of the GNU Affero General Public License
rem along with Dragom.  If not, see <http://www.gnu.org/licenses/>.

rem Main start script for Dragom tools. It launches the JVM starting
rem org.azyva.dragom.tool.DragomToolInvoker.
rem
rem This script calls set-env.cmd, or set-env.cmd if the former does not exist,
rem which can set various variables to configure the Dragom execution environment.
rem See the comments in set-env.sh for more information.
rem
rem Additional parameters can be passed to the JVM with one or more --jvm-option
rem cli option specified as the first arguments to the script, before the Dragom
rem tool name.
rem
rem Synopsis:
rem
rem dragom [ [ --jvm-option <jvm-option> ] ... ] <dragom-tool> [argument] ...

setlocal EnableDelayedExpansion

set DRAGOM_HOME_DIR=%~dp0%..

rem We handle the --jvm-option cli option before sourcing dragom-set-env.cmd
rem or set-env.cmd since we want to set the Dragom tool.

rem Extracting and handling some arguments, while leaving the remaining arguments
rem as is is difficult for various reasons, including:
rem - %* does not take into account shifted-out arguments
rem - Windows interprets = as an argument separator when parsing a command line
rem   into the positional variables %1, %2, etc.
rem The solution is to take the whole command line (%*) and parse it explicitly.
rem Here again, this is difficult since a for loop breaks on lines, not tokens. So
rem we replace spaces with newlines.

set STATE=
set CLI_JVM_OPTIONS=
set ARGS=

set "ORG_ARGS=%*"

rem The 2 empty lines after this set are important. This solution was found here:
rem http://stackovervlow.com/questions/2524928/dos-batch-iterate-through-a-delimited-string
set NEWLINE=^

rem When a variable is empty, its evaluation with replacement (see below in for)
rem does not work correctly.
rem We use delayed expansion as normal expansion does not work when the variable
rem contains some combinations of spaces and double-quotes, such as
rem -DPARAM="MY VALUE".
if "!ORG_ARGS!" == "" goto continue1

for /f %%A in ("%ORG_ARGS: =!NEWLINE!%") do (
  if "!STATE!" == "" (
    if "%%A" == "--jvm-option" (
      set STATE=jvm-option
    ) else (
      rem This state is encountered only for the very first non-option argument which
      rem corresponds to the Dragom tool.

      set "ARGS=%%A"
      set "DRAGOM_TOOL=%%A"
      set STATE=arg
    )
  ) else if "!STATE!" == "jvm-option" (
    set CLI_JVM_OPTIONS=!CLI_JVM_OPTIONS! %%A
    set STATE=
  ) else if "!STATE!" == "arg" (
    set "ARGS=!ARGS! %%A"
  )
)

:continue1

set DRAGOM_TOOL=

if exist %DRAGOM_HOME_DIR%\bin\dragom-set-env.cmd (
  call %DRAGOM_HOME_DIR%\bin\dragom-set-env.cmd
) else (
  call %DRAGOM_HOME_DIR%\bin\set-env.cmd
)

if "%JAVA_HOME%" == "" (
  echo JAVA_HOME not set.
  exit /b 1
)

rem We use a temporary file for getting variable lists in order to redirect errors
rem (when a variable does not exist) in nul, which is not possible with the
rem "for /f" command.

:retry-temp-file
set TEMP_FILE=%TEMP%\dragom-temp-%RANDOM%.tmp
if exist %TEMP_FILE% goto retry-temp-file

set SYSTEM_PROPERTIES_JVM_OPTIONS=

set SYSTEM_PROPERTY_ 2>nul 1>%TEMP_FILE%

for /f "tokens=1* delims==" %%P in (%TEMP_FILE%) do (
  set PROPERTY=%%P
  set PROPERTY=!PROPERTY:SYSTEM_PROPERTY_=!
  set SYSTEM_PROPERTIES_JVM_OPTIONS=!SYSTEM_PROPERTIES_JVM_OPTIONS! -D!PROPERTY!=%%Q
)

del %TEMP_FILE%

set DRAGOM_SYSTEM_PROPERTIES_JVM_OPTIONS=

set DRAGOM_SYSTEM_PROPERTY_ 2>nul 1>%TEMP_FILE%

for /f "tokens=1* delims==" %%P in (%TEMP_FILE%) do (
  set PROPERTY=%%P
  set PROPERTY=!PROPERTY:DRAGOM_SYSTEM_PROPERTY_=!
  set DRAGOM_SYSTEM_PROPERTIES_JVM_OPTIONS=!DRAGOM_SYSTEM_PROPERTIES_JVM_OPTIONS! -Dorg.azyva.dragom.!PROPERTY!=%%Q
)

del %TEMP_FILE%

set INIT_PROPERTIES_JVM_OPTIONS=

set INIT_PROPERTY_ 2>nul 1>%TEMP_FILE%

for /f "tokens=1* delims==" %%P in (%TEMP_FILE%) do (
  set PROPERTY=%%P
  set PROPERTY=!PROPERTY:INIT_PROPERTY_=!
  set INIT_PROPERTIES_JVM_OPTIONS=!INIT_PROPERTIES_JVM_OPTIONS! -Dorg.azyva.dragom.init-property.!PROPERTY!=%%Q
)

del %TEMP_FILE%

rem The computed arguments and options could very well include reserved characters
rem which would need to be escaped. We neglect handling them, except for ARGS
rem which could include a --reference-path-matcher option that includes ">".

rem The computed arguments and options could very well include reserved characters
rem which would need to be escaped. We neglect handling them, except for ARGS
rem which could include a --reference-path-matcher option that includes ">".
rem We use delayed expansion as normal expansion does not work when the variable
rem contains some combinations of spaces and double-quotes, such as
rem -DPARAM="MY VALUE".
if "!ARGS!" == "" goto continue2

set "ARGS=%ARGS:>=^>%"

:continue2

%JAVA_HOME%/bin/java ^
  %JVM_OPTIONS% ^
  %SYSTEM_PROPERTIES_JVM_OPTIONS% ^
  %DRAGOM_SYSTEM_PROPERTIES_JVM_OPTIONS% ^
  %INIT_PROPERTIES_JVM_OPTIONS% ^
  %CLI_JVM_OPTIONS% ^
  -classpath "%DRAGOM_HOME_DIR%\classpath;%DRAGOM_HOME_DIR%\lib\*" ^
  org.azyva.dragom.tool.DragomToolInvoker %ARGS%

Fix for when argument contains spaces and double-quotes.


@ECHO off
SETLOCAL EnableExtensions
SETLOCAL EnableDelayedExpansion

:: ### Version History -- X.Y.Z_YYYYMMDD-hhmm Author Description
SET version=1.0.0_20150930-0600 &: Peter Kirschner   downloading,extract,configure and launch eclipse-installer with jre
SET version=%version: =%
SET title=idefixInstaller script %~nx0 - version %version%
TITLE %title%
SET POWERSHELL_TITLE=$Host.UI.RawUI.WindowTitle='%title%'

IF "%1"=="" (
	SET BRANCH=peterkir
) ELSE (
	SET BRANCH=%1
)

:: ###########################################################
SET SCRIPTNAME=%~n0
SET SCRIPT_PATH=%~dp0
SET SCRIPT_PATH=%SCRIPT_PATH:~0,-1%

SET IDEFIX_NAME=idefixInstaller
SET DL=%SCRIPT_PATH%\.download
:: folder must exists for powershell download requests
MKDIR %DL% 2>&1 > NUL

SET BRANCH=master
SET GITHUB_IO=http://peterkir.github.io/org.eclipse.oomph/
SET GITHUB_IO_LATEST=latest

SET GITHUB_IO_BOOT=http://peterkir.github.io/idefix/bootstrap/peterkir/win32

::ECHO.
::ECHO # workaroung for NTLMv2 ProxyAuth - starting IE
::ECHO.
::SET IE_CMD="C:\Program Files (x86)\Internet Explorer\iexplore.exe www.google.de"
::SET IE_DIR="%TEMP%"
::FOR /F "tokens=2 delims=;=" %%a IN (
::	'WMIC process call create %IE_CMD%^, %IE_DIR% ^| find "ProcessId"'
::) DO (
::	SET IE_PID=%%a
::)
::ECHO browser launched with PID %IE_PID%
:: TODO search an kill the IE if not previously open WMIC process %IE_PID% delete

SET JAVA_CMD=setupJavaSDK.cmd
ECHO.
ECHO # downloading and configuring Java via %GITHUB_IO_BOOT%/%JAVA_CMD%
ECHO.
powershell -nologo -noprofile  -command "%POWERSHELL_TITLE%;if ( Test-Path %DL%\%JAVA_CMD% ) { Write-Output 'skipping download, cause file exists - %DL%\%JAVA_CMD%' } else {(New-Object System.Net.WebClient).DownloadFile('%GITHUB_IO_BOOT%/%JAVA_CMD%','%DL%\%JAVA_CMD%')}"
IF "%ERRORLEVEL%"=="" (
	ECHO failing downloading file %GITHUB_IO_BOOT%/%JAVA_CMD%
	GOTO END
)

:: installing JDKs into %SCRIPT_PATH%/java
CALL %DL%\%JAVA_CMD% %SCRIPT_PATH%

FOR /F %%a IN ('DIR /B %SCRIPT_PATH%\java\1.8') DO SET JAVA8=%SCRIPT_PATH%\java\1.8\%%a

ECHO.
ECHO # setup local %IDEFIX_NAME%
ECHO.

:: download of a file with powershell - http://superuser.com/a/423789/344922
powershell -nologo -noprofile -command "%POWERSHELL_TITLE%; (New-Object System.Net.WebClient).DownloadFile('%GITHUB_IO%/%BRANCH%/%GITHUB_IO_LATEST%','%DL%\%BRANCH%_%GITHUB_IO_LATEST%')"
SET /P LATEST=<%DL%\%BRANCH%_%GITHUB_IO_LATEST%
ECHO found latest build ^<%LATEST%^> from %GITHUB_IO%/%BRANCH%/%GITHUB_IO_LATEST%
ECHO.

SET BINTRAY_BUILD_ROOT=https://dl.bintray.com/peterkir/generic/org.eclipse.oomph/1.3.0/%BRANCH%/%LATEST%
SET ECLIPSE_INSTALLER_WEB=%BINTRAY_BUILD_ROOT%/products
SET ECLIPSE_INSTALLER_ARCHIVE=org.eclipse.oomph.setup.installer.product-win32.win32.x86_64.zip
SET ECLIPSE_INSTALLER=%ECLIPSE_INSTALLER_ARCHIVE:~0,-4%

powershell -nologo -noprofile -command "%POWERSHELL_TITLE%;if ( Test-Path %DL%\%ECLIPSE_INSTALLER_ARCHIVE% ) { Write-Output '   - skipping download, cause file exists - %DL%\%ECLIPSE_INSTALLER_ARCHIVE%' } else { Write-Output '   - downloading archive %ECLIPSE_INSTALLER_WEB%/%ECLIPSE_INSTALLER_ARCHIVE%';(New-Object System.Net.WebClient).DownloadFile('%ECLIPSE_INSTALLER_WEB%/%ECLIPSE_INSTALLER_ARCHIVE%','%DL%\%ECLIPSE_INSTALLER_ARCHIVE%')}"
IF "%ERRORLEVEL%"=="" (
	ECHO failing downloading file %ECLIPSE_INSTALLER_WEB%/%ECLIPSE_INSTALLER_ARCHIVE%
	GOTO END
)

powershell -nologo -noprofile  -command "%POWERSHELL_TITLE%;if ( Test-Path '%SCRIPT_PATH%\%IDEFIX_NAME%' -PathType Container )  { Write-Output '   - skipping extraction, cause folder exists - %SCRIPT_PATH%\%IDEFIX_NAME%' } else { Write-Output '   - extracting ECLIPSE_INSTALLER archive to %SCRIPT_PATH%\%IDEFIX_NAME%'; Add-Type -A System.IO.Compression.FileSystem; [IO.Compression.ZipFile]::ExtractToDirectory('%DL%\%ECLIPSE_INSTALLER_ARCHIVE%', '%SCRIPT_PATH%\%IDEFIX_NAME%')}"

ECHO    - copying latest java %JAVA8%\jre into %SCRIPT_PATH%\%IDEFIX_NAME%\jre
IF NOT EXIST %SCRIPT_PATH%\%IDEFIX_NAME%\jre\NUL (
	XCOPY /Y /I /E /H %JAVA8%\jre %SCRIPT_PATH%\%IDEFIX_NAME%\jre 2>&1 > NUL
)

SET "IDEFIX_HOME=%SCRIPT_PATH%"
MKDIR %IDEFIX_HOME% 2>&1 > NUL

SET IDEFIX_HOME=%IDEFIX_HOME:\=/%
SET IDEFIX_INI=%SCRIPT_PATH%\%IDEFIX_NAME%\eclipse-inst.ini

ECHO    - adding vmArgs to ini file
:: allow installation of unsigned bundles
ECHO -Declipse.p2.unsignedPolicy=allow >> %IDEFIX_INI%

:: hidden p2 options (configured to default)
ECHO -Declipse.p2.max.threads=4        >> %IDEFIX_INI%
ECHO -Declipse.p2.force.threading=true >> %IDEFIX_INI%
ECHO -Declipse.p2.mirrors=true         >> %IDEFIX_INI%

:: filtering user displayed catalogs/products/versions
ECHO -Doomph.setup.product.catalog.filter=(io\.klib\.products) >> %OOMPH_INI%
ECHO -Doomph.setup.product.filter=(idefix\.base) >> %OOMPH_INI%
ECHO -Doomph.setup.product.version.filter=(Mars) >> %OOMPH_INI%

ECHO -Doomph.setup.jre.choice=false                                 >> %IDEFIX_INI%
ECHO -Doomph.installer.update.url=%BINTRAY_BUILD_ROOT%/p2/installer >> %IDEFIX_INI%
ECHO -Doomph.update.url=%BINTRAY_BUILD_ROOT%/p2/oomph               >> %IDEFIX_INI%
ECHO -Doomph.setup.installer.mode=advanced                          >> %IDEFIX_INI%
ECHO -Doomph.redirection.klibProductCatalog=index:/redirectable.products.setup-^>http://peterkir.github.io/idefix/oomph/peterkir/productsCatalog.setup >> %IDEFIX_INI%
ECHO -Doomph.redirection.klibProjectCatalog=index:/redirectable.projects.setup-^>http://peterkir.github.io/idefix/oomph/peterkir/projectsCatalog.setup >> %IDEFIX_INI%

ECHO.
ECHO # launching %IDEFIX_NAME%
ECHO.
START /B %SCRIPT_PATH%\%IDEFIX_NAME%\eclipse-inst.exe

::ECHO.
::ECHO # clean-up
::ECHO.
::RMDIR /Q /S %DL%

:END

@ECHO on
SETLOCAL EnableExtensions
SETLOCAL EnableDelayedExpansion

:: ### Version History -- X.Y.Z_YYYYMMDD-hhmm Author Description
SET version=1.0.0_20150930-0600 &: Peter Kirschner   downloading,extract,configure and launch eclipse-installer with jre
SET version=%version: =%
SET title=idefixInstaller script %~nx0 - version %version%
TITLE %title%
SET POWERSHELL_TITLE=$Host.UI.RawUI.WindowTitle='%title%'

IF "%1"=="" (
	SET BRANCH=peterkir
) ELSE (
	SET BRANCH=%1
)

:: ###########################################################
SET SCRIPTNAME=%~n0
SET SCRIPT_PATH=%~dp0
SET SCRIPT_PATH=%SCRIPT_PATH:~0,-1%

SET IDEFIX_NAME=idefixInstaller
SET DL=%SCRIPT_PATH%\.download
:: folder must exists for powershell download requests
MKDIR %DL% 2>&1 > NUL

SET BRANCH=master
SET GITHUB_IO=http://peterkir.github.io/org.eclipse.oomph/
SET GITHUB_IO_LATEST=latest

SET GITHUB_IO_BOOT=http://peterkir.github.io/idefix/bootstrap/peterkir/win32

::ECHO.
::ECHO # workaroung for NTLMv2 ProxyAuth - starting IE
::ECHO.
::SET IE_CMD="C:\Program Files (x86)\Internet Explorer\iexplore.exe www.google.de"
::SET IE_DIR="%TEMP%"
::FOR /F "tokens=2 delims=;=" %%a IN (
::	'WMIC process call create %IE_CMD%^, %IE_DIR% ^| find "ProcessId"'
::) DO (
::	SET IE_PID=%%a
::)
::ECHO browser launched with PID %IE_PID%
:: TODO search an kill the IE if not previously open WMIC process %IE_PID% delete

SET JAVA_CMD=setupJavaSDK.cmd
ECHO.
ECHO # downloading and configuring Java via %GITHUB_IO_BOOT%/%JAVA_CMD%
ECHO.
powershell -nologo -noprofile  -command "%POWERSHELL_TITLE%;if ( Test-Path %DL%\%JAVA_CMD% ) { Write-Output 'skipping download, cause file exists - %DL%\%JAVA_CMD%' } else {(New-Object System.Net.WebClient).DownloadFile('%GITHUB_IO_BOOT%/%JAVA_CMD%','%DL%\%JAVA_CMD%')}"
IF "%ERRORLEVEL%"=="" (
	ECHO failing downloading file %GITHUB_IO_BOOT%/%JAVA_CMD%
	GOTO END
)

:: installing JDKs into %SCRIPT_PATH%/java
CALL %DL%\%JAVA_CMD% %SCRIPT_PATH%

FOR /F %%a IN ('DIR /B %SCRIPT_PATH%\java\1.8') DO SET JAVA8=%SCRIPT_PATH%\java\1.8\%%a

ECHO.
ECHO # setup local %IDEFIX_NAME%
ECHO.

:: download of a file with powershell - http://superuser.com/a/423789/344922
powershell -nologo -noprofile -command "%POWERSHELL_TITLE%; (New-Object System.Net.WebClient).DownloadFile('%GITHUB_IO%/%BRANCH%/%GITHUB_IO_LATEST%','%DL%\%BRANCH%_%GITHUB_IO_LATEST%')"
SET /P LATEST=<%DL%\%BRANCH%_%GITHUB_IO_LATEST%
ECHO found latest build ^<%LATEST%^> from %GITHUB_IO%/%BRANCH%/%GITHUB_IO_LATEST%
ECHO.

SET BINTRAY_BUILD_ROOT=https://dl.bintray.com/peterkir/generic/org.eclipse.oomph/1.3.0/%BRANCH%/%LATEST%
SET ECLIPSE_INSTALLER_WEB=%BINTRAY_BUILD_ROOT%/products
SET ECLIPSE_INSTALLER_ARCHIVE=org.eclipse.oomph.setup.installer.product-win32.win32.x86_64.zip
SET ECLIPSE_INSTALLER=%ECLIPSE_INSTALLER_ARCHIVE:~0,-4%

powershell -nologo -noprofile -command "%POWERSHELL_TITLE%;if ( Test-Path %DL%\%ECLIPSE_INSTALLER_ARCHIVE% ) { Write-Output '   - skipping download, cause file exists - %DL%\%ECLIPSE_INSTALLER_ARCHIVE%' } else { Write-Output '   - downloading archive %ECLIPSE_INSTALLER_WEB%/%ECLIPSE_INSTALLER_ARCHIVE%';(New-Object System.Net.WebClient).DownloadFile('%ECLIPSE_INSTALLER_WEB%/%ECLIPSE_INSTALLER_ARCHIVE%','%DL%\%ECLIPSE_INSTALLER_ARCHIVE%')}"
IF "%ERRORLEVEL%"=="" (
	ECHO failing downloading file %ECLIPSE_INSTALLER_WEB%/%ECLIPSE_INSTALLER_ARCHIVE%
	GOTO END
)

powershell -nologo -noprofile  -command "%POWERSHELL_TITLE%;if ( Test-Path '%SCRIPT_PATH%\%IDEFIX_NAME%' -PathType Container )  { Write-Output '   - skipping extraction, cause folder exists - %SCRIPT_PATH%\%IDEFIX_NAME%' } else { Write-Output '   - extracting ECLIPSE_INSTALLER archive to %SCRIPT_PATH%\%IDEFIX_NAME%'; Add-Type -A System.IO.Compression.FileSystem; [IO.Compression.ZipFile]::ExtractToDirectory('%DL%\%ECLIPSE_INSTALLER_ARCHIVE%', '%SCRIPT_PATH%\%IDEFIX_NAME%')}"

ECHO    - copying latest java %JAVA8%\jre into %SCRIPT_PATH%\%IDEFIX_NAME%\jre
IF NOT EXIST %SCRIPT_PATH%\%IDEFIX_NAME%\jre\NUL (
	XCOPY /Y /I /E /H %JAVA8%\jre %SCRIPT_PATH%\%IDEFIX_NAME%\jre 2>&1 > NUL
)

SET "IDEFIX_HOME=%SCRIPT_PATH%"
MKDIR %IDEFIX_HOME% 2>&1 > NUL

SET IDEFIX_HOME=%IDEFIX_HOME:\=/%
SET IDEFIX_INI=%SCRIPT_PATH%\%IDEFIX_NAME%\eclipse-inst.ini

ECHO    - adding vmArgs to ini file
:: allow installation of unsigned bundles
ECHO -Declipse.p2.unsignedPolicy=allow >> %IDEFIX_INI%

:: hidden p2 options (configured to default)
ECHO -Declipse.p2.max.threads=4        >> %IDEFIX_INI%
ECHO -Declipse.p2.force.threading=true >> %IDEFIX_INI%
ECHO -Declipse.p2.mirrors=true         >> %IDEFIX_INI%

:: filtering user displayed catalogs/products/versions
ECHO -Doomph.setup.product.catalog.filter=(io\.klib\.products) >> %OOMPH_INI%
ECHO -Doomph.setup.product.filter=(idefix\.base) >> %OOMPH_INI%
ECHO -Doomph.setup.product.version.filter=(Mars) >> %OOMPH_INI%

ECHO -Doomph.setup.jre.choice=false                                 >> %IDEFIX_INI%
ECHO -Doomph.installer.update.url=%BINTRAY_BUILD_ROOT%/p2/installer >> %IDEFIX_INI%
ECHO -Doomph.update.url=%BINTRAY_BUILD_ROOT%/p2/oomph               >> %IDEFIX_INI%
ECHO -Doomph.setup.installer.mode=advanced                          >> %IDEFIX_INI%
ECHO -Doomph.redirection.klibProductCatalog=index:/redirectable.products.setup-^>http://peterkir.github.io/idefix/oomph/peterkir/productsCatalog.setup >> %IDEFIX_INI%
ECHO -Doomph.redirection.klibProjectCatalog=index:/redirectable.projects.setup-^>http://peterkir.github.io/idefix/oomph/peterkir/projectsCatalog.setup >> %IDEFIX_INI%

ECHO.
ECHO # launching %IDEFIX_NAME%
ECHO.
START /B %SCRIPT_PATH%\%IDEFIX_NAME%\eclipse-inst.exe

::ECHO.
::ECHO # clean-up
::ECHO.
::RMDIR /Q /S %DL%

:END

Update engageOriginal.cmd

Update engageOriginal.cmd


where cinst
if ERRORLEVEL 1 goto install_chocolatey
goto install_packer
:install_chocolatey
echo Ensuring .NET 4.0 is installed
@powershell -NoProfile -ExecutionPolicy unrestricted -Command "iex ((new-object net.webclient).DownloadString('https://raw.github.com/StefanScherer/arduino-ide/install/InstallNet4.ps1'))"
echo Installing Chocolatey
@powershell -NoProfile -ExecutionPolicy unrestricted -Command "iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1'))" && SET PATH=%PATH%;%systemdrive%\chocolatey\bin
if "%ChocolateyInstall%x"=="x" set ChocolateyInstall=%SystemDrive%\Chocolatey
set PATH=%PATH%;%ChocolateyInstall%\bin
:install_packer

call cinst golang
set PATH=%PATH%;c:\go\bin

call cinst git
set PATH=%PATH%;c:\program files (x86)\git\cmd

call cinst bzr
set PATH=%PATH%;c:\program files (x86)\Bazaar

call cinst hg
set PATH=%PATH%;c:\program files\Mercurial

set GOPATH=C:\users\vagrant\go
setx GOPATH C:\users\vagrant\go

mkdir %GOPATH%\bin
for /F "tokens=2* delims= " %%f IN ('reg query "HKCU\Environment" /v Path ^| findstr /i path') do set OLD_USER_PATH=%%
reg add HKCU\Environment /v Path /d "%OLD_USER_PATH%;%GOPATH%\bin" /f
set PATH=%PATH%;%GOPATH%\bin

echo Downloading and compiling packer
go get github.com/mitchellh/packer
cd /D %GOPATH%\src\github.com\mitchellh\packer
go get ./...
cd /D %GOPATH%\bin
for /f "tokens=1" %%i in ('dir /b builder* command* post* provision*') DO if exist packer-%%i del packer-%%i
for /f "tokens=1" %%i in ('dir /b builder* command* post* provision*') DO ren %%i packer-%%i

echo Downloading and compiling packer-post-processor-vagrant-vmware-ovf
go get github.com/gosddc/packer-post-processor-vagrant-vmware-ovf

set packerconfig=%AppData%\packer.config
echo { > %packerconfig%
echo  "post-processors": { >> %packerconfig%
echo      "vagrant-vmware-ovf": "packer-post-processor-vagrant-vmware-ovf" >> %packerconfig%
echo  } >> %packerconfig%
echo } >> %packerconfig%

cd /D %USERPROFILE%
where packer
packer --version

where cinst
if ERRORLEVEL 1 goto install_chocolatey
goto install_packer
:install_chocolatey
echo Ensuring .NET 4.0 is installed
@powershell -NoProfile -ExecutionPolicy unrestricted -Command "iex ((new-object net.webclient).DownloadString('https://raw.github.com/StefanScherer/arduino-ide/install/InstallNet4.ps1'))"
echo Installing Chocolatey
@powershell -NoProfile -ExecutionPolicy unrestricted -Command "iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1'))" && SET PATH=%PATH%;%systemdrive%\chocolatey\bin
if "%ChocolateyInstall%x"=="x" set ChocolateyInstall=%SystemDrive%\Chocolatey
set PATH=%PATH%;%ChocolateyInstall%\bin
:install_packer

call cinst golang
set PATH=%PATH%;c:\go\bin

call cinst git
where git
if ERRORLEVEL 1 call :addGitToUserPath
goto GIT_DONE
:addGitToUserPath
for /F "tokens=2* delims= " %%f IN ('reg query "HKCU\Environment" /v Path ^| findstr /i path') do set OLD_USER_PATH=%%g
reg add HKCU\Environment /v Path /d "%OLD_USER_PATH%;C:\Program Files (x86)\Git\cmd" /f
set PATH=%PATH%;C:\Program Files (x86)\Git\cmd
exit /b
:GIT_DONE

call cinst bzr
set PATH=%PATH%;c:\program files (x86)\Bazaar

call cinst hg
set PATH=%PATH%;c:\program files\Mercurial

set GOPATH=C:\users\vagrant\go
setx GOPATH C:\users\vagrant\go

mkdir %GOPATH%\bin
for /F "tokens=2* delims= " %%f IN ('reg query "HKCU\Environment" /v Path ^| findstr /i path') do set OLD_USER_PATH=%%
reg add HKCU\Environment /v Path /d "%OLD_USER_PATH%;%GOPATH%\bin" /f
set PATH=%PATH%;%GOPATH%\bin

echo Downloading and compiling packer
go get github.com/mitchellh/packer
cd /D %GOPATH%\src\github.com\mitchellh\packer
go get ./...
cd /D %GOPATH%\bin
for /f "tokens=1" %%i in ('dir /b builder* command* post* provision*') DO if exist packer-%%i del packer-%%i
for /f "tokens=1" %%i in ('dir /b builder* command* post* provision*') DO ren %%i packer-%%i

echo Downloading and compiling packer-post-processor-vagrant-vmware-ovf
go get github.com/gosddc/packer-post-processor-vagrant-vmware-ovf

set packerconfig=%AppData%\packer.config
echo { > %packerconfig%
echo  "post-processors": { >> %packerconfig%
echo      "vagrant-vmware-ovf": "packer-post-processor-vagrant-vmware-ovf" >> %packerconfig%
echo  } >> %packerconfig%
echo } >> %packerconfig%

cd /D %USERPROFILE%
where packer
packer --version

add git permanently to PATH

add git permanently to PATH


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

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

Update bld.bat

Update bld.bat


:: Set the right msvc version according to Python version
if "%PY_VER%"=="2.7" (
    set MSVC_VER=9.0
    set LIB_VER=90
) else if "%PY_VER%"=="3.4" (
    set MSVC_VER=10.0
    set LIB_VER=100
) else (
    set MSVC_VER=14.0
    set LIB_VER=140
)

call bootstrap.bat ^
    --with-libraries=python
if errorlevel 1 exit 1

CALL b2 install toolset=msvc-%MSVC_VER% ^
        address-model=%ARCH% ^
        variant=release ^
        threading=multi ^
        link=shared ^
        -j%CPU_COUNT% ^
        --with-python ^
        --build-dir=buildboost ^
        --prefix=%LIBRARY_PREFIX%
IF errorlevel 1 exit 1

ECHO move %LIBRARY_INC%\boost-1_61\boost %LIBRARY_INC%
move %LIBRARY_INC%\boost-1_61\boost %LIBRARY_INC%
IF errorlevel 1 exit 1

dir  %LIBRARY_LIB%
ECHO %LIBRARY_LIB%\boost_python-vc90-mt-1_61.dll "%LIBRARY_BIN%"
move %LIBRARY_LIB%\boost_python-vc90-mt-1_61.dll "%LIBRARY_BIN%"
IF errorlevel 1 exit 1

:: Set the right msvc version according to Python version
if "%PY_VER%"=="2.7" (
    set MSVC_VER=9.0
    set LIB_VER=90
) else if "%PY_VER%"=="3.4" (
    set MSVC_VER=10.0
    set LIB_VER=100
) else (
    set MSVC_VER=14.0
    set LIB_VER=140
)

call bootstrap.bat ^
    --with-libraries=python
if errorlevel 1 exit 1

echo %ARCH%

CALL b2 install toolset=msvc-%MSVC_VER% ^
        address-model=%ARCH% ^
        variant=release ^
        threading=multi ^
        link=shared ^
        -j%CPU_COUNT% ^
        --with-python ^
        --build-dir=buildboost ^
        --prefix=%LIBRARY_PREFIX%
IF errorlevel 1 exit 1

ECHO move %LIBRARY_INC%\boost-1_61\boost %LIBRARY_INC%
move %LIBRARY_INC%\boost-1_61\boost %LIBRARY_INC%
IF errorlevel 1 exit 1

dir  %LIBRARY_LIB%
ECHO %LIBRARY_LIB%\boost_python-vc90-mt-1_61.dll "%LIBRARY_BIN%"
move %LIBRARY_LIB%\boost_python-vc90-mt-1_61.dll "%LIBRARY_BIN%"
IF errorlevel 1 exit 1

Update bld.bat

Update bld.bat


@echo off

:: check if boot2docker is running
for /f "usebackq tokens=*" %%s in (`boot2docker status`) do (
  if %%s == running (
    echo The boot2docker VM is already running, doing nothing
    goto end
  )
)

SETLOCAL

:: make sure we are stopped
echo Making sure the boot2docker VM is stopped...
boot2docker halt

:: get the BK_ROOT as windows path
set BK_ROOT=%SCRIPT_DIR%
:: replace backward with forward slashes
set BK_ROOT_FWD_SLASH=%BK_ROOT:\=/%
:: convert drive letter to cygwin style (try c, d, e, w)
set BK_ROOT_DRIVE=%BK_ROOT_FWD_SLASH:C:/=/c/%
set BK_ROOT_DRIVE=%BK_ROOT_DRIVE:D:/=/d/%
set BK_ROOT_DRIVE=%BK_ROOT_DRIVE:E:/=/e/%
set BK_ROOT_DRIVE=%BK_ROOT_DRIVE:W:/=/w/%
:: okay, here we go
set BK_ROOT_CYGPATH=%BK_ROOT_DRIVE%

:: add the drive while the VM is still down
echo Adding shared folder "billskitchen" for hostpath %BK_ROOT%
VBoxManage sharedfolder add "boot2docker-vm" --name "billskitchen" --hostpath %BK_ROOT%

:: idempotently create the VM, bring it up
echo Bringing up the boot2docker VM...
boot2docker init
boot2docker up

:: mount drive inside vbox
echo Mounting the shared folder inside the VM to %BK_ROOT_CYGPATH%
boot2docker ssh -- sudo mount -t vboxsf billskitchen %BK_ROOT_CYGPATH%

:: for proxies:
:: see http://stackoverflow.com/a/29303930/2388971

ENDLOCAL

:: experimental: enable remote docker host patch in vagrant when b2d is started
set VAGRANT_DOCKER_REMOTE_HOST_PATCH=1

:end

@echo off

:: check if boot2docker is running
for /f "usebackq tokens=*" %%s in (`boot2docker status`) do (
  if %%s == running (
    echo The boot2docker VM is already running, doing nothing
    goto end
  )
)

SETLOCAL

:: make sure we are stopped
echo Making sure the boot2docker VM is stopped...
boot2docker halt

:: get the BK_ROOT as windows path
set BK_ROOT=%SCRIPT_DIR%
:: replace backward with forward slashes
set BK_ROOT_FWD_SLASH=%BK_ROOT:\=/%
:: convert drive letter to cygwin style (try c, d, e, w)
set BK_ROOT_DRIVE=%BK_ROOT_FWD_SLASH:C:/=/c/%
set BK_ROOT_DRIVE=%BK_ROOT_DRIVE:D:/=/d/%
set BK_ROOT_DRIVE=%BK_ROOT_DRIVE:E:/=/e/%
set BK_ROOT_DRIVE=%BK_ROOT_DRIVE:W:/=/w/%
:: okay, here we go
set BK_ROOT_CYGPATH=%BK_ROOT_DRIVE%

:: add the drive while the VM is still down
echo Adding shared folder "billskitchen" for hostpath %BK_ROOT%
VBoxManage sharedfolder add "boot2docker-vm" --name "billskitchen" --hostpath %BK_ROOT%

:: idempotently create the VM, bring it up
echo Bringing up the boot2docker VM...
boot2docker init
boot2docker up

:: mount drive inside vbox
echo Mounting the shared folder inside the VM to %BK_ROOT_CYGPATH%
boot2docker ssh -- sudo mount -t vboxsf billskitchen %BK_ROOT_CYGPATH%

:: set / unset proxy in boot2docker VM
:: for more on proxies, see http://stackoverflow.com/a/29303930/2388971
if "%HTTP_PROXY%" == "" (
  echo making sure no proxy is set in the boot2docker VM...
  boot2docker ssh sudo rm -rf /var/lib/boot2docker/profile
) else (
  echo setting proxy in the boot2docker VM...
  boot2docker ssh "echo 'export HTTP_PROXY=%HTTP_PROXY%; export HTTPS_PROXY=%HTTPS_PROXY%; export NO_PROXY=%NO_PROXY%;' | sudo tee /var/lib/boot2docker/profile"
)
boot2docker ssh sudo /etc/init.d/docker restart

ENDLOCAL

:: experimental: enable remote docker host patch in vagrant when b2d is started
set VAGRANT_DOCKER_REMOTE_HOST_PATCH=1

:end

set the proxy in the boot2docker VM too

set the proxy in the boot2docker VM too