@git fetch --all --tags --prune --quiet && git checkout develop --quiet && git branch -vv | grep -v -e "gone\]" -e "[*]" -e "dshaheen" | awk "{print $1"":""$1}" | xargs -L1 git fetch origin & git pull --quiet && git branch -vv | grep "gone\]" | awk "{print $1}" | xargs -L1 -r git branch -d %*

@git fetch --all --tags --prune --quiet && git checkout master --quiet && git branch -vv | grep -v -e "gone\]" -e "[*]" | awk "{print $1"":""$1}" | xargs -L1 git fetch origin & git pull --quiet && git branch -vv | grep "gone\]" | awk "{print $1}" | xargs -L1 -r git branch -d %*

Update windows gfx.cmd

Update windows gfx.cmd


@ECHO off
SETLOCAL EnableExtensions
SETLOCAL EnableDelayedExpansion

SET version=1.0.0_20160616-0600
SET title=idefixInstaller script %~nx0 - version %version%
TITLE %title%
SET POWERSHELL_TITLE=$Host.UI.RawUI.WindowTitle='%title%'

SET JAVA_WEB=http://www.klib.io/_archives/java/1.8
SET JAVA_ARCHIVE=win32.x86_64-jre1.8.0_74.zip
SET JAVA=%JAVA_ARCHIVE:~13,-4%

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

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

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

SET BUILD_SERVER_ROOT=https://dl.bintray.com/peterkir/generic/org.eclipse.oomph
#SET BUILD_SERVER_ROOT=http://www.klib.io/org.eclipse.oomph
SET OOMPH_VERSION=1.6.0

SET PROD_CAT_FILTER=io\\.klib\\.products
SET PROD_FILTER=osgi\\.idefix\\.neon
SET PROD_VERSION=osgi\\.idefix\\.neon\\.bndtools\\.3\\.3\\.0

SET productSetup=https://peterkir.github.io/idefix/oomph/peterkir/catalogProducts.setup
SET projectSetup=https://peterkir.github.io/idefix/oomph/peterkir/catalogProjects.setup

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

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

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

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

ECHO.
ECHO # download and extract into %SCRIPT_PATH%\%ECL_INST_NAME%
ECHO.

SET ECLIPSE_INSTALLER_WEB=%BUILD_SERVER_ROOT%/%OOMPH_VERSION%
SET ECLIPSE_INSTALLER_ARCHIVE=org.eclipse.oomph.setup.installer.product-win32.win32.x86_64.zip
SET ECLIPSE_INSTALLER=%ECLIPSE_INSTALLER_ARCHIVE:~0,-4%

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

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

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

SET ECL_INST_INI=%SCRIPT_PATH%\%ECL_INST_NAME%\eclipse-inst.ini

FINDSTR peterkir.github.io %ECL_INST_INI% 2>&1 > NUL
IF "%ERRORLEVEL%"=="" (
    ECHO    - skipping vmArgs addition, cause already inside
) ELSE (
    ECHO    - adding vmArgs to ini file
    :: allow installation of unsigned bundles
    ECHO -Declipse.p2.unsignedPolicy=allow >> %ECL_INST_INI%

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

    :: filtering user displayed catalogs/products/versions
    ECHO -Doomph.setup.product.catalog.filter=%PROD_CAT_FILTER%>> %ECL_INST_INI%
    ECHO -Doomph.setup.product.filter=%PROD_FILTER%>>             %ECL_INST_INI%
    ECHO -Doomph.setup.product.version.filter=%PROD_VERSION%>>    %ECL_INST_INI%

    ECHO -Doomph.setup.jre.choice=false                          >> %ECL_INST_INI%
    ECHO -Doomph.installer.update.url=%BUILD_STORE%/p2/installer >> %ECL_INST_INI%
    ECHO -Doomph.update.url=%BUILD_STORE%/p2/oomph               >> %ECL_INST_INI%
    ECHO -Doomph.setup.installer.mode=advanced                   >> %ECL_INST_INI%
    ECHO -Doomph.redirection.klibProductCatalog=index:/redirectable.products.setup-^>%productSetup% >> %ECL_INST_INI%
    ECHO -Doomph.redirection.klibProjectCatalog=index:/redirectable.projects.setup-^>%projectSetup% >> %ECL_INST_INI%
)

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

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

:END

@ECHO off
SETLOCAL EnableExtensions
SETLOCAL EnableDelayedExpansion

SET version=1.0.0_20160616-0600
SET title=idefixInstaller script %~nx0 - version %version%
TITLE %title%
SET POWERSHELL_TITLE=$Host.UI.RawUI.WindowTitle='%title%'

SET JAVA_WEB=http://www.klib.io/_archives/java/1.8
SET JAVA_ARCHIVE=win32.x86_64-jre1.8.0_74.zip
SET JAVA=%JAVA_ARCHIVE:~13,-4%

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

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

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

SET BUILD_SERVER_ROOT=https://dl.bintray.com/peterkir/generic/org.eclipse.oomph
::SET BUILD_SERVER_ROOT=http://www.klib.io/org.eclipse.oomph
SET OOMPH_VERSION=1.6.0

SET PROD_CAT_FILTER=io\\.klib\\.products
SET PROD_FILTER=osgi\\.idefix\\.neon
SET PROD_VERSION=osgi\\.idefix\\.neon\\.bndtools\\.3\\.3\\.0

SET productSetup=https://peterkir.github.io/idefix/bootstrap/peterkir/catalogProducts.setup
SET projectSetup=https://peterkir.github.io/idefix/bootstrap/peterkir/catalogProjects.setup

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

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

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

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

ECHO.
ECHO # download and extract into %SCRIPT_PATH%\%ECL_INST_NAME%
ECHO.

SET ECLIPSE_INSTALLER_WEB=%BUILD_SERVER_ROOT%/%OOMPH_VERSION%
SET ECLIPSE_INSTALLER_ARCHIVE=org.eclipse.oomph.setup.installer.product-win32.win32.x86_64.zip
SET ECLIPSE_INSTALLER=%ECLIPSE_INSTALLER_ARCHIVE:~0,-4%

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

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

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

SET ECL_INST_INI=%SCRIPT_PATH%\%ECL_INST_NAME%\eclipse-inst.ini

FINDSTR peterkir.github.io %ECL_INST_INI% 2>&1 > NUL
IF "%ERRORLEVEL%"=="" (
    ECHO    - skipping vmArgs addition, cause already inside
) ELSE (
    ECHO    - adding vmArgs to ini file
    :: allow installation of unsigned bundles
    ECHO -Declipse.p2.unsignedPolicy=allow >> %ECL_INST_INI%

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

    :: filtering user displayed catalogs/products/versions
    ECHO -Doomph.setup.product.catalog.filter=%PROD_CAT_FILTER%>> %ECL_INST_INI%
    ECHO -Doomph.setup.product.filter=%PROD_FILTER%>>             %ECL_INST_INI%
    ECHO -Doomph.setup.product.version.filter=%PROD_VERSION%>>    %ECL_INST_INI%

    ECHO -Doomph.setup.jre.choice=false                          >> %ECL_INST_INI%
    ECHO -Doomph.installer.update.url=%BUILD_STORE%/p2/installer >> %ECL_INST_INI%
    ECHO -Doomph.update.url=%BUILD_STORE%/p2/oomph               >> %ECL_INST_INI%
    ECHO -Doomph.setup.installer.mode=advanced                   >> %ECL_INST_INI%
    ECHO -Doomph.redirection.klibProductCatalog=index:/redirectable.products.setup-^>%productSetup% >> %ECL_INST_INI%
    ECHO -Doomph.redirection.klibProjectCatalog=index:/redirectable.projects.setup-^>%projectSetup% >> %ECL_INST_INI%
)

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

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

:END

update peterkir to oomph 1.6.0

update peterkir to oomph 1.6.0


"C:\Windows\Microsoft.NET\Framework\v4.0.30319\msbuild.exe" "Medidata.ZipkinTracerModule.csproj" /p:Configuration=Release /t:Clean
"..\.nuget\nuget.exe" pack Medidata.ZipkinTracerModule.csproj -Build -Properties Configuration=Release

"C:\Windows\Microsoft.NET\Framework\v4.0.30319\msbuild.exe" "Medidata.ZipkinTracerModule.csproj" /p:Configuration=Release /t:Clean
"..\.nuget\nuget.exe" pack Medidata.ZipkinTracer.Core.csproj -Build -Properties Configuration=Release

fix bat files command

fix bat files command


@echo off

set BOOST_ROOT=D:/dev/boost_1_65_1
set BOOST_LIBRARYDIR=D:/dev/boost_1_65_1/lib/stage
set INCLUDE=%BOOST_ROOT%;D:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include
set QL_DIR=%CD%\QuantLib
set QLEXT_DIR=%CD%\QuantLib-Ext
set BUILD_TYPE=Release
set ADDRESS_MODEL=Win64

cd QuantLib

if exist build (
  rem build folder already exists.
) else (
  mkdir build
)

if %ADDRESS_MODEL%==Win64 (
  set PLATFORM=x64
) else (
  set PLATFORM=Win32
)

cd build

if %ADDRESS_MODEL%==Win64 (
  cmake -G "Visual Studio 14 2015 %ADDRESS_MODEL%" -DCMAKE_BUILD_TYPE=%BUILD_TYPE% -DCMAKE_INSTALL_PREFIX=%QL_DIR% --target install ..
) else (
  cmake -G "Visual Studio 14 2015" -DCMAKE_BUILD_TYPE=%BUILD_TYPE% -DCMAKE_INSTALL_PREFIX=%QL_DIR% --target install ..
)

if %errorlevel% neq 0 exit /b 1

msbuild QuantLib.sln /m:%NUMBER_OF_PROCESSORS% /p:Configuration=%BUILD_TYPE% /p:Platform=%PLATFORM%
msbuild INSTALL.vcxproj /m:%NUMBER_OF_PROCESSORS% /p:Configuration=%BUILD_TYPE% /p:Platform=%PLATFORM%

if %errorlevel% neq 0 exit /b 1

cd ..\bin

quantlib-test-suite --log_level=message --build_info=true

if %errorlevel% neq 0 exit /b 1

cd ..\..\QuantLib-Ext

if exist build (
  rem build folder already exists.
) else (
  mkdir build
)

cd build

if %ADDRESS_MODEL%==Win64 (
  cmake -G "Visual Studio 14 2015 %ADDRESS_MODEL%" -DCMAKE_BUILD_TYPE=%BUILD_TYPE% -DCMAKE_INSTALL_PREFIX=%QLEXT_DIR% --target install ..
) else (
  cmake -G "Visual Studio 14 2015" -DCMAKE_BUILD_TYPE=%BUILD_TYPE% -DCMAKE_INSTALL_PREFIX=%QLEXT_DIR% --target install ..
)

if %errorlevel% neq 0 exit /b 1

msbuild QuantLibExt.sln /m:%NUMBER_OF_PROCESSORS% /p:Configuration=%BUILD_TYPE% /p:Platform=%PLATFORM%
msbuild INSTALL.vcxproj /m:%NUMBER_OF_PROCESSORS% /p:Configuration=%BUILD_TYPE% /p:Platform=%PLATFORM%

if %errorlevel% neq 0 exit /b 1

cd ..\bin

quantlibext-test-suite --log_level=message --build_info=true

if %errorlevel% neq 0 exit /b 1

cd ..\..\QuantLib-SWIG\Python

python setup.py wrap
python setup.py build
python setup.py bdist_wheel

if %errorlevel% neq 0 exit /b 1

cd ..\..

@echo on

@echo off

set BOOST_ROOT=D:/dev/boost_1_65_1
set BOOST_LIBRARYDIR=D:/dev/boost_1_65_1/lib/stage
set INCLUDE=%BOOST_ROOT%;D:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include
set QL_DIR=%CD%\QuantLib
set QLEXT_DIR=%CD%\QuantLib-Ext
set BUILD_TYPE=Release
set ADDRESS_MODEL=Win64
set MSVC_RUNTIME=dynamic

cd QuantLib

if exist build (
  rem build folder already exists.
) else (
  mkdir build
)

if %ADDRESS_MODEL%==Win64 (
  set PLATFORM=x64
) else (
  set PLATFORM=Win32
)

cd build

if %ADDRESS_MODEL%==Win64 (
  cmake -G "Visual Studio 14 2015 %ADDRESS_MODEL%" -DCMAKE_BUILD_TYPE=%BUILD_TYPE% -DCMAKE_INSTALL_PREFIX=%QL_DIR% -DMSVC_RUNTIME=%MSVC_RUNTIME% --target install ..
) else (
  cmake -G "Visual Studio 14 2015" -DCMAKE_BUILD_TYPE=%BUILD_TYPE% -DCMAKE_INSTALL_PREFIX=%QL_DIR% -DMSVC_RUNTIME=%MSVC_RUNTIME% --target install ..
)

if %errorlevel% neq 0 exit /b 1

msbuild QuantLib.sln /m:%NUMBER_OF_PROCESSORS% /p:Configuration=%BUILD_TYPE% /p:Platform=%PLATFORM%
msbuild INSTALL.vcxproj /m:%NUMBER_OF_PROCESSORS% /p:Configuration=%BUILD_TYPE% /p:Platform=%PLATFORM%

if %errorlevel% neq 0 exit /b 1

cd ..\bin

rem quantlib-test-suite --log_level=message --build_info=true

if %errorlevel% neq 0 exit /b 1

cd ..\..\QuantLib-Ext

if exist build (
  rem build folder already exists.
) else (
  mkdir build
)

cd build

if %ADDRESS_MODEL%==Win64 (
  cmake -G "Visual Studio 14 2015 %ADDRESS_MODEL%" -DCMAKE_BUILD_TYPE=%BUILD_TYPE% -DCMAKE_INSTALL_PREFIX=%QLEXT_DIR% -DMSVC_RUNTIME=%MSVC_RUNTIME% --target install ..
) else (
  cmake -G "Visual Studio 14 2015" -DCMAKE_BUILD_TYPE=%BUILD_TYPE% -DCMAKE_INSTALL_PREFIX=%QLEXT_DIR% -DMSVC_RUNTIME=%MSVC_RUNTIME% --target install ..
)

if %errorlevel% neq 0 exit /b 1

msbuild QuantLibExt.sln /m:%NUMBER_OF_PROCESSORS% /p:Configuration=%BUILD_TYPE% /p:Platform=%PLATFORM%
msbuild INSTALL.vcxproj /m:%NUMBER_OF_PROCESSORS% /p:Configuration=%BUILD_TYPE% /p:Platform=%PLATFORM%

if %errorlevel% neq 0 exit /b 1

cd ..\bin

rem quantlibext-test-suite --log_level=message --build_info=true

if %errorlevel% neq 0 exit /b 1

cd ..\..\QuantLib-SWIG\Python

python setup.py wrap

if %MSVC_RUNTIME% neq static (
  if %BUILD_TYPE% neq Release (
    python setup.py build --debug
  ) else (
    python setup.py build
  )
) else (
  if %BUILD_TYPE% neq Release (
    python setup.py build --static --debug
  ) else (
    python setup.py build --static
  )
)

python setup.py bdist_wheel

if %errorlevel% neq 0 exit /b 1

cd ..\..

@echo on

update lib build script

update lib build script


@echo off

::Arquivo usdo para compilar os arquivos jsx/js
::para js nativo e ser usado no index.html ou qualquer outro
::deve ser executado em outra janela do terminal junto com
::o servidor.

set output="public/build"
set input="src"
::set date="%Y-%m-%d-%H:%M";
set log="build.log.txt"

for /F "usebackq tokens=1,2 delims==" %%i in (`wmic os get LocalDateTime /VALUE 2^>NUL`) do if '.%%i.'=='.LocalDateTime.' set ldt=%%j
set ldt=%ldt:~0,4%-%ldt:~4,2%-%ldt:~6,2%-%ldt:~8,2%:%ldt:~10,2%

set now=%ltd%;
::set logsize="$(du -hsb $log)"
set outputFile="bundle.js"
set success="$(tput setaf 2)"
set error="$(tput setaf 1)"
set info="$(tput setaf 4)"
set reset=`tput sgr0`
set cont=0;

FOR /F "usebackq" %%A IN ('%log%') DO set logsize=%%~zA

while  read file ; do
   let cont=$cont+1;
done < %log%;

if %cont% > 200 (

    dialog --title "Clear File" \
    --backtitle "Build - React" \
    --yesno "The %log% have more than 200 line.Are you want clear this log ? [ESC to cancel]" 7 60
    response=$?
    case $response in
       0) echo "file is clear";echo"">%log%;;
       1) echo "not clear";;
       255) echo "[operation was canceled]"; exit;;
    esac
)

::Verifica se o diretorio  de entrada é válido
if not exist %input% (
  echo "+-----------------------------------------+"
  echo "+%error% Directory %input% not found in current dir!%{reset}% +"
  echo "+%info% See %log% for more details %{reset}%    +"
  echo "+-----------------------------------------+"
  echo "[%now%] - %logsize%
  It is necessary that the directory <%input%> is set up so that
  the watchify compile the code to <%output%>" >> %log%
  exit
)

::Verifica se o diretorio de saida está criado, se não ele é criado automaticamente
if not exist %output% (
  md %output%
)

::Caso o diretório de entrada e saída estiverem OK ele builda os arquivos
::de entrada para a pasta de saída em um único arquivo,.
if exist %input% (
  echo "+--------------------------------------------+"
  echo "+%success% Build project from <%input%> to <%output%>%{reset}% +"
  echo "+--------------------------------------------+"
  watchify -t [ babelify --presets [ react ] ] %input%/*.jsx -o %output%/%outputFile% -d -w |

  echo "[%now%]
  File %output%/%outputFile% was built in %output%" >> %log%
)

Create build.bat

Create build.bat

versão batch para o build.sh(em progresso)
dúvidas:
-sobre o while
-como fazer o dialog


cls

@REM ###############################
@REM ## AIMGAMES SCRIPTS COMPILER ##
@REM ##  MADE BY RAFA1231518 AKA  ##
@REM ##       CHRISHANSEN69       ##
@REM ###############################

@REM "C:\Program Files\Java\jdk1.8.0_65\bin\java" -version
@REM dir

@REM build java files

@cd build
@cd src\

@REM compile everything
javac br\com\chrishansen\aimgames\builder\*.java
@REM pack AddUserscriptLines
jar cvfe AddUserscriptLines.jar br.com.chrishansen.aimgames.builder.AddUserscriptLines br\com\chrishansen\aimgames\builder\AddUserscriptLines.class
@REM pack IncrementBuildNumber
jar cvfe IncrementBuildNumber.jar br.com.chrishansen.aimgames.builder.IncrementBuildNumber br\com\chrishansen\aimgames\builder\IncrementBuildNumber.class
@REM pack beautify stuff
jar cvfe BeautifyScript.jar br.com.chrishansen.aimgames.builder.BeautifyScript br\com\chrishansen\aimgames\builder\BeautifyScript.class

move AddUserscriptLines.jar ..\AddUserscriptLines.jar
move IncrementBuildNumber.jar ..\IncrementBuildNumber.jar
move BeautifyScript.jar ..\BeautifyScript.jar
mkdir ..\libraries\
move libraries\beautifier.js ..\libraries\beautifier.js

@cd ..

@REM build scripts

@REM Argument 1 is the file that will be output, argument 2 is the file that will be input, argument 3 is the number of lines to be kept from the start of the file.
@REM ..\ means "go back one folder"
call compile ..\bin\swearify.compiled.user.js "..\swearify\swearify.user.js" 15
call compile ..\bin\swearify_v2.compiled.user.js "..\swearify\swearify_v2.user.js" 17
call compile ..\bin\alive.compiled.user.js "..\alive\alive.user.js" 8
call compile ..\bin\chatboxplusplus.compiled.user.js "..\alive\chatboxplusplus.user.js" 9
call compile ..\bin\chameleon.compiled.user.js "..\chameleon\chameleon.user.js" 11
call compile ..\bin\chameleon_random.compiled.user.js "..\chameleon\chameleon_random.user.js" 8
call compile ..\bin\chameleon_vampire.compiled.user.js "..\chameleon\chameleon_vampire.user.js" 7
call compile ..\bin\accountassist.compiled.user.js "..\other\accountassist.user.js" 11
call compile ..\bin\ratebot.compiled.user.js "..\other\ratebot.user.js" 9
call compile ..\bin\imagereuploader.compiled.user.js "..\swearify\imagereuploader.user.js" 9
call compile ..\bin\swearify_image_utility.compiled.user.js "..\swearify\swearify_image_utility.user.js" 8
call increment

@REM return to home
@cd ..

cls

@REM ###############################
@REM ## AIMGAMES SCRIPTS COMPILER ##
@REM ##  MADE BY RAFA1231518 AKA  ##
@REM ##       CHRISHANSEN69       ##
@REM ###############################

@REM "C:\Program Files\Java\jdk1.8.0_65\bin\java" -version
@REM dir

@REM build java files

@cd build
@cd src\

@REM compile everything
javac br\com\chrishansen\aimgames\builder\*.java
@REM pack AddUserscriptLines
jar cvfe AddUserscriptLines.jar br.com.chrishansen.aimgames.builder.AddUserscriptLines br\com\chrishansen\aimgames\builder\AddUserscriptLines.class
@REM pack IncrementBuildNumber
jar cvfe IncrementBuildNumber.jar br.com.chrishansen.aimgames.builder.IncrementBuildNumber br\com\chrishansen\aimgames\builder\IncrementBuildNumber.class
@REM pack beautify stuff
jar cvfe BeautifyScript.jar br.com.chrishansen.aimgames.builder.BeautifyScript br\com\chrishansen\aimgames\builder\BeautifyScript.class

move AddUserscriptLines.jar ..\AddUserscriptLines.jar
move IncrementBuildNumber.jar ..\IncrementBuildNumber.jar
move BeautifyScript.jar ..\BeautifyScript.jar
mkdir ..\libraries\
move libraries\beautifier.js ..\libraries\beautifier.js

@cd ..

@REM build scripts

@REM Argument 1 is the file that will be output, argument 2 is the file that will be input, argument 3 is the number of lines to be kept from the start of the file.
@REM ..\ means "go back one folder"
call compile ..\bin\swearify.compiled.user.js "..\swearify\swearify.user.js" 15
call compile ..\bin\swearify_v2.compiled.user.js "..\swearify\swearify_v2.user.js" 17
call compile ..\bin\alive.compiled.user.js "..\alive\alive.user.js" 8
call compile ..\bin\chatboxplusplus-v2.compiled.user.js "..\alive\chatboxplusplus-v2.user.js" 9
call compile ..\bin\chameleon.compiled.user.js "..\chameleon\chameleon.user.js" 11
call compile ..\bin\chameleon_random.compiled.user.js "..\chameleon\chameleon_random.user.js" 8
call compile ..\bin\chameleon_vampire.compiled.user.js "..\chameleon\chameleon_vampire.user.js" 7
call compile ..\bin\accountassist.compiled.user.js "..\other\accountassist.user.js" 11
call compile ..\bin\ratebot.compiled.user.js "..\other\ratebot.user.js" 9
call compile ..\bin\imagereuploader.compiled.user.js "..\swearify\imagereuploader.user.js" 9
call compile ..\bin\swearify_image_utility.compiled.user.js "..\swearify\swearify_image_utility.user.js" 8
call increment

@REM return to home
@cd ..

make build.bat use chatbox++ v2

make build.bat use chatbox++ v2


@ECHO OFF

SETLOCAL EnableDelayedExpansion

SET ScriptRoot=%~dp0

IF %ScriptRoot:~-1%==\ SET ScriptRoot=%ScriptRoot:~0,-1%

PUSHD "%ScriptRoot%"

SET DeviceName=%1
SET BuildTarget=%2
SET BuildConfiguration=%3
SET BuildVerbosity=%4
SET GccDirectory=%5

IF "%BuildTarget%" == "" SET BuildTarget=build
IF "%BuildConfiguration%" == "" SET BuildConfiguration=release
IF "%BuildVerbosity%" == "" SET BuildVerbosity=quiet

IF NOT EXIST "%ScriptRoot%\Devices\%DeviceName%" (
    ECHO Unsupported device passed: %DeviceName%
    GOTO :EOF
)

IF NOT "%BuildTarget%" == "build" IF NOT "%BuildTarget%" == "cleanbuild" IF NOT "%BuildTarget%" == "clean" (
    ECHO Unsupported target passed: %BuildTarget%
    GOTO :EOF
)

IF NOT "%BuildConfiguration%" == "debug" IF NOT "%BuildConfiguration%" == "release" (
    ECHO Unsupported configuration passed: %BuildConfiguration%
    GOTO :EOF
)

IF NOT EXIST "%GccDirectory%" SET GccDirectory=C:\Program Files (x86)\GNU Tools ARM Embedded\7 2017-q4-major
IF NOT EXIST "%GccDirectory%" SET GccDirectory=C:\Program Files\GNU Tools ARM Embedded\7 2017-q4-major

IF NOT EXIST "%GccDirectory%" (
    ECHO Cannot find GCC. Try passing the directory explicitly like `build.bat device build release normal "C:\Program Files (x86)\GNU Tools ARM Embedded\7 2017-q4-major"`
    GOTO :EOF
)

IF "%GccDirectory:~-1%"=="\" SET "GccDirectory=%GccDirectory:~0,-1%"

SET DeviceBuildConfiguration=%ScriptRoot%\Devices\%DeviceName%\BuildConfiguration.txt

IF NOT EXIST "%DeviceBuildConfiguration%" (
    ECHO Cannot find device configuration at "%DeviceBuildConfiguration%".
    GOTO :EOF
)

FOR /F "usebackq tokens=1,2 delims=:" %%A IN ("%DeviceBuildConfiguration%") DO SET %%A=%%B

IF "%TargetName%" == "" (
    ECHO TargetName not defined in "%DeviceBuildConfiguration%".
    GOTO :EOF
)

SET TargetBuildConfiguration=%ScriptRoot%\Targets\%TargetName%\BuildConfiguration.txt

IF NOT EXIST "%TargetBuildConfiguration%" (
    ECHO Cannot find target configuration at "%TargetBuildConfiguration%".
    GOTO :EOF
)

FOR /F "usebackq tokens=1,2 delims=:" %%A IN ("%TargetBuildConfiguration%") DO SET %%A=%%B

IF "%TargetArchitecture%" == "" (
    ECHO TargetArchitecture not defined in "%TargetBuildConfiguration%".
    GOTO :EOF
)

SET LibraryBuildConfiguration=%ScriptRoot%\Core\%TargetArchitecture%BuildConfiguration.txt

IF NOT EXIST "%LibraryBuildConfiguration%" (
    ECHO Cannot find library configuration at "%LibraryBuildConfiguration%".
    GOTO :EOF
)

FOR /F "usebackq tokens=1,2 delims=:" %%A IN ("%LibraryBuildConfiguration%") DO SET "%%A=%%B"

IF "%NeedCmsis%" == "1" (
    IF NOT EXIST "%ScriptRoot%\CMSIS\ARM.CMSIS.pdsc" (
        ECHO Cannot find CMSIS. Please make sure it is downloaded and extracted to repo_root\CMSIS.
        GOTO :EOF
    )
)

SET AdditionalIncludes=%AdditionalIncludes% -I"%GccDirectory%\lib\gcc\arm-none-eabi\7.2.1\include"
SET AdditionalIncludes=%AdditionalIncludes% -I"%ScriptRoot%\Targets\%TargetName%"
SET AdditionalIncludes=%AdditionalIncludes% -I"%ScriptRoot%\Devices\%DeviceName%"
SET AdditionalIncludes=%AdditionalIncludes% -I"%ScriptRoot%\Core"

SET AdditionalDefines=%AdditionalDefines% -DGCC
SET AdditionalCompilerArguments=-mstructure-size-boundary=8 -fno-exceptions -ffunction-sections -fdata-sections -fshort-wchar -funsigned-char -mlong-calls

IF "%BuildConfiguration%" == "debug" (
    SET AdditionalDefines=%AdditionalDefines% -DDEBUG -D_DEBUG
    SET AdditionalAssemblerArguments=%AdditionalAssemblerArguments% -g
    SET AdditionalCompilerArguments=-O0 -femit-class-debug-always -g3 -ggdb %AdditionalCompilerArguments%
) ELSE (
    SET AdditionalDefines=%AdditionalDefines%
    SET AssemblerCompileArguments=%AdditionalAssemblerArguments%
    SET AdditionalCompilerArguments=%OptimizeLevel% %AdditionalCompilerArguments%
)

SET OutputDirectory=%ScriptRoot%\Build\%BuildConfiguration%\%DeviceName%
SET CoreDirectory=%ScriptRoot%\Core
SET CoreLibraryFile=%CoreDirectory%\TinyCLR_%TargetArchitecture%.lib
SET CoreHeaderFile=%CoreDirectory%\TinyCLR.h

IF "%BuildTarget%" == "cleanbuild" (
    SET DoClean=1
    SET DoBuild=1
) ELSE IF "%BuildTarget%" == "build" (
    SET DoClean=0
    SET DoBuild=1
) ELSE IF "%BuildTarget%" == "clean" (
    SET DoClean=1
    SET DoBuild=0
)

IF "%DoClean%" == "1" IF EXIST "%OutputDirectory%" (
    RMDIR /S /Q "%OutputDirectory%"
)

IF "%DoBuild%" == "1" (
    IF NOT EXIST "%OutputDirectory%" MD "%OutputDirectory%"

    IF NOT EXIST "%CoreLibraryFile%" (
        ECHO Cannot find the core library file. Please make sure it is downloaded and extracted to repo_root\Core\TinyCLR_%TargetArchitecture%.lib.
        GOTO :EOF
    )

    IF NOT EXIST "%CoreHeaderFile%" (
        ECHO Cannot find the core header file. Please make sure it is downloaded and extracted to repo_root\Core\TinyCLR.h.
        GOTO :EOF
    )

    SET CompilePaths="%ScriptRoot%\Targets\%TargetName%", "%ScriptRoot%\Devices\%DeviceName%", "%ScriptRoot%\Main"

    IF NOT "%AdditionalTargetDrivers%" == "" (
        FOR %%A IN (!AdditionalTargetDrivers!) DO SET CompilePaths=!CompilePaths!, "%ScriptRoot%\Drivers\%%A"
    )

    IF NOT "%AdditionalDeviceDrivers%" == "" (
        FOR %%A IN (!AdditionalDeviceDrivers!) DO SET CompilePaths=!CompilePaths!, "%ScriptRoot%\Drivers\%%A"
    )

    FOR %%A IN (!CompilePaths!) DO (
        PUSHD "%%A"

        FOR /R %%B IN ("*.gcc.s") DO (
            ECHO %%B

            "%GccDirectory%\bin\arm-none-eabi-as.exe" %AdditionalAssemblerArguments% -mcpu=%MCpu% -mlittle-endian %FloatCompileArguments% -o "%OutputDirectory%\%%~nB.obj" "%%B"
        )

        FOR /R %%B IN ("*.cpp") DO (
            ECHO %%B

            "%GccDirectory%\bin\arm-none-eabi-g++.exe" -std=c++11 -xc++ %AdditionalCompilerArguments% -mcpu=%MCpu% -mlittle-endian %FloatCompileArguments% %AdditionalDefines% %AdditionalIncludes% -o "%OutputDirectory%\%%~nB.obj" -c "%%B"
        )

        POPD
    )

    "%GccDirectory%\bin\arm-none-eabi-g++.exe" -mcpu=%MCpu% -mlittle-endian -nostartfiles %FloatCompileArguments% -Xlinker %AdditionalCompilerArguments% -L "%GccLibrary%" -Wl,-static,--gc-sections,--no-wchar-size-warning,-Map="%OutputDirectory%\%DeviceName% Firmware.map" -specs="%GccLibrary%\nano.specs" -T"%ScriptRoot%\Devices\%DeviceName%\Scatterfile.gcc.ldf" "%OutputDirectory%\*.obj" "%CoreLibraryFile%" -o "%OutputDirectory%\%DeviceName% Firmware.axf"

    "%GccDirectory%\bin\arm-none-eabi-objcopy.exe" -S -j ER_FLASH -j ER_RAM_RO -j ER_RAM_RW -O binary "%OutputDirectory%\%DeviceName% Firmware.axf" "%OutputDirectory%\%DeviceName% Firmware.bin"
    "%GccDirectory%\bin\arm-none-eabi-objcopy.exe" -S -R ER_DAT -R ER_CONFIG -O ihex "%OutputDirectory%\%DeviceName% Firmware.axf" "%OutputDirectory%\%DeviceName% Firmware.hex"

    IF NOT "%ImageGenParameters%" == ""  "%ScriptRoot%\imagegen.exe" %ImageGenParameters% "%OutputDirectory%\%DeviceName% Firmware.bin"
)

ECHO Done

POPD

ENDLOCAL

@ECHO OFF

SETLOCAL EnableDelayedExpansion

SET ScriptRoot=%~dp0

IF %ScriptRoot:~-1%==\ SET ScriptRoot=%ScriptRoot:~0,-1%

PUSHD "%ScriptRoot%"

SET DeviceName=%1
SET BuildTarget=%2
SET BuildConfiguration=%3
SET BuildVerbosity=%4
SET GccDirectory=%5

IF "%BuildTarget%" == "" SET BuildTarget=build
IF "%BuildConfiguration%" == "" SET BuildConfiguration=release
IF "%BuildVerbosity%" == "" SET BuildVerbosity=quiet

IF NOT EXIST "%ScriptRoot%\Devices\%DeviceName%" (
    ECHO Unsupported device passed: %DeviceName%
    GOTO :EOF
)

IF NOT "%BuildTarget%" == "build" IF NOT "%BuildTarget%" == "cleanbuild" IF NOT "%BuildTarget%" == "clean" (
    ECHO Unsupported target passed: %BuildTarget%
    GOTO :EOF
)

IF NOT "%BuildConfiguration%" == "debug" IF NOT "%BuildConfiguration%" == "release" (
    ECHO Unsupported configuration passed: %BuildConfiguration%
    GOTO :EOF
)

IF NOT EXIST "%GccDirectory%" SET GccDirectory=C:\Program Files (x86)\GNU Tools ARM Embedded\7 2018-q2-update
IF NOT EXIST "%GccDirectory%" SET GccDirectory=C:\Program Files\GNU Tools ARM Embedded\7 2018-q2-update

IF NOT EXIST "%GccDirectory%" (
    ECHO Cannot find GCC. Try passing the directory explicitly like `build.bat device build release normal "C:\Program Files (x86)\GNU Tools ARM Embedded\7 2018-q2-update"`
    GOTO :EOF
)

IF "%GccDirectory:~-1%"=="\" SET "GccDirectory=%GccDirectory:~0,-1%"

SET DeviceBuildConfiguration=%ScriptRoot%\Devices\%DeviceName%\BuildConfiguration.txt

IF NOT EXIST "%DeviceBuildConfiguration%" (
    ECHO Cannot find device configuration at "%DeviceBuildConfiguration%".
    GOTO :EOF
)

FOR /F "usebackq tokens=1,2 delims=:" %%A IN ("%DeviceBuildConfiguration%") DO SET %%A=%%B

IF "%TargetName%" == "" (
    ECHO TargetName not defined in "%DeviceBuildConfiguration%".
    GOTO :EOF
)

SET TargetBuildConfiguration=%ScriptRoot%\Targets\%TargetName%\BuildConfiguration.txt

IF NOT EXIST "%TargetBuildConfiguration%" (
    ECHO Cannot find target configuration at "%TargetBuildConfiguration%".
    GOTO :EOF
)

FOR /F "usebackq tokens=1,2 delims=:" %%A IN ("%TargetBuildConfiguration%") DO SET %%A=%%B

IF "%TargetArchitecture%" == "" (
    ECHO TargetArchitecture not defined in "%TargetBuildConfiguration%".
    GOTO :EOF
)

SET LibraryBuildConfiguration=%ScriptRoot%\Core\%TargetArchitecture%BuildConfiguration.txt

IF NOT EXIST "%LibraryBuildConfiguration%" (
    ECHO Cannot find library configuration at "%LibraryBuildConfiguration%".
    GOTO :EOF
)

FOR /F "usebackq tokens=1,2 delims=:" %%A IN ("%LibraryBuildConfiguration%") DO SET "%%A=%%B"

IF "%NeedCmsis%" == "1" (
    IF NOT EXIST "%ScriptRoot%\CMSIS\ARM.CMSIS.pdsc" (
        ECHO Cannot find CMSIS. Please make sure it is downloaded and extracted to repo_root\CMSIS.
        GOTO :EOF
    )
)

SET AdditionalIncludes=%AdditionalIncludes% -I"%GccDirectory%\lib\gcc\arm-none-eabi\7.3.1\include"
SET AdditionalIncludes=%AdditionalIncludes% -I"%ScriptRoot%\Targets\%TargetName%"
SET AdditionalIncludes=%AdditionalIncludes% -I"%ScriptRoot%\Devices\%DeviceName%"
SET AdditionalIncludes=%AdditionalIncludes% -I"%ScriptRoot%\Core"

SET AdditionalDefines=%AdditionalDefines% -DGCC
SET AdditionalCompilerArguments=-mstructure-size-boundary=8 -fno-exceptions -ffunction-sections -fdata-sections -fshort-wchar -funsigned-char -mlong-calls

IF "%BuildConfiguration%" == "debug" (
    SET AdditionalDefines=%AdditionalDefines% -DDEBUG -D_DEBUG
    SET AdditionalAssemblerArguments=%AdditionalAssemblerArguments% -g
    SET AdditionalCompilerArguments=-O0 -femit-class-debug-always -g3 -ggdb %AdditionalCompilerArguments%
) ELSE (
    SET AdditionalDefines=%AdditionalDefines%
    SET AssemblerCompileArguments=%AdditionalAssemblerArguments%
    SET AdditionalCompilerArguments=%OptimizeLevel% %AdditionalCompilerArguments%
)

SET OutputDirectory=%ScriptRoot%\Build\%BuildConfiguration%\%DeviceName%
SET CoreDirectory=%ScriptRoot%\Core
SET CoreLibraryFile=%CoreDirectory%\TinyCLR_%TargetArchitecture%.lib
SET CoreHeaderFile=%CoreDirectory%\TinyCLR.h

IF "%BuildTarget%" == "cleanbuild" (
    SET DoClean=1
    SET DoBuild=1
) ELSE IF "%BuildTarget%" == "build" (
    SET DoClean=0
    SET DoBuild=1
) ELSE IF "%BuildTarget%" == "clean" (
    SET DoClean=1
    SET DoBuild=0
)

IF "%DoClean%" == "1" IF EXIST "%OutputDirectory%" (
    RMDIR /S /Q "%OutputDirectory%"
)

IF "%DoBuild%" == "1" (
    IF NOT EXIST "%OutputDirectory%" MD "%OutputDirectory%"

    IF NOT EXIST "%CoreLibraryFile%" (
        ECHO Cannot find the core library file. Please make sure it is downloaded and extracted to repo_root\Core\TinyCLR_%TargetArchitecture%.lib.
        GOTO :EOF
    )

    IF NOT EXIST "%CoreHeaderFile%" (
        ECHO Cannot find the core header file. Please make sure it is downloaded and extracted to repo_root\Core\TinyCLR.h.
        GOTO :EOF
    )

    SET CompilePaths="%ScriptRoot%\Targets\%TargetName%", "%ScriptRoot%\Devices\%DeviceName%", "%ScriptRoot%\Main"

    IF NOT "%AdditionalTargetDrivers%" == "" (
        FOR %%A IN (!AdditionalTargetDrivers!) DO SET CompilePaths=!CompilePaths!, "%ScriptRoot%\Drivers\%%A"
    )

    IF NOT "%AdditionalDeviceDrivers%" == "" (
        FOR %%A IN (!AdditionalDeviceDrivers!) DO SET CompilePaths=!CompilePaths!, "%ScriptRoot%\Drivers\%%A"
    )

    FOR %%A IN (!CompilePaths!) DO (
        PUSHD "%%A"

        FOR /R %%B IN ("*.gcc.s") DO (
            ECHO %%B

            "%GccDirectory%\bin\arm-none-eabi-as.exe" %AdditionalAssemblerArguments% -mcpu=%MCpu% -mlittle-endian %FloatCompileArguments% -o "%OutputDirectory%\%%~nB.obj" "%%B"
        )

        FOR /R %%B IN ("*.cpp") DO (
            ECHO %%B

            "%GccDirectory%\bin\arm-none-eabi-g++.exe" -std=c++11 -xc++ %AdditionalCompilerArguments% -mcpu=%MCpu% -mlittle-endian %FloatCompileArguments% %AdditionalDefines% %AdditionalIncludes% -o "%OutputDirectory%\%%~nB.obj" -c "%%B"
        )

        POPD
    )

    "%GccDirectory%\bin\arm-none-eabi-g++.exe" -mcpu=%MCpu% -mlittle-endian -nostartfiles %FloatCompileArguments% -Xlinker %AdditionalCompilerArguments% -L "%GccLibrary%" -Wl,-static,--gc-sections,--no-wchar-size-warning,-Map="%OutputDirectory%\%DeviceName% Firmware.map" -specs="%GccLibrary%\nano.specs" -T"%ScriptRoot%\Devices\%DeviceName%\Scatterfile.gcc.ldf" "%OutputDirectory%\*.obj" "%CoreLibraryFile%" -o "%OutputDirectory%\%DeviceName% Firmware.axf"

    "%GccDirectory%\bin\arm-none-eabi-objcopy.exe" -S -j ER_FLASH -j ER_RAM_RO -j ER_RAM_RW -O binary "%OutputDirectory%\%DeviceName% Firmware.axf" "%OutputDirectory%\%DeviceName% Firmware.bin"
    "%GccDirectory%\bin\arm-none-eabi-objcopy.exe" -S -R ER_DAT -R ER_CONFIG -O ihex "%OutputDirectory%\%DeviceName% Firmware.axf" "%OutputDirectory%\%DeviceName% Firmware.hex"

    IF NOT "%ImageGenParameters%" == ""  "%ScriptRoot%\imagegen.exe" %ImageGenParameters% "%OutputDirectory%\%DeviceName% Firmware.bin"
)

ECHO Done

POPD

ENDLOCAL

Update gcc version, ghi-electronics/TinyCLR-Core#230


WHERE choco
IF %ERRORLEVEL% NEQ 0 %PS% -NoProfile -ExecutionPolicy unrestricted -Command "iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))" && SET PATH=%PATH%;%systemdrive%\ProgramData\chocolatey\bin
choco install sbt --acceptlicense -y
WHERE sbt
IF %ERRORLEVEL% NEQ 0 SET PATH=%PATH%;%systemdrive%\Program Files (x86)\sbt\bin
choco install "\\columbus\sw_share\DEPARTMENT\SD Software\Java\jdk8.8.0.66.nupkg" --acceptlicense -y

WHERE sbt
IF %ERRORLEVEL% EQU 0 GOTO sbtgood:
echo ERROR: cannot find sbt
exit /b 1

:sbtgood
WHERE java
IF %ERRORLEVEL% NEQ 0 SET PATH=%PATH%;%systemdrive%\Program Files\Java\jdk1.8.0_66\bin

WHERE java
IF %ERRORLEVEL% EQU 0 GOTO javagood:
echo ERROR: cannot find java
exit /b 1

:javagood
call sbt clean editsource:edit assembly

md Deploy
copy .\fetch\target\s3fetch-*.jar .\Deploy
copy .\material\target\s3material-*.jar .\Deploy
copy .\publish\target\s3publish-*.jar .\Deploy

Build batch file for Windows build agents


@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
.nuget\NuGet.exe install FSharpSupport -ExcludeVersion -o packages -nocache -pre
.nuget\NuGet.exe install KoreBuild -ExcludeVersion -o packages -nocache -pre
.nuget\NuGet.exe install KoreBuild -ExcludeVersion -o packages -nocache -pre

IF "%SKIP_KRE_INSTALL%"=="1" goto run
CALL packages\KoreBuild\build\kvm upgrade -svr50 -x86
REM CALL packages\KoreBuild\build\kvm install default -svrc50 -x86

:run
REM Get the path of `kpm` and store it as KPM_PATH
for /f "usebackq tokens=*" %%a in (`where kpm`) do set KPM_PATH=%%a
REM Get the dir name of `KPM_PATH`
for %%F in (%KPM_PATH%) do set KPM_DIR=%%~dpF

cd src\FSharpSupport
call kpm restore

mkdir obj\pass1
mkdir obj\pass2
mkdir obj\pass3

SET ERRORLEVEL=
REM First build to make sure source is valid
move %~dp0\packages\FSharpSupport\lib\net45\FSharpSupport.dll obj\pass1\FSharpSupport.dll > nul
call klr --lib "%KPM_DIR%;%KPM_DIR%\lib\Microsoft.Framework.PackageManager;%~dp0\src\FSharpSupport\obj\pass1" "Microsoft.Framework.PackageManager" build
IF NOT "%ERRORLEVEL%" == "0" goto end

REM build again to make sure it fills the contracts
move bin\debug\net45\FSharpSupport.dll obj\pass2\FSharpSupport.dll > nul
move bin\debug\net45\FSharpSupport.pdb obj\pass2\FSharpSupport.pdb > nul
call klr --lib "%KPM_DIR%;%KPM_DIR%\lib\Microsoft.Framework.PackageManager;%~dp0\src\FSharpSupport\obj\pass2" "Microsoft.Framework.PackageManager" build
IF NOT "%ERRORLEVEL%" == "0" goto end

REM build again to make sure it constructs something that fills the contracts
move bin\debug\net45\FSharpSupport.dll obj\pass3\FSharpSupport.dll > nul
move bin\debug\net45\FSharpSupport.pdb obj\pass3\FSharpSupport.pdb > nul
call klr --lib "%KPM_DIR%;%KPM_DIR%\lib\Microsoft.Framework.PackageManager;%~dp0\src\FSharpSupport\obj\pass3" "Microsoft.Framework.PackageManager" build
IF NOT "%ERRORLEVEL%" == "0" goto end

IF NOT "%APPVEYOR_REPO_BRANCH%" == "master" goto wrongbranch
IF NOT "%APPVEYOR_PULL_REQUEST_NUMBER%" == "" goto pullreq
IF "%NUGET_SOURCE%" == "" goto end
.nuget\NuGet.exe push bin\debug\FSharpSupport.0.1-alpha-%K_BUILD_VERSION%.nupkg %NUGET_API_KEY% -Source %NUGET_SOURCE%

IF "%SYMBOL_SOURCE%" == "" goto end
.nuget\NuGet.exe push bin\debug\FSharpSupport.0.1-alpha-%K_BUILD_VERSION%.symbols.nupkg %SYMBOL_API_KEY% -Source %SYMBOL_SOURCE%
goto end

:wrongbranch
echo Skipping commit since branch = %APPVEYOR_REPO_NAME%
goto end

:pullreq
echo Skipping commit since it's a pull request
goto end

:end
exit /b %ERRORLEVEL%

@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
.nuget\NuGet.exe install FSharpSupport -ExcludeVersion -o packages -nocache -pre
.nuget\NuGet.exe install KoreBuild -ExcludeVersion -o packages -nocache -pre
.nuget\NuGet.exe install KoreBuild -ExcludeVersion -o packages -nocache -pre

IF "%SKIP_KRE_INSTALL%"=="1" goto run
CALL packages\KoreBuild\build\kvm upgrade -svr50 -x86
REM CALL packages\KoreBuild\build\kvm install default -svrc50 -x86

:run
REM Get the path of `kpm` and store it as KPM_PATH
for /f "usebackq tokens=*" %%a in (`where kpm`) do set KPM_PATH=%%a
REM Get the dir name of `KPM_PATH`
for %%F in (%KPM_PATH%) do set KPM_DIR=%%~dpF

cd src\FSharpSupport
call kpm restore

mkdir obj\pass1
mkdir obj\pass2
mkdir obj\pass3

SET ERRORLEVEL=
REM First build to make sure source is valid
move %~dp0\packages\FSharpSupport\lib\net45\FSharpSupport.dll obj\pass1\FSharpSupport.dll > nul
call klr --lib "%KPM_DIR%;%KPM_DIR%\lib\Microsoft.Framework.PackageManager;%~dp0\src\FSharpSupport\obj\pass1" "Microsoft.Framework.PackageManager" build
IF NOT "%ERRORLEVEL%" == "0" goto end

REM build again to make sure it fills the contracts
move bin\debug\net45\FSharpSupport.dll obj\pass2\FSharpSupport.dll > nul
move bin\debug\net45\FSharpSupport.pdb obj\pass2\FSharpSupport.pdb > nul
call klr --lib "%KPM_DIR%;%KPM_DIR%\lib\Microsoft.Framework.PackageManager;%~dp0\src\FSharpSupport\obj\pass2" "Microsoft.Framework.PackageManager" build
IF NOT "%ERRORLEVEL%" == "0" goto end

REM build again to make sure it constructs something that fills the contracts
move bin\debug\net45\FSharpSupport.dll obj\pass3\FSharpSupport.dll > nul
move bin\debug\net45\FSharpSupport.pdb obj\pass3\FSharpSupport.pdb > nul
call klr --lib "%KPM_DIR%;%KPM_DIR%\lib\Microsoft.Framework.PackageManager;%~dp0\src\FSharpSupport\obj\pass3" "Microsoft.Framework.PackageManager" build
IF NOT "%ERRORLEVEL%" == "0" goto end

IF NOT "%APPVEYOR_REPO_BRANCH%" == "master" goto wrongbranch
IF NOT "%APPVEYOR_PULL_REQUEST_NUMBER%" == "" goto pullreq
IF "%NUGET_SOURCE%" == "" goto end
echo Publishing bin\debug\FSharpSupport.0.1-alpha-%K_BUILD_VERSION%.nupkg
.nuget\NuGet.exe push bin\debug\FSharpSupport.0.1-alpha-%K_BUILD_VERSION%.nupkg %NUGET_API_KEY% -Source %NUGET_SOURCE%

IF "%SYMBOL_SOURCE%" == "" goto end
echo Publishing bin\debug\FSharpSupport.0.1-alpha-%K_BUILD_VERSION%.symbols.nupkg
.nuget\NuGet.exe push bin\debug\FSharpSupport.0.1-alpha-%K_BUILD_VERSION%.symbols.nupkg %SYMBOL_API_KEY% -Source %SYMBOL_SOURCE%
goto end

:wrongbranch
echo Skipping commit since branch = %APPVEYOR_REPO_NAME%
goto end

:pullreq
echo Skipping commit since it's a pull request
goto end

:end
exit /b %ERRORLEVEL%

Build debug

Build debug


@ECHO OFF
REM NOTE: This file was auto-generated with `IB.exe prepare` from `IntelliFactory.Build`.

setlocal
set PATH=%PATH%;%ProgramFiles(x86)%\Microsoft SDKs\F#\4.0\Framework\v4.0
set PATH=%PATH%;%ProgramFiles(x86)%\Microsoft SDKs\F#\3.1\Framework\v4.0
set PATH=%PATH%;%ProgramFiles(x86)%\Microsoft SDKs\F#\3.0\Framework\v4.0
set PATH=%PATH%;%ProgramFiles%\Microsoft SDKs\F#\4.0\Framework\v4.0
set PATH=%PATH%;%ProgramFiles%\Microsoft SDKs\F#\3.1\Framework\v4.0
set PATH=%PATH%;%ProgramFiles%\Microsoft SDKs\F#\3.0\Framework\v4.0
set PATH=%PATH%;tools\NuGet
nuget install IntelliFactory.Build -nocache -pre -ExcludeVersion -o tools\packages
fsi.exe --exec build-zafir.fsx %*

@ECHO OFF
REM NOTE: This file was auto-generated with `IB.exe prepare` from `IntelliFactory.Build`.

setlocal
set PATH=%PATH%;%ProgramFiles(x86)%\Microsoft SDKs\F#\4.0\Framework\v4.0
set PATH=%PATH%;%ProgramFiles(x86)%\Microsoft SDKs\F#\3.1\Framework\v4.0
set PATH=%PATH%;%ProgramFiles(x86)%\Microsoft SDKs\F#\3.0\Framework\v4.0
set PATH=%PATH%;%ProgramFiles%\Microsoft SDKs\F#\4.0\Framework\v4.0
set PATH=%PATH%;%ProgramFiles%\Microsoft SDKs\F#\3.1\Framework\v4.0
set PATH=%PATH%;%ProgramFiles%\Microsoft SDKs\F#\3.0\Framework\v4.0
set PATH=%PATH%;tools\NuGet
nuget install IntelliFactory.Build -nocache -pre -ExcludeVersion -o tools\packages
fsi.exe --exec build.fsx %*

fix build.cmd

fix build.cmd


@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
IF DEFINED BUILDCMD_RELEASE (
	.nuget\NuGet.exe install KoreBuild -version 0.2.1-%BUILDCMD_RELEASE% -ExcludeVersion -o packages -nocache -pre
) ELSE (
	.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
IF DEFINED BUILDCMD_RELEASE (
	CALL packages\KoreBuild\build\dnvm install 1.0.0-%BUILDCMD_RELEASE% -runtime CLR -arch x86 -a default
) ELSE (
	CALL packages\KoreBuild\build\dnvm upgrade -runtime CLR -arch x86
)
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 NUGET_VERSION=v3.2.0
SET CACHED_NUGET=%LocalAppData%\NuGet\nuget.%NUGET_VERSION%.exe
SET BUILDCMD_KOREBUILD_VERSION=0.2.1-beta8
SET BUILDCMD_DNX_VERSION=1.0.0-beta8

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://dist.nuget.org/win-x86-commandline/%NUGET_VERSION%/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 -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

Update build.cmd


@echo off

:Build
cls
if not exist tools\FAKE.Core\tools\Fake.exe (
	"tools\nuget\nuget.exe" "install" "FAKE.Core" "-OutputDirectory" "tools" "-ExcludeVersion" "-Prerelease"
)

SET TARGET="Default"

IF NOT [%1]==[] (set TARGET="%1")

SET BUILDMODE="Release"
IF NOT [%2]==[] (set BUILDMODE="%2")

"tools\FAKE.Core\tools\Fake.exe" "build.fsx" "target=%TARGET%" "buildMode=%BUILDMODE%"

rem Bail if we're running a TeamCity build.
if defined TEAMCITY_PROJECT_NAME goto Quit

rem Bail if we're running a MyGet build.
if /i "%BuildRunner%"=="MyGet" goto Quit

rem Loop the build script.
set CHOICE=nothing
echo (Q)uit, (Enter) runs the build again
set /P CHOICE=
if /i "%CHOICE%"=="Q" goto :Quit

GOTO Build

:Quit
exit /b %errorlevel%

@echo off

SET MinimalFAKEVersion=639
SET FAKEVersion=1
cls

if exist tools\FAKE.Core\tools\PatchVersion.txt (
    FOR /F "tokens=*" %%i in (tools\FAKE.Core\tools\PatchVersion.txt) DO (SET FAKEVersion=%%i)
)

if %MinimalFAKEVersion% lss %FAKEVersion% goto Build
if %MinimalFAKEVersion%==%FAKEVersion% goto Build

"tools\nuget\nuget.exe" "install" "FAKE.Core" "-OutputDirectory" "tools" "-ExcludeVersion" "-Prerelease"

:Build
cls

SET TARGET="Default"

IF NOT [%1]==[] (set TARGET="%1")

SET BUILDMODE="Release"
IF NOT [%2]==[] (set BUILDMODE="%2")

"tools\FAKE.Core\tools\Fake.exe" "build.fsx" "target=%TARGET%" "buildMode=%BUILDMODE%"

rem Bail if we're running a TeamCity build.
if defined TEAMCITY_PROJECT_NAME goto Quit

rem Bail if we're running a MyGet build.
if /i "%BuildRunner%"=="MyGet" goto Quit

rem Loop the build script.
set CHOICE=nothing
echo (Q)uit, (Enter) runs the build again
set /P CHOICE=
if /i "%CHOICE%"=="Q" goto :Quit

GOTO Build

:Quit
exit /b %errorlevel%

Check if we are already on the minimal FAKE version - otherwise patch it.


@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.1 (
  RD /S/Q %PACKAGEPATH%FAKE.BuildLib
  %NUGET% install FAKE.BuildLib -Version 0.3.1 %NUGETOPTIONS%
  COPY NUL %PACKAGEPATH%FAKE.BuildLib\Ver_0.3.1
)

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.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.3 (
  RD /S/Q %PACKAGEPATH%FAKE.BuildLib
  %NUGET% install FAKE.BuildLib -Version 0.3.3 %NUGETOPTIONS%
  COPY NUL %PACKAGEPATH%FAKE.BuildLib\Ver_0.3.3
)

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

popd

Update BuildLib 0.3.3

Update BuildLib 0.3.3


:: @ECHO OFF
:: Target (x64 CLR)
call dnvm use 1.0.0-rc1-update1 -a x64 -r clr

:: Patch project.json files
cd %APPVEYOR_BUILD_FOLDER%\build
call npm install
call node patch-project-json.js ../src/SteelToe.Extensions.Configuration.CloudFoundry/project.json %APPVEYOR_BUILD_VERSION% %APPVEYOR_REPO_TAG_NAME%
call node patch-project-json.js ../src/SteelToe.Extensions.Configuration.ConfigServer/project.json %APPVEYOR_BUILD_VERSION% %APPVEYOR_REPO_TAG_NAME%
cd %APPVEYOR_BUILD_FOLDER%

:: Restore packages
cd src
call dnu restore
cd ..\test
call dnu restore
cd ..

:: Build packages
cd src\SteelToe.Extensions.Configuration.CloudFoundry
call dnu pack --configuration Release
cd %APPVEYOR_BUILD_FOLDER%
cd src\SteelToe.Extensions.Configuration.ConfigServer
call dnu pack --configuration Release
cd %APPVEYOR_BUILD_FOLDER%

:: @ECHO OFF
:: Target (x64 CLR)
call dnvm use 1.0.0-rc1-update1 -a x64 -r clr

:: Patch project.json files
cd %APPVEYOR_BUILD_FOLDER%\scripts
call npm install
call node patch-project-json.js ../src/SteelToe.Extensions.Configuration.CloudFoundry/project.json %APPVEYOR_BUILD_VERSION% %APPVEYOR_REPO_TAG_NAME%
call node patch-project-json.js ../src/SteelToe.Extensions.Configuration.ConfigServer/project.json %APPVEYOR_BUILD_VERSION% %APPVEYOR_REPO_TAG_NAME%
cd %APPVEYOR_BUILD_FOLDER%

:: Restore packages
cd src
call dnu restore
cd ..\test
call dnu restore
cd ..

:: Build packages
cd src\SteelToe.Extensions.Configuration.CloudFoundry
call dnu pack --configuration Release
cd %APPVEYOR_BUILD_FOLDER%
cd src\SteelToe.Extensions.Configuration.ConfigServer
call dnu pack --configuration Release
cd %APPVEYOR_BUILD_FOLDER%

Update appveyor_build

Update appveyor_build


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

ECHO dir %LIBRARY_LIB%
CALL dir %LIBRARY_LIB%
move %LIBRARY_LIB%\*mingw49-mt-1_61.dll "%LIBRARY_BIN%"
IF errorlevel 1 exit 1

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

ECHO dir %LIBRARY_LIB%
CALL dir %LIBRARY_LIB%
move %LIBRARY_LIB%\libboost_python-mingw49-mt-1_61.dll "%LIBRARY_BIN%"
IF errorlevel 1 exit 1

Update bld.bat

Update bld.bat


:: Setup directory structure
mkdir build
if errorlevel 1 exit 1

:: Configure
cmake -G "Ninja" -B "build" -S . ^
         -DCMAKE_BUILD_TYPE=Release ^
         -DCMAKE_PREFIX_PATH=%LIBRARY_PREFIX% ^
         -DCMAKE_INSTALL_PREFIX=%LIBRARY_PREFIX% ^
         -DCMAKE_VERBOSE_MAKEFILE=ON
if errorlevel 1 exit 1

:: Build and install
cd build
if errorlevel 1 exit 1
ninja
if errorlevel 1 exit 1
ninja test
if errorlevel 1 exit 1
ninja install
if errorlevel 1 exit 1

:: Setup directory structure
mkdir build
if errorlevel 1 exit 1

:: Configure
cmake -G "Ninja" -B "build" -S . ^
         -DCMAKE_BUILD_TYPE=Release ^
         -DCMAKE_PREFIX_PATH=%LIBRARY_PREFIX% ^
         -DCMAKE_INSTALL_PREFIX=%LIBRARY_PREFIX% ^
         -DCMAKE_VERBOSE_MAKEFILE=ON
if errorlevel 1 exit 1

:: Build and install
cd build
if errorlevel 1 exit 1
ninja
if errorlevel 1 exit 1
ninja install
if errorlevel 1 exit 1

Update bld.bat

Update bld.bat


SET CURRENT_PATH_PREINSTALL=%CD%
@powershell -NoProfile -ExecutionPolicy unrestricted -Command "iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1'))" && SET PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin
choco install visualstudio2013professional git mingw openssl.light gnuwin
setx PATH "%PATH%;C:\turbo.lua;C:\turbo.lua\luarocks\2.2" /M
SET PATH=%PATH%;C:\Program Files (x86)\Git\cmd;C:\GnuWin\bin;C:\tools\mingw64\bin;C:\Program Files (x86)\Windows Kits\8.1\bin\x64;C:\turbo.lua;C:\turbo.lua\luarocks\2.2
SET VS120COMNTOOLS=C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\Tools\
rm -rf C:\turbo.lua
mkdir C:\turbo.lua
cd C:\turbo.lua
mkdir src
cd src

git clone https://github.com/kernelsauce/turbo.git
cd C:\turbo.lua\src\turbo
git checkout luasocket
mingw32-make SSL=none
mv libtffi_wrap.so libtffi_wrap.dll
setx TURBO_LIBTFFI "C:\turbo.lua\src\turbo\libtffi_wrap.dll" /M
SET TURBO_LIBTFFI=C:\turbo.lua\src\turbo\libtffi_wrap.dll

cd C:\turbo.lua\src
git clone http://luajit.org/git/luajit-2.0.git
cd C:\turbo.lua\src\luajit-2.0\src
call "C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\vcvarsall.bat" amd64
call msvcbuild
cp luajit.exe C:\turbo.lua
cp lua51.dll C:\turbo.lua

cd C:\turbo.lua\src
git clone https://github.com/keplerproject/luarocks.git
cd C:\turbo.lua\src\luarocks
SET LUA_PATH=C:\turbo.lua\rocks\share\lua\5.1\?.lua;C:\turbo.lua\rocks\share\lua\5.1\?\init.lua;C:\turbo.lua\src\turbo\?.lua;C:\turbo.lua\src\turbo\turbo\?.lua
SET LUA_CPATH=C:\turbo.lua\rocks\lib\lua\5.1\?.dll
setx LUA_PATH "%LUA_PATH%" /M
setx LUA_CPATH "%LUA_CPATH%" /M
call install.bat /TREE C:\turbo.lua\rocks\ /P C:\turbo.lua\luarocks\ /INC C:\turbo.lua\src\luajit-2.0\src /LIB C:\turbo.lua\src\luajit-2.0\src /LUA C:\turbo.lua /Q
call luarocks install luasocket

cd %CURRENT_PATH_PREINSTALL%
echo ===========================
echo Turbo is now installed. Try it by running 'luajit C:\turbo.lua\src\turbo\examples\helloworld.lua' and point your browser to http://localhost:8888.
echo Have a nice day!
echo ===========================

SET CURRENT_PATH_PREINSTALL=%CD%
setx PATH "%PATH%;C:\turbo.lua;C:\turbo.lua\luarocks\2.2" /M
@powershell -NoProfile -ExecutionPolicy unrestricted -Command "iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1'))" && SET PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin
choco install visualstudio2013professional git mingw openssl.light gnuwin
SET PATH=%PATH%;C:\Program Files (x86)\Git\cmd;C:\GnuWin\bin;C:\tools\mingw64\bin;C:\Program Files (x86)\Windows Kits\8.1\bin\x64;C:\turbo.lua;C:\turbo.lua\luarocks\2.2
SET VS120COMNTOOLS=C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\Tools\
rm -rf C:\turbo.lua
mkdir C:\turbo.lua
cd C:\turbo.lua
mkdir src
cd src

git clone https://github.com/kernelsauce/turbo.git
cd C:\turbo.lua\src\turbo
git checkout luasocket
mingw32-make SSL=none
mv libtffi_wrap.so libtffi_wrap.dll
setx TURBO_LIBTFFI "C:\turbo.lua\src\turbo\libtffi_wrap.dll" /M
setx TURBO_LIBSSL "C:\Program Files\OpenSSL\libeay32.dll" /M
SET TURBO_LIBTFFI=C:\turbo.lua\src\turbo\libtffi_wrap.dll
SET TURBO_LIBSSL=C:\Program Files\OpenSSL\libeay32.dll

cd C:\turbo.lua\src
git clone http://luajit.org/git/luajit-2.0.git
cd C:\turbo.lua\src\luajit-2.0\src
call "C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\vcvarsall.bat" amd64
call msvcbuild
cp luajit.exe C:\turbo.lua
cp lua51.dll C:\turbo.lua

cd C:\turbo.lua\src
git clone https://github.com/keplerproject/luarocks.git
cd C:\turbo.lua\src\luarocks
SET LUA_PATH=C:\turbo.lua\rocks\share\lua\5.1\?.lua;C:\turbo.lua\rocks\share\lua\5.1\?\init.lua;C:\turbo.lua\src\turbo\?.lua;C:\turbo.lua\src\turbo\turbo\?.lua
SET LUA_CPATH=C:\turbo.lua\rocks\lib\lua\5.1\?.dll
setx LUA_PATH "%LUA_PATH%" /M
setx LUA_CPATH "%LUA_CPATH%" /M
call install.bat /TREE C:\turbo.lua\rocks\ /P C:\turbo.lua\luarocks\ /INC C:\turbo.lua\src\luajit-2.0\src /LIB C:\turbo.lua\src\luajit-2.0\src /LUA C:\turbo.lua /Q
call luarocks install luasocket

cd %CURRENT_PATH_PREINSTALL%
echo ===========================
echo Turbo is now installed. Try it by running 'luajit C:\turbo.lua\src\turbo\examples\helloworld.lua' and point your browser to http://localhost:8888.
echo Have a nice day!
echo ===========================

Add to PATH before running choco to avoid overwriting values set.


@echo off
setlocal

REM Workaround https://github.com/dotnet/coreclr/issues/2153
set ComPlus_ReadyToRun=0

set INIT_TOOLS_LOG=%~dp0init-tools.log
set PACKAGES_DIR=%~dp0packages\
set TOOLRUNTIME_DIR=%~dp0Tools
set DOTNET_PATH=%TOOLRUNTIME_DIR%\dotnetcli\
set DOTNET_CMD=%DOTNET_PATH%bin\dotnet.exe
if [%BUILDTOOLS_SOURCE%]==[] set BUILDTOOLS_SOURCE=https://dotnet.myget.org/F/dotnet-buildtools/api/v3/index.json
set /P BUILDTOOLS_VERSION=< %~dp0BuildToolsVersion.txt
set BUILD_TOOLS_PATH=%PACKAGES_DIR%Microsoft.DotNet.BuildTools\%BUILDTOOLS_VERSION%\lib\
set PROJECT_JSON_PATH=%TOOLRUNTIME_DIR%\%BUILDTOOLS_VERSION%
set PROJECT_JSON_FILE=%PROJECT_JSON_PATH%\project.json
set PROJECT_JSON_CONTENTS={ "dependencies": { "Microsoft.DotNet.BuildTools": "%BUILDTOOLS_VERSION%" }, "frameworks": { "dnxcore50": { } } }
set BUILD_TOOLS_SEMAPHORE=%PROJECT_JSON_PATH%\init-tools.completed

:: if force option is specified then clean the tool runtime and build tools package directory to force it to get recreated
if [%1]==[force] (
  if exist "%TOOLRUNTIME_DIR%" rmdir /S /Q "%TOOLRUNTIME_DIR%"
  if exist "%PACKAGES_DIR%Microsoft.DotNet.BuildTools" rmdir /S /Q "%PACKAGES_DIR%Microsoft.DotNet.BuildTools"
)

:: If sempahore exists do nothing
if exist "%BUILD_TOOLS_SEMAPHORE%" (
  echo Tools are already initialized.
  goto :EOF
)

if exist "%TOOLRUNTIME_DIR%" rmdir /S /Q "%TOOLRUNTIME_DIR%"

:: Download nuget
if NOT exist "%PACKAGES_DIR%\NuGet.exe" (
  if NOT exist "PACKAGES_DIR" mkdir "%PACKAGES_DIR%"
  powershell -NoProfile -ExecutionPolicy unrestricted -Command "(New-Object Net.WebClient).DownloadFile('https://www.nuget.org/nuget.exe', '%PACKAGES_DIR%\NuGet.exe')
)

if NOT exist "%PROJECT_JSON_PATH%" mkdir "%PROJECT_JSON_PATH%"
echo %PROJECT_JSON_CONTENTS% > %PROJECT_JSON_FILE%
echo Running %0 > %INIT_TOOLS_LOG%

if exist "%DOTNET_CMD%" goto :afterdotnetrestore

echo Installing dotnet cli...
if NOT exist "%DOTNET_PATH%" mkdir "%DOTNET_PATH%"
set /p DOTNET_VERSION=< %~dp0DotnetCLIVersion.txt
set DOTNET_ZIP_NAME=dotnet-win-x64.%DOTNET_VERSION%.zip
set DOTNET_REMOTE_PATH=https://dotnetcli.blob.core.windows.net/dotnet/beta/Binaries/%DOTNET_VERSION%/%DOTNET_ZIP_NAME%
set DOTNET_LOCAL_PATH=%DOTNET_PATH%%DOTNET_ZIP_NAME%
echo Installing '%DOTNET_REMOTE_PATH%' to '%DOTNET_LOCAL_PATH%' >> %INIT_TOOLS_LOG%
powershell -NoProfile -ExecutionPolicy unrestricted -Command "(New-Object Net.WebClient).DownloadFile('%DOTNET_REMOTE_PATH%', '%DOTNET_LOCAL_PATH%'); Add-Type -Assembly 'System.IO.Compression.FileSystem' -ErrorVariable AddTypeErrors; if ($AddTypeErrors.Count -eq 0) { [System.IO.Compression.ZipFile]::ExtractToDirectory('%DOTNET_LOCAL_PATH%', '%DOTNET_PATH%') } else { (New-Object -com shell.application).namespace('%DOTNET_PATH%').CopyHere((new-object -com shell.application).namespace('%DOTNET_LOCAL_PATH%').Items(),16) }" >> %INIT_TOOLS_LOG%
if NOT exist "%DOTNET_LOCAL_PATH%" (
  echo ERROR: Could not install dotnet cli correctly. See '%INIT_TOOLS_LOG%' for more details.
  goto :EOF
)

:afterdotnetrestore

if exist "%BUILD_TOOLS_PATH%" goto :afterbuildtoolsrestore
echo Restoring BuildTools version %BUILDTOOLS_VERSION%...
echo Running: "%DOTNET_CMD%" restore "%PROJECT_JSON_FILE%" --packages %PACKAGES_DIR% --source "%BUILDTOOLS_SOURCE%" >> %INIT_TOOLS_LOG%
call "%DOTNET_CMD%" restore "%PROJECT_JSON_FILE%" --packages %PACKAGES_DIR% --source "%BUILDTOOLS_SOURCE%" >> %INIT_TOOLS_LOG%
if NOT exist "%BUILD_TOOLS_PATH%init-tools.cmd" (
  echo ERROR: Could not restore build tools correctly. See '%INIT_TOOLS_LOG%' for more details.
  goto :EOF
)

:afterbuildtoolsrestore

echo Initializing BuildTools ...
echo Running: "%BUILD_TOOLS_PATH%init-tools.cmd" "%~dp0" "%DOTNET_CMD%" "%TOOLRUNTIME_DIR%" >> %INIT_TOOLS_LOG%
call "%BUILD_TOOLS_PATH%init-tools.cmd" "%~dp0" "%DOTNET_CMD%" "%TOOLRUNTIME_DIR%" >> %INIT_TOOLS_LOG%

:: Create sempahore file
echo Done initializing tools.
echo Init-Tools.cmd completed for BuildTools Version: %BUILDTOOLS_VERSION% > "%BUILD_TOOLS_SEMAPHORE%"

@echo off
setlocal

set INIT_TOOLS_LOG=%~dp0init-tools.log
set PACKAGES_DIR=%~dp0packages\
set TOOLRUNTIME_DIR=%~dp0Tools
set DOTNET_PATH=%TOOLRUNTIME_DIR%\dotnetcli\
set DOTNET_CMD=%DOTNET_PATH%bin\dotnet.exe
if [%BUILDTOOLS_SOURCE%]==[] set BUILDTOOLS_SOURCE=https://dotnet.myget.org/F/dotnet-buildtools/api/v3/index.json
set /P BUILDTOOLS_VERSION=< %~dp0BuildToolsVersion.txt
set BUILD_TOOLS_PATH=%PACKAGES_DIR%Microsoft.DotNet.BuildTools\%BUILDTOOLS_VERSION%\lib\
set PROJECT_JSON_PATH=%TOOLRUNTIME_DIR%\%BUILDTOOLS_VERSION%
set PROJECT_JSON_FILE=%PROJECT_JSON_PATH%\project.json
set PROJECT_JSON_CONTENTS={ "dependencies": { "Microsoft.DotNet.BuildTools": "%BUILDTOOLS_VERSION%" }, "frameworks": { "dnxcore50": { } } }
set BUILD_TOOLS_SEMAPHORE=%PROJECT_JSON_PATH%\init-tools.completed

:: if force option is specified then clean the tool runtime and build tools package directory to force it to get recreated
if [%1]==[force] (
  if exist "%TOOLRUNTIME_DIR%" rmdir /S /Q "%TOOLRUNTIME_DIR%"
  if exist "%PACKAGES_DIR%Microsoft.DotNet.BuildTools" rmdir /S /Q "%PACKAGES_DIR%Microsoft.DotNet.BuildTools"
)

:: If sempahore exists do nothing
if exist "%BUILD_TOOLS_SEMAPHORE%" (
  echo Tools are already initialized.
  goto :EOF
)

if exist "%TOOLRUNTIME_DIR%" rmdir /S /Q "%TOOLRUNTIME_DIR%"

:: Download nuget
if NOT exist "%PACKAGES_DIR%\NuGet.exe" (
  if NOT exist "PACKAGES_DIR" mkdir "%PACKAGES_DIR%"
  powershell -NoProfile -ExecutionPolicy unrestricted -Command "(New-Object Net.WebClient).DownloadFile('https://www.nuget.org/nuget.exe', '%PACKAGES_DIR%\NuGet.exe')
)

if NOT exist "%PROJECT_JSON_PATH%" mkdir "%PROJECT_JSON_PATH%"
echo %PROJECT_JSON_CONTENTS% > %PROJECT_JSON_FILE%
echo Running %0 > %INIT_TOOLS_LOG%

if exist "%DOTNET_CMD%" goto :afterdotnetrestore

echo Installing dotnet cli...
if NOT exist "%DOTNET_PATH%" mkdir "%DOTNET_PATH%"
set /p DOTNET_VERSION=< %~dp0DotnetCLIVersion.txt
set DOTNET_ZIP_NAME=dotnet-win-x64.%DOTNET_VERSION%.zip
set DOTNET_REMOTE_PATH=https://dotnetcli.blob.core.windows.net/dotnet/beta/Binaries/%DOTNET_VERSION%/%DOTNET_ZIP_NAME%
set DOTNET_LOCAL_PATH=%DOTNET_PATH%%DOTNET_ZIP_NAME%
echo Installing '%DOTNET_REMOTE_PATH%' to '%DOTNET_LOCAL_PATH%' >> %INIT_TOOLS_LOG%
powershell -NoProfile -ExecutionPolicy unrestricted -Command "(New-Object Net.WebClient).DownloadFile('%DOTNET_REMOTE_PATH%', '%DOTNET_LOCAL_PATH%'); Add-Type -Assembly 'System.IO.Compression.FileSystem' -ErrorVariable AddTypeErrors; if ($AddTypeErrors.Count -eq 0) { [System.IO.Compression.ZipFile]::ExtractToDirectory('%DOTNET_LOCAL_PATH%', '%DOTNET_PATH%') } else { (New-Object -com shell.application).namespace('%DOTNET_PATH%').CopyHere((new-object -com shell.application).namespace('%DOTNET_LOCAL_PATH%').Items(),16) }" >> %INIT_TOOLS_LOG%
if NOT exist "%DOTNET_LOCAL_PATH%" (
  echo ERROR: Could not install dotnet cli correctly. See '%INIT_TOOLS_LOG%' for more details.
  goto :EOF
)

:afterdotnetrestore

if exist "%BUILD_TOOLS_PATH%" goto :afterbuildtoolsrestore
echo Restoring BuildTools version %BUILDTOOLS_VERSION%...
echo Running: "%DOTNET_CMD%" restore "%PROJECT_JSON_FILE%" --packages %PACKAGES_DIR% --source "%BUILDTOOLS_SOURCE%" >> %INIT_TOOLS_LOG%
call "%DOTNET_CMD%" restore "%PROJECT_JSON_FILE%" --packages %PACKAGES_DIR% --source "%BUILDTOOLS_SOURCE%" >> %INIT_TOOLS_LOG%
if NOT exist "%BUILD_TOOLS_PATH%init-tools.cmd" (
  echo ERROR: Could not restore build tools correctly. See '%INIT_TOOLS_LOG%' for more details.
  goto :EOF
)

:afterbuildtoolsrestore

echo Initializing BuildTools ...
echo Running: "%BUILD_TOOLS_PATH%init-tools.cmd" "%~dp0" "%DOTNET_CMD%" "%TOOLRUNTIME_DIR%" >> %INIT_TOOLS_LOG%
call "%BUILD_TOOLS_PATH%init-tools.cmd" "%~dp0" "%DOTNET_CMD%" "%TOOLRUNTIME_DIR%" >> %INIT_TOOLS_LOG%

:: Create sempahore file
echo Done initializing tools.
echo Init-Tools.cmd completed for BuildTools Version: %BUILDTOOLS_VERSION% > "%BUILD_TOOLS_SEMAPHORE%"

Remove ReadyToRun workaround

Remove ReadyToRun workaround


if "%COMPILER%"=="" SET COMPILER=MSVC2015
if "%PREFIX%"=="" SET PREFIX=d:\libs2015r
if "%BOOST_ROOT%"=="" SET BOOST_ROOT=d:\boost
if "%VARIANT%"=="" SET Variant=Release

set "ER=if ERRORLEVEL 1 exit /b 1"
if "%COMPILER%"=="MINGW" (
  SET "PATH=%PATH%;c:\mingw64\bin"
  SET "MSYSDIR=c:\msys64\usr\bin"
  SET CMAKE_TARGET="MinGW Makefiles"
  SET "CFLAGS=-I%PREFIX:\=/%/include"
  SET "CPPFLAGS=-I%PREFIX:\=/%/include"
  SET "LDFLAGS=-L%PREFIX:\=/%/lib"
  SET "CONFARGS=--prefix=%PREFIX:\=/% --host=x86_64-w64-mingw32 --build=x86_64-w64-mingw32"
  set "CMAKE=cmake -G "MinGW Makefiles" -DCMAKE_BUILD_TYPE=%VARIANT% -DCMAKE_INSTALL_PREFIX=%PREFIX%"
  SET "MAKEC=mingw32-make"
  SET "SEDC=sed"
  SET GENERATOR="MinGW Makefiles"
  SET PREFIX1=%PREFIX:\=/%
  SET "MSBUILDINSTALL=mingw32-make install"
) else (
  if "%COMPILER%"=="MSVC2008-32"  (
      set MSC_VER=9
     set "GENERATOR= -G"Visual Studio 12 2008""
      call "%VS90COMNTOOLS%\..\..\VC\vcvarsall.bat" x86
  )
  if "%COMPILER%"=="MSVC2010-32"  (
      set MSC_VER=10
     set "GENERATOR= -G"Visual Studio 12 2010""
      call "%VS100COMNTOOLS%\..\..\VC\vcvarsall.bat" x86
  )
  if "%COMPILER%"=="MSVC2012"  (
     set MSC_VER=11
     set "GENERATOR= -G"Visual Studio 12 2012 Win64""
     call "%VS110COMNTOOLS%\..\..\VC\vcvarsall.bat" x86_amd64
  )
  if "%COMPILER%"=="MSVC2013"  (
     set MSC_VER=12
     set "GENERATOR= -G"Visual Studio 12 2013 Win64""
     call "%VS120COMNTOOLS%\..\..\VC\vcvarsall.bat" x86_amd64
  )
  if "%COMPILER%"=="MSVC2013-CTP"  (
     set MSC_VER=12
     set "GENERATOR= -G"Visual Studio 12 2013 Win64" -T CTP_Nov2013"
     call "%VS120COMNTOOLS%\..\..\VC\vcvarsall.bat" x86_amd64
  )
  if "%COMPILER%"=="MSVC2015"  (
     set MSC_VER=14
     set "GENERATOR= -G"Visual Studio 14 2015 Win64""
     call "%VS140COMNTOOLS%\..\..\VC\vcvarsall.bat" amd64
  )
  set "CMAKE=cmake -G "NMake Makefiles" -DCMAKE_BUILD_TYPE=%VARIANT% -DCMAKE_INSTALL_PREFIX=%PREFIX%"
  SET "MAKEC=nmake"
  SET PREFIX1=%PREFIX:\=/%
  SET "MSBUILDINSTALL=msbuild /p:Configuration=%Variant% /p:BuildInParallel=true /clp:Verbosity=normal /nologo  /flp1:logfile=build_errors.txt;errorsonly /flp2:logfile=build_warnings.txt;warningsonly INSTALL.vcxproj"
  SET "MSBUILD=msbuild /p:Configuration=%Variant% /p:BuildInParallel=true /clp:Verbosity=normal /nologo  /flp1:logfile=build_errors.txt;errorsonly /flp2:logfile=build_warnings.txt;warningsonly"
  SET "SEDC=C:\Program Files\Git\usr\bin\sed"
)
set "CMAKEVS=cmake %GENERATOR% -DCMAKE_BUILD_TYPE=%VARIANT% -DCMAKE_INSTALL_PREFIX=%PREFIX%"

if NOT EXIST %PREFIX% mkdir %PREFIX%
if NOT EXIST %PREFIX%\include mkdir %PREFIX%\include
if NOT EXIST %PREFIX%\lib mkdir %PREFIX%\lib
if NOT EXIST %PREFIX%\bin mkdir %PREFIX%\bin

echo ============= %COMPILER% -- %VARIANT% --- %PREFIX% --- %CMAKE_TARGET% ==============

if "%COMPILER%"=="" SET COMPILER=MSVC2015
if "%PREFIX%"=="" SET PREFIX=d:\libs2015r
if "%BOOST_ROOT%"=="" SET BOOST_ROOT=d:\boost
if "%VARIANT%"=="" SET Variant=Release

set "ER=if ERRORLEVEL 1 exit /b 1"
if "%COMPILER%"=="MINGW" (
  SET "PATH=%PATH%;c:\mingw64\bin"
  SET "MSYSDIR=c:\msys64\usr\bin"
  SET CMAKE_TARGET="MinGW Makefiles"
  SET "CFLAGS=-I%PREFIX:\=/%/include"
  SET "CPPFLAGS=-I%PREFIX:\=/%/include"
  SET "LDFLAGS=-L%PREFIX:\=/%/lib"
  SET "CONFARGS=--prefix=%PREFIX:\=/% --host=x86_64-w64-mingw32 --build=x86_64-w64-mingw32"
  set "CMAKE=cmake -G "MinGW Makefiles" -DCMAKE_BUILD_TYPE=%VARIANT% -DCMAKE_INSTALL_PREFIX=%PREFIX%"
  SET "MAKEC=mingw32-make"
  SET "SEDC=sed"
  SET GENERATOR="MinGW Makefiles"
  SET PREFIX1=%PREFIX:\=/%
  SET "MSBUILDINSTALL=mingw32-make install"
) else (
  if "%COMPILER%"=="MSVC2008-32"  (
      set MSC_VER=9
     set "GENERATOR= -G"Visual Studio 12 2008""
      call "%VS90COMNTOOLS%\..\..\VC\vcvarsall.bat" x86
  )
  if "%COMPILER%"=="MSVC2010-32"  (
      set MSC_VER=10
     set "GENERATOR= -G"Visual Studio 12 2010""
      call "%VS100COMNTOOLS%\..\..\VC\vcvarsall.bat" x86
  )
  if "%COMPILER%"=="MSVC2012"  (
     set MSC_VER=11
     set "GENERATOR= -G"Visual Studio 12 2012 Win64""
     call "%VS110COMNTOOLS%\..\..\VC\vcvarsall.bat" x86_amd64
  )
  if "%COMPILER%"=="MSVC2013"  (
     set MSC_VER=12
     set "GENERATOR= -G"Visual Studio 12 2013 Win64""
     call "%VS120COMNTOOLS%\..\..\VC\vcvarsall.bat" x86_amd64
  )
  if "%COMPILER%"=="MSVC2013-CTP"  (
     set MSC_VER=12
     set "GENERATOR= -G"Visual Studio 12 2013 Win64" -T CTP_Nov2013"
     call "%VS120COMNTOOLS%\..\..\VC\vcvarsall.bat" x86_amd64
  )
  if "%COMPILER%"=="MSVC2015"  (
     set MSC_VER=14
     set "GENERATOR= -G"Visual Studio 14 2015 Win64""
     call "%VS140COMNTOOLS%\..\..\VC\vcvarsall.bat" amd64
  )
  set "CMAKE=cmake -G "NMake Makefiles" -DCMAKE_BUILD_TYPE=%VARIANT% -DCMAKE_INSTALL_PREFIX=%PREFIX%"
  SET "MAKEC=nmake"
  SET PREFIX1=%PREFIX:\=/%
  SET "MSBUILDINSTALL=msbuild /p:Configuration=%Variant% /p:BuildInParallel=true /clp:Verbosity=normal /nologo  /flp1:logfile=build_errors.txt;errorsonly /flp2:logfile=build_warnings.txt;warningsonly INSTALL.vcxproj"
  SET "MSBUILD=msbuild /p:Configuration=%Variant% /p:BuildInParallel=true /clp:Verbosity=normal /nologo  /flp1:logfile=build_errors.txt;errorsonly /flp2:logfile=build_warnings.txt;warningsonly"
  SET "SEDC=C:\Program Files\Git\usr\bin\sed"
  SET "CMAKE_BOOST_FLAGS=-DBOOST_ROOT=%BOOST_ROOT% -DBoost_USE_STATIC_LIBS=ON  -DBoost_ADDITIONAL_VERSIONS=1.58;1.59;1.60;1.61;1.62;1.63;1.64"
)
set "CMAKEVS=cmake %GENERATOR% -DCMAKE_BUILD_TYPE=%VARIANT% -DCMAKE_INSTALL_PREFIX=%PREFIX%"

if NOT EXIST %PREFIX% mkdir %PREFIX%
if NOT EXIST %PREFIX%\include mkdir %PREFIX%\include
if NOT EXIST %PREFIX%\lib mkdir %PREFIX%\lib
if NOT EXIST %PREFIX%\bin mkdir %PREFIX%\bin

echo ============= %COMPILER% -- %VARIANT% --- %PREFIX% --- %CMAKE_TARGET% ==============

add missing cmake_boost_flags for previous fixes


@echo off

rem Licensed to the Apache Software Foundation (ASF) under one or more
rem contributor license agreements.  See the NOTICE file distributed with
rem this work for additional information regarding copyright ownership.
rem The ASF licenses this file to You under the Apache License, Version 2.0
rem (the "License"); you may not use this file except in compliance with
rem 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, software
rem distributed under the License is distributed on an "AS IS" BASIS,
rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
rem See the License for the specific language governing permissions and
rem limitations under the License.

set major_version=0.5

if "%1" == "--prefix" goto opt_prefix
echo Usage: install.bat --prefix path
exit /b 1

:opt_prefix
if not "%~2" == "" goto has_prefix
echo --prefix requires an argument.
exit /b 1

:has_prefix
set prefix=%~2

mkdir "%prefix%\bin" 2>nul
mkdir "%prefix%\lib" 2>nul

rem Install libraries.
copy cfish-%major_version%.dll "%prefix%\bin" >nul
copy libcfish-%major_version%.dll "%prefix%\bin" >nul
copy cfish-%major_version%.lib "%prefix%\lib" >nul
copy libcfish-%major_version%.dll.a "%prefix%\lib" >nul

rem Install executables.
copy ..\..\compiler\c\cfc.exe "%prefix%\bin" >nul

rem Install Clownfish header files and HTML documentation.
xcopy /siy autogen\share "%prefix%" >nul

rem Install man pages.
xcopy /siy autogen\man "%prefix%" >nul

@echo off

rem Licensed to the Apache Software Foundation (ASF) under one or more
rem contributor license agreements.  See the NOTICE file distributed with
rem this work for additional information regarding copyright ownership.
rem The ASF licenses this file to You under the Apache License, Version 2.0
rem (the "License"); you may not use this file except in compliance with
rem 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, software
rem distributed under the License is distributed on an "AS IS" BASIS,
rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
rem See the License for the specific language governing permissions and
rem limitations under the License.

set major_version=0.5

if "%1" == "--prefix" goto opt_prefix
echo Usage: install.bat --prefix path
exit /b 1

:opt_prefix
if not "%~2" == "" goto has_prefix
echo --prefix requires an argument.
exit /b 1

:has_prefix
set prefix=%~2

mkdir "%prefix%\bin" 2>nul
mkdir "%prefix%\lib" 2>nul

rem Install libraries.
copy cfish-%major_version%.dll "%prefix%\bin" >nul
copy libcfish-%major_version%.dll "%prefix%\bin" >nul
copy cfish-%major_version%.lib "%prefix%\lib" >nul
copy libcfish-%major_version%.dll.a "%prefix%\lib" >nul

rem Install executables.
copy ..\..\compiler\c\cfc.exe "%prefix%\bin" >nul

rem Install Clownfish header files and HTML documentation.
xcopy /siy autogen\share "%prefix%\share" >nul

rem Install man pages.
xcopy /siy autogen\man "%prefix%\man" >nul

Fix Windows install script

Fix Windows install script


cd python
rmdir /s /q build
mkdir build
cd build

cmake -G "Ninja" ^
    -DCMAKE_INSTALL_PREFIX=%LIBRARY_PREFIX% ^
    -DCMAKE_BUILD_TYPE=Release ^
    -DBUILD_SHARED_LIBS:BOOL=ON ^
    -DCMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP=ON ^
    -DUSE_SYSTEM_PATHS_FOR_PYTHON_INSTALLATION:BOOL=ON ^
    -DPython3_EXECUTABLE:PATH=%PYTHON% ^
    -DPYTHON_EXECUTABLE:PATH=%PYTHON% ^
    ..
if errorlevel 1 exit 1

:: Build.
cmake --build . --config Release
if errorlevel 1 exit 1

:: Install.
cmake --build . --config Release --target install
if errorlevel 1 exit 1

Create bld_py.bat

Create bld_py.bat


:: Build tcplotter command-line utilities using cmake

:: Change working directory to archive directory
cd "%PKG_NAME%"

:: Create build directory
cd "src"
mkdir build
if errorlevel 1 exit 1
cd build
if errorlevel 1 exit 1

:: Build with cmake
cmake -G "MinGW Makefiles" -DCMAKE_CXX_STANDARD=11 --prefix=%PREFIX% ..
if errorlevel 1 exit 1
cmake --build .
if errorlevel 1 exit 1

:: Install executables to bin directory
cmake --build . --target install
if errorlevel 1 exit 1

:: Install tcplotter
cd "%SRC_DIR%"
$PYTHON -m pip install . -vv

:: Build tcplotter command-line utilities using cmake

:: Change working directory to archive directory
cd "%PKG_NAME%"

:: Create build directory
cd "src"
mkdir build
if errorlevel 1 exit 1
cd build
if errorlevel 1 exit 1

:: Build with cmake
cmake -G "MinGW Makefiles" -DCMAKE_CXX_STANDARD=11 --prefix=%PREFIX% ..
if errorlevel 1 exit 1
cmake --build .
if errorlevel 1 exit 1

:: Install executables to bin directory
cmake --install . --prefix=%PREFIX%
if errorlevel 1 exit 1

:: Install tcplotter
cd "%SRC_DIR%"
$PYTHON -m pip install . -vv

Tweak windows build again

Tweak windows build again


SET SCRIPTPATH=%~dp0
CD /D %~dp0

SET outputdir=%SCRIPTPATH%boost_1_58_0\build\%platform%
echo "%outputdir%"

CD "%SCRIPTPATH%\boost_1_58_0"
call .\bootstrap.bat

if exist "stage" (
	RMDIR "stage" /S /Q
)

md build

SET folder=build/win_32

if not exist "%folder%" (
  echo "x86..."

  md  %folder%
  md  %folder%\static
  md  %folder%\static_fpic
  md  %folder%\shared

  .\b2.exe --clean
  .\bjam.exe link=static --with-filesystem --with-system --with-date_time --with-regex
  XCOPY /Y stage\lib\* "%folder%\static\"

  .\b2.exe --clean
  .\bjam.exe link=static cxxflags=-fPIC --with-filesystem --with-system --with-date_time --with-regex
  XCOPY /Y stage\lib\* "%folder%\static_fpic\"

  .\b2.exe --clean
  .\bjam.exe link=shared --with-filesystem --with-system --with-date_time --with-regex
  XCOPY /Y stage\lib\* "%folder%\shared\"
)

SET folder=build/win_64

if not exist "%folder%" (
  echo "x64..."

  if exist "stage" (
    RMDIR "stage" /S /Q
  )

  md  %folder%
  md  %folder%\static
  md  %folder%\static_fpic
  md  %folder%\shared

  .\b2.exe --clean
  .\bjam.exe link=static --with-filesystem --with-system --with-date_time --with-regex address-model=64
  XCOPY /Y stage\lib\* "%folder%\static\"

  .\b2.exe --clean
  .\bjam.exe link=static cxxflags=-fPIC --with-filesystem --with-system --with-date_time --with-regex address-model=64
  XCOPY /Y stage\lib\* "%folder%\static_fpic\"

  .\b2.exe --clean
  .\bjam.exe link=shared --with-filesystem --with-system --with-date_time --with-regex address-model=64
  XCOPY /Y stage\lib\* "%folder%\shared\"
)

SET SCRIPTPATH=%~dp0
CD /D %~dp0

SET outputdir=%SCRIPTPATH%boost_1_58_0\build\%platform%
echo "%outputdir%"

SET TOOLSET=msvc-14.0

CD "%SCRIPTPATH%\boost_1_58_0"
call .\bootstrap.bat

if exist "stage" (
	RMDIR "stage" /S /Q
)

md build

SET folder=build/win_32

if not exist "%folder%" (
  echo "x86..."

  md  %folder%
  md  %folder%\static
  md  %folder%\static_fpic
  md  %folder%\shared

  .\b2.exe --clean
  .\bjam.exe link=static --with-filesystem --with-system --with-date_time --with-regex --toolset=%TOOLSET%
  XCOPY /Y stage\lib\* "%folder%\static\"

  .\b2.exe --clean
  .\bjam.exe link=static cxxflags=-fPIC --with-filesystem --with-system --with-date_time --with-regex --toolset=%TOOLSET%
  XCOPY /Y stage\lib\* "%folder%\static_fpic\"

  .\b2.exe --clean
  .\bjam.exe link=shared --with-filesystem --with-system --with-date_time --with-regex --toolset=%TOOLSET%
  XCOPY /Y stage\lib\* "%folder%\shared\"
)

SET folder=build/win_64

if not exist "%folder%" (
  echo "x64..."

  if exist "stage" (
    RMDIR "stage" /S /Q
  )

  md  %folder%
  md  %folder%\static
  md  %folder%\static_fpic
  md  %folder%\shared

  .\b2.exe --clean
  .\bjam.exe link=static --with-filesystem --with-system --with-date_time --with-regex address-model=64 --toolset=%TOOLSET%
  XCOPY /Y stage\lib\* "%folder%\static\"

  .\b2.exe --clean
  .\bjam.exe link=static cxxflags=-fPIC --with-filesystem --with-system --with-date_time --with-regex address-model=64 --toolset=%TOOLSET%
  XCOPY /Y stage\lib\* "%folder%\static_fpic\"

  .\b2.exe --clean
  .\bjam.exe link=shared --with-filesystem --with-system --with-date_time --with-regex address-model=64 --toolset=%TOOLSET%
  XCOPY /Y stage\lib\* "%folder%\shared\"
)

Fix build failing on visual studio 2015

Fix build failing on visual studio 2015


set CARGO_HOME=%CONDA_PREFIX%\.cargo.win
set CARGO_CONFIG=%CARGO_HOME%\config
set RUSTUP_HOME=%CARGO_HOME%\rustup
set PATH=%CARGO_HOME%\bin:%PATH%

if not exist "%CARGO_HOME%" mkdir "%CARGO_HOME%"

echo [target.x86_64-pc-windows-msvc]>> %CARGO_CONFIG%
if [%LD%] == [] (
    echo linker = "link.exe">> %CARGO_CONFIG%
) else (
    echo linker = "%LD%">> %CARGO_CONFIG%
)

set CARGO_HOME=%CONDA_PREFIX%\.cargo
set CARGO_CONFIG=%CARGO_HOME%\config
set RUSTUP_HOME=%CARGO_HOME%\rustup
set PATH=%CARGO_HOME%\bin:%PATH%

if not exist "%CARGO_HOME%" mkdir "%CARGO_HOME%"

echo [target.x86_64-pc-windows-msvc]> %CARGO_CONFIG%
if [%LD%] == [] (
    echo linker = "link.exe">> %CARGO_CONFIG%
) else (
    echo linker = "%LD%">> %CARGO_CONFIG%
)

Fix windows build

Fix windows build


@echo off
setlocal

IF [%PACKAGES_DIR%]==[] set PACKAGES_DIR=%~dp0packages\
IF [%TOOLRUNTIME_DIR%]==[] set TOOLRUNTIME_DIR=%~dp0Tools
set DOTNET_PATH=%TOOLRUNTIME_DIR%\dotnetcli\
IF [%DOTNET_CMD%]==[] set DOTNET_CMD=%DOTNET_PATH%bin\dotnet.exe
IF [%BUILDTOOLS_SOURCE%]==[] set BUILDTOOLS_SOURCE=https://www.myget.org/F/dotnet-buildtools/
set /P BUILDTOOLS_VERSION=< %~dp0BuildToolsVersion.txt
set BUILD_TOOLS_PATH=%PACKAGES_DIR%Microsoft.DotNet.BuildTools\%BUILDTOOLS_VERSION%\lib\
set PROJECT_JSON_PATH=%TOOLRUNTIME_DIR%\%BUILDTOOLS_VERSION%
set PROJECT_JSON_FILE=%PROJECT_JSON_PATH%\project.json
set PROJECT_JSON_CONTENTS={ "dependencies": { "Microsoft.DotNet.BuildTools": "%BUILDTOOLS_VERSION%" }, "frameworks": { "dnxcore50": { } } }

IF EXIST "%PROJECT_JSON_FILE%" goto :EOF
IF EXIST %TOOLRUNTIME_DIR% RMDIR /S /Q %TOOLRUNTIME_DIR%

if exist "%DOTNET_CMD%" goto :afterdotnetrestore

echo **Installing dotnet cli at %DOTNET_PATH%
mkdir "%DOTNET_PATH%%"
powershell -NoProfile -ExecutionPolicy unrestricted -Command "(New-Object Net.WebClient).DownloadFile('https://dotnetcli.blob.core.windows.net/dotnet/dev/Binaries/Latest/dotnet-win-x64.latest.zip', '%DOTNET_PATH%' + '\dotnet-win-x64.latest.zip')"
powershell -NoProfile -ExecutionPolicy unrestricted -Command "(New-Object -com shell.application).namespace('%DOTNET_PATH%').CopyHere((new-object -com shell.application).namespace('%DOTNET_PATH%' + 'dotnet-win-x64.latest.zip').Items(),16)"

:afterdotnetrestore

echo **Creating semaphore file: %PROJECT_JSON_FILE%
mkdir "%PROJECT_JSON_PATH%"
echo %PROJECT_JSON_CONTENTS% > %PROJECT_JSON_FILE%
echo **Finished creating semaphore file.

IF EXIST "%BUILD_TOOLS_PATH%" goto :afterbuildtoolsrestore
echo **Installing build tools at %BUILD_TOOLS_PATH%
echo Running: %DOTNET_CMD% restore %PROJECT_JSON_FILE% --packages %PACKAGES_DIR% --source %BUILDTOOLS_SOURCE%
call %DOTNET_CMD% restore %PROJECT_JSON_FILE% --packages %PACKAGES_DIR% --source %BUILDTOOLS_SOURCE%
IF NOT EXIST "%BUILD_TOOLS_PATH%init-tools.cmd" goto :errordownloadingbuildtools
echo **Finished Installing build tools

:afterbuildtoolsrestore
echo **Calling %BUILD_TOOLS_PATH%init-tools.cmd
echo Running: %BUILD_TOOLS_PATH%init-tools.cmd %~dp0 %DOTNET_CMD% %TOOLRUNTIME_DIR%
call "%BUILD_TOOLS_PATH%init-tools.cmd" "%~dp0" "%DOTNET_CMD%" "%TOOLRUNTIME_DIR%"
echo **Finished calling %BUILD_TOOLS_PATH%init-tools.cmd

goto :EOF

:errordownloadingbuildtools
echo ERROR: Could not restore build tools correctly
del "%PROJECT_JSON_FILE%"
EXIT /B 1
echo %errorlevel%
goto :EOF

@echo off
setlocal

IF [%PACKAGES_DIR%]==[] set PACKAGES_DIR=%~dp0packages\
IF [%TOOLRUNTIME_DIR%]==[] set TOOLRUNTIME_DIR=%~dp0Tools
set DOTNET_PATH=%TOOLRUNTIME_DIR%\dotnetcli\
IF [%DOTNET_CMD%]==[] set DOTNET_CMD=%DOTNET_PATH%bin\dotnet.exe
IF [%BUILDTOOLS_SOURCE%]==[] set BUILDTOOLS_SOURCE=https://www.myget.org/F/dotnet-buildtools/
set /P BUILDTOOLS_VERSION=< %~dp0BuildToolsVersion.txt
set BUILD_TOOLS_PATH=%PACKAGES_DIR%Microsoft.DotNet.BuildTools\%BUILDTOOLS_VERSION%\lib\
set PROJECT_JSON_PATH=%TOOLRUNTIME_DIR%\%BUILDTOOLS_VERSION%
set PROJECT_JSON_FILE=%PROJECT_JSON_PATH%\project.json
set PROJECT_JSON_CONTENTS={ "dependencies": { "Microsoft.DotNet.BuildTools": "%BUILDTOOLS_VERSION%" }, "frameworks": { "dnxcore50": { } } }
set BUILD_TOOLS_SEMAPHORE=%PROJECT_JSON_PATH%\init-tools.completed

IF EXIST "%BUILD_TOOLS_SEMAPHORE%" goto :EOF
IF EXIST %TOOLRUNTIME_DIR% RMDIR /S /Q %TOOLRUNTIME_DIR%

if exist "%DOTNET_CMD%" goto :afterdotnetrestore

echo **Installing dotnet cli at %DOTNET_PATH%
mkdir "%DOTNET_PATH%"
powershell -NoProfile -ExecutionPolicy unrestricted -Command "(New-Object Net.WebClient).DownloadFile('https://dotnetcli.blob.core.windows.net/dotnet/dev/Binaries/Latest/dotnet-win-x64.latest.zip', '%DOTNET_PATH%' + '\dotnet-win-x64.latest.zip')"
powershell -NoProfile -ExecutionPolicy unrestricted -Command "(New-Object -com shell.application).namespace('%DOTNET_PATH%').CopyHere((new-object -com shell.application).namespace('%DOTNET_PATH%' + 'dotnet-win-x64.latest.zip').Items(),16)"

:afterdotnetrestore

echo **Creating semaphore file: %PROJECT_JSON_FILE%
mkdir "%PROJECT_JSON_PATH%"
echo %PROJECT_JSON_CONTENTS% > %PROJECT_JSON_FILE%
echo **Finished creating semaphore file.

IF EXIST "%BUILD_TOOLS_PATH%" goto :afterbuildtoolsrestore
echo **Installing build tools at %BUILD_TOOLS_PATH%
echo Running: %DOTNET_CMD% restore %PROJECT_JSON_FILE% --packages %PACKAGES_DIR% --source %BUILDTOOLS_SOURCE%
call %DOTNET_CMD% restore %PROJECT_JSON_FILE% --packages %PACKAGES_DIR% --source %BUILDTOOLS_SOURCE%
IF NOT EXIST "%BUILD_TOOLS_PATH%init-tools.cmd" goto :errordownloadingbuildtools
echo **Finished Installing build tools

:afterbuildtoolsrestore
echo **Calling %BUILD_TOOLS_PATH%init-tools.cmd
echo Running: %BUILD_TOOLS_PATH%init-tools.cmd %~dp0 %DOTNET_CMD% %TOOLRUNTIME_DIR%
call "%BUILD_TOOLS_PATH%init-tools.cmd" "%~dp0" "%DOTNET_CMD%" "%TOOLRUNTIME_DIR%"
echo **Finished calling %BUILD_TOOLS_PATH%init-tools.cmd

echo Init-Tools.cmd completed> "%BUILD_TOOLS_SEMAPHORE%"
goto :EOF

:errordownloadingbuildtools
echo ERROR: Could not restore build tools correctly
goto :EOF

Update init-tools.cmd so the semaphore file is written last so the failures are easier to recover from.

[tfs-changeset: 1563091]


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

%WINDIR%\Microsoft.NET\Framework\v4.0.30319\msbuild src\VolskNet.sln /p:Configuration="%config%" /m /v:M /fl /flp:LogFile=msbuild.log;Verbosity=diag /nr:false

mkdir Build
mkdir Build\lib
mkdir Build\lib\net40

%nuget% pack "src\VolskNet.Core.nuspec" -NoPackageAnalysis -verbosity detailed -o Build -Version %version% -p Configuration="%config%"

Create build.bat

Create build.bat


REM
REM Copyright (C) 2011-13, DyND Developers
REM BSD 2-Clause License, see LICENSE.txt
REM
REM This is the master windows build + test script for building
REM the dynd python bindings on jenkins.
REM
REM Jenkins Requirements:
REM   - Anaconda should be installed in C:\Anaconda.
REM   - Use a jenkins build matrix for multiple
REM     platforms/python versions
REM   - Use the XShell plugin to launch this script
REM   - Call the script from the root workspace
REM     directory as buildscripts/jenkins-build
REM   - Use a user-defined axis to select python versions with PYTHON_VERSION
REM

REM If no MSVC version is selected, choose 2013
if "%MSVC_VERSION%" == "" set MSVC_VERSION=12.0
REM Require a version of Python to be selected
if "%PYTHON_VERSION%" == "" exit /b 1

REM Jenkins has '/' in its workspace. Fix it to '\' to simplify the DOS commands.
set WORKSPACE=%WORKSPACE:/=\%

REM Remove the build subdirectory from last time
rd /q /s build

REM Get libdynd into the libraries subdirectory
REM TODO: Build libdynd in a separate jenkins project,
REM       and use its build artifact here.
call .\buildscripts\checkout_libdynd.bat
IF %ERRORLEVEL% NEQ 0 exit /b 1

REM Make sure binstar is installed in the main environment
echo Updating binstar...
call C:\Anaconda\Scripts\conda install --yes binstar || exit 1
call C:\Anaconda\Scripts\binstar --version
echo on

REM Use conda to create a conda environment of the required
REM python version and containing the dependencies.
SET PYENV_PREFIX=%WORKSPACE%\build\pyenv
rd /s /q %PYENV_PREFIX%
REM NOTE: cython is forced to 0.20.2 temporarily because of a bug in anaconda
REM       https://github.com/ContinuumIO/anaconda-issues/issues/178
call C:\Anaconda\Scripts\conda create --yes -p %PYENV_PREFIX% python=%PYTHON_VERSION% cython=0.20.2 scipy nose
IF %ERRORLEVEL% NEQ 0 exit /b 1
echo on
set PYTHON_EXECUTABLE=%PYENV_PREFIX%\Python.exe
set PATH=%PYENV_PREFIX%;%PYENV_PREFIX%\Scripts;%PATH%

REM Select the correct compiler, by first getting whether
REM the Python is 32-bit or 64-bit.
FOR /F "delims=" %%i IN ('%PYTHON_EXECUTABLE% -c "import ctypes;print(8*ctypes.sizeof(ctypes.c_void_p))"') DO set PYTHON_BITS=%%i
if "%PYTHON_BITS%" == "64" goto :python64
 set MSVC_VCVARS_PLATFORM=x86
 set MSVC_BUILD_PLATFORM=Win32
 if "%MSVC_VERSION%" == "12.0" set CMAKE_BUILD_TARGET="Visual Studio 12"
goto :python32
:python64
 set MSVC_VCVARS_PLATFORM=amd64
 set MSVC_BUILD_PLATFORM=x64
 if "%MSVC_VERSION%" == "12.0" set CMAKE_BUILD_TARGET="Visual Studio 12 Win64"
:python32

REM Configure the appropriate visual studio command line environment
if "%PROGRAMFILES(X86)%" == "" set VCDIR=%PROGRAMFILES%\Microsoft Visual Studio %MSVC_VERSION%\VC
if NOT "%PROGRAMFILES(X86)%" == "" set VCDIR=%PROGRAMFILES(X86)%\Microsoft Visual Studio %MSVC_VERSION%\VC
call "%VCDIR%\vcvarsall.bat" %MSVC_VCVARS_PLATFORM%
IF %ERRORLEVEL% NEQ 0 exit /b 1
echo on

REM Create a fresh visual studio solution with cmake, and do the build/install
cd build
cmake -DDYND_INSTALL_LIB=OFF -DCMAKE_INSTALL_PREFIX=install -G %CMAKE_BUILD_TARGET% -DPYTHON_EXECUTABLE=%PYTHON_EXECUTABLE% .. || exit /b 1
cmake --build . --config RelWithDebInfo || exit /b 1
cmake --build . --config RelWithDebInfo --target install || exit /b 1

REM Run the tests and generate xml results
%PYTHON_EXECUTABLE% -c "import dynd;dynd.test(xunitfile='../test_results.xml', verbosity=2, exit=1)"
IF %ERRORLEVEL% NEQ 0 exit /b 1

REM Get the version number and process it into a suitable form
FOR /F "delims=" %%i IN ('%PYTHON_EXECUTABLE% -c "import dynd;print(dynd.__version__)"') DO set PYDYND_VERSION=%%i
if "%PYDYND_VERSION%" == "" exit /b 1
set PYDYND_VERSION=%PYDYND_VERSION:-=_%

REM Put the conda package by itself in the directory pkgs/<anaconda-arch>
cd ..
rd /q /s pkgs
mkdir pkgs
cd pkgs
mkdir win-%PYTHON_BITS%
cd win-%PYTHON_BITS%

REM Create a conda package from the build
call C:\Anaconda\Scripts\conda package -p %PYENV_PREFIX% --pkg-name=dynd-python --pkg-version=%PYDYND_VERSION%
IF %ERRORLEVEL% NEQ 0 exit /b 1
echo on

REM Upload the package to binstar
FOR /F "delims=" %%i IN ('dir /b dynd-python-*.tar.bz2') DO set PKG_FILE=%%i
call C:\Anaconda\Scripts\binstar -t %BINSTAR_MWIEBE_AUTH% upload --force %PKG_FILE% || exit 1
call C:\Anaconda\Scripts\binstar -t %BINSTAR_BLAZE_AUTH% upload --force %PKG_FILE% || exit 1

cd ..

exit /b 0

REM
REM Copyright (C) 2011-13, DyND Developers
REM BSD 2-Clause License, see LICENSE.txt
REM
REM This is the master windows build + test script for building
REM the dynd python bindings on jenkins.
REM
REM Jenkins Requirements:
REM   - Anaconda should be installed in C:\Anaconda.
REM   - Use a jenkins build matrix for multiple
REM     platforms/python versions
REM   - Use the XShell plugin to launch this script
REM   - Call the script from the root workspace
REM     directory as buildscripts/jenkins-build
REM   - Use a user-defined axis to select python versions with PYTHON_VERSION
REM

REM If no MSVC version is selected, choose 2013
if "%MSVC_VERSION%" == "" set MSVC_VERSION=12.0
REM Require a version of Python to be selected
if "%PYTHON_VERSION%" == "" exit /b 1

REM Jenkins has '/' in its workspace. Fix it to '\' to simplify the DOS commands.
set WORKSPACE=%WORKSPACE:/=\%

REM Remove the build subdirectory from last time
rd /q /s build

REM Get libdynd into the libraries subdirectory
REM TODO: Build libdynd in a separate jenkins project,
REM       and use its build artifact here.
call .\buildscripts\checkout_libdynd.bat
IF %ERRORLEVEL% NEQ 0 exit /b 1

REM Make sure binstar is installed in the main environment
echo Updating binstar...
call C:\Anaconda\Scripts\conda install --yes binstar || exit 1
call C:\Anaconda\Scripts\binstar --version
echo on

REM Use conda to create a conda environment of the required
REM python version and containing the dependencies.
SET PYENV_PREFIX=%WORKSPACE%\build\pyenv
rd /s /q %PYENV_PREFIX%
REM NOTE: cython is forced to 0.20.2 temporarily because of a bug in anaconda
REM       https://github.com/ContinuumIO/anaconda-issues/issues/178
call C:\Anaconda\Scripts\conda create --yes -p %PYENV_PREFIX% python=%PYTHON_VERSION% cython=0.20.2 scipy nose
IF %ERRORLEVEL% NEQ 0 exit /b 1
echo on
set PYTHON_EXECUTABLE=%PYENV_PREFIX%\Python.exe
set PATH=%PYENV_PREFIX%;%PYENV_PREFIX%\Scripts;%PATH%

REM Select the correct compiler, by first getting whether
REM the Python is 32-bit or 64-bit.
FOR /F "delims=" %%i IN ('%PYTHON_EXECUTABLE% -c "import ctypes;print(8*ctypes.sizeof(ctypes.c_void_p))"') DO set PYTHON_BITS=%%i
if "%PYTHON_BITS%" == "64" goto :python64
 if "%MSVC_VERSION%" == "12.0" set CMAKE_BUILD_TARGET="Visual Studio 12"
goto :python32
:python64
 if "%MSVC_VERSION%" == "12.0" set CMAKE_BUILD_TARGET="Visual Studio 12 Win64"
:python32

REM Create a fresh visual studio solution with cmake, and do the build/install
cd build
cmake -DDYND_INSTALL_LIB=OFF -DCMAKE_INSTALL_PREFIX=install -G %CMAKE_BUILD_TARGET% -DPYTHON_EXECUTABLE=%PYTHON_EXECUTABLE% .. || exit /b 1
cmake --build . --config RelWithDebInfo || exit /b 1
cmake --build . --config RelWithDebInfo --target install || exit /b 1

REM Run the tests and generate xml results
%PYTHON_EXECUTABLE% -c "import dynd;dynd.test(xunitfile='../test_results.xml', verbosity=2, exit=1)"
IF %ERRORLEVEL% NEQ 0 exit /b 1

REM Get the version number and process it into a suitable form
FOR /F "delims=" %%i IN ('%PYTHON_EXECUTABLE% -c "import dynd;print(dynd.__version__)"') DO set PYDYND_VERSION=%%i
if "%PYDYND_VERSION%" == "" exit /b 1
set PYDYND_VERSION=%PYDYND_VERSION:-=_%

REM Put the conda package by itself in the directory pkgs/<anaconda-arch>
cd ..
rd /q /s pkgs
mkdir pkgs
cd pkgs
mkdir win-%PYTHON_BITS%
cd win-%PYTHON_BITS%

REM Create a conda package from the build
call C:\Anaconda\Scripts\conda package -p %PYENV_PREFIX% --pkg-name=dynd-python --pkg-version=%PYDYND_VERSION%
IF %ERRORLEVEL% NEQ 0 exit /b 1
echo on

REM Upload the package to binstar
FOR /F "delims=" %%i IN ('dir /b dynd-python-*.tar.bz2') DO set PKG_FILE=%%i
call C:\Anaconda\Scripts\binstar -t %BINSTAR_MWIEBE_AUTH% upload --force %PKG_FILE% || exit 1
call C:\Anaconda\Scripts\binstar -t %BINSTAR_BLAZE_AUTH% upload --force %PKG_FILE% || exit 1

cd ..

exit /b 0

Clean up the jenkins-build windows script a bit