@echo off
rem ScratchPlus Summer 2016 project - setup script for Windows consoles.
rem Can be run over and over if you need to. If you see it change when
rem you do a git pull, you should run it again to pull down any Node.js
rem NPM packages or perform other setups.

where npm
if ERRORLEVEL 1 echo ERROR: NPM not found. Did you install Node.js according to the instructions at https://github.com/erikma/ScratchPlus2016Project ? && exit /b 1

echo.
echo ==========================================================================
echo Ensuring we have all the needed Node.js Package Manager packages.
echo ==========================================================================

echo.
echo ==========================================================================
echo Installing Gulp ^(http://gulpjs.com/^) command line
echo We use this as a cross-operating-system way to build code instead of
echo trying to use Windows command scripts.
echo ==========================================================================
echo.
call npm install --global gulp-cli
if ERRORLEVEL 1 echo ERROR: npm install --global gulp-cli failed with errorlevel %ERRORLEVEL% && exit /b 1
call npm install --save-dev gulp
if ERRORLEVEL 1 echo ERROR: npm install --save-dev gulp failed with errorlevel %ERRORLEVEL% && exit /b 1

echo.
echo ==========================================================================
echo Installing Gulp modules we need:
echo   Uglify - for minifying JavaScript
echo   pump - simplifies dealing with Node.js streams when lots of piping is used.
echo   del - deletes files and folders
echo   path - Always better than using string concatenation.
echo.
echo TODO - get working:
echo   gulp-spritesmith - Lets us assemble a spritesheet/tilemap for Pixi.js
echo     from individual sprite images.
echo     https://www.npmjs.com/package/gulp.spritesmith/
echo   spritesmith-texturepacker - Creates JSON based outputs for spritesheets
echo     from SpriteSmith, for use with Pixi.js.
echo ==========================================================================
echo.
call npm install --save-dev gulp-uglify pump del path
@rem TODO - add some or all of these back and get spritesheet compilation working on Windows: gulp-spritesmith spritesmith-texturepacker gulp-imagemin
if ERRORLEVEL 1 echo ERROR: npm install failed for Gulp modules  with errorlevel %ERRORLEVEL% && exit /b 1

echo.
echo ==========================================================================
echo Installing development modules we need:
echo   Mocha - unit testing framework that uses Node.js and fits well into
echo     Visual Studio Code. https://mochajs.org/
echo   Chai - assertion library for use in Mocha. http://chaijs.com/
echo   spritesheet-js - Assembles individual sprite images into a spritesheet
echo     suitable for Pixi.js. https://github.com/krzysztof-o/spritesheet.js/
echo ==========================================================================
echo.
call npm install --save-dev mocha chai spritesheet-js
if ERRORLEVEL 1 echo ERROR: npm install failed for dev modules with errorlevel %ERRORLEVEL% && exit /b 1

echo.
echo ==========================================================================
echo Installing site modules we need:
echo   Primus - wrapper onto various HTML5 WebSockets libraries, with some additional
echo     sugar. https://github.com/primus/primus . Also includes JSON and BinaryePack
echo     ^(https://github.com/binaryjs/js-binarypack^) which is based on MessagePack
echo     ^(http://msgpack.org/^) wire formats for a choice of debuggability and wire
echo     speed.
echo   ws - needed for Primus as a WebSockets implementation.
echo   binary-pack - needed for using a binary-mode transport in Primus.
echo   Express - web site framework. http://expressjs.com/
echo   compression - Express plugin for compressing content sent over the network.
echo   Pixi.JS - WebGL/Canvas wrapper for Flash-like game and animation authoring.
echo     https://github.com/pixijs/pixi.js
echo ==========================================================================
echo.
call npm install --save primus ws binary-pack express compression Pixi.JS
if ERRORLEVEL 1 echo ERROR: npm install failed for site modules with errorlevel %ERRORLEVEL% && exit /b 1

echo.
echo ==========================================================================
echo Setting aliases for easier command line experience
echo ==========================================================================
echo.
doskey master = git checkout master
doskey cb = git checkout dev/%USERNAME%/$*
doskey nb = git checkout dev/%USERNAME%/$*
doskey pull = git pull
doskey branch = git branch
doskey stat = git status
doskey mmerge = "git checkout master && git merge dev/%USERNAME%/$* --squash && git commit"

doskey /macros

echo.
echo ==========================================================================
echo Complete!
echo ==========================================================================
echo.

@echo off
rem ScratchPlus Summer 2016 project - setup script for Windows consoles.
rem Can be run over and over if you need to. If you see it change when
rem you do a git pull, you should run it again to pull down any Node.js
rem NPM packages or perform other setups.

where npm
if ERRORLEVEL 1 echo ERROR: NPM not found. Did you install Node.js according to the instructions at https://github.com/erikma/ScratchPlus2016Project ? && exit /b 1

echo.
echo ==========================================================================
echo Ensuring we have all the needed Node.js Package Manager packages.
echo ==========================================================================

echo.
echo ==========================================================================
echo Installing Gulp ^(http://gulpjs.com/^) command line
echo We use this as a cross-operating-system way to build code instead of
echo trying to use Windows command scripts.
echo ==========================================================================
echo.
call npm install --global gulp-cli
if ERRORLEVEL 1 echo ERROR: npm install --global gulp-cli failed with errorlevel %ERRORLEVEL% && exit /b 1
call npm install --save-dev gulp
if ERRORLEVEL 1 echo ERROR: npm install --save-dev gulp failed with errorlevel %ERRORLEVEL% && exit /b 1

echo.
echo ==========================================================================
echo Installing Gulp modules we need:
echo   Uglify - for minifying JavaScript
echo   pump - simplifies dealing with Node.js streams when lots of piping is used.
echo   del - deletes files and folders
echo   path - Always better than using string concatenation.
echo.
echo TODO - get working:
echo   gulp-spritesmith - Lets us assemble a spritesheet/tilemap for Pixi.js
echo     from individual sprite images.
echo     https://www.npmjs.com/package/gulp.spritesmith/
echo   spritesmith-texturepacker - Creates JSON based outputs for spritesheets
echo     from SpriteSmith, for use with Pixi.js.
echo ==========================================================================
echo.
call npm install --save-dev gulp-uglify pump del path
@rem TODO - add some or all of these back and get spritesheet compilation working on Windows: gulp-spritesmith spritesmith-texturepacker gulp-imagemin
if ERRORLEVEL 1 echo ERROR: npm install failed for Gulp modules  with errorlevel %ERRORLEVEL% && exit /b 1

echo.
echo ==========================================================================
echo Installing development modules we need:
echo   Mocha - unit testing framework that uses Node.js and fits well into
echo     Visual Studio Code. https://mochajs.org/
echo   Chai - assertion library for use in Mocha. http://chaijs.com/
echo   spritesheet-js - Assembles individual sprite images into a spritesheet
echo     suitable for Pixi.js. https://github.com/krzysztof-o/spritesheet.js/
echo ==========================================================================
echo.
call npm install --save-dev mocha chai spritesheet-js
if ERRORLEVEL 1 echo ERROR: npm install failed for dev modules with errorlevel %ERRORLEVEL% && exit /b 1

echo.
echo ==========================================================================
echo Installing site modules we need:
echo   Primus - wrapper onto various HTML5 WebSockets libraries, with some additional
echo     sugar. https://github.com/primus/primus . Also includes JSON and BinaryePack
echo     ^(https://github.com/binaryjs/js-binarypack^) which is based on MessagePack
echo     ^(http://msgpack.org/^) wire formats for a choice of debuggability and wire
echo     speed.
echo   ws - needed for Primus as a WebSockets implementation.
echo   binary-pack - needed for using a binary-mode transport in Primus.
echo   Express - web site framework. http://expressjs.com/
echo   compression - Express plugin for compressing content sent over the network.
echo   Pixi.JS - WebGL/Canvas wrapper for Flash-like game and animation authoring.
echo     https://github.com/pixijs/pixi.js
echo ==========================================================================
echo.
call npm install --save primus ws binary-pack express compression pixi.js
if ERRORLEVEL 1 echo ERROR: npm install failed for site modules with errorlevel %ERRORLEVEL% && exit /b 1

echo.
echo ==========================================================================
echo Setting aliases for easier command line experience
echo ==========================================================================
echo.
doskey master = git checkout master
doskey cb = git checkout dev/%USERNAME%/$*
doskey nb = git checkout dev/%USERNAME%/$*
doskey pull = git pull
doskey branch = git branch
doskey stat = git status
doskey mmerge = "git checkout master && git merge dev/%USERNAME%/$* --squash && git commit"

doskey /macros

echo.
echo ==========================================================================
echo Complete!
echo ==========================================================================
echo.

Fix casing on package

Fix casing on package


@echo off

set MSVCVER=2019
set QTVER=5.14.1
set SSLVER=1.1.1d
set PREFIX=C:\Qt
set EXTRABUILDOPTIONS=-qt-sqlite
set PATH=C:\Python\;C:\Python27\;C:\Strawberry\perl\bin;%PATH%

REM DO NOT EDIT BELOW THIS LINE

set STARTDIR=%CD%
set SRCDIR=%CD%\sources
set BUILDDIR=%CD%\build
set PLATFORM=win32-msvc%MSVCVER%
set QTINSTALLDIR=%PREFIX%\%QTVER%\msvc%MSVCVER%-%VSCMD_ARG_TGT_ARCH%-static

set QTRELEASE=official
for %%A in (alpha beta rc) DO (echo.%QTVER% | find /I "%%A">Nul && set QTRELEASE=development)

set QTURL=http://download.qt.io/%QTRELEASE%_releases/qt/%QTVER:~0,-2%/%QTVER%/submodules/qtbase-everywhere-src-%QTVER%.zip
set QTDIR=%SRCDIR%\qtbase-everywhere-src-%QTVER%
set QTBUILDDIR=%QTDIR%\build

set SSLURL=https://www.openssl.org/source/openssl-%SSLVER%.tar.gz
set SSLBUILDDIR=%SRCDIR%\openssl-%SSLVER%
set SSLINSTALLDIR=%QTINSTALLDIR%\openssl-%SSLVER%

set CURLOPTS=-L -C - -O
set ZOPTS=x -aos -y
set PATH=%STARTDIR%\tools\gnuwin32\bin;%STARTDIR%\tools\jom;%STARTDIR%\tools\nasm;%PATH%

@echo off

set MSVCVER=2019
set QTVER=5.15.2
set SSLVER=1.1.1k
set PREFIX=C:\Qt
set EXTRABUILDOPTIONS=-qt-sqlite
set PATH=C:\Python\;C:\Python27\;C:\Strawberry\perl\bin;%PATH%

REM DO NOT EDIT BELOW THIS LINE

set STARTDIR=%CD%
set SRCDIR=%CD%\sources
set BUILDDIR=%CD%\build
set PLATFORM=win32-msvc%MSVCVER%
set QTINSTALLDIR=%PREFIX%\%QTVER%\msvc%MSVCVER%-%VSCMD_ARG_TGT_ARCH%-static

set QTRELEASE=official
for %%A in (alpha beta rc) DO (echo.%QTVER% | find /I "%%A">Nul && set QTRELEASE=development)

set QTURL=http://download.qt.io/%QTRELEASE%_releases/qt/%QTVER:~0,-2%/%QTVER%/submodules/qtbase-everywhere-src-%QTVER%.zip
set QTDIR=%SRCDIR%\qtbase-everywhere-src-%QTVER%
set QTBUILDDIR=%QTDIR%\build

set SSLURL=https://www.openssl.org/source/openssl-%SSLVER%.tar.gz
set SSLBUILDDIR=%SRCDIR%\openssl-%SSLVER%
set SSLINSTALLDIR=%QTINSTALLDIR%\openssl-%SSLVER%

set CURLOPTS=-L -C - -O
set ZOPTS=x -aos -y
set PATH=%STARTDIR%\tools\gnuwin32\bin;%STARTDIR%\tools\jom;%STARTDIR%\tools\nasm;%PATH%

Update options.bat

Update options.bat


@ECHO OFF

echo [   INFO] Build starting at %TIME% %DATE%

rem Populate feature files like feed changes by reading through the code and hooking up
rem all the calls we need, as well as processing settings files
call yarn gen-feedChanges || goto :errexit

echo [   INFO] Checking code style with ESLint...
call yarn legacy-eslint || goto :errexit

rem Generate features/index.js for the new features
call yarn gen-featureIndex || goto :errexit

rem Generate legacy and new settings
call yarn gen-settings || goto :errexit

rem Run webpack to grab all new framework features
echo [   INFO] Webpacking new framework...
call yarn webpack || goto :errexit

rem Transpile the source/ directory, putting the files in src/ which is where Kango expects to see them.
echo [   INFO] Transpiling code with Babel on ES2015 preset...
call yarn legacy-babel || goto :errexit

rem Copy any non JS files across that babel didn't bring with it. Ignore existing files we just transpiled.
echo [   INFO] Copying non JS files...
robocopy sauce/extension/legacy dist/toolkit /E /XC /XN /XO /NFL /NDL /NJH /NJS

goto :exit

:errexit
echo Build errors encountered

:exit
echo [   INFO] Build finished at %TIME% %DATE%

@ECHO OFF

echo [   INFO] Build starting at %TIME% %DATE%

rem Populate feature files like feed changes by reading through the code and hooking up
rem all the calls we need, as well as processing settings files
call yarn gen-feedChanges || goto :errexit

echo [   INFO] Checking code style with ESLint...
call yarn legacy-eslint || goto :errexit

rem Generate features/index.js for the new features
call yarn gen-featureIndex || goto :errexit

rem Generate legacy and new settings
call yarn gen-settings || goto :errexit

rem Run webpack to grab all new framework features
echo [   INFO] Webpacking new framework...
call yarn webpack || goto :errexit

rem Transpile the source/ directory, putting the files in src/ which is where Kango expects to see them.
echo [   INFO] Transpiling code with Babel on ES2015 preset...
call yarn legacy-babel || goto :errexit

rem Copy any non JS files across that babel didn't bring with it. Ignore existing files we just transpiled.
echo [   INFO] Copying non JS files...
robocopy sauce/extension/legacy dist/toolkit/legacy /E /XC /XN /XO /NFL /NDL /NJH /NJS

goto :exit

:errexit
echo Build errors encountered

:exit
echo [   INFO] Build finished at %TIME% %DATE%

Fix builds on Windows

Fix builds on Windows


REM @echo Off
set config=%1
if "%config%" == "" (
   set config=Release
)

set version=1.0.0
if not "%PackageVersion%" == "" (
   set version=%PackageVersion%
)

set nuget=
if "%nuget%" == "" (
	set nuget=nuget
)

set build="%programfiles(x86)%\MSBuild\14.0\Bin\MsBuild.exe"

powershell -Command "(new-object System.Net.WebClient).DownloadFile('https://dist.nuget.org/win-x86-commandline/latest/nuget.exe','nuget.exe')"

copy nuget.exe Sigma.Core
copy nuget.exe Sigma.Core.Monitors.WPF

REM old: "%build%" Sigma.sln /p:Configuration="%config%" /p:Platform=x64

REM build Sigma.Core
cd Sigma.Core

	nuget.exe restore -SolutionDirectory ../

	%build% Sigma.Core.csproj /p:Configuration="%config%" /p:Platform=x64

	REM pack Sigma.Core

	nuget.exe pack "Sigma.Core.csproj" -IncludeReferencedProjects -Prop Platform=x64 -Verbosity detailed -Prop Configuration=%config% -Version %version%

REM build Sigma.Core.Monitors.WPF
cd ../Sigma.Core.Monitors.WPF

	REM update the targets file
	cd build
		powershell -Command "(gc Sigma.Core.Monitors.WPF.targets) -replace '~version~', '%version%' | Out-File Sigma.Core.Monitors.WPF.targets"
		cd ..

	REM actual build
	nuget.exe restore -SolutionDirectory ../

	%build% Sigma.Core.Monitors.WPF.csproj /p:Configuration="%config%" /p:Platform=x64

	REM pack Sigma.Core.Monitors.WPF

	nuget.exe pack "Sigma.Core.Monitors.WPF.csproj" -IncludeReferencedProjects -Prop Platform=x64 -Verbosity detailed -Prop Configuration=%config% -Version %version%

@echo Off
set config=%1
if "%config%" == "" (
   set config=Release
)

set version=1.0.0
if not "%PackageVersion%" == "" (
   set version=%PackageVersion%
)

set nuget=
if "%nuget%" == "" (
	set nuget=nuget
)

set build="%programfiles(x86)%\MSBuild\14.0\Bin\MsBuild.exe"

powershell -Command "(new-object System.Net.WebClient).DownloadFile('https://dist.nuget.org/win-x86-commandline/latest/nuget.exe','nuget.exe')"

copy nuget.exe Sigma.Core
copy nuget.exe Sigma.Core.Monitors.WPF

REM build Sigma.Core
cd Sigma.Core

	nuget.exe restore -SolutionDirectory ../

	%build% Sigma.Core.csproj /p:Configuration="%config%" /p:Platform=x64

	REM pack Sigma.Core

	nuget.exe pack "Sigma.Core.csproj" -IncludeReferencedProjects -Prop Platform=x64 -Verbosity detailed -Prop Configuration=%config% -Version %version%

REM build Sigma.Core.Monitors.WPF
cd ../Sigma.Core.Monitors.WPF

	REM update the targets file
	cd build
		powershell -Command "(gc Sigma.Core.Monitors.WPF.targets) -replace '~version~', '%version%' | Out-File Sigma.Core.Monitors.WPF.targets"
		cd ..

	REM actual build
	nuget.exe restore -SolutionDirectory ../

	%build% Sigma.Core.Monitors.WPF.csproj /p:Configuration="%config%" /p:Platform=x64

	REM pack Sigma.Core.Monitors.WPF

	nuget.exe pack "Sigma.Core.Monitors.WPF.csproj" -IncludeReferencedProjects -Prop Platform=x64 -Verbosity detailed -Prop Configuration=%config% -Version %version%

Improve builed passed, echo off now

Improve builed passed, echo off now

signing out


@echo OFF

	echo.
	echo " _____ _____ ____  _____ "
	echo "|   __|   __|    \|  |  |"
	echo "|__   |  |  |  |  |    -|"
	echo "|_____|_____|____/|__|__|"
	echo.
	echo.
	echo "This batch script helps to build SGDK if PATH environmental variables "
	echo "    are not setup for GDK already.                                    "
	echo.
	echo "(1) When run the GDK and GDK_WIN EnvVars will be configured           "
	echo "    temporarily for the local directory.                              "
	echo "(2) The User will be asked whether to temporarily empty PATH. If yes, "
	echo "    PATH will be cleared for the the local script's execution only.   "
	echo "(3) SGDK clean script will be launched and then SGDK will be rebuild. "

:START
    echo.
    echo.
    echo.
    echo 1) Starting:
    echo ------------
    set "str_ScriptName=%~f0"
    echo Now running %str_ScriptName%
    echo.

    setlocal

:CREATEENVVARS
    echo.
    echo 2) Creating EnvVars:
    echo --------------------
    set "str_MyCurrentDir=%~dp0"

    set "GDK=%str_MyCurrentDir%"
    set "GDK_WIN=%str_MyCurrentDir%"
    set "GDK=%GDK:\=/%"

    set "GDK=%GDK:~3%"
    set "GDK=/%GDK%"

    if %GDK:~-1%==/ set GDK=%GDK:~0,-1%
    if %GDK_WIN:~-1%==\ set GDK_WIN=%GDK_WIN:~0,-1%

    echo GDK is %GDK%
    echo GDK_WIN is %GDK_WIN%

:CHECKINGPATH
    echo.
    echo 3) Checking PATH:
    echo --------------------

    set "PATHREAL=%PATH%"
    echo PATH = %PATH%
    echo.

:PATHCLEARQUESTION
    echo Conflicting GCC setups in PATH can cause issues.
    set /p "EMPTYPATH=Should PATH be temporarily cleared? (Y/[N])?"
    if /i "%EMPTYPATH:~,1%" EQU "Y" goto YCLEARPATH
    if /i "%EMPTYPATH:~,1%" EQU "N" goto NCLEARPATH
    echo Please type Y for Yes or N for No
    goto PATHCLEARQUESTION

:YCLEARPATH
    echo Setting PATH to just GDK stuff so that other CC1's do not conflict.

    REM Assuming that the current directory exists since that is where this file is.
    set "%PATH%=%GDK%;%GDK_WIN%"

    REM if EXIST %GDK_WIN%\bin set PATH=%PATH%;%GDK_WIN%\bin
    if EXIST %GDK_WIN%\bin set PATH=%GDK_WIN%\bin
    echo PATH = %PATH%
    goto CONTINUEAFTERCLEARQUESTION

:NCLEARPATH
    set "TPATH=%GDK%;%GDK_WIN%;%PATH%"
    set "%PATH%=%TPATH%"
    goto CONTINUEAFTERCLEARQUESTION

:CONTINUEAFTERCLEARQUESTION
    echo %GDK_WIN%\bin added to PATH
    echo.
    echo PATH = %PATH%

:LAUNCHING
    echo.
    echo 3) Launching:
    echo ------------------

    %GDK_WIN%\bin\make -f %GDK_WIN%\makelib.gen clean
    %GDK_WIN%\bin\make -f %GDK_WIN%\makelib.gen

    set "PATH=%PATHREAL%"
    echo PATH = %PATH%

:END
    endlocal
    @echo ON
    exit /b

Create build.bat (local build script)

Create build.bat (local build script)

This batch script helps to build SGDK if PATH environmental variables are not setup for GDK already.

(1) When run the GDK and GDK_WIN EnvVars will be configured temporarily for the local directory.
(2) The User will be asked whether to temporarily empty PATH. If yes, PATH will be cleared for the the local script's execution only.
(3) SGDK clean script will be launched and then SGDK will be rebuild.


@echo off
cd %~dp0

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

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

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

:restore
IF EXIST packages\KoreBuild goto run
.nuget\NuGet.exe install KoreBuild -ExcludeVersion -o packages -nocache -pre
.nuget\NuGet.exe install Sake -version 0.2 -o packages -ExcludeVersion

IF "%SKIP_KRE_INSTALL%"=="1" goto run
CALL packages\KoreBuild\build\kvm upgrade -runtime CLR -x86
CALL packages\KoreBuild\build\kvm install default -runtime CoreCLR -x86

:run
CALL packages\KoreBuild\build\kvm use default -runtime CLR -x86
packages\Sake\tools\Sake.exe -I packages\KoreBuild\build -f makefile.shade %*

@echo off
cd %~dp0

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

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

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

:restore
IF EXIST packages\KoreBuild goto run
.nuget\NuGet.exe install KoreBuild -ExcludeVersion -o packages -nocache -pre
.nuget\NuGet.exe install Sake -version 0.2 -o packages -ExcludeVersion

IF "%SKIP_DNX_INSTALL%"=="1" goto run
CALL packages\KoreBuild\build\kvm upgrade -runtime CLR -x86
CALL packages\KoreBuild\build\kvm install default -runtime CoreCLR -x86

:run
CALL packages\KoreBuild\build\kvm use default -runtime CLR -x86
packages\Sake\tools\Sake.exe -I packages\KoreBuild\build -f makefile.shade %*

Update K_BUILD_VERSION/kre/KRE/.k => DNX_BUILD_VERSION/dnx/DNX/.dnx.


@echo off

pushd %~dp0
set "DNX_FEED=https://www.nuget.org/api/v2"
setlocal EnableDelayedExpansion
where dnvm
if %ERRORLEVEL% neq 0 (
    @powershell -NoProfile -ExecutionPolicy unrestricted -Command "&{$Branch='dev';iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/aspnet/Home/dev/dnvminstall.ps1'))}"
    set PATH=!PATH!;!USERPROFILE!\.dnx\bin
    set DNX_HOME=!USERPROFILE!\.dnx
    goto install
)

:install
set
call dnvm install 1.0.0-beta4
call dnvm use 1.0.0-beta4
rem set the runtime path because the above commands set \.dnx<space>\runtimes
set PATH=!USERPROFILE!\.dnx\runtimes\dnx-clr-win-x86.1.0.0-beta4\bin;!PATH!

call dnu restore
if %errorlevel% neq 0 exit /b %errorlevel%
cd tests\OmniSharp.Tests
call dnx . test
if %errorlevel% neq 0 exit /b %errorlevel%
cd ..\OmniSharp.Stdio.Tests
call dnx . test
if %errorlevel% neq 0 exit /b %errorlevel%
cd ..\..
call dnu build src\OmniSharp.Abstractions --configuration Release --out artifacts
call dnu build src\OmniSharp.Roslyn.CSharp --configuration Release --out artifacts
call dnu publish src\OmniSharp --no-source --out artifacts\build\omnisharp --runtime dnx-clr-win-x86.1.0.0-beta4

popd

@echo off

pushd %~dp0
set "DNX_FEED=https://www.nuget.org/api/v2"
setlocal EnableDelayedExpansion
where dnvm
if %ERRORLEVEL% neq 0 (
    @powershell -NoProfile -ExecutionPolicy unrestricted -Command "&{$Branch='dev';iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/aspnet/Home/dev/dnvminstall.ps1'))}"
    set PATH=!PATH!;!USERPROFILE!\.dnx\bin
    set DNX_HOME=!USERPROFILE!\.dnx
    goto install
)

:install
set
call dnvm install 1.0.0-beta4
call dnvm use 1.0.0-beta4
rem set the runtime path because the above commands set \.dnx<space>\runtimes
set PATH=!USERPROFILE!\.dnx\runtimes\dnx-clr-win-x86.1.0.0-beta4\bin;!PATH!

call dnu restore
if %errorlevel% neq 0 exit /b %errorlevel%

pushd tests\OmniSharp.Dnx.Tests
call dnx . test
if %errorlevel% neq 0 exit /b %errorlevel%
popd

pushd tests\OmniSharp.MSBuild.Tests
call dnx . test
if %errorlevel% neq 0 exit /b %errorlevel%
popd

pushd tests\OmniSharp.Plugins.Tests
call dnx . test
if %errorlevel% neq 0 exit /b %errorlevel%
popd

pushd tests\OmniSharp.Roslyn.CSharp.Tests
call dnx . test
if %errorlevel% neq 0 exit /b %errorlevel%
popd

pushd tests\OmniSharp.ScriptCs.Tests
call dnx . test
if %errorlevel% neq 0 exit /b %errorlevel%
popd

pushd tests\OmniSharp.Stdio.Tests
call dnx . test
if %errorlevel% neq 0 exit /b %errorlevel%
popd

pushd tests\OmniSharp.Tests
call dnx . test
if %errorlevel% neq 0 exit /b %errorlevel%
popd

pushd tests\OmniSharp.Tests
call dnx . test
if %errorlevel% neq 0 exit /b %errorlevel%
popd

call dnu build src/OmniSharp.Abstractions --configuration Release --out artifacts
call dnu build src/OmniSharp.Dnx --configuration Release --out artifacts
call dnu build src/OmniSharp.MSBuild --configuration Release --out artifacts
call dnu build src/OmniSharp.Nuget --configuration Release --out artifacts
call dnu build src/OmniSharp.Roslyn --configuration Release --out artifacts
call dnu build src/OmniSharp.Roslyn.CSharp --configuration Release --out artifacts
call dnu build src/OmniSharp.ScriptCs --configuration Release --out artifacts
call dnu build src/OmniSharp.Stdio --configuration Release --out artifacts
call dnu publish src\OmniSharp --no-source --out artifacts\build\omnisharp --runtime dnx-clr-win-x86.1.0.0-beta4

popd

Fix build.cmd to batch build.sh

Fix build.cmd to batch build.sh


Add build.cmd.

Add build.cmd.


@echo off
setlocal

: Check which branch we are on, or just assume master if we are not in a git repository
for /f %%z in ('git rev-parse --abbrev-ref HEAD') do set GIT_BRANCH=%%z
if not defined GIT_BRANCH (
    set GIT_BRANCH=master
)

if "%1"=="/?" (
    goto usage
) else if "%1"=="" (
    set _git_pull=1
    set _compile_vm=1
    set _bootimage=download
    set _bootstrap_factor=1
) else if "%1"=="latest" (
    set _git_pull=1
    set _compile_vm=1
    set _bootimage=download
    set _bootstrap_factor=1
) else if "%1"=="update" (
    set _git_pull=1
    set _compile_vm=1
    set _bootimage=download
    set _bootstrap_factor=1
) else if "%1"=="compile" (
    set _git_pull=0
    set _compile_vm=1
    set _bootimage=current
    set _bootstrap_factor=0
) else if "%1"=="self-bootstrap" (
    set _git_pull=1
    set _compile_vm=0
    set _bootimage="make"
    set _bootstrap_factor=1
) else if "%1"=="bootstrap" (
    set _git_pull=0
    set _compile_vm=0
    set _bootimage=current
    set _bootstrap_factor=1
) else if "%1"=="net-bootstrap" (
    set _git_pull=0
    set _compile_vm=1
    set _bootimage=download
    set _bootstrap_factor=1
) else goto usage

if not exist Nmakefile goto wrongdir

call cl 2>&1 | find "x86" >nul
if not errorlevel 1 (
    echo x86-32 cl.exe detected.
    set _target=x86-32
    set _bootimage=boot.windows-x86.32.image
) else (
    call cl 2>&1 | find "x64" >nul
    if not errorlevel 1 (
        echo x86-64 cl.exe detected.
        set _target=x86-64
        set _bootimage=boot.windows-x86.64.image
    ) else goto nocl
)

echo Deleting staging images from temp/...
del temp\staging.*.image

if "%_git_pull%"=="1" (
    echo Updating working copy from %GIT_BRANCH%...
    call git pull https://github.com/factor/factor %GIT_BRANCH%
    if errorlevel 1 goto fail
)

if "%_compile_vm%"=="1" (
    echo Building vm...
    nmake /nologo /f Nmakefile clean
    if errorlevel 1 goto fail

    nmake /nologo /f Nmakefile %_target%
    if errorlevel 1 goto fail
)

if "%_bootimage%"=="download" (
    echo Fetching %GIT_BRANCH% boot image...
    set boot_image_url=http://downloads.factorcode.org/images/%GIT_BRANCH%/%_bootimage% %_bootimage%
    echo URL: %boot_image_url%
    cscript /nologo misc\http-get.vbs %boot_image_url% %_bootimage%
    if errorlevel 1 goto fail
) else if "%_bootimage%"=="make" (
    echo Making boot image...
    .\factor.com -run=bootstrap.image %_bootimage%
    if errorlevel 1 goto fail
)

if "%_bootstrap_factor%"=="1" (
    echo Bootstrapping...
    .\factor.com -i=%_bootimage%
    if errorlevel 1 goto fail

    echo Copying fresh factor.image to factor.image.fresh.
    copy factor.image factor.image.fresh
    if errorlevel 1 goto fail
)

echo Build complete.
goto :EOF

:fail
echo Build failed.
goto :EOF

:wrongdir
echo build.cmd must be run from the root of the Factor source tree.
goto :EOF

:nocl
echo Unable to detect cl.exe target platform.
echo Make sure you're running within the Visual Studio or Windows SDK environment.
goto :EOF

:usage
echo Usage: build.cmd [command]
echo     Updates the working copy, cleans and builds the vm using nmake,
echo     fetches a boot image, and bootstraps factor.
echo:
echo     The branch that bootstraps is the one that is checked out locally.
echo:
echo     compile - recompile vm
echo     update - git pull, recompile vm, download a boot image, bootstrap
echo     self-bootstrap - git pull, make a boot image, bootstrap
echo     bootstrap - git pull, existing boot image, bootstrap
echo     net-bootstrap - recompile vm, download a boot image, bootstrap
goto :EOF

@echo off
setlocal

: Check which branch we are on, or just assume master if we are not in a git repository
for /f %%z in ('git rev-parse --abbrev-ref HEAD') do set GIT_BRANCH=%%z
if not defined GIT_BRANCH (
    set GIT_BRANCH=master
)

if "%1"=="/?" (
    goto usage
) else if "%1"=="" (
    set _git_pull=1
    set _compile_vm=1
    set _bootimage=download
    set _bootstrap_factor=1
) else if "%1"=="latest" (
    set _git_pull=1
    set _compile_vm=1
    set _bootimage=download
    set _bootstrap_factor=1
) else if "%1"=="update" (
    set _git_pull=1
    set _compile_vm=1
    set _bootimage=download
    set _bootstrap_factor=1
) else if "%1"=="compile" (
    set _git_pull=0
    set _compile_vm=1
    set _bootimage=current
    set _bootstrap_factor=0
) else if "%1"=="self-bootstrap" (
    set _git_pull=1
    set _compile_vm=0
    set _bootimage="make"
    set _bootstrap_factor=1
) else if "%1"=="bootstrap" (
    set _git_pull=0
    set _compile_vm=0
    set _bootimage=current
    set _bootstrap_factor=1
) else if "%1"=="net-bootstrap" (
    set _git_pull=0
    set _compile_vm=1
    set _bootimage=download
    set _bootstrap_factor=1
) else goto usage

if not exist Nmakefile goto wrongdir

call cl 2>&1 | find "x86" >nul
if not errorlevel 1 (
    echo x86-32 cl.exe detected.
    set _target=x86-32
    set _bootimage=boot.windows-x86.32.image
) else (
    call cl 2>&1 | find "x64" >nul
    if not errorlevel 1 (
        echo x86-64 cl.exe detected.
        set _target=x86-64
        set _bootimage=boot.windows-x86.64.image
    ) else goto nocl
)

echo Deleting staging images from temp/...
del temp\staging.*.image

if "%_git_pull%"=="1" (
    echo Updating working copy from %GIT_BRANCH%...
    call git pull https://github.com/factor/factor %GIT_BRANCH%
    if errorlevel 1 goto fail
)

if "%_compile_vm%"=="1" (
    echo Building vm...
    nmake /nologo /f Nmakefile clean
    if errorlevel 1 goto fail

    nmake /nologo /f Nmakefile %_target%
    if errorlevel 1 goto fail
)

if "%_bootimage%"=="download" (
    echo Fetching %GIT_BRANCH% boot image...
    set boot_image_url=http://downloads.factorcode.org/images/%GIT_BRANCH%/%_bootimage% %_bootimage%
    echo URL: %boot_image_url%
    cscript /nologo misc\http-get.vbs %boot_image_url% %_bootimage%
    if errorlevel 1 goto fail
) else if "%_bootimage%"=="make" (
    echo Making boot image...
    .\factor.com -run=bootstrap.image %_bootimage%
    if errorlevel 1 goto fail
)

if "%_bootstrap_factor%"=="1" (
    echo Bootstrapping...
    .\factor.com -i=%_bootimage%
    if errorlevel 1 goto fail

    echo Copying fresh factor.image to factor.image.fresh.
    copy factor.image factor.image.fresh
    if errorlevel 1 goto fail
)

echo Build complete.
goto :EOF

:fail
echo Build failed.
goto :EOF

:wrongdir
echo build.cmd must be run from the root of the Factor source tree.
goto :EOF

:nocl
echo Unable to detect cl.exe target platform.
echo Make sure you're running within the Visual Studio or Windows SDK environment.
goto :EOF

:usage
echo Usage: build.cmd [command]
echo     Updates the working copy, cleans and builds the vm using nmake,
echo     fetches a boot image, and bootstraps factor.
echo:
echo     The branch that bootstraps is the one that is checked out locally.
echo:
echo     compile - recompile vm
echo     update - git pull, recompile vm, download a boot image, bootstrap
echo     self-bootstrap - git pull, make a boot image, bootstrap
echo     bootstrap - existing boot image, bootstrap
echo     net-bootstrap - recompile vm, download a boot image, bootstrap
goto :EOF

fix usage.

build.cmd: fix usage.


@echo off
cd %~dp0

SETLOCAL
SET CACHED_NUGET=%LocalAppData%\NuGet\NuGet.exe
SET BUILDCMD_KOREBUILD_VERSION=""
SET BUILDCMD_DNX_VERSION=""

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

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

:restore
IF EXIST packages\KoreBuild goto run
IF %BUILDCMD_KOREBUILD_VERSION%=="" (
	.nuget\NuGet.exe install KoreBuild -ExcludeVersion -o packages -nocache -pre
) ELSE (
	.nuget\NuGet.exe install KoreBuild -version %BUILDCMD_KOREBUILD_VERSION% -ExcludeVersion -o packages -nocache -pre
)
.nuget\NuGet.exe install Sake -version 0.2 -o packages -ExcludeVersion

IF "%SKIP_DNX_INSTALL%"=="1" goto run
IF %BUILDCMD_DNX_VERSION%=="" (
	CALL packages\KoreBuild\build\dnvm upgrade -runtime CLR -arch x86
) ELSE (
	CALL packages\KoreBuild\build\dnvm install %BUILDCMD_DNX_VERSION% -runtime CLR -arch x86 -a default
)
CALL packages\KoreBuild\build\dnvm install default -runtime CoreCLR -arch x86

:run
CALL packages\KoreBuild\build\dnvm use default -runtime CLR -arch x86
packages\Sake\tools\Sake.exe -I packages\KoreBuild\build -f makefile.shade %*

@echo off
cd %~dp0

SETLOCAL
SET CACHED_NUGET=%LocalAppData%\NuGet\NuGet.exe
SET BUILDCMD_KOREBUILD_VERSION=""
SET BUILDCMD_DNX_VERSION=""

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

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

:restore
IF EXIST packages\KoreBuild goto run
IF %BUILDCMD_KOREBUILD_VERSION%=="" (
	.nuget\NuGet.exe install KoreBuild -ExcludeVersion -o packages -nocache -pre
) ELSE (
	.nuget\NuGet.exe install KoreBuild -version %BUILDCMD_KOREBUILD_VERSION% -ExcludeVersion -o packages -nocache -pre
)
.nuget\NuGet.exe install Sake -ExcludeVersion -Source https://www.nuget.org/api/v2/ -Out packages

IF "%SKIP_DNX_INSTALL%"=="1" goto run
IF %BUILDCMD_DNX_VERSION%=="" (
	CALL packages\KoreBuild\build\dnvm upgrade -runtime CLR -arch x86
) ELSE (
	CALL packages\KoreBuild\build\dnvm install %BUILDCMD_DNX_VERSION% -runtime CLR -arch x86 -a default
)
CALL packages\KoreBuild\build\dnvm install default -runtime CoreCLR -arch x86

:run
CALL packages\KoreBuild\build\dnvm use default -runtime CLR -arch x86
packages\Sake\tools\Sake.exe -I packages\KoreBuild\build -f makefile.shade %*

Update 'build.cmd' to pull Sake from v2 NuGet feed.


@echo off

pushd %~dp0

SET PACKAGEPATH=.\packages\
SET NUGET=.\tools\nuget\NuGet.exe
SET NUGETOPTIONS=-ConfigFile .\tools\nuget\NuGet.Config -OutputDirectory %PACKAGEPATH% -ExcludeVersion

IF NOT EXIST %PACKAGEPATH%FAKE\Ver_4.25.4 (
  RD /S/Q %PACKAGEPATH%FAKE
  %NUGET% install FAKE -Version 4.25.4 %NUGETOPTIONS%
  COPY NUL %PACKAGEPATH%FAKE\Ver_4.25.4
)

IF NOT EXIST %PACKAGEPATH%FAKE.BuildLib\Ver_0.3.5 (
  RD /S/Q %PACKAGEPATH%FAKE.BuildLib
  %NUGET% install FAKE.BuildLib -Version 0.3.5 %NUGETOPTIONS%
  COPY NUL %PACKAGEPATH%FAKE.BuildLib\Ver_0.3.5
)

set encoding=utf-8
"%PACKAGEPATH%FAKE\tools\FAKE.exe" build.fsx %*

popd

@echo off

pushd %~dp0

SET PACKAGEPATH=.\packages\
SET NUGET=.\tools\nuget\NuGet.exe
SET NUGETOPTIONS=-ConfigFile .\tools\nuget\NuGet.Config -OutputDirectory %PACKAGEPATH% -ExcludeVersion

IF NOT EXIST %PACKAGEPATH%FAKE\Ver_4.28.0 (
  RD /S/Q %PACKAGEPATH%FAKE
  %NUGET% install FAKE -Version 4.28.0 %NUGETOPTIONS%
  COPY NUL %PACKAGEPATH%FAKE\Ver_4.28.0
)

IF NOT EXIST %PACKAGEPATH%FAKE.BuildLib\Ver_0.3.6 (
  RD /S/Q %PACKAGEPATH%FAKE.BuildLib
  %NUGET% install FAKE.BuildLib -Version 0.3.6 %NUGETOPTIONS%
  COPY NUL %PACKAGEPATH%FAKE.BuildLib\Ver_0.3.6
)

set encoding=utf-8
"%PACKAGEPATH%FAKE\tools\FAKE.exe" build.fsx %*

popd

Use BuildLib 0.3.6

Use BuildLib 0.3.6


@echo Off
pushd %~dp0
setlocal

:Build
call npm install
if %ERRORLEVEL% neq 0 goto BuildFail

call npm run validate
if %ERRORLEVEL% neq 0 goto BuildFail

goto BuildSuccess

:BuildFail
echo.
echo *** BUILD FAILED ***
goto End

:BuildSuccess
echo.
echo *** BUILD SUCCEEDED ***
goto End

:End
echo.
popd
exit /B %ERRORLEVEL%

Add build.cmd

Add build.cmd


@echo off
pushd "%~dp0"
call :main %*
popd
goto :EOF

:main
setlocal
if "%PROCESSOR_ARCHITECTURE%"=="x86" set MSBUILD=%ProgramFiles%
if defined ProgramFiles(x86) set MSBUILD=%ProgramFiles(x86)%
set MSBUILD=%MSBUILD%\MSBuild\14.0\bin\msbuild
if not exist "%MSBUILD%" goto :nomsbuild
for %%i in (dotnet.exe) do set dotnet=%%~dpnx$PATH:i
if "%dotnet%"=="" goto :nodotnet
if "%1"=="docs" shift & goto :docs

:base
dotnet restore ^
  && for %%i in (debug release) do "%MSBUILD%" "MoreLinq.sln" /v:m /p:Configuration=%%i %* || exit /b 1
goto :EOF

:docs
call :base && "%MSBUILD%" MoreLinq.shfbproj %1 %2 %3 %4 %5 %6 %7 %8 %9
goto :EOF

:nomsbuild
echo>&2 Microsoft Build Tools 2015 does not appear to be installed on this
echo>&2 machine, which is required to build the solution. You can install
echo>&2 it from the URL below and then try building again:
echo>&2 https://www.microsoft.com/en-us/download/details.aspx?id=48159
exit /b s

:nodotnet
echo>&2 dotnet executable not found in PATH
echo>&2 For more on dotnet, see https://www.microsoft.com/net/core
exit /b 2

@echo off
pushd "%~dp0"
call :main %*
popd
goto :EOF

:main
setlocal
if "%PROCESSOR_ARCHITECTURE%"=="x86" set MSBUILD=%ProgramFiles%
if defined ProgramFiles(x86) set MSBUILD=%ProgramFiles(x86)%
set MSBUILD=%MSBUILD%\MSBuild\14.0\bin\msbuild
if not exist "%MSBUILD%" goto :nomsbuild
for %%i in (dotnet.exe) do set dotnet=%%~dpnx$PATH:i
if "%dotnet%"=="" goto :nodotnet
if "%1"=="docs" shift & goto :docs

:base
dotnet --info ^
  && dotnet restore ^
  && for %%i in (debug release) do "%MSBUILD%" "MoreLinq.sln" /v:m /p:Configuration=%%i %* || exit /b 1
goto :EOF

:docs
call :base && "%MSBUILD%" MoreLinq.shfbproj %1 %2 %3 %4 %5 %6 %7 %8 %9
goto :EOF

:nomsbuild
echo>&2 Microsoft Build Tools 2015 does not appear to be installed on this
echo>&2 machine, which is required to build the solution. You can install
echo>&2 it from the URL below and then try building again:
echo>&2 https://www.microsoft.com/en-us/download/details.aspx?id=48159
exit /b s

:nodotnet
echo>&2 dotnet executable not found in PATH
echo>&2 For more on dotnet, see https://www.microsoft.com/net/core
exit /b 2

Add dotnet info to build output

Add dotnet info to build output


cd src\tools\msvc

echo $config-^>{openssl} = '%LIBRARY_PREFIX%'; >> config.pl
echo $config-^>{zlib} = '%LIBRARY_PREFIX%';    >> config.pl
echo $config-^>{python} = '%PREFIX%';          >> config.pl

:: Need to move a more current msbuild into PATH.  32-bit one in particular on AppVeyor barfs on the solution that
::    Postgres writes here.  This one comes from the Win7 SDK (.net 4.0), and is known to work.
if "%ARCH%" == "32" (
   COPY C:\Windows\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe .\
)

call build.bat
call install.bat "%LIBRARY_PREFIX%"
call vcregress check
call vcregress installcheck
call vcregress plcheck
call vcregress contribcheck

cd src\tools\msvc

echo $config-^>{openssl} = '%LIBRARY_PREFIX%'; >> config.pl
echo $config-^>{zlib} = '%LIBRARY_PREFIX%';    >> config.pl
echo $config-^>{python} = '%PREFIX%';          >> config.pl

:: Need to move a more current msbuild into PATH.  32-bit one in particular on AppVeyor barfs on the solution that
::    Postgres writes here.  This one comes from the Win7 SDK (.net 4.0), and is known to work.
if "%ARCH%" == "32" (
   COPY C:\Windows\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe .\
   set PATH=%CD%;%PATH%
)

call build.bat
call install.bat "%LIBRARY_PREFIX%"
call vcregress check
call vcregress installcheck
call vcregress plcheck
call vcregress contribcheck

set PATH for msbuild in postgres

set PATH for msbuild in postgres


ring gendoc.ring
copy ringlibsdlfuncsdoc.txt ..\docs\source\

ring gendoc.ring
copy ringlibsdlfuncsdoc.txt ..\..\docs\source\

Update RingSDL - document.bat

Update RingSDL - document.bat


@echo off
REM @author Sebastian Thomschke, Vegard IT GmbH
REM
REM generates API documentation using dox at <project_root>\target\site

setlocal

set TOP_LEVEL_PACKAGE=hx.concurrent
set OWNER=https://vegardit.com

set CDP=%~dp0

pushd .
cd "%CDP%..\target"
set TARGET=%CD%
popd

REM extract GIT URL from haxelib.json
for /f "tokens=*" %%a in ( 'findstr url "%CDP%..\haxelib.json"' ) do (set textLine=%%a)
set REPO_URL=%textLine:"url": "=%
set REPO_URL=%REPO_URL:",=%
set REPO_URL=%REPO_URL:"=%
echo REPO_URL=%REPO_URL%

REM extract project version from haxelib.json
for /f "tokens=*" %%a in ( 'findstr version "%CDP%..\haxelib.json"' ) do (set textLine=%%a)
set PROJECT_VERSION=%textLine:"version": "=%
set PROJECT_VERSION=%PROJECT_VERSION:",=%
set PROJECT_VERSION=%PROJECT_VERSION:"=%

REM extract project name from haxelib.json
for /f "tokens=*" %%a in ( 'findstr name "%CDP%..\haxelib.json"' ) do (set textLine=%%a)
set PROJECT_NAME=%textLine:"name": "=%
set PROJECT_NAME=%PROJECT_NAME:",=%
set PROJECT_NAME=%PROJECT_NAME:"=%

REM extract project description from haxelib.json
for /f "tokens=*" %%a in ( 'findstr description "%CDP%..\haxelib.json"' ) do (set textLine=%%a)
set PROJECT_DESCRIPTION=%textLine:"description": "=%
set PROJECT_DESCRIPTION=%PROJECT_DESCRIPTION:",=%
set PROJECT_DESCRIPTION=%PROJECT_DESCRIPTION:"=%

haxelib list | findstr dox >NUL
if %errorlevel% neq 0 (
    echo Installing [dox]...
    haxelib install dox
)

if exist "%TARGET%\site" (
    echo Cleaning %TARGET%\site...
    rd /s /q "%TARGET%\site"
)

echo Analyzing source code...
haxe -cp "%CDP%..\src" --no-output -D doc-gen -xml "%TARGET%\doc.xml" --macro include('%TOP_LEVEL_PACKAGE%')

REM https://github.com/HaxeFoundation/dox/wiki/Commandline-arguments-overview
echo Generating HTML files...
haxelib run dox ^
 --title "%PROJECT_NAME% %PROJECT_VERSION% API documentation" ^
 --toplevel-package "%TOP_LEVEL_PACKAGE%" ^
 -D description "%PROJECT_NAME%: %PROJECT_DESCRIPTION%" ^
 -D source-path "%REPO_URL%/tree/master/src" ^
 -D themeColor 0x00658F ^
 -D version "%PROJECT_VERSION%" ^
 -D website "%OWNER%" ^
 -ex "^%TOP_LEVEL_PACKAGE:.=\.%\.internal" ^
 -i "%TARGET%\doc.xml" ^
 -o "%TARGET%\site"

echo.
echo Documentation generated at [file:///%TARGET:\=/%/site/index.html]...

endlocal

@echo off
REM @author Sebastian Thomschke, Vegard IT GmbH
REM
REM generates API documentation using dox at <project_root>\target\site

setlocal

set TOP_LEVEL_PACKAGE=hx.concurrent
set OWNER=https://vegardit.com

REM cd into project root
pushd .
cd %~dp0..

REM extract GIT URL from haxelib.json
for /f "tokens=*" %%a in ( 'findstr url haxelib.json' ) do (set textLine=%%a)
set REPO_URL=%textLine:"url": "=%
set REPO_URL=%REPO_URL:",=%
set REPO_URL=%REPO_URL:"=%
echo REPO_URL=%REPO_URL%

REM extract project version from haxelib.json
for /f "tokens=*" %%a in ( 'findstr version haxelib.json' ) do (set textLine=%%a)
set PROJECT_VERSION=%textLine:"version": "=%
set PROJECT_VERSION=%PROJECT_VERSION:",=%
set PROJECT_VERSION=%PROJECT_VERSION:"=%
echo PROJECT_VERSION=%PROJECT_VERSION%

REM extract project name from haxelib.json
for /f "tokens=*" %%a in ( 'findstr name haxelib.json' ) do (set textLine=%%a)
set PROJECT_NAME=%textLine:"name": "=%
set PROJECT_NAME=%PROJECT_NAME:",=%
set PROJECT_NAME=%PROJECT_NAME:"=%

REM extract project description from haxelib.json
for /f "tokens=*" %%a in ( 'findstr description haxelib.json' ) do (set textLine=%%a)
set PROJECT_DESCRIPTION=%textLine:"description": "=%
set PROJECT_DESCRIPTION=%PROJECT_DESCRIPTION:",=%
set PROJECT_DESCRIPTION=%PROJECT_DESCRIPTION:"=%

haxelib list | findstr dox >NUL
if %errorlevel% neq 0 (
    echo Installing [dox]...
    haxelib install dox
)

if exist target\site (
    echo Cleaning target\site...
    del target\doc.xml >NUL
    rd /s /q target\site
)

echo Analyzing source code...
haxe -cp src --no-output -D doc-gen -xml target\doc.xml --macro include('%TOP_LEVEL_PACKAGE%') || goto :eof

REM https://github.com/HaxeFoundation/dox/wiki/Commandline-arguments-overview
echo Generating HTML files...
haxelib run dox ^
 --title "%PROJECT_NAME% %PROJECT_VERSION% API documentation" ^
 --toplevel-package "%TOP_LEVEL_PACKAGE%" ^
 -D description "%PROJECT_NAME%: %PROJECT_DESCRIPTION%" ^
 -D source-path "%REPO_URL%/tree/master/src" ^
 -D themeColor 0x1690CC ^
 -D version "%PROJECT_VERSION%" ^
 -D website "%OWNER%" ^
 -ex "^%TOP_LEVEL_PACKAGE:.=\.%\.internal" ^
 -i target\doc.xml ^
 -o target\site || goto :eof

set INDEX_HTML=%CD%\target\site\index.html

echo.
echo Documentation generated at [file:///%INDEX_HTML:\=/%]...

:eof
popd
endlocal

use https url

use https url


rem if "%APPVEYOR_REPO_TAG%" NEQ "True" goto :ok

set HERE=%~dp0

git tag -a %APPVEYOR_BUILD_VERSION% -m "Release vesion %APPVEYOR_BUILD_VERSION%" || goto :ko
git push --tags || goto :ko

%HERE%tools\github-release.exe release ^
                         --user pchalamet ^
                         --repo full-build ^
						 --tag %APPVEYOR_BUILD_VERSION% ^
						 --name "full-build %APPVEYOR_BUILD_VERSION%" ^
                         --description "%APPVEYOR_PROJECT_NAME% %APPVEYOR_BUILD_VERSION% - %PLATFORM% %CONFIGURATION%" ^
                         --pre-release || goto :ko

%HERE%tools\github-release upload ^
                     --user pchalamet ^
					 --repo full-build ^
                     --tag %APPVEYOR_BUILD_VERSION% ^
                     --name "%APPVEYOR_PROJECT_NAME%-net45-%PLATFORM%" ^
                     --file %HERE%/src/bin/%CONFIGURATION%.zip || goto :ko

:ok
exit /b 0

:ko
exit /b 5

if "%APPVEYOR_REPO_TAG%" NEQ "True" goto :ok

set HERE=%~dp0

git tag -a %APPVEYOR_BUILD_VERSION% -m "Release vesion %APPVEYOR_BUILD_VERSION%" || goto :ko
git push --tags https://%GITHUB_TOKEN%:@github.com/pchalamet/full-build.git || goto :ko

%HERE%tools\github-release.exe release ^
                         --user pchalamet ^
                         --repo full-build ^
						 --tag %APPVEYOR_BUILD_VERSION% ^
						 --name "full-build %APPVEYOR_BUILD_VERSION%" ^
                         --description "%APPVEYOR_PROJECT_NAME% %APPVEYOR_BUILD_VERSION% - %PLATFORM% %CONFIGURATION%" ^
                         --pre-release || goto :ko

%HERE%tools\github-release upload ^
                     --user pchalamet ^
					 --repo full-build ^
                     --tag %APPVEYOR_BUILD_VERSION% ^
                     --name "%APPVEYOR_PROJECT_NAME%-net45-%PLATFORM%" ^
                     --file %HERE%/src/bin/%CONFIGURATION%.zip || goto :ko

:ok
exit /b 0

:ko
exit /b 5

fix git tagging

fix git tagging


@ECHO OFF
SETLOCAL
SET EL=0

ECHO ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ %~f0 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~

IF /I "%msvs_toolset%"=="" ECHO msvs_toolset unset, defaulting to 12 && SET msvs_toolset=12
SET NODE_MAJOR=%nodejs_version:~0,1%
IF %NODE_MAJOR% GTR 4 ECHO detected node v5, forcing msvs_toolset 14 && SET msvs_toolset=14

SET PATH=%CD%;%PATH%
SET msvs_version=2013
IF "%msvs_toolset%"=="14" SET msvs_version=2015

ECHO APPVEYOR^: %APPVEYOR%
ECHO nodejs_version^: %nodejs_version%
ECHO platform^: %platform%
ECHO msvs_toolset^: %msvs_toolset%
ECHO msvs_version^: %msvs_version%
ECHO TOOLSET_ARGS^: %TOOLSET_ARGS%

ECHO activating VS command prompt
:: NOTE this call makes the x64 -> X64
IF /I "%platform%"=="x64" ECHO x64 && CALL "C:\Program Files (x86)\Microsoft Visual Studio %msvs_toolset%.0\VC\vcvarsall.bat" amd64
IF /I "%platform%"=="x86" ECHO x86 && CALL "C:\Program Files (x86)\Microsoft Visual Studio %msvs_toolset%.0\VC\vcvarsall.bat" x86
IF %ERRORLEVEL% NEQ 0 GOTO ERROR

ECHO using compiler^: && CALL cl
IF %ERRORLEVEL% NEQ 0 GOTO ERROR

ECHO using MSBuild^: && CALL msbuild /version && ECHO.
IF %ERRORLEVEL% NEQ 0 GOTO ERROR

ECHO downloading/installing node
::only use Install-Product when using VS2013
::IF /I "%APPVEYOR%"=="True" IF /I "%msvs_toolset%"=="12" powershell Install-Product node $env:nodejs_version $env:Platform
::TESTING:
::always install (get npm matching node), but delete installed programfiles node.exe afterwards for VS2015 (using custom node.exe)
IF /I "%APPVEYOR%"=="True" GOTO APPVEYOR_INSTALL
GOTO SKIP_APPVEYOR_INSTALL

:APPVEYOR_INSTALL
IF /I "%platform%"=="x64" powershell Install-Product node $env:nodejs_version x64
IF /I "%platform%"=="x86" powershell Install-Product node $env:nodejs_version x86
IF %ERRORLEVEL% NEQ 0 GOTO ERROR

ECHO node major version^: %NODE_MAJOR%
IF %NODE_MAJOR% GTR 0 ECHO node version greater than zero, not updating npm && GOTO SKIP_APPVEYOR_INSTALL

powershell Set-ExecutionPolicy Unrestricted -Scope CurrentUser -Force
IF %ERRORLEVEL% NEQ 0 GOTO ERROR

:SKIP_APPVEYOR_INSTALL
IF /I "%msvs_toolset%"=="12" GOTO NODE_INSTALLED
IF %NODE_MAJOR% GTR 4 GOTO NODE_INSTALLED

::custom node for VS2015
SET ARCHPATH=
IF "%platform%"=="X64" (SET ARCHPATH=x64/)
IF "%platform%"=="x64" (SET ARCHPATH=x64/)
SET NODE_URL=https://mapbox.s3.amazonaws.com/node-cpp11/v%nodejs_version%/%ARCHPATH%node.exe
ECHO downloading node^: %NODE_URL%
powershell Invoke-WebRequest "${env:NODE_URL}" -OutFile node.exe
IF %ERRORLEVEL% NEQ 0 GOTO ERROR

ECHO deleting node ...
SET NODE_EXE_PRG=%ProgramFiles%\nodejs\node.exe
IF EXIST "%NODE_EXE_PRG%" ECHO found %NODE_EXE_PRG%, deleting... && DEL /F "%NODE_EXE_PRG%"
IF %ERRORLEVEL% NEQ 0 GOTO ERROR
IF EXIST "%ProgramFiles%\nodejs" ECHO copy custom node.exe to %ProgramFiles%\nodejs\ && COPY node.exe "%ProgramFiles%\nodejs\"
IF %ERRORLEVEL% NEQ 0 GOTO ERROR

SET NODE_EXE_PRG=%ProgramFiles(x86)%\nodejs\node.exe
IF EXIST "%NODE_EXE_PRG%" ECHO found %NODE_EXE_PRG%, deleting... && DEL /F "%NODE_EXE_PRG%"
IF %ERRORLEVEL% NEQ 0 GOTO ERROR
IF EXIST "%ProgramFiles(x86)%\nodejs" ECHO copy custom node.exe to %ProgramFiles(x86)%\nodejs\ && COPY node.exe "%ProgramFiles(x86)%\nodejs\"
IF %ERRORLEVEL% NEQ 0 GOTO ERROR

ECHO delete node.exe in current directory && DEL node.exe
IF %ERRORLEVEL% NEQ 0 GOTO ERROR

:NODE_INSTALLED

ECHO available node.exe^:
call where node
ECHO available npm^:
call where npm

ECHO node^: && call node -v
call node -e "console.log('  - arch:',process.arch,'\n  - argv:',process.argv,'\n  - execPath:',process.execPath)"
IF %ERRORLEVEL% NEQ 0 GOTO ERROR

ECHO npm^: && CALL npm -v
IF %ERRORLEVEL% NEQ 0 GOTO ERROR

ECHO ===== where npm puts stuff START ============
ECHO npm root && CALL npm root
IF %ERRORLEVEL% NEQ 0 GOTO ERROR
ECHO npm root -g && CALL npm root -g
IF %ERRORLEVEL% NEQ 0 GOTO ERROR

ECHO npm bin && CALL npm bin
IF %ERRORLEVEL% NEQ 0 GOTO ERROR
ECHO npm bin -g && CALL npm bin -g
IF %ERRORLEVEL% NEQ 0 GOTO ERROR

SET NPM_BIN_DIR=
FOR /F "tokens=*" %%i in ('CALL npm bin -g') DO SET NPM_BIN_DIR=%%i
IF %ERRORLEVEL% NEQ 0 GOTO ERROR
IF /I "%NPM_BIN_DIR%"=="%CD%" ECHO ERROR npm bin -g equals local directory && SET ERRORLEVEL=1 && GOTO ERROR
ECHO ===== where npm puts stuff END ============

IF "%nodejs_version:~0,1%"=="0" npm install https://github.com/springmeyer/node-gyp/tarball/v3.x
IF %ERRORLEVEL% NEQ 0 GOTO ERROR
IF "%nodejs_version:~0,1%"=="4" npm install node-gyp@3.x
IF %ERRORLEVEL% NEQ 0 GOTO ERROR

CALL npm install --build-from-source --msvs_version=%msvs_version% %TOOLSET_ARGS% --loglevel=http
IF %ERRORLEVEL% NEQ 0 GOTO ERROR

FOR /F "tokens=*" %%i in ('CALL node_modules\.bin\node-pre-gyp reveal module --silent') DO SET MODULE=%%i
IF %ERRORLEVEL% NEQ 0 GOTO ERROR
FOR /F "tokens=*" %%i in ('node -e "console.log(process.execPath)"') DO SET NODE_EXE=%%i
IF %ERRORLEVEL% NEQ 0 GOTO ERROR

dumpbin /DEPENDENTS "%NODE_EXE%"
IF %ERRORLEVEL% NEQ 0 GOTO ERROR
dumpbin /DEPENDENTS "%MODULE%"
IF %ERRORLEVEL% NEQ 0 GOTO ERROR

::skipping check for errorlevel npm test result when using io.js
::@springmeyer: how to proceed?
IF NOT "%nodejs_version%"=="1.8.1" IF NOT "%nodejs_version%"=="2.0.0" GOTO CHECK_NPM_TEST_ERRORLEVEL

ECHO calling npm test
CALL npm test
ECHO ==========================================
ECHO ==========================================
ECHO ==========================================
ECHO using iojs, not checking test result!!!!!!!!!
ECHO ==========================================
ECHO ==========================================
ECHO ==========================================

GOTO NPM_TEST_FINISHED

:CHECK_NPM_TEST_ERRORLEVEL
ECHO calling npm test
CALL npm test
IF %ERRORLEVEL% NEQ 0 GOTO ERROR

:NPM_TEST_FINISHED

CALL node_modules\.bin\node-pre-gyp package %TOOLSET_ARGS%
::make commit message env var shorter
SET CM=%APPVEYOR_REPO_COMMIT_MESSAGE%
IF NOT "%CM%" == "%CM:[publish binary]=%" (ECHO publishing && CALL node_modules\.bin\node-pre-gyp --msvs_version=%msvs_version% publish %TOOLSET_ARGS%) ELSE (ECHO not publishing)
IF %ERRORLEVEL% NEQ 0 GOTO ERROR

GOTO DONE

:ERROR
ECHO ~~~~~~~~~~~~~~~~~~~~~~ ERROR %~f0 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
ECHO ERRORLEVEL^: %ERRORLEVEL%
SET EL=%ERRORLEVEL%

:DONE
ECHO ~~~~~~~~~~~~~~~~~~~~~~ DONE %~f0 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~

EXIT /b %EL%

@ECHO OFF
SETLOCAL
SET EL=0

ECHO ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ %~f0 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~

IF /I "%msvs_toolset%"=="" ECHO msvs_toolset unset, defaulting to 12 && SET msvs_toolset=12
SET NODE_MAJOR=%nodejs_version:~0,1%
IF %NODE_MAJOR% GTR 4 ECHO detected node v5, forcing msvs_toolset 14 && SET msvs_toolset=14

SET PATH=%CD%;%PATH%
SET msvs_version=2013
IF "%msvs_toolset%"=="14" SET msvs_version=2015

ECHO APPVEYOR^: %APPVEYOR%
ECHO nodejs_version^: %nodejs_version%
ECHO platform^: %platform%
ECHO msvs_toolset^: %msvs_toolset%
ECHO msvs_version^: %msvs_version%
ECHO TOOLSET_ARGS^: %TOOLSET_ARGS%

ECHO activating VS command prompt
:: NOTE this call makes the x64 -> X64
IF /I "%platform%"=="x64" ECHO x64 && CALL "C:\Program Files (x86)\Microsoft Visual Studio %msvs_toolset%.0\VC\vcvarsall.bat" amd64
IF /I "%platform%"=="x86" ECHO x86 && CALL "C:\Program Files (x86)\Microsoft Visual Studio %msvs_toolset%.0\VC\vcvarsall.bat" x86
IF %ERRORLEVEL% NEQ 0 GOTO ERROR

ECHO using compiler^: && CALL cl
IF %ERRORLEVEL% NEQ 0 GOTO ERROR

ECHO using MSBuild^: && CALL msbuild /version && ECHO.
IF %ERRORLEVEL% NEQ 0 GOTO ERROR

ECHO downloading/installing node
::only use Install-Product when using VS2013
::IF /I "%APPVEYOR%"=="True" IF /I "%msvs_toolset%"=="12" powershell Install-Product node $env:nodejs_version $env:Platform
::TESTING:
::always install (get npm matching node), but delete installed programfiles node.exe afterwards for VS2015 (using custom node.exe)
IF /I "%APPVEYOR%"=="True" GOTO APPVEYOR_INSTALL
GOTO SKIP_APPVEYOR_INSTALL

:APPVEYOR_INSTALL
IF /I "%platform%"=="x64" powershell Install-Product node $env:nodejs_version x64
IF /I "%platform%"=="x86" powershell Install-Product node $env:nodejs_version x86
IF %ERRORLEVEL% NEQ 0 GOTO ERROR

ECHO node major version^: %NODE_MAJOR%
IF %NODE_MAJOR% GTR 0 ECHO node version greater than zero, not updating npm && GOTO SKIP_APPVEYOR_INSTALL

powershell Set-ExecutionPolicy Unrestricted -Scope CurrentUser -Force
IF %ERRORLEVEL% NEQ 0 GOTO ERROR

:SKIP_APPVEYOR_INSTALL
IF /I "%msvs_toolset%"=="12" GOTO NODE_INSTALLED
IF %NODE_MAJOR% GTR 4 GOTO NODE_INSTALLED

::custom node for VS2015
SET ARCHPATH=
IF "%platform%"=="X64" (SET ARCHPATH=x64/)
IF "%platform%"=="x64" (SET ARCHPATH=x64/)
SET NODE_URL=https://mapbox.s3.amazonaws.com/node-cpp11/v%nodejs_version%/%ARCHPATH%node.exe
ECHO downloading node^: %NODE_URL%
powershell Invoke-WebRequest "${env:NODE_URL}" -OutFile node.exe
IF %ERRORLEVEL% NEQ 0 GOTO ERROR

ECHO deleting node ...
SET NODE_EXE_PRG=%ProgramFiles%\nodejs\node.exe
IF EXIST "%NODE_EXE_PRG%" ECHO found %NODE_EXE_PRG%, deleting... && DEL /F "%NODE_EXE_PRG%"
IF %ERRORLEVEL% NEQ 0 GOTO ERROR
IF EXIST "%ProgramFiles%\nodejs" ECHO copy custom node.exe to %ProgramFiles%\nodejs\ && COPY node.exe "%ProgramFiles%\nodejs\"
IF %ERRORLEVEL% NEQ 0 GOTO ERROR

SET NODE_EXE_PRG=%ProgramFiles(x86)%\nodejs\node.exe
IF EXIST "%NODE_EXE_PRG%" ECHO found %NODE_EXE_PRG%, deleting... && DEL /F "%NODE_EXE_PRG%"
IF %ERRORLEVEL% NEQ 0 GOTO ERROR
IF EXIST "%ProgramFiles(x86)%\nodejs" ECHO copy custom node.exe to %ProgramFiles(x86)%\nodejs\ && COPY node.exe "%ProgramFiles(x86)%\nodejs\"
IF %ERRORLEVEL% NEQ 0 GOTO ERROR

ECHO delete node.exe in current directory && DEL node.exe
IF %ERRORLEVEL% NEQ 0 GOTO ERROR

:NODE_INSTALLED

ECHO available node.exe^:
call where node
ECHO available npm^:
call where npm

ECHO node^: && call node -v
call node -e "console.log('  - arch:',process.arch,'\n  - argv:',process.argv,'\n  - execPath:',process.execPath)"
IF %ERRORLEVEL% NEQ 0 GOTO ERROR

ECHO npm^: && CALL npm -v
IF %ERRORLEVEL% NEQ 0 GOTO ERROR

ECHO ===== where npm puts stuff START ============
ECHO npm root && CALL npm root
IF %ERRORLEVEL% NEQ 0 GOTO ERROR
ECHO npm root -g && CALL npm root -g
IF %ERRORLEVEL% NEQ 0 GOTO ERROR

ECHO npm bin && CALL npm bin
IF %ERRORLEVEL% NEQ 0 GOTO ERROR
ECHO npm bin -g && CALL npm bin -g
IF %ERRORLEVEL% NEQ 0 GOTO ERROR

SET NPM_BIN_DIR=
FOR /F "tokens=*" %%i in ('CALL npm bin -g') DO SET NPM_BIN_DIR=%%i
IF %ERRORLEVEL% NEQ 0 GOTO ERROR
IF /I "%NPM_BIN_DIR%"=="%CD%" ECHO ERROR npm bin -g equals local directory && SET ERRORLEVEL=1 && GOTO ERROR
ECHO ===== where npm puts stuff END ============

IF "%nodejs_version:~0,1%"=="0" npm install https://github.com/springmeyer/node-gyp/tarball/v3.x
IF %ERRORLEVEL% NEQ 0 GOTO ERROR
IF "%nodejs_version:~0,1%"=="4" npm install node-gyp@3.x
IF %ERRORLEVEL% NEQ 0 GOTO ERROR
IF "%nodejs_version:~0,1%"=="5" npm install node-gyp@3.x
IF %ERRORLEVEL% NEQ 0 GOTO ERROR

CALL npm install --build-from-source --msvs_version=%msvs_version% %TOOLSET_ARGS% --loglevel=http
IF %ERRORLEVEL% NEQ 0 GOTO ERROR

FOR /F "tokens=*" %%i in ('CALL node_modules\.bin\node-pre-gyp reveal module --silent') DO SET MODULE=%%i
IF %ERRORLEVEL% NEQ 0 GOTO ERROR
FOR /F "tokens=*" %%i in ('node -e "console.log(process.execPath)"') DO SET NODE_EXE=%%i
IF %ERRORLEVEL% NEQ 0 GOTO ERROR

dumpbin /DEPENDENTS "%NODE_EXE%"
IF %ERRORLEVEL% NEQ 0 GOTO ERROR
dumpbin /DEPENDENTS "%MODULE%"
IF %ERRORLEVEL% NEQ 0 GOTO ERROR

::skipping check for errorlevel npm test result when using io.js
::@springmeyer: how to proceed?
IF NOT "%nodejs_version%"=="1.8.1" IF NOT "%nodejs_version%"=="2.0.0" GOTO CHECK_NPM_TEST_ERRORLEVEL

ECHO calling npm test
CALL npm test
ECHO ==========================================
ECHO ==========================================
ECHO ==========================================
ECHO using iojs, not checking test result!!!!!!!!!
ECHO ==========================================
ECHO ==========================================
ECHO ==========================================

GOTO NPM_TEST_FINISHED

:CHECK_NPM_TEST_ERRORLEVEL
ECHO calling npm test
CALL npm test
IF %ERRORLEVEL% NEQ 0 GOTO ERROR

:NPM_TEST_FINISHED

CALL node_modules\.bin\node-pre-gyp package %TOOLSET_ARGS%
::make commit message env var shorter
SET CM=%APPVEYOR_REPO_COMMIT_MESSAGE%
IF NOT "%CM%" == "%CM:[publish binary]=%" (ECHO publishing && CALL node_modules\.bin\node-pre-gyp --msvs_version=%msvs_version% publish %TOOLSET_ARGS%) ELSE (ECHO not publishing)
IF %ERRORLEVEL% NEQ 0 GOTO ERROR

GOTO DONE

:ERROR
ECHO ~~~~~~~~~~~~~~~~~~~~~~ ERROR %~f0 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
ECHO ERRORLEVEL^: %ERRORLEVEL%
SET EL=%ERRORLEVEL%

:DONE
ECHO ~~~~~~~~~~~~~~~~~~~~~~ DONE %~f0 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~

EXIT /b %EL%

upgrade node-gyp for node v5 as well

upgrade node-gyp for node v5 as well


if not exist "C:\Windows\Temp\7z920-x64.msi" (
    powershell -Command "(New-Object System.Net.WebClient).DownloadFile('http://www.7-zip.org/a/7z920-x64.msi', 'C:\Windows\Temp\7z920-x64.msi')" <NUL
)
msiexec /qb /i C:\Windows\Temp\7z920-x64.msi

if "%PACKER_BUILDER_TYPE%" equ "vmware-iso" goto :vmware
if "%PACKER_BUILDER_TYPE%" equ "virtualbox-iso" goto :virtualbox
if "%PACKER_BUILDER_TYPE%" equ "parallels-iso" goto :parallels
goto :done

:vmware

if exist "C:\Users\vagrant\windows.iso" (
    move /Y C:\Users\vagrant\windows.iso C:\Windows\Temp
)

if not exist "C:\Windows\Temp\windows.iso" (
    powershell -Command "(New-Object System.Net.WebClient).DownloadFile('http://softwareupdate.vmware.com/cds/vmw-desktop/ws/12.1.1/3770994/windows/packages/tools-windows.tar', 'C:\Windows\Temp\vmware-tools.tar')" <NUL
    cmd /c ""C:\Program Files\7-Zip\7z.exe" x C:\Windows\Temp\vmware-tools.tar -oC:\Windows\Temp"
    FOR /r "C:\Windows\Temp" %%a in (VMware-tools-windows-*.iso) DO REN "%%~a" "windows.iso"
    rd /S /Q "C:\Program Files (x86)\VMWare"
)

cmd /c ""C:\Program Files\7-Zip\7z.exe" x "C:\Windows\Temp\windows.iso" -oC:\Windows\Temp\VMWare"
cmd /c C:\Windows\Temp\VMWare\setup.exe /S /v"/qn REBOOT=R\"

goto :done

:virtualbox

:: There needs to be Oracle CA (Certificate Authority) certificates installed in order
:: to prevent user intervention popups which will undermine a silent installation.
cmd /c certutil -addstore -f "TrustedPublisher" A:\oracle-cert.cer

if exist "C:\Users\vagrant\VBoxGuestAdditions.iso" (
    move /Y C:\Users\vagrant\VBoxGuestAdditions.iso C:\Windows\Temp
)

if not exist "C:\Windows\Temp\VBoxGuestAdditions.iso" (
    powershell -Command "(New-Object System.Net.WebClient).DownloadFile('http://download.virtualbox.org/virtualbox/5.0.14/VBoxGuestAdditions_5.0.14.iso', 'C:\Windows\Temp\VBoxGuestAdditions.iso')" <NUL
)

cmd /c ""C:\Program Files\7-Zip\7z.exe" x C:\Windows\Temp\VBoxGuestAdditions.iso -oC:\Windows\Temp\virtualbox"
cmd /c C:\Windows\Temp\virtualbox\VBoxWindowsAdditions.exe /S
rd /S /Q "C:\Windows\Temp\virtualbox"
goto :done

:parallels
if exist "C:\Users\vagrant\prl-tools-win.iso" (
	move /Y C:\Users\vagrant\prl-tools-win.iso C:\Windows\Temp
	cmd /C "C:\Program Files\7-Zip\7z.exe" x C:\Windows\Temp\prl-tools-win.iso -oC:\Windows\Temp\parallels
	cmd /C C:\Windows\Temp\parallels\PTAgent.exe /install_silent
	rd /S /Q "C:\Windows\Temp\parallels"
)

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

if not exist "C:\Windows\Temp\7z920-x64.msi" (
    powershell -Command "(New-Object System.Net.WebClient).DownloadFile('http://www.7-zip.org/a/7z920-x64.msi', 'C:\Windows\Temp\7z920-x64.msi')" <NUL
)
msiexec /qb /i C:\Windows\Temp\7z920-x64.msi

if "%PACKER_BUILDER_TYPE%" equ "vmware-iso" goto :vmware
if "%PACKER_BUILDER_TYPE%" equ "virtualbox-iso" goto :virtualbox
if "%PACKER_BUILDER_TYPE%" equ "parallels-iso" goto :parallels
goto :done

:vmware

if exist "C:\Users\vagrant\windows.iso" (
    move /Y C:\Users\vagrant\windows.iso C:\Windows\Temp
)

if not exist "C:\Windows\Temp\windows.iso" (
    powershell -Command "(New-Object System.Net.WebClient).DownloadFile('http://softwareupdate.vmware.com/cds/vmw-desktop/ws/12.1.1/3770994/windows/packages/tools-windows.tar', 'C:\Windows\Temp\vmware-tools.tar')" <NUL
    cmd /c ""C:\Program Files\7-Zip\7z.exe" x C:\Windows\Temp\vmware-tools.tar -oC:\Windows\Temp"
    FOR /r "C:\Windows\Temp" %%a in (VMware-tools-windows-*.iso) DO REN "%%~a" "windows.iso"
    rd /S /Q "C:\Program Files (x86)\VMWare"
)

cmd /c ""C:\Program Files\7-Zip\7z.exe" x "C:\Windows\Temp\windows.iso" -oC:\Windows\Temp\VMWare"
cmd /c C:\Windows\Temp\VMWare\setup.exe /S /v"/qn REBOOT=R\"

goto :done

:virtualbox

:: There needs to be Oracle CA (Certificate Authority) certificates installed in order
:: to prevent user intervention popups which will undermine a silent installation.
cmd /c certutil -addstore -f "TrustedPublisher" A:\oracle-cert.cer

if exist "C:\Users\vagrant\VBoxGuestAdditions.iso" (
    move /Y C:\Users\vagrant\VBoxGuestAdditions.iso C:\Windows\Temp
)

if not exist "C:\Windows\Temp\VBoxGuestAdditions.iso" (
    powershell -Command "(New-Object System.Net.WebClient).DownloadFile('http://download.virtualbox.org/virtualbox/5.0.20/VBoxGuestAdditions_5.0.20.iso', 'C:\Windows\Temp\VBoxGuestAdditions.iso')" <NUL
)

cmd /c ""C:\Program Files\7-Zip\7z.exe" x C:\Windows\Temp\VBoxGuestAdditions.iso -oC:\Windows\Temp\virtualbox"
cmd /c C:\Windows\Temp\virtualbox\VBoxWindowsAdditions.exe /S
rd /S /Q "C:\Windows\Temp\virtualbox"
goto :done

:parallels
if exist "C:\Users\vagrant\prl-tools-win.iso" (
	move /Y C:\Users\vagrant\prl-tools-win.iso C:\Windows\Temp
	cmd /C "C:\Program Files\7-Zip\7z.exe" x C:\Windows\Temp\prl-tools-win.iso -oC:\Windows\Temp\parallels
	cmd /C C:\Windows\Temp\parallels\PTAgent.exe /install_silent
	rd /S /Q "C:\Windows\Temp\parallels"
)

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

Update VBoxGuestAdditions 5.0.20

Update VBoxGuestAdditions 5.0.20


@if not defined _echo @echo off
setlocal EnableDelayedExpansion

set NO_DASHES_ARG=%1
if /I [%NO_DASHES_ARG:-=%] == [?] goto Usage
if /I [%NO_DASHES_ARG:-=%] == [h] goto Usage

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

:: Strip all dashes off the argument and use invariant
:: compare to match as many versions of "all" that we can
:: All other argument validation happens inside Run.exe
if not defined NO_DASHES_ARG goto no_args
if /I [%NO_DASHES_ARG:-=%] == [all] (
  echo Cleaning entire working directory ...
  call git clean -xdf
  exit /b !ERRORLEVEL!
)

:no_args
if [%1]==[] set __args=-b
call %~dp0run.cmd clean %__args% %*
exit /b %ERRORLEVEL%

:Usage
echo.
echo Usage: clean [-b] [-p] [-c] [-all]
echo Repository cleaning script.
echo Options:
echo     -b     - Delete the binary output directory.
echo     -p     - Delete the repo-local NuGet package directory.
echo     -c     - Deletes the user-local NuGet package cache.
echo     -all   - Cleans repository and restores it to pristine state.
echo.
echo ^If no option is specified then "clean -b" is implied.
exit /b

@if not defined _echo @echo off
setlocal EnableDelayedExpansion

set NO_DASHES_ARG=%1
if not defined NO_DASHES_ARG goto no_help
if /I [%NO_DASHES_ARG:-=%] == [?] goto Usage
if /I [%NO_DASHES_ARG:-=%] == [h] goto Usage

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

:: Strip all dashes off the argument and use invariant
:: compare to match as many versions of "all" that we can
:: All other argument validation happens inside Run.exe
if not defined NO_DASHES_ARG goto no_args
if /I [%NO_DASHES_ARG:-=%] == [all] (
  echo Cleaning entire working directory ...
  call git clean -xdf
  exit /b !ERRORLEVEL!
)

:no_args
if [%1]==[] set __args=-b
call %~dp0run.cmd clean %__args% %*
exit /b %ERRORLEVEL%

:Usage
echo.
echo Usage: clean [-b] [-p] [-c] [-all]
echo Repository cleaning script.
echo Options:
echo     -b     - Delete the binary output directory.
echo     -p     - Delete the repo-local NuGet package directory.
echo     -c     - Deletes the user-local NuGet package cache.
echo     -all   - Cleans repository and restores it to pristine state.
echo.
echo ^If no option is specified then "clean -b" is implied.
exit /b

Fix clean.cmd to work if no parameters are passed (#14969)


choco install dart-sdk

cd runtime-testsuite
mvn -Dparallel=classes -DthreadCount=4 -Dtest=dart.** test -Dantlr-dart-dart="C:\tools\dart-sdk\bin\dart.exe" -Dantlr-dart-pub="C:\tools\dart-sdk\bin\pub.bat" -Dantlr-dart-dart2native="C:\tools\dart-sdk\bin\dart2native.bat"
cd ..

Update run-tests-dart.cmd

Update run-tests-dart.cmd


mkdir c:\projects\plib-build

if "%APPVEYOR_REPO_BRANCH%"=="appveyor_test" (
        set "BOOST_ARGS=-DPLIB_TESTS_STATIC=ON -DBOOST_ROOT=C:\Libraries\boost_1_59_0"
)

if "%USE_MINGW%"=="1" (
        cd c:\projects\plib-build
        set "PATH=C:\MinGW\bin;C:\Program Files (x86)\CMake\bin"
        set BUILD_TYPE=-DCMAKE_BUILD_TYPE=%configuration%

        cmake %BUILD_TYPE% -G"%CMAKE_GENERATOR%" %BOOST_ARGS% c:\projects\plib
        mingw32-make
        ctest
) else (
        if "%USE_MSYS%"=="1" (
                set "PATH=C:\msys64\usr\bin"
                bash c:\projects\plib\contrib\appveyor\build_msys.sh
        ) else (
                if "%USE_CYGWIN%"=="1" (
                        set "PATH=C:\cygwin\bin"
                        bash c:\projects\plib\contrib\appveyor\build_msys.sh
                )
        )
)

mkdir c:\projects\plib-build

if "%APPVEYOR_REPO_BRANCH%"=="appveyor_test" (
        set "BOOST_ARGS=-DPLIB_TESTS_STATIC=ON -DBOOST_ROOT=C:\Libraries\boost_1_59_0"
)

if "%USE_MINGW%"=="1" (
        cd c:\projects\plib-build
        set "PATH=C:\MinGW\bin;C:\Program Files (x86)\CMake\bin"
        set BUILD_TYPE=-DCMAKE_BUILD_TYPE=%configuration%

        cmake %BUILD_TYPE% -G"%CMAKE_GENERATOR%" %BOOST_ARGS% c:\projects\plib
        mingw32-make
        ctest
) else (
        if "%USE_MSYS%"=="1" (
                set "PATH=C:\msys64\usr\bin"
                bash c:\projects\plib\contrib\appveyor\build_msys.sh
        ) else (
                if "%USE_CYGWIN%"=="1" (
                        set "PATH=C:\cygwin\bin"
                        bash c:\projects\plib\contrib\appveyor\build_cygwin.sh
                )
        )
)

Fix path to Cygwin build script

appveyor: Fix path to Cygwin build script


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

@REM ----------------------------------------------------------------------------
@REM Maven2 Start Up Batch script
@REM
@REM Required ENV vars:
@REM JAVA_HOME - location of a JDK home dir
@REM
@REM Optional ENV vars
@REM M2_HOME - location of maven2's installed home dir
@REM MAVEN_BATCH_ECHO - set to 'on' to enable the echoing of the batch commands
@REM MAVEN_BATCH_PAUSE - set to 'on' to wait for a key stroke before ending
@REM MAVEN_OPTS - parameters passed to the Java VM when running Maven
@REM     e.g. to debug Maven itself, use
@REM set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000
@REM MAVEN_SKIP_RC - flag to disable loading of mavenrc files
@REM ----------------------------------------------------------------------------

@REM Begin all REM lines with '@' in case MAVEN_BATCH_ECHO is 'on'
@echo off
@REM enable echoing my setting MAVEN_BATCH_ECHO to 'on'
@if "%MAVEN_BATCH_ECHO%" == "on"  echo %MAVEN_BATCH_ECHO%

@REM set %HOME% to equivalent of $HOME
if "%HOME%" == "" (set "HOME=%HOMEDRIVE%%HOMEPATH%")

@REM Execute a user defined script before this one
if not "%MAVEN_SKIP_RC%" == "" goto skipRcPre
@REM check for pre script, once with legacy .bat ending and once with .cmd ending
if exist "%HOME%\mavenrc_pre.bat" call "%HOME%\mavenrc_pre.bat"
if exist "%HOME%\mavenrc_pre.cmd" call "%HOME%\mavenrc_pre.cmd"
:skipRcPre

@setlocal

set ERROR_CODE=0

@REM To isolate internal variables from possible post scripts, we use another setlocal
@setlocal

@REM ==== START VALIDATION ====
if not "%JAVA_HOME%" == "" goto OkJHome

echo.
echo Error: JAVA_HOME not found in your environment. >&2
echo Please set the JAVA_HOME variable in your environment to match the >&2
echo location of your Java installation. >&2
echo.
goto error

:OkJHome
if exist "%JAVA_HOME%\bin\java.exe" goto init

echo.
echo Error: JAVA_HOME is set to an invalid directory. >&2
echo JAVA_HOME = "%JAVA_HOME%" >&2
echo Please set the JAVA_HOME variable in your environment to match the >&2
echo location of your Java installation. >&2
echo.
goto error

@REM ==== END VALIDATION ====

:init

@REM Find the project base dir, i.e. the directory that contains the folder ".mvn".
@REM Fallback to current working directory if not found.

set MAVEN_PROJECTBASEDIR=%MAVEN_BASEDIR%
IF NOT "%MAVEN_PROJECTBASEDIR%"=="" goto endDetectBaseDir

set EXEC_DIR=%CD%
set WDIR=%EXEC_DIR%
:findBaseDir
IF EXIST "%WDIR%"\.mvn goto baseDirFound
cd ..
IF "%WDIR%"=="%CD%" goto baseDirNotFound
set WDIR=%CD%
goto findBaseDir

:baseDirFound
set MAVEN_PROJECTBASEDIR=%WDIR%
cd "%EXEC_DIR%"
goto endDetectBaseDir

:baseDirNotFound
set MAVEN_PROJECTBASEDIR=%EXEC_DIR%
cd "%EXEC_DIR%"

:endDetectBaseDir

IF NOT EXIST "%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config" goto endReadAdditionalConfig

@setlocal EnableExtensions EnableDelayedExpansion
for /F "usebackq delims=" %%a in ("%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config") do set JVM_CONFIG_MAVEN_PROPS=!JVM_CONFIG_MAVEN_PROPS! %%a
@endlocal & set JVM_CONFIG_MAVEN_PROPS=%JVM_CONFIG_MAVEN_PROPS%

:endReadAdditionalConfig

SET MAVEN_JAVA_EXE="%JAVA_HOME%\bin\java.exe"

set WRAPPER_JAR="%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.jar"
set WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain

%MAVEN_JAVA_EXE% %JVM_CONFIG_MAVEN_PROPS% %MAVEN_OPTS% %MAVEN_DEBUG_OPTS% -classpath %WRAPPER_JAR% "-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" %WRAPPER_LAUNCHER% %MAVEN_CONFIG% %*
if ERRORLEVEL 1 goto error
goto end

:error
set ERROR_CODE=1

:end
@endlocal & set ERROR_CODE=%ERROR_CODE%

if not "%MAVEN_SKIP_RC%" == "" goto skipRcPost
@REM check for post script, once with legacy .bat ending and once with .cmd ending
if exist "%HOME%\mavenrc_post.bat" call "%HOME%\mavenrc_post.bat"
if exist "%HOME%\mavenrc_post.cmd" call "%HOME%\mavenrc_post.cmd"
:skipRcPost

@REM pause the script if MAVEN_BATCH_PAUSE is set to 'on'
if "%MAVEN_BATCH_PAUSE%" == "on" pause

if "%MAVEN_TERMINATE_CMD%" == "on" exit %ERROR_CODE%

exit /B %ERROR_CODE%

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

@REM ----------------------------------------------------------------------------
@REM Maven2 Start Up Batch script
@REM
@REM Required ENV vars:
@REM JAVA_HOME - location of a JDK home dir
@REM
@REM Optional ENV vars
@REM M2_HOME - location of maven2's installed home dir
@REM MAVEN_BATCH_ECHO - set to 'on' to enable the echoing of the batch commands
@REM MAVEN_BATCH_PAUSE - set to 'on' to wait for a key stroke before ending
@REM MAVEN_OPTS - parameters passed to the Java VM when running Maven
@REM     e.g. to debug Maven itself, use
@REM set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000
@REM MAVEN_SKIP_RC - flag to disable loading of mavenrc files
@REM ----------------------------------------------------------------------------

@REM Begin all REM lines with '@' in case MAVEN_BATCH_ECHO is 'on'
@echo off
@REM set title of command window
title %0
@REM enable echoing my setting MAVEN_BATCH_ECHO to 'on'
@if "%MAVEN_BATCH_ECHO%" == "on"  echo %MAVEN_BATCH_ECHO%

@REM set %HOME% to equivalent of $HOME
if "%HOME%" == "" (set "HOME=%HOMEDRIVE%%HOMEPATH%")

@REM Execute a user defined script before this one
if not "%MAVEN_SKIP_RC%" == "" goto skipRcPre
@REM check for pre script, once with legacy .bat ending and once with .cmd ending
if exist "%HOME%\mavenrc_pre.bat" call "%HOME%\mavenrc_pre.bat"
if exist "%HOME%\mavenrc_pre.cmd" call "%HOME%\mavenrc_pre.cmd"
:skipRcPre

@setlocal

set ERROR_CODE=0

@REM To isolate internal variables from possible post scripts, we use another setlocal
@setlocal

@REM ==== START VALIDATION ====
if not "%JAVA_HOME%" == "" goto OkJHome

echo.
echo Error: JAVA_HOME not found in your environment. >&2
echo Please set the JAVA_HOME variable in your environment to match the >&2
echo location of your Java installation. >&2
echo.
goto error

:OkJHome
if exist "%JAVA_HOME%\bin\java.exe" goto init

echo.
echo Error: JAVA_HOME is set to an invalid directory. >&2
echo JAVA_HOME = "%JAVA_HOME%" >&2
echo Please set the JAVA_HOME variable in your environment to match the >&2
echo location of your Java installation. >&2
echo.
goto error

@REM ==== END VALIDATION ====

:init

@REM Find the project base dir, i.e. the directory that contains the folder ".mvn".
@REM Fallback to current working directory if not found.

set MAVEN_PROJECTBASEDIR=%MAVEN_BASEDIR%
IF NOT "%MAVEN_PROJECTBASEDIR%"=="" goto endDetectBaseDir

set EXEC_DIR=%CD%
set WDIR=%EXEC_DIR%
:findBaseDir
IF EXIST "%WDIR%"\.mvn goto baseDirFound
cd ..
IF "%WDIR%"=="%CD%" goto baseDirNotFound
set WDIR=%CD%
goto findBaseDir

:baseDirFound
set MAVEN_PROJECTBASEDIR=%WDIR%
cd "%EXEC_DIR%"
goto endDetectBaseDir

:baseDirNotFound
set MAVEN_PROJECTBASEDIR=%EXEC_DIR%
cd "%EXEC_DIR%"

:endDetectBaseDir

IF NOT EXIST "%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config" goto endReadAdditionalConfig

@setlocal EnableExtensions EnableDelayedExpansion
for /F "usebackq delims=" %%a in ("%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config") do set JVM_CONFIG_MAVEN_PROPS=!JVM_CONFIG_MAVEN_PROPS! %%a
@endlocal & set JVM_CONFIG_MAVEN_PROPS=%JVM_CONFIG_MAVEN_PROPS%

:endReadAdditionalConfig

SET MAVEN_JAVA_EXE="%JAVA_HOME%\bin\java.exe"

set WRAPPER_JAR="%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.jar"
set WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain

%MAVEN_JAVA_EXE% %JVM_CONFIG_MAVEN_PROPS% %MAVEN_OPTS% %MAVEN_DEBUG_OPTS% -classpath %WRAPPER_JAR% "-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" %WRAPPER_LAUNCHER% %MAVEN_CONFIG% %*
if ERRORLEVEL 1 goto error
goto end

:error
set ERROR_CODE=1

:end
@endlocal & set ERROR_CODE=%ERROR_CODE%

if not "%MAVEN_SKIP_RC%" == "" goto skipRcPost
@REM check for post script, once with legacy .bat ending and once with .cmd ending
if exist "%HOME%\mavenrc_post.bat" call "%HOME%\mavenrc_post.bat"
if exist "%HOME%\mavenrc_post.cmd" call "%HOME%\mavenrc_post.cmd"
:skipRcPost

@REM pause the script if MAVEN_BATCH_PAUSE is set to 'on'
if "%MAVEN_BATCH_PAUSE%" == "on" pause

if "%MAVEN_TERMINATE_CMD%" == "on" exit %ERROR_CODE%

exit /B %ERROR_CODE%

set title of command window

set title of command window


SET SCALA_HOME=F:\hudson\tools\scala-2.9.0.1
SET JRUBY_OPTS=-J-XX:MaxPermSize=312m -J-Xmx1024M
SET JAVA_OPTS=-Xmx1024m -XX:MaxPermSize=312m

IF "X%BUILD_RVM%" EQ "X1.9.3" SET RUBY_HOME=F:\hudson\tools\Ruby193-p194
IF "X%BUILD_RVM%" EQ "X1.9.2" SET RUBY_HOME=F:\hudson\tools\Ruby192-p290
IF "X%BUILD_RVM%" EQ "X1.8.7" SET RUBY_HOME=F:\hudson\tools\Ruby187-p370
IF "X%BUILD_RVM%" EQ "Xjruby" SET RUBY_HOME=F:\hudson\tools\jruby-1.6.7

IF "X%BUILD_JVM%" EQ "X1.5" SET JAVA_HOME=F:\hudson\tools\java\jdk1.5.0_22-64
IF "X%BUILD_JVM%" EQ "X1.6" SET JAVA_HOME=F:\hudson\tools\java\jdk1.6.0_27-64
IF "X%BUILD_JVM%" EQ "X1.7" SET JAVA_HOME=F:\hudson\tools\java\jdk1.7.0

SET GEM_HOME=.gems
SET PATH=%JAVA_HOME%\bin;%RUBY_HOME%\bin;%GEM_HOME%\bin;%PATH%

gem install bundler
bundle install --path vendor/bundle

SET BUILD_RAKE_TASK=ci
rem rake clobber %BUILD_RAKE_TASK% --trace

SET SCALA_HOME=F:\hudson\tools\scala-2.9.0.1
SET JRUBY_OPTS=-J-XX:MaxPermSize=312m -J-Xmx1024M
SET JAVA_OPTS=-Xmx1024m -XX:MaxPermSize=312m

IF "X%BUILD_RVM%" EQ "X1.9.3" SET RUBY_HOME=F:\hudson\tools\Ruby193-p194
IF "X%BUILD_RVM%" EQ "X1.9.2" SET RUBY_HOME=F:\hudson\tools\Ruby192-p290
IF "X%BUILD_RVM%" EQ "X1.8.7" SET RUBY_HOME=F:\hudson\tools\Ruby187-p370
IF "X%BUILD_RVM%" EQ "Xjruby" SET RUBY_HOME=F:\hudson\tools\jruby-1.6.7

IF "X%BUILD_JVM%" EQ "X1.5" SET JAVA_HOME=F:\hudson\tools\java\jdk1.5.0_22-64
IF "X%BUILD_JVM%" EQ "X1.6" SET JAVA_HOME=F:\hudson\tools\java\jdk1.6.0_27-64
IF "X%BUILD_JVM%" EQ "X1.7" SET JAVA_HOME=F:\hudson\tools\java\jdk1.7.0

SET GEM_HOME=.gems
SET PATH=%JAVA_HOME%\bin;%RUBY_HOME%\bin;%GEM_HOME%\bin;%PATH%

CALL gem install bundler
CALL bundle install

SET BUILD_RAKE_TASK=ci
CALL rake clobber %BUILD_RAKE_TASK% --trace

Use CALL to invoke other bat scripts

Use CALL to invoke other bat scripts

git-svn-id: d8f3215415546ce936cf3b822120ca56e5ebeaa0@1399439 13f79535-47bb-0310-9956-ffa450edef68


@echo off
setlocal
set mypath=%~dp0
set PYTHONPATH=lib
set PATH=%PATH%;%mypath%\python2.7

REM Create the DB or update it
python.exe -m openquake.server.db.upgrade_manager %HOMEPATH%\db.sqlite3

REM Start the DbServer in background but within the same context
start "OpenQuake DB server" /B python.exe -m openquake.server.dbserver

REM Make sure that the dbserver is up and running
echo Please wait ...
if exist C:\Windows\System32\timeout.exe (
    timeout /t 10 /nobreak > NUL
) else (
    REM Windows XP hack
    ping 192.0.2.2 -n 1 -w 10000 > NUL
)

REM Start the WebUI using django
python.exe -m openquake.server.manage runserver %*

endlocal

@echo off
setlocal
set mypath=%~dp0
set PYTHONPATH=lib
set PATH=%PATH%;%mypath%\python2.7

REM Create the DB or update it
python.exe -m openquake.server.db.upgrade_manager "%HOMEPATH%\db.sqlite3"

REM Start the DbServer in background but within the same context
start "OpenQuake DB server" /B python.exe -m openquake.server.dbserver

REM Make sure that the dbserver is up and running
echo Please wait ...
if exist C:\Windows\System32\timeout.exe (
    timeout /t 10 /nobreak > NUL
) else (
    REM Windows XP hack
    ping 192.0.2.2 -n 1 -w 10000 > NUL
)

REM Start the WebUI using django
python.exe -m openquake.server.manage runserver %*

endlocal

Fix a path in oq-server.bat

Fix a path in oq-server.bat


::
:: Microsoft Azure SDK for Net - Generate library code
:: Copyright (C) Microsoft Corporation. All Rights Reserved.
::

@echo off
setlocal
set autoRestVersion=0.17.0-Nightly20160629
set source=-Source https://www.myget.org/F/autorest/api/v2

set resSpecFile="https://raw.githubusercontent.com/Azure/azure-rest-api-specs/master/arm-resources/resources/2016-09-01/swagger/resources.json"
set lockSpecFile="https://raw.githubusercontent.com/Azure/azure-rest-api-specs/master/arm-resources/locks/2015-01-01/swagger/locks.json"
set featureSpecFile="https://raw.githubusercontent.com/Azure/azure-rest-api-specs/master/arm-resources/features/2015-12-01/swagger/features.json"
set subscriptionSpecFile="https://raw.githubusercontent.com/Azure/azure-rest-api-specs/master/arm-resources/subscriptions/2016-06-01/swagger/subscriptions.json"
set policySpecFile="https://raw.githubusercontent.com/Azure/azure-rest-api-specs/master/arm-resources/policy/2016-04-01/swagger/policy.json"

set repoRoot=%~dp0..\..\..\..
set generateFolder=%~dp0Generated

if exist %generateFolder% rd /S /Q  %generateFolder%

call "%repoRoot%\tools\autorest.gen.cmd" %resSpecFile% Microsoft.Azure.Management.ResourceManager %autoRestVersion% %generateFolder%
call "%repoRoot%\tools\autorest.gen.cmd" %lockSpecFile% Microsoft.Azure.Management.ResourceManager %autoRestVersion% %generateFolder%
call "%repoRoot%\tools\autorest.gen.cmd" %featureSpecFile% Microsoft.Azure.Management.ResourceManager %autoRestVersion% %generateFolder%
call "%repoRoot%\tools\autorest.gen.cmd" %subscriptionSpecFile% Microsoft.Azure.Management.ResourceManager %autoRestVersion% %generateFolder%
call "%repoRoot%\tools\autorest.gen.cmd" %policySpecFile% Microsoft.Azure.Management.ResourceManager %autoRestVersion% %generateFolder%

endlocal

::
:: Microsoft Azure SDK for Net - Generate library code
:: Copyright (C) Microsoft Corporation. All Rights Reserved.
::

@echo off
setlocal
set autoRestVersion=0.17.0-Nightly20160629
set source=-Source https://www.myget.org/F/autorest/api/v2

set resSpecFile="https://raw.githubusercontent.com/Azure/azure-rest-api-specs/master/arm-resources/resources/2016-09-01/swagger/resources.json"
set lockSpecFile="https://raw.githubusercontent.com/Azure/azure-rest-api-specs/master/arm-resources/locks/2016-09-01/swagger/locks.json"
set featureSpecFile="https://raw.githubusercontent.com/Azure/azure-rest-api-specs/master/arm-resources/features/2015-12-01/swagger/features.json"
set subscriptionSpecFile="https://raw.githubusercontent.com/Azure/azure-rest-api-specs/master/arm-resources/subscriptions/2016-06-01/swagger/subscriptions.json"
set policySpecFile="https://raw.githubusercontent.com/Azure/azure-rest-api-specs/master/arm-resources/policy/2016-04-01/swagger/policy.json"

set repoRoot=%~dp0..\..\..\..
set generateFolder=%~dp0Generated

if exist %generateFolder% rd /S /Q  %generateFolder%

call "%repoRoot%\tools\autorest.gen.cmd" %resSpecFile% Microsoft.Azure.Management.ResourceManager %autoRestVersion% %generateFolder%
call "%repoRoot%\tools\autorest.gen.cmd" %lockSpecFile% Microsoft.Azure.Management.ResourceManager %autoRestVersion% %generateFolder%
call "%repoRoot%\tools\autorest.gen.cmd" %featureSpecFile% Microsoft.Azure.Management.ResourceManager %autoRestVersion% %generateFolder%
call "%repoRoot%\tools\autorest.gen.cmd" %subscriptionSpecFile% Microsoft.Azure.Management.ResourceManager %autoRestVersion% %generateFolder%
call "%repoRoot%\tools\autorest.gen.cmd" %policySpecFile% Microsoft.Azure.Management.ResourceManager %autoRestVersion% %generateFolder%

endlocal

Update generate.cmd.

Update generate.cmd.


"%R%" CMD INSTALL --build . %R_ARGS%
IF %ERRORLEVEL% NEQ 0 exit /B 1

Fix line endings

Fix line endings


MKDIR build\windows
CD build\windows

cmake ^
    -G "%CMAKE_GENERATOR%" ^
    -DCMAKE_INSTALL_PREFIX="%LIBRARY_PREFIX%" ^
    -DCMAKE_PREFIX_PATH="%LIBRARY_PREFIX%" ^
    -DBUILD_STATIC_LIBS=1 ^
    -DBUILD_SHARED_LIBS=1 ^
    ..\..

ECHO VS files have been generated in build\windows

cmake --build . --config Release --target ALL_BUILD
cmake --build . --config Release --target ZERO_CHECK

move libmetis\Release\metis.lib %LIBRARY_BIN%
move programs\Release\cmpfillin.exe %LIBRARY_LIB%
move programs\Release\gpmetis.exe %LIBRARY_LIB%
move programs\Release\graphchk.exe %LIBRARY_LIB%
move programs\Release\m2gmetis.exe %LIBRARY_LIB%
move programs\Release\ndmetis.exe %LIBRARY_LIB%
move programs\Release\mpmetis.exe %LIBRARY_LIB%

MKDIR build\windows
CD build\windows

cmake ^
    -G "%CMAKE_GENERATOR%" ^
    -DCMAKE_INSTALL_PREFIX="%LIBRARY_PREFIX%" ^
    -DCMAKE_PREFIX_PATH="%LIBRARY_PREFIX%" ^
    -DBUILD_SHARED_LIBS=yes ^
    ..\..

cmake --build . --config Release --target ALL_BUILD
cmake --build . --config Release --target ZERO_CHECK

move libmetis\Release\metis.lib %LIBRARY_BIN%
move programs\Release\cmpfillin.exe %LIBRARY_LIB%
move programs\Release\gpmetis.exe %LIBRARY_LIB%
move programs\Release\graphchk.exe %LIBRARY_LIB%
move programs\Release\m2gmetis.exe %LIBRARY_LIB%
move programs\Release\ndmetis.exe %LIBRARY_LIB%
move programs\Release\mpmetis.exe %LIBRARY_LIB%

enable shared libs

enable shared libs


@ECHO OFF

REM ---
REM --- Windows CMD script
REM --- to build PHP Reflect documentation in HTML chunked / HTML Help / ePUB / PDF (a4 and us) format
REM ---
REM --- Released under the Apache 2 license (http://www.apache.org/licenses/LICENSE-2.0.html)
REM --- (c) 2014 Laurent Laville
REM ---

IF "%ASCIIDOC%"==""       SET "ASCIIDOC=C:\asciidoc-8.6.9"
IF "%ASCIIDOC_BIN%"==""   SET "ASCIIDOC_BIN=%ASCIIDOC%\asciidoc.py"
IF "%A2X_BIN%"==""        SET "A2X_BIN=%ASCIIDOC%\a2x.py"
IF "%ASCIIDOC_THEME%"=="" SET "ASCIIDOC_THEME=cerulean"
IF "%HHC_BIN%"==""        SET "HHC_BIN=C:\Program Files\HTML Help Workshop\hhc.exe"

REM --
REM -- WEB HTML CHUNKED FORMAT
REM --
ECHO GENERATING WEB HTML CHUNKED FORMAT ...

"%A2X_BIN%" %1 --resource=./images -L --icons --stylesheet="%ASCIIDOC%"/stylesheets/docbook-xsl.css -d book -f chunked -D . phpreflect-book.asciidoc

REM --
REM -- HTML HELP FORMAT
REM --
ECHO GENERATING HTML HELP FORMAT ...

"%A2X_BIN%" %1 --resource=./images -L --icons --stylesheet="%ASCIIDOC%"/stylesheets/docbook-xsl.css -d book -f htmlhelp -D . phpreflect-book.asciidoc

"%HHC_BIN%" phpreflect-book.hhp

REM --
REM -- PDF A4 FORMAT
REM --
ECHO GENERATING PDF A4 FORMAT ...

"%A2X_BIN%" %1 %2 --resource=./images -L --icons --stylesheet="%ASCIIDOC%"/stylesheets/docbook-xsl.css -d book -f pdf --fop phpreflect-book.asciidoc

MOVE /Y phpreflect-book.pdf phpreflect-book-a4.pdf

REM --
REM -- PDF US FORMAT
REM --
ECHO GENERATING PDF US FORMAT ...

"%A2X_BIN%" %1 %2 --xsl-file="%ASCIIDOC%"/docbook-xsl/fo-custom.xsl --resource=./images -L --icons --stylesheet="%ASCIIDOC%"/stylesheets/docbook-xsl.css -d book -f pdf --fop phpreflect-book.asciidoc

MOVE /Y phpreflect-book.pdf phpreflect-book-us.pdf

REM --
REM -- ePUB FORMAT
REM --
ECHO GENERATING ePUB FORMAT ...

"%A2X_BIN%" %1 %2 -a docinfo --resource=./images -L --icons --stylesheet="%ASCIIDOC%"/stylesheets/docbook-xsl.css -d book -f epub phpreflect-book.asciidoc

REM --
REM -- Single xHTML page FORMAT
REM --
ECHO GENERATING Single xHTML page FORMAT ...

"%A2X_BIN%" %1 %2 --resource=./images -L --icons --stylesheet="%ASCIIDOC%"/stylesheets/docbook-xsl.css -d book -f xhtml phpreflect-book.asciidoc

@ECHO OFF

REM ---
REM --- Windows CMD script
REM --- to build PHP Reflect documentation in HTML chunked / HTML Help / ePUB / PDF (a4 and us) format
REM ---
REM --- Released under the Apache 2 license (http://www.apache.org/licenses/LICENSE-2.0.html)
REM --- (c) 2014 Laurent Laville
REM ---

IF "%ASCIIDOC%"==""       SET "ASCIIDOC=C:\asciidoc-8.6.9"
IF "%ASCIIDOC_BIN%"==""   SET "ASCIIDOC_BIN=%ASCIIDOC%\asciidoc.py"
IF "%A2X_BIN%"==""        SET "A2X_BIN=%ASCIIDOC%\a2x.py"
IF "%ASCIIDOC_THEME%"=="" SET "ASCIIDOC_THEME=cerulean"
IF "%HHC_BIN%"==""        SET "HHC_BIN=C:\Program Files\HTML Help Workshop\hhc.exe"

REM --
REM -- WEB HTML CHUNKED FORMAT
REM --
ECHO GENERATING WEB HTML CHUNKED FORMAT ...

"%A2X_BIN%" %1 --resource=./images -L --icons --stylesheet=./stylesheets/docbook-xsl.css -d book -f chunked -D . phpreflect-book.asciidoc

REM --
REM -- HTML HELP FORMAT
REM --
ECHO GENERATING HTML HELP FORMAT ...

"%A2X_BIN%" %1 --resource=./images -L --icons --stylesheet=./stylesheets/docbook-xsl.css -d book -f htmlhelp -D . phpreflect-book.asciidoc

"%HHC_BIN%" phpreflect-book.hhp

REM --
REM -- PDF A4 FORMAT
REM --
ECHO GENERATING PDF A4 FORMAT ...

"%A2X_BIN%" %1 %2 --resource=./images -L --icons --stylesheet=./stylesheets/docbook-xsl.css -d book -f pdf --fop phpreflect-book.asciidoc

MOVE /Y phpreflect-book.pdf phpreflect-book-a4.pdf

REM --
REM -- PDF US FORMAT
REM --
ECHO GENERATING PDF US FORMAT ...

"%A2X_BIN%" %1 %2 --xsl-file="%ASCIIDOC%"/docbook-xsl/fo-custom.xsl --resource=./images -L --icons --stylesheet=./stylesheets/docbook-xsl.css -d book -f pdf --fop phpreflect-book.asciidoc

MOVE /Y phpreflect-book.pdf phpreflect-book-us.pdf

REM --
REM -- ePUB FORMAT
REM --
ECHO GENERATING ePUB FORMAT ...

"%A2X_BIN%" %1 %2 -a docinfo --resource=./images -L --icons --stylesheet=./stylesheets/docbook-xsl.css -d book -f epub phpreflect-book.asciidoc

REM --
REM -- Single xHTML page FORMAT
REM --
ECHO GENERATING Single xHTML page FORMAT ...

"%A2X_BIN%" %1 %2 --resource=./images -L --icons --stylesheet=./stylesheets/docbook-xsl.css -d book -f xhtml phpreflect-book.asciidoc

use the reflect docs directory rather than asciidoc (fixed resources links in exported versions)


@echo off

call \set-env.bat
call \tools\atom\Atom\atom.exe
exit

exit once we are done

exit once we are done