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

:: ----------------------
:: KUDU Deployment Script
:: Version: 1.0.6
:: ----------------------

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

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

:: Setup
:: -----

setlocal enabledelayedexpansion

SET ARTIFACTS=%~dp0%..\artifacts

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

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

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

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

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

  :: Locally just running "kuduSync" would also work
  SET KUDU_SYNC_CMD=%appdata%\npm\kuduSync.cmd
)
IF NOT DEFINED DEPLOYMENT_TEMP (
  SET DEPLOYMENT_TEMP=%temp%\___deployTemp%random%
  SET CLEAN_LOCAL_DEPLOYMENT_TEMP=true
)

IF DEFINED CLEAN_LOCAL_DEPLOYMENT_TEMP (
  IF EXIST "%DEPLOYMENT_TEMP%" rd /s /q "%DEPLOYMENT_TEMP%"
  mkdir "%DEPLOYMENT_TEMP%"
)

IF DEFINED MSBUILD_PATH goto MsbuildPathDefined
SET MSBUILD_PATH=%ProgramFiles(x86)%\MSBuild\14.0\Bin\MSBuild.exe
:MsbuildPathDefined

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

echo Handling backend WebApi project.

:: 1. Restore NuGet packages
IF /I "AzureFunctions.sln" NEQ "" (
  call :ExecuteCmd nuget restore "%DEPLOYMENT_SOURCE%\AzureFunctions.sln"
  IF !ERRORLEVEL! NEQ 0 goto error
)

:: 2. Build to the temporary path
IF /I "%IN_PLACE_DEPLOYMENT%" NEQ "1" (
  call :ExecuteCmd "%MSBUILD_PATH%" "%DEPLOYMENT_SOURCE%\AzureFunctions\AzureFunctions.csproj" /nologo /verbosity:m /t:Build /t:pipelinePreDeployCopyAllFilesToOneFolder /p:_PackageTempDir="%DEPLOYMENT_TEMP%";AutoParameterizationWebConfigConnectionStrings=false;Configuration=Release;UseSharedCompilation=false /p:SolutionDir="%DEPLOYMENT_SOURCE%\.\\" %SCM_BUILD_ARGS%
) ELSE (
  call :ExecuteCmd "%MSBUILD_PATH%" "%DEPLOYMENT_SOURCE%\AzureFunctions\AzureFunctions.csproj" /nologo /verbosity:m /t:Build /p:AutoParameterizationWebConfigConnectionStrings=false;Configuration=Release;UseSharedCompilation=false /p:SolutionDir="%DEPLOYMENT_SOURCE%\.\\" %SCM_BUILD_ARGS%
)

IF !ERRORLEVEL! NEQ 0 goto error

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

echo Handling frontend Angular2 project.

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

:: 5. Create lastCommit, packageJsonLastCommit, bowerLastCommit, typingsLastCommit vars
  pushd "%DEPLOYMENT_SOURCE%"

  call :ExecuteCmd git log -n 1 --oneline > lastCommit.txt
  IF !ERRORLEVEL! NEQ 0 goto error
  SET /p lastCommit=<lastCommit.txt
  DEL lastCommit.txt

  call :ExecuteCmd git log -n 1 --oneline -- AzureFunctions.Client\package.json > packageJsonLastCommit.txt
  IF !ERRORLEVEL! NEQ 0 goto error
  SET /p packageJsonLastCommit=<packageJsonLastCommit.txt
  DEL packageJsonLastCommit.txt

  call :ExecuteCmd git log -n 1 --oneline -- AzureFunctions.Client\bower.json > bowerLastCommit.txt
  IF !ERRORLEVEL! NEQ 0 goto error
  SET /p bowerLastCommit=<bowerLastCommit.txt
  DEL bowerLastCommit.txt

  call :ExecuteCmd git log -n 1 --oneline -- AzureFunctions.Client\typings.json > typingsLastCommit.txt
  IF !ERRORLEVEL! NEQ 0 goto error
  SET /p typingsLastCommit=<typingsLastCommit.txt
  DEL typingsLastCommit.txt

  popd

:: 6. Install npm packages
IF EXIST "%DEPLOYMENT_TARGET%\package.json" (
  pushd "%DEPLOYMENT_TARGET%"

  SET res=F
  IF "%packageJsonLastCommit%"=="%lastCommit%" SET res=T
  IF NOT EXIST "node_modules" SET res=T
  IF "%res%"=="T" (
    call :ExecuteCmd npm install
    IF !ERRORLEVEL! NEQ 0 goto error
  ) ELSE (
    echo skipping npm install
  )

  SET res=F
  IF "%packageJsonLastCommit%"=="%lastCommit%" SET res=T
  IF NOT EXIST "jspm_packages" SET res=T
  IF "%res%"=="T" (
    call :ExecuteCmd npm run jspm:i
    IF !ERRORLEVEL! NEQ 0 goto error
  ) ELSE (
    echo skipping jspm install
  )

  SET res=F
  IF "%typingsLastCommit%"=="%lastCommit%" SET res=T
  IF NOT EXIST "typings" SET res=T
  IF "%res%"=="T" (
    call :ExecuteCmd npm run typings install
    IF !ERRORLEVEL! NEQ 0 goto error
  ) ELSE (
    echo skipping typings install
  )

  call :ExecuteCmd gulp
  IF !ERRORLEVEL! NEQ 0 goto error

  call :ExecuteCmd npm run tsc
  IF !ERRORLEVEL! NEQ 0 goto error

  call :ExecuteCmd npm run jspm:bundle
  IF !ERRORLEVEL! NEQ 0 goto error

  call :ExecuteCmd npm run uglifyjs
  IF !ERRORLEVEL! NEQ 0 goto error

  popd
)

:: 7. Install bower
IF EXIST "%DEPLOYMENT_TARGET%\bower.json" (
  pushd "%DEPLOYMENT_TARGET%"

  SET res=F
  IF NOT "%bowerLastCommit%"=="%lastCommit%" SET res=T
  IF NOT EXIST "bower_components" SET res=T
  IF "%res%"=="T" (
    call :ExecuteCmd bower install
    IF !ERRORLEVEL! NEQ 0 goto error
  ) ELSE (
    echo skipping bower install
  )
  popd
)

:: 8. Copy templates-update webjob
SET WEBJOB_PATH=%HOME%\site\wwwroot\App_Data\jobs\triggered\templates-update
IF NOT EXIST "%WEBJOB_PATH%" (
  mkdir "%WEBJOB_PATH%"
)

copy "%DEPLOYMENT_SOURCE%\WebJobs\templates-update\templates-update.cmd" "%WEBJOB_PATH%"
copy "%DEPLOYMENT_SOURCE%\WebJobs\templates-update\settings.job" "%WEBJOB_PATH%"

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

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

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

:exitSetErrorLevel
exit /b 1

:exitFromFunction
()

:end
endlocal
echo Finished successfully.

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

:: ----------------------
:: KUDU Deployment Script
:: Version: 1.0.6
:: ----------------------

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

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

:: Setup
:: -----

setlocal enabledelayedexpansion

SET ARTIFACTS=%~dp0%..\artifacts

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

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

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

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

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

  :: Locally just running "kuduSync" would also work
  SET KUDU_SYNC_CMD=%appdata%\npm\kuduSync.cmd
)
IF NOT DEFINED DEPLOYMENT_TEMP (
  SET DEPLOYMENT_TEMP=%temp%\___deployTemp%random%
  SET CLEAN_LOCAL_DEPLOYMENT_TEMP=true
)

IF DEFINED CLEAN_LOCAL_DEPLOYMENT_TEMP (
  IF EXIST "%DEPLOYMENT_TEMP%" rd /s /q "%DEPLOYMENT_TEMP%"
  mkdir "%DEPLOYMENT_TEMP%"
)

IF DEFINED MSBUILD_PATH goto MsbuildPathDefined
SET MSBUILD_PATH=%ProgramFiles(x86)%\MSBuild\14.0\Bin\MSBuild.exe
:MsbuildPathDefined

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

echo Handling backend WebApi project.

:: 1. Restore NuGet packages
IF /I "AzureFunctions.sln" NEQ "" (
  call :ExecuteCmd nuget restore "%DEPLOYMENT_SOURCE%\AzureFunctions.sln"
  IF !ERRORLEVEL! NEQ 0 goto error
)

:: 2. Build to the temporary path
IF /I "%IN_PLACE_DEPLOYMENT%" NEQ "1" (
  call :ExecuteCmd "%MSBUILD_PATH%" "%DEPLOYMENT_SOURCE%\AzureFunctions\AzureFunctions.csproj" /nologo /verbosity:m /t:Build /t:pipelinePreDeployCopyAllFilesToOneFolder /p:_PackageTempDir="%DEPLOYMENT_TEMP%";AutoParameterizationWebConfigConnectionStrings=false;Configuration=Release;UseSharedCompilation=false /p:SolutionDir="%DEPLOYMENT_SOURCE%\.\\" %SCM_BUILD_ARGS%
) ELSE (
  call :ExecuteCmd "%MSBUILD_PATH%" "%DEPLOYMENT_SOURCE%\AzureFunctions\AzureFunctions.csproj" /nologo /verbosity:m /t:Build /p:AutoParameterizationWebConfigConnectionStrings=false;Configuration=Release;UseSharedCompilation=false /p:SolutionDir="%DEPLOYMENT_SOURCE%\.\\" %SCM_BUILD_ARGS%
)

IF !ERRORLEVEL! NEQ 0 goto error

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

echo Handling frontend Angular2 project.

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

:: 5. Install npm packages
IF EXIST "%DEPLOYMENT_TARGET%\package.json" (
  pushd "%DEPLOYMENT_TARGET%"

  IF NOT EXIST "node_modules" (
    call :ExecuteCmd npm install
    IF !ERRORLEVEL! NEQ 0 goto error
  ) ELSE (
    echo skipping npm install
  )

  IF NOT EXIST "jspm_packages" (
    call :ExecuteCmd npm run jspm:i
    IF !ERRORLEVEL! NEQ 0 goto error
  ) ELSE (
    echo skipping jspm install
  )

  IF NOT EXIST "typings" (
    call :ExecuteCmd npm run typings install
    IF !ERRORLEVEL! NEQ 0 goto error
  ) ELSE (
    echo skipping typings install
  )

  call :ExecuteCmd gulp
  IF !ERRORLEVEL! NEQ 0 goto error

  call :ExecuteCmd npm run tsc
  IF !ERRORLEVEL! NEQ 0 goto error

  call :ExecuteCmd npm run jspm:bundle
  IF !ERRORLEVEL! NEQ 0 goto error

  ::call :ExecuteCmd npm run uglifyjs
  ::IF !ERRORLEVEL! NEQ 0 goto error

  popd
)

:: 7. Install bower
IF EXIST "%DEPLOYMENT_TARGET%\bower.json" (
  pushd "%DEPLOYMENT_TARGET%"

  IF NOT EXIST "bower_components" (
    call :ExecuteCmd bower install
    IF !ERRORLEVEL! NEQ 0 goto error
  ) ELSE (
    echo skipping bower install
  )
  popd
)

:: 8. Copy templates-update webjob
SET WEBJOB_PATH=%HOME%\site\wwwroot\App_Data\jobs\triggered\templates-update
IF NOT EXIST "%WEBJOB_PATH%" (
  mkdir "%WEBJOB_PATH%"
)

copy "%DEPLOYMENT_SOURCE%\WebJobs\templates-update\templates-update.cmd" "%WEBJOB_PATH%"
copy "%DEPLOYMENT_SOURCE%\WebJobs\templates-update\settings.job" "%WEBJOB_PATH%"

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

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

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

:exitSetErrorLevel
exit /b 1

:exitFromFunction
()

:end
endlocal
echo Finished successfully.

Update deployment script

Update deployment script


@echo off
setlocal
call "%~DP0setenv.bat"

call python.exe "%~DP0docgen.py"
endlocal
pause

@echo off
setlocal ENABLEDELAYEDEXPANSION
call "%~DP0setenv.bat"
call python.exe "%~DP0docgen.py"
endlocal
pause

Fix setlocal

Fix setlocal


@echo off
echo "+++ Running %1"
FOR /L %%i IN (1,1,100) DO (
    %1 --use-colour no --order rand --rng-seed time > nul
	if %errorlevel% neq 0 exit /b %errorlevel%
)
echo "Tests OK"

@echo off
echo "+++ Running %1"
FOR /L %%i IN (1,1,100) DO (
    %1 --use-colour no --order rand --rng-seed 'time' > nul
	if %errorlevel% neq 0 exit /b %errorlevel%
)
echo "Tests OK"

fix bat script

fix bat script


Upgrade to vs2017

Upgrade to vs2017


@echo off

setlocal

if "%1"=="/?" goto usage
if "%1"=="-?" goto usage

@echo Building SolrInstWR for external release
@echo Deleting previous build

if exist build rmdir /S /Q build
if exist Inst4WA\bin rmdir /S /Q Inst4WA\bin
if exist Inst4WA\DeployCmdlets4WA\bin rmdir /S /Q  Inst4WA\DeployCmdlets4WA\bin

if exist SolrDeployCmdletsSetup\bin  rmdir /S /Q SolrDeployCmdletsSetup\bin
if exist SolrInstWR\ReplSolr\HelperLib\bin rmdir /S /Q SolrInstWR\ReplSolr\HelperLib\bin
if exist SolrInstWR\ReplSolr\SolrMasterHostWorkerRole\bin rmdir /S /Q SolrInstWR\ReplSolr\SolrMasterHostWorkerRole\bin
if exist SolrInstWR\ReplSolr\SolrSlaveHostWorkerRole\bin rmdir /S /Q SolrInstWR\ReplSolr\SolrSlaveHostWorkerRole\bin
if exist SolrInstWR\ReplSolr\SolrAdminWebRole\bin rmdir /S /Q SolrInstWR\ReplSolr\SolrAdminWebRole\bin
if exist SolrDeployCmdlets\bin  rmdir /S /Q SolrDeployCmdlets\bin

if exist Inst4WA\obj rmdir /S /Q Inst4WA\obj
if exist Inst4WA\DeployCmdlets4WA\obj rmdir /S /Q  Inst4WA\DeployCmdlets4WA\obj

if exist SolrDeployCmdletsSetup\obj  rmdir /S /Q SolrDeployCmdletsSetup\obj
if exist SolrInstWR\ReplSolr\HelperLib\obj rmdir /S /Q SolrInstWR\ReplSolr\HelperLib\obj
if exist SolrInstWR\ReplSolr\SolrMasterHostWorkerRole\obj rmdir /S /Q SolrInstWR\ReplSolr\SolrMasterHostWorkerRole\obj
if exist SolrInstWR\ReplSolr\SolrSlaveHostWorkerRole\obj rmdir /S /Q SolrInstWR\ReplSolr\SolrSlaveHostWorkerRole\obj
if exist SolrInstWR\ReplSolr\SolrAdminWebRole\obj rmdir /S /Q SolrInstWR\ReplSolr\SolrAdminWebRole\obj
if exist SolrDeployCmdlets\obj  rmdir /S /Q SolrDeployCmdlets\obj

@echo Building Debug
set Configuration=Debug

msbuild Inst4WA\Inst4WA.sln
if errorlevel 1 goto error

msbuild SolrInstWR\SolrInstWR.sln
if errorlevel 1 goto error

mkdir build\SolrInstWR\Debug

COPY /Y SolrInstWR\SolrDeployCmdletsSetup\bin\Debug build\SolrInstWR\Debug
COPY /Y Inst4WA\bin\Debug build\SolrInstWR\Debug

@echo Building Release
set Configuration=Release

msbuild Inst4WA\Inst4WA.sln
if errorlevel 1 goto error

msbuild SolrInstWR\SolrInstWR.sln
if errorlevel 1 goto error

mkdir build\SolrInstWR\Release

COPY /Y SolrInstWR\SolrDeployCmdletsSetup\bin\Release build\SolrInstWR\Release
COPY /Y Inst4WA\bin\Release build\SolrInstWR\Release

goto noerror

:error
@echo !!! Build Error !!!
goto end

:noerror
exit /b 0

:usage
@echo.
@echo Builds SolrInstWR for external release
@echo Usage: build
goto end

:end
endlocal

build script for building Inst4WA and SolrInstWR


@echo off

goto getVersionNumber
set /p doNpm=Update package.json and push to npm: y or n?
IF "%doNpm%"=="y" GOTO npm

set /p doGit=Tag and Push to git: y or n?
IF "%doGit%"=="y" GOTO git

:getVersionNumber
set /p ver=New Version Number or q to quit:
IF "%ver%"=="q" GOTO end
IF "%ver%"=="" GOTO Error

:git
git tag v%ver%
git push
git push --tags

:npm
npm version %ver%
npm publish

:Error
echo no version number found!
goto getVersionNumber

:end

@echo off

REM Get version number
set /p ver=New Version Number or q to quit:
IF "%ver%"=="q" GOTO end
IF "%ver%"=="" GOTO Error

REM update npm with new version and publish
npm version %ver%
npm publish

REM tag and push to origin
git tag v%ver%
git push origin v%ver%

:Error
echo no version number found!
goto start

:end

update publish

update publish


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

rem   =====================================================
rem   Environment variables that can be defined externally:
rem
rem   Do not set the variables in this script. Instead put them into a script
rem   setenv.bat in JMETER_HOME/bin to keep your customizations separate.
rem
rem   DDRAW       - (Optional) JVM options to influence usage of direct draw,
rem                 e.g. '-Dsun.java2d.ddscale=true'
rem
rem   JMETER_BIN  - JMeter bin directory (must end in \)
rem
rem   JMETER_COMPLETE_ARGS - if set indicates that JVM_ARGS is to be used exclusively instead
rem                 of adding other options like HEAP or GC_ALGO
rem
rem   JMETER_HOME - installation directory. Will be guessed from location of jmeter.bat
rem
rem   JM_LAUNCH   - java.exe (default) or javaw.exe
rem
rem   JM_START    - set this to "start" to launch JMeter in a separate window
rem                 this is used by the jmeterw.cmd script.
rem
rem   JVM_ARGS    - (Optional) Java options used when starting JMeter, e.g. -Dprop=val
rem                 Defaults to '-Duser.language="en" -Duser.region="EN"'
rem
rem   GC_ALGO     - (Optional) JVM garbage collector options
rem                 Defaults to '-XX:+UseG1GC -XX:MaxGCPauseMillis=100 -XX:G1ReservePercent=20'
rem
rem   HEAP        - (Optional) JVM memory settings used when starting JMeter
rem                 Defaults to '-Xms1g -Xmx1g -XX:MaxMetaspaceSize=256m'
rem
rem   =====================================================

setlocal

rem Guess JMETER_HOME if not defined
set "CURRENT_DIR=%cd%"
if not "%JMETER_HOME%" == "" goto gotHome
set "JMETER_HOME=%CURRENT_DIR%"
if exist "%JMETER_HOME%\bin\jmeter.bat" goto okHome
cd ..
set "JMETER_HOME=%cd%"
cd "%CURRENT_DIR%"
if exist "%JMETER_HOME%\bin\jmeter.bat" goto okHome
set "JMETER_HOME=%~dp0\.."
:gotHome

if exist "%JMETER_HOME%\bin\jmeter.bat" goto okHome
echo The JMETER_HOME environment variable is not defined correctly
echo This environment variable is needed to run this program
goto end
:okHome

rem Get standard environment variables
if exist "%JMETER_HOME%\bin\setenv.bat" call "%JMETER_HOME%\bin\setenv.bat"

if not defined JMETER_LANGUAGE (
    rem Set language
    rem Default to en_EN
    set JMETER_LANGUAGE=-Duser.language="en" -Duser.region="EN"
)

rem Minimal version to run JMeter
set MINIMAL_VERSION=1.8.0

rem --add-modules java.activation if JAVA 9
set JAVA9_OPTS=

for /f "tokens=3" %%g in ('java -version 2^>^&1 ^| findstr /i "version"') do (
    rem @echo Debug Output: %%g
    set JAVAVER=%%g
)
if not defined JAVAVER (
    @echo Not able to find Java executable or version. Please check your Java installation.
    set ERRORLEVEL=2
    goto pause
)

rem Check if version is from OpenJDK or Oracle Hotspot JVM prior to 9 containing 1.${version}.x
rem JAVAVER will be equal to "9.0.4" (quotes are part of the value) for Oracle Java 9
rem JAVAVER will be equal to "1.8.0_161" (quotes are part of the value) for Oracle Java 8
rem so we extract 2 chars starting from index 1
IF "%JAVAVER:~1,2%"=="1." (
    set JAVAVER=%JAVAVER:"=%
    for /f "delims=. tokens=1-3" %%v in ("%JAVAVER%") do (
        set current_minor=%%w
)
) else (
    rem Java 9 at least
    set current_minor=9
    set JAVA9_OPTS=--add-modules java.activation --add-opens java.desktop/sun.awt=ALL-UNNAMED --add-opens java.desktop/sun.swing=ALL-UNNAMED --add-opens java.desktop/javax.swing.text.html=ALL-UNNAMED --add-opens java.desktop/java.awt=ALL-UNNAMED --add-opens java.desktop/java.awt.font=ALL-UNNAMED --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.lang.invoke=ALL-UNNAMED --add-opens=java.base/java.lang.reflect=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.base/java.text=ALL-UNNAMED
)

for /f "delims=. tokens=1-3" %%v in ("%MINIMAL_VERSION%") do (
    set minimal_minor=%%w
)

if not defined current_minor (
    @echo Not able to find Java executable or version. Please check your Java installation.
    set ERRORLEVEL=2
    goto pause
)
rem @echo Debug: CURRENT=%current_minor% - MINIMAL=%minimal_minor%
if %current_minor% LSS %minimal_minor% (
    @echo Error: Java version -- %JAVAVER% -- is too low to run JMeter. Needs a Java version greater than or equal to %MINIMAL_VERSION%
    set ERRORLEVEL=3
    goto pause
)

if not defined JM_LAUNCH (
    set JM_LAUNCH=java.exe
)

if exist jmeter.bat goto winNT1
if not defined JMETER_BIN (
    set JMETER_BIN=%~dp0
)

:winNT1
rem On NT/2K grab all arguments at once
set JMETER_CMD_LINE_ARGS=%*

rem The following link describes the -XX options:
rem http://docs.oracle.com/javase/8/docs/technotes/tools/unix/java.html

if not defined HEAP (
    rem See the unix startup file for the rationale of the following parameters,
    rem including some tuning recommendations
    set HEAP=-Xms1g -Xmx1g -XX:MaxMetaspaceSize=256m
)

rem Uncomment this to generate GC verbose file with Java prior to 9
rem set VERBOSE_GC=-verbose:gc -Xloggc:gc_jmeter_%%p.log -XX:+PrintGCDetails -XX:+PrintGCCause -XX:+PrintTenuringDistribution -XX:+PrintHeapAtGC -XX:+PrintGCApplicationConcurrentTime -XX:+PrintGCApplicationStoppedTime -XX:+PrintGCDateStamps -XX:+PrintAdaptiveSizePolicy

rem Uncomment this to generate GC verbose file with Java 9 and above
rem set VERBOSE_GC=-Xlog:gc*,gc+age=trace,gc+heap=debug:file=gc_jmeter_%%p.log
rem You may want to add those settings
rem -XX:+ParallelRefProcEnabled -XX:+PerfDisableSharedMem
if not defined GC_ALGO (
    set GC_ALGO=-XX:+UseG1GC -XX:MaxGCPauseMillis=100 -XX:G1ReservePercent=20
)

set SYSTEM_PROPS=-Djava.security.egd=file:/dev/urandom

rem Always dump on OOM (does not cost anything unless triggered)
set DUMP=-XX:+HeapDumpOnOutOfMemoryError

rem Uncomment this if you run JMeter in DOCKER (need Java SE 8u131 or JDK 9)
rem see https://blogs.oracle.com/java-platform-group/java-se-support-for-docker-cpu-and-memory-limits
rem set RUN_IN_DOCKER=-XX:+UnlockExperimentalVMOptions -XX:+UseCGroupMemoryLimitForHeap

rem Additional settings that might help improve GUI performance on some platforms
rem See: http://www.oracle.com/technetwork/java/perf-graphics-135933.html

if not defined DDRAW (
    set DDRAW=
    rem  Setting this flag to true turns off DirectDraw usage, which sometimes helps to get rid of a lot of rendering problems on Win32.
    rem set DDRAW=%DDRAW% -Dsun.java2d.noddraw=true

    rem  Setting this flag to false turns off DirectDraw offscreen surfaces acceleration by forcing all createVolatileImage calls to become createImage calls, and disables hidden acceleration performed on surfaces created with createImage .
    rem set DDRAW=%DDRAW% -Dsun.java2d.ddoffscreen=false

    rem Setting this flag to true enables hardware-accelerated scaling.
    rem set DDRAW=%DDRAW% -Dsun.java2d.ddscale=true
)

rem Collect the settings defined above
if not defined JMETER_COMPLETE_ARGS (
    set ARGS=%JAVA9_OPTS% %DUMP% %HEAP% %VERBOSE_GC% %GC_ALGO% %DDRAW% %SYSTEM_PROPS% %JMETER_LANGUAGE% %RUN_IN_DOCKER%
) else (
    set ARGS=
)

%JM_START% "%JM_LAUNCH%" %ARGS% %JVM_ARGS% -jar "%JMETER_BIN%ApacheJMeter.jar" %JMETER_CMD_LINE_ARGS%

rem If the errorlevel is not zero, then display it and pause

if NOT errorlevel 0 goto pause
if errorlevel 1 goto pause

goto end

:pause
echo errorlevel=%ERRORLEVEL%
pause

:end

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

rem   =====================================================
rem   Environment variables that can be defined externally:
rem
rem   Do not set the variables in this script. Instead put them into a script
rem   setenv.bat in JMETER_HOME/bin to keep your customizations separate.
rem
rem   DDRAW       - (Optional) JVM options to influence usage of direct draw,
rem                 e.g. '-Dsun.java2d.ddscale=true'
rem
rem   JMETER_BIN  - JMeter bin directory (must end in \)
rem
rem   JMETER_COMPLETE_ARGS - if set indicates that JVM_ARGS is to be used exclusively instead
rem                 of adding other options like HEAP or GC_ALGO
rem
rem   JMETER_HOME - installation directory. Will be guessed from location of jmeter.bat
rem
rem   JM_LAUNCH   - java.exe (default) or javaw.exe
rem
rem   JM_START    - set this to 'start ""' to launch JMeter in a separate window
rem                 this is used by the jmeterw.cmd script.
rem
rem   JVM_ARGS    - (Optional) Java options used when starting JMeter, e.g. -Dprop=val
rem                 Defaults to '-Duser.language="en" -Duser.region="EN"'
rem
rem   GC_ALGO     - (Optional) JVM garbage collector options
rem                 Defaults to '-XX:+UseG1GC -XX:MaxGCPauseMillis=100 -XX:G1ReservePercent=20'
rem
rem   HEAP        - (Optional) JVM memory settings used when starting JMeter
rem                 Defaults to '-Xms1g -Xmx1g -XX:MaxMetaspaceSize=256m'
rem
rem   =====================================================

setlocal

rem Guess JMETER_HOME if not defined
set "CURRENT_DIR=%cd%"
if not "%JMETER_HOME%" == "" goto gotHome
set "JMETER_HOME=%CURRENT_DIR%"
if exist "%JMETER_HOME%\bin\jmeter.bat" goto okHome
cd ..
set "JMETER_HOME=%cd%"
cd "%CURRENT_DIR%"
if exist "%JMETER_HOME%\bin\jmeter.bat" goto okHome
set "JMETER_HOME=%~dp0\.."
:gotHome

if exist "%JMETER_HOME%\bin\jmeter.bat" goto okHome
echo The JMETER_HOME environment variable is not defined correctly
echo This environment variable is needed to run this program
goto end
:okHome

rem Get standard environment variables
if exist "%JMETER_HOME%\bin\setenv.bat" call "%JMETER_HOME%\bin\setenv.bat"

if not defined JMETER_LANGUAGE (
    rem Set language
    rem Default to en_EN
    set JMETER_LANGUAGE=-Duser.language="en" -Duser.region="EN"
)

rem Minimal version to run JMeter
set MINIMAL_VERSION=1.8.0

rem --add-modules java.activation if JAVA 9
set JAVA9_OPTS=

for /f "tokens=3" %%g in ('java -version 2^>^&1 ^| findstr /i "version"') do (
    rem @echo Debug Output: %%g
    set JAVAVER=%%g
)
if not defined JAVAVER (
    @echo Not able to find Java executable or version. Please check your Java installation.
    set ERRORLEVEL=2
    goto pause
)

rem Check if version is from OpenJDK or Oracle Hotspot JVM prior to 9 containing 1.${version}.x
rem JAVAVER will be equal to "9.0.4" (quotes are part of the value) for Oracle Java 9
rem JAVAVER will be equal to "1.8.0_161" (quotes are part of the value) for Oracle Java 8
rem so we extract 2 chars starting from index 1
IF "%JAVAVER:~1,2%"=="1." (
    set JAVAVER=%JAVAVER:"=%
    for /f "delims=. tokens=1-3" %%v in ("%JAVAVER%") do (
        set current_minor=%%w
)
) else (
    rem Java 9 at least
    set current_minor=9
    set JAVA9_OPTS=--add-modules java.activation --add-opens java.desktop/sun.awt=ALL-UNNAMED --add-opens java.desktop/sun.swing=ALL-UNNAMED --add-opens java.desktop/javax.swing.text.html=ALL-UNNAMED --add-opens java.desktop/java.awt=ALL-UNNAMED --add-opens java.desktop/java.awt.font=ALL-UNNAMED --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.lang.invoke=ALL-UNNAMED --add-opens=java.base/java.lang.reflect=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.base/java.text=ALL-UNNAMED
)

for /f "delims=. tokens=1-3" %%v in ("%MINIMAL_VERSION%") do (
    set minimal_minor=%%w
)

if not defined current_minor (
    @echo Not able to find Java executable or version. Please check your Java installation.
    set ERRORLEVEL=2
    goto pause
)
rem @echo Debug: CURRENT=%current_minor% - MINIMAL=%minimal_minor%
if %current_minor% LSS %minimal_minor% (
    @echo Error: Java version -- %JAVAVER% -- is too low to run JMeter. Needs a Java version greater than or equal to %MINIMAL_VERSION%
    set ERRORLEVEL=3
    goto pause
)

if not defined JM_LAUNCH (
    set JM_LAUNCH=java.exe
)

if exist jmeter.bat goto winNT1
if not defined JMETER_BIN (
    set JMETER_BIN=%~dp0
)

:winNT1
rem On NT/2K grab all arguments at once
set JMETER_CMD_LINE_ARGS=%*

rem The following link describes the -XX options:
rem http://docs.oracle.com/javase/8/docs/technotes/tools/unix/java.html

if not defined HEAP (
    rem See the unix startup file for the rationale of the following parameters,
    rem including some tuning recommendations
    set HEAP=-Xms1g -Xmx1g -XX:MaxMetaspaceSize=256m
)

rem Uncomment this to generate GC verbose file with Java prior to 9
rem set VERBOSE_GC=-verbose:gc -Xloggc:gc_jmeter_%%p.log -XX:+PrintGCDetails -XX:+PrintGCCause -XX:+PrintTenuringDistribution -XX:+PrintHeapAtGC -XX:+PrintGCApplicationConcurrentTime -XX:+PrintGCApplicationStoppedTime -XX:+PrintGCDateStamps -XX:+PrintAdaptiveSizePolicy

rem Uncomment this to generate GC verbose file with Java 9 and above
rem set VERBOSE_GC=-Xlog:gc*,gc+age=trace,gc+heap=debug:file=gc_jmeter_%%p.log
rem You may want to add those settings
rem -XX:+ParallelRefProcEnabled -XX:+PerfDisableSharedMem
if not defined GC_ALGO (
    set GC_ALGO=-XX:+UseG1GC -XX:MaxGCPauseMillis=100 -XX:G1ReservePercent=20
)

set SYSTEM_PROPS=-Djava.security.egd=file:/dev/urandom

rem Always dump on OOM (does not cost anything unless triggered)
set DUMP=-XX:+HeapDumpOnOutOfMemoryError

rem Uncomment this if you run JMeter in DOCKER (need Java SE 8u131 or JDK 9)
rem see https://blogs.oracle.com/java-platform-group/java-se-support-for-docker-cpu-and-memory-limits
rem set RUN_IN_DOCKER=-XX:+UnlockExperimentalVMOptions -XX:+UseCGroupMemoryLimitForHeap

rem Additional settings that might help improve GUI performance on some platforms
rem See: http://www.oracle.com/technetwork/java/perf-graphics-135933.html

if not defined DDRAW (
    set DDRAW=
    rem  Setting this flag to true turns off DirectDraw usage, which sometimes helps to get rid of a lot of rendering problems on Win32.
    rem set DDRAW=%DDRAW% -Dsun.java2d.noddraw=true

    rem  Setting this flag to false turns off DirectDraw offscreen surfaces acceleration by forcing all createVolatileImage calls to become createImage calls, and disables hidden acceleration performed on surfaces created with createImage .
    rem set DDRAW=%DDRAW% -Dsun.java2d.ddoffscreen=false

    rem Setting this flag to true enables hardware-accelerated scaling.
    rem set DDRAW=%DDRAW% -Dsun.java2d.ddscale=true
)

rem Collect the settings defined above
if not defined JMETER_COMPLETE_ARGS (
    set ARGS=%JAVA9_OPTS% %DUMP% %HEAP% %VERBOSE_GC% %GC_ALGO% %DDRAW% %SYSTEM_PROPS% %JMETER_LANGUAGE% %RUN_IN_DOCKER%
) else (
    set ARGS=
)

if "%JM_START%" == "start" (
    set JM_START=start "Apache JMeter"
)

%JM_START% "%JM_LAUNCH%" %ARGS% %JVM_ARGS% -jar "%JMETER_BIN%ApacheJMeter.jar" %JMETER_CMD_LINE_ARGS%

rem If the errorlevel is not zero, then display it and pause

if NOT errorlevel 0 goto pause
if errorlevel 1 goto pause

goto end

:pause
echo errorlevel=%ERRORLEVEL%
pause

:end

Enable starting of jmeter.bat with JM_START set to "start"

Correct documentation for usage of JM_START to start JMeter.
Add a title to 'start' when none was given, which can happen,
when following old documentation.

Bugzilla Id: 62107

git-svn-id: https://svn.apache.org/repos/asf/jmeter/trunk@1825804 13f79535-47bb-0310-9956-ffa450edef68

Former-commit-id: e2270cd9d8c44eec9813b1a78582e1ac9d93c69f


@echo off
echo Copying Media SDK signed managed DLLs and the pdbs to the final drop location...
echo Creating \drop\WAMSSDKEXT\lib\net45
md .\drop\WAMSSDKEXT\lib\net45
echo Copy MediaServices.Client.Extensions.dll
copy /y \\adxsdkbuilder2\Signed\Microsoft.WindowsAzure.MediaServices.Client.Extensions.dll .\drop\WAMSSDKEXT\lib\net45\
echo Copy MediaServices.Client.pdb
copy /y .\Publish\Build\Release\Microsoft.WindowsAzure.MediaServices.Client.Extensions.pdb .\drop\WAMSSDKEXT\lib\net45\
echo Copy Nuget spec
copy /y .\.nuget\windowsazure.mediaservices.extensions.nuspec .\drop\WAMSSDKEXT\
if %ERRORLEVEL% neq 0 goto copyfailed
echo OK

echo Creating Media SDK NuGet Packages....
nuget.exe pack .\drop\WAMSSDKEXT\windowsazure.mediaservices.extensions.nuspec -o .\drop -Symbols
if %ERRORLEVEL% neq 0 goto packagingfailed
echo OK

echo Copying files to the packages share...
copy .\drop\*.* c:\packages
if %ERRORLEVEL% neq 0 goto copyfailed
echo OK

echo Removing all signed files from \\adksdksign\unsigned...
del /q c:\signing\signed\*.*
echo OK

echo Removing all unsigned files from \\adksdksign\unsigned...
del /q c:\signing\tosign\*.*
echo OK

echo SUCCESS. Signed files are available at \\adxsdksign\packages

exit /b 0

:packagingfailed

echo FAILED. Unable to create NuGet packages
exit /b -1

:copyfailed

echo FAILED. Unable to copy native DLLs
exit /b -1

:publishfailed

echo FAILED. Unable to publish to myget
exit /b -1

:signfailed
del /q c:\signing\tosign\*.*
echo FAILED. Signing tool failed.
exit /b -1

@echo off
echo Copying Media SDK signed managed DLLs and the pdbs to the final drop location...
echo Creating \drop\WAMSSDKEXT\lib\net45
md .\drop\WAMSSDKEXT\lib\net45
echo Copy MediaServices.Client.Extensions.dll
copy /y "\\iisdist\release\Media\nimbus\Client SDK Extensions\dlls\latest signed\Microsoft.WindowsAzure.MediaServices.Client.Extensions.dll" .\drop\WAMSSDKEXT\lib\net45\
echo Copy MediaServices.Client.pdb
copy /y .\Publish\Build\Release\Microsoft.WindowsAzure.MediaServices.Client.Extensions.pdb .\drop\WAMSSDKEXT\lib\net45\
echo Copy Nuget spec
copy /y .\.nuget\windowsazure.mediaservices.extensions.nuspec .\drop\WAMSSDKEXT\
if %ERRORLEVEL% neq 0 goto copyfailed
echo OK

echo Creating Media SDK NuGet Packages....
nuget.exe pack .\drop\WAMSSDKEXT\windowsazure.mediaservices.extensions.nuspec -o .\drop -Symbols
if %ERRORLEVEL% neq 0 goto packagingfailed
echo OK

echo Copying files to the packages share...
copy .\drop\*.* c:\packages
if %ERRORLEVEL% neq 0 goto copyfailed
echo OK

echo Removing all signed files from \\adksdksign\unsigned...
del /q c:\signing\signed\*.*
echo OK

echo Removing all unsigned files from \\adksdksign\unsigned...
del /q c:\signing\tosign\*.*
echo OK

echo SUCCESS. Signed files are available at \\adxsdksign\packages

exit /b 0

:packagingfailed

echo FAILED. Unable to create NuGet packages
exit /b -1

:copyfailed

echo FAILED. Unable to copy native DLLs
exit /b -1

:publishfailed

echo FAILED. Unable to publish to myget
exit /b -1

:signfailed
del /q c:\signing\tosign\*.*
echo FAILED. Signing tool failed.
exit /b -1

Update the location to pull the signed dlls from


@echo off
REM ##################################################################################################
REM You should not need to edit this file.  All user configuration should be completed in the
REM SET_ENV_VARS.bat file.  That is where you should set system paths and build options.
REM ##################################################################################################

REM Ensure any variable changes don't exceed the life of this batch file.
setlocal

REM Remember the path without anything prepended so we can easily switch toolchains
set "BASE_PATH=%SystemRoot%;%SystemRoot%\system32;"

REM Capture timing metrics
set START_TIME=%TIME%

REM Set up the environment variables
call SET_ENV_VARS.bat

REM Build necessary paths based on this information
set "INST_DIR=%CD%"
set "MINGW_BIN=%MINGW_ROOT%\bin\"
set "MSYS_BIN=%MINGW_ROOT%\msys\1.0\bin\"
set MSYS_SH="%MSYS_BIN%\sh.exe"
set "TOOL_CHAIN_ROOT=%MINGW_ROOT%"

REM Add MSYS and MinGW bin directories to the start of path so commands are available
set "PATH=%MSYS_BIN%;%MINGW_BIN%;%BASE_PATH%"
REM Remember the path without the toolchain prepended so we can easily switch toolchains
set "OLD_PATH=%PATH%"

REM Since the build procedure is the same for x86 and x64 except for the toolchain and deps path
REM Just set the variable for these paths here based on build mode
REM This allows building both 32-bit and 64-bit in a single run
if "%BUILD_32_BIT%" NEQ "" (
	echo Building for 32-bit

	REM The way the toolchain is installed, the \mingw32 subdirectory will always be created
	set "TOOLCHAIN_BIN=%TOOL_CHAIN_ROOT%\mingw32\bin"
	set "PATH_DEPS=%DEPS_ROOT%\x86"
	set "BUILD_OUTPUT=%BITCOIN_GIT_ROOT%\build-output\x86"

	GOTO BUILD_START
)
REM else fall-through

:BUILD_START_64
if "%HAS_BUILT_64_BIT%" NEQ "" GOTO BUILD_END
if "%BUILD_64_BIT%" NEQ "" (
	echo Building for 64-bit

	REM The way the toolchain is installed, the \mingw64 subdirectory will always be created
	set "TOOLCHAIN_BIN=%TOOL_CHAIN_ROOT%\mingw64\bin"
	set "PATH_DEPS=%DEPS_ROOT%\x64"
	set "BUILD_OUTPUT=%BITCOIN_GIT_ROOT%\build-output\x64"

	set HAS_BUILT_64_BIT=TRUE

	GOTO BUILD_START
) else ( GOTO BUILD_END )

:BUILD_START
REM Set the path variable to contain the toolchain as well as MSYS bin directories
set "PATH=%TOOLCHAIN_BIN%;%OLD_PATH%"

%MSYS_SH% "%INST_DIR%\clean-bitcoin.sh"

REM Go to the 64-bit build section (in case we are building both 32 and 64 bit)
GOTO BUILD_START_64

:BUILD_END
REM ##################################################################################################
REM Get end time so we can output execution duration metrics
REM ##################################################################################################
set END_TIME=%TIME%

REM Change formatting for the start and end times
for /F "tokens=1-4 delims=:.," %%a in ("%START_TIME%") do (
   set /A "start=(((%%a*60)+1%%b %% 100)*60+1%%c %% 100)*100+1%%d %% 100"
)

for /F "tokens=1-4 delims=:.," %%a in ("%END_TIME%") do (
   set /A "end=(((%%a*60)+1%%b %% 100)*60+1%%c %% 100)*100+1%%d %% 100"
)

rem Calculate the elapsed time by subtracting values
set /A elapsed=end-start

rem Format the results for output
set /A hh=elapsed/(60*60*100), rest=elapsed%%(60*60*100), mm=rest/(60*100), rest%%=60*100, ss=rest/100, cc=rest%%100
if %hh% lss 10 set hh=0%hh%
if %mm% lss 10 set mm=0%mm%
if %ss% lss 10 set ss=0%ss%
if %cc% lss 10 set cc=0%cc%

set DURATION=%hh%:%mm%:%ss%.%cc%

echo Start    : %START_TIME%
echo Finish   : %END_TIME%
echo          ---------------
echo Duration : %DURATION%

REM Clear any variables that may have been set in this script
endlocal

REM Allow the user to see the final results at the end of file execution.
pause

@echo off
REM ##################################################################################################
REM You should not need to edit this file.  All user configuration should be completed in the
REM SET_ENV_VARS.bat file.  That is where you should set system paths and build options.
REM ##################################################################################################

REM Ensure any variable changes don't exceed the life of this batch file.
setlocal

REM Remember the path without anything prepended so we can easily switch toolchains
set "BASE_PATH=%SystemRoot%;%SystemRoot%\system32;"

REM Capture timing metrics
set START_TIME=%TIME%

REM Set up the environment variables
call SET_ENV_VARS.bat

REM Build necessary paths based on this information
set "INST_DIR=%CD%"
set "MINGW_BIN=%MINGW_ROOT%\bin\"
set "MSYS_BIN=%MINGW_ROOT%\msys\1.0\bin\"
set MSYS_SH="%MSYS_BIN%\sh.exe"
set "TOOL_CHAIN_ROOT=%MINGW_ROOT%"

REM Add MSYS and MinGW bin directories to the start of path so commands are available
set "PATH=%MSYS_BIN%;%MINGW_BIN%;%BASE_PATH%"
REM Remember the path without the toolchain prepended so we can easily switch toolchains
set "OLD_PATH=%PATH%"

REM Since the build procedure is the same for x86 and x64 except for the toolchain and deps path
REM Just set the variable for these paths here based on build mode
REM This allows building both 32-bit and 64-bit in a single run
if "%BUILD_32_BIT%" NEQ "" (
	echo Building for 32-bit

	REM The way the toolchain is installed, the \mingw32 subdirectory will always be created
	set "TOOLCHAIN_BIN=%TOOL_CHAIN_ROOT%\mingw32\bin"
	set "PATH_DEPS=%DEPS_ROOT%\x86"
	set "BUILD_OUTPUT=%BITCOIN_GIT_ROOT%\build-output\x86"

	GOTO BUILD_START
)
REM else fall-through

:BUILD_START_64
if "%HAS_BUILT_64_BIT%" NEQ "" GOTO BUILD_END
if "%BUILD_64_BIT%" NEQ "" (
	echo Building for 64-bit

	REM The way the toolchain is installed, the \mingw64 subdirectory will always be created
	set "TOOLCHAIN_BIN=%TOOL_CHAIN_ROOT%\mingw64\bin"
	set "PATH_DEPS=%DEPS_ROOT%\x64"
	set "BUILD_OUTPUT=%BITCOIN_GIT_ROOT%\build-output\x64"

	set HAS_BUILT_64_BIT=TRUE

	GOTO BUILD_START
) else ( GOTO BUILD_END )

:BUILD_START
REM Set the path variable to contain the toolchain as well as MSYS bin directories
set "PATH=%TOOLCHAIN_BIN%;%OLD_PATH%"

%MSYS_SH% "%INST_DIR%\clean-bitcoin.sh"

REM Remove previously built executable outputs that were copied to non-standard location
del /F /Q "%BUILD_OUTPUT%\bitcoin-tx.exe"
del /F /Q "%BUILD_OUTPUT%\bitcoin-cli.exe"
del /F /Q "%BUILD_OUTPUT%\bitcoind.exe"
del /F /Q "%BUILD_OUTPUT%\bitcoin-miner.exe"
del /F /Q "%BUILD_OUTPUT%\bitcoin-qt.exe"

REM Go to the 64-bit build section (in case we are building both 32 and 64 bit)
GOTO BUILD_START_64

:BUILD_END
REM ##################################################################################################
REM Get end time so we can output execution duration metrics
REM ##################################################################################################
set END_TIME=%TIME%

REM Change formatting for the start and end times
for /F "tokens=1-4 delims=:.," %%a in ("%START_TIME%") do (
   set /A "start=(((%%a*60)+1%%b %% 100)*60+1%%c %% 100)*100+1%%d %% 100"
)

for /F "tokens=1-4 delims=:.," %%a in ("%END_TIME%") do (
   set /A "end=(((%%a*60)+1%%b %% 100)*60+1%%c %% 100)*100+1%%d %% 100"
)

rem Calculate the elapsed time by subtracting values
set /A elapsed=end-start

rem Format the results for output
set /A hh=elapsed/(60*60*100), rest=elapsed%%(60*60*100), mm=rest/(60*100), rest%%=60*100, ss=rest/100, cc=rest%%100
if %hh% lss 10 set hh=0%hh%
if %mm% lss 10 set mm=0%mm%
if %ss% lss 10 set ss=0%ss%
if %cc% lss 10 set cc=0%cc%

set DURATION=%hh%:%mm%:%ss%.%cc%

echo Start    : %START_TIME%
echo Finish   : %END_TIME%
echo          ---------------
echo Duration : %DURATION%

REM Clear any variables that may have been set in this script
endlocal

REM Allow the user to see the final results at the end of file execution.
pause

Update cleanup script to remove previous build outputs (#1540)

Affects native windows builds produced using the Mingw scripts


echo off

set BASE_STR="c:\anywhere\yes\or\no"
set TAKEN=o
set VALUE=bbbb
Setlocal Enabledelayedexpansion
for /f "delims=*" %%a in ("%BASE_STR%") do (
set a=%%a
set a=!a:%TAKEN%=%VALUE%!
set x=!a!
)
echo !a!

REM echo "DEMO for replace \ with / "
set TAKEN=\
set VALUE=/
Setlocal Enabledelayedexpansion
for /f "delims=*" %%a in ("%BASE_STR%") do (
set a=%%a
set a=!a:%TAKEN%=%VALUE%!
set x=!a!
)
echo %x%

echo on

add a function of replace string with batch.


set NPCAP_OEM_CREDENTIALS_DEFINED=0
if defined NPCAP_USERNAME set /A NPCAP_OEM_CREDENTIALS_DEFINED=NPCAP_OEM_CREDENTIALS_DEFINED+1
if defined NPCAP_PASSWORD set /A NPCAP_OEM_CREDENTIALS_DEFINED=NPCAP_OEM_CREDENTIALS_DEFINED+1

if "%NPCAP_OEM_CREDENTIALS_DEFINED%"=="2" (
	set NPCAP_FILE=npcap-0.9988-oem.exe
) else (
	set NPCAP_FILE=npcap-0.96.exe
)

if "%NPCAP_OEM_CREDENTIALS_DEFINED%"=="2" (
	echo Using Npcap OEM version %NPCAP_FILE%
	curl --digest --user %NPCAP_USERNAME%:%NPCAP_PASSWORD% https://nmap.org/npcap/oem/dist/%NPCAP_FILE% --output %NPCAP_FILE%
) else (
	echo Using Npcap free version %NPCAP_FILE%
	curl https://nmap.org/npcap/dist/%NPCAP_FILE% --output %NPCAP_FILE%
)

%NPCAP_FILE% /S /winpcap_mode

if not "%NPCAP_OEM_CREDENTIALS_DEFINED%"=="2" (
	xcopy C:\Windows\System32\Npcap\*.dll C:\Windows\System32
	xcopy C:\Windows\SysWOW64\Npcap\*.dll C:\Windows\SysWOW64
)

curl --connect-timeout 5 --max-time 10 --retry 5 --retry-delay 0 --retry-max-time 120 https://nmap.org/npcap/dist/npcap-sdk-1.04.zip --output npcap-sdk-1.04.zip
mkdir C:\Npcap-sdk
7z x .\npcap-sdk-1.04.zip -oC:\Npcap-sdk

set NPCAP_OEM_CREDENTIALS_DEFINED=0
if defined NPCAP_USERNAME set /A NPCAP_OEM_CREDENTIALS_DEFINED=NPCAP_OEM_CREDENTIALS_DEFINED+1
if defined NPCAP_PASSWORD set /A NPCAP_OEM_CREDENTIALS_DEFINED=NPCAP_OEM_CREDENTIALS_DEFINED+1

if "%NPCAP_OEM_CREDENTIALS_DEFINED%"=="2" (
	set NPCAP_FILE=npcap-0.9988-oem.exe
) else (
	set NPCAP_FILE=npcap-0.96.exe
)

if "%NPCAP_OEM_CREDENTIALS_DEFINED%"=="2" (
	echo Using Npcap OEM version %NPCAP_FILE%
	curl -L --digest --user %NPCAP_USERNAME%:%NPCAP_PASSWORD% https://npcap.com/oem/dist/%NPCAP_FILE% --output %NPCAP_FILE%
) else (
	echo Using Npcap free version %NPCAP_FILE%
	curl -L https://npcap.com/dist/%NPCAP_FILE% --output %NPCAP_FILE%
)

%NPCAP_FILE% /S /winpcap_mode

if not "%NPCAP_OEM_CREDENTIALS_DEFINED%"=="2" (
	xcopy C:\Windows\System32\Npcap\*.dll C:\Windows\System32
	xcopy C:\Windows\SysWOW64\Npcap\*.dll C:\Windows\SysWOW64
)

curl -L --connect-timeout 5 --max-time 10 --retry 5 --retry-delay 0 --retry-max-time 120 https://npcap.com/dist/npcap-sdk-1.04.zip --output npcap-sdk-1.04.zip
mkdir C:\Npcap-sdk
7z x .\npcap-sdk-1.04.zip -oC:\Npcap-sdk

fix Npcap URL moved (#787)

ci: fix Npcap URL moved (#787)


fix main.cmd

fix main.cmd


@ECHO off
@SET LIT_VERSION=3.5.4

IF NOT "x%1" == "x" GOTO :%1

:luvit
IF NOT EXIST lit.exe CALL make.bat lit
ECHO "Building luvit"
lit.exe make
if %errorlevel% neq 0 goto error
GOTO :end

:lit
ECHO "Building lit"
PowerShell -NoProfile -ExecutionPolicy unrestricted -Command "[Net.ServicePointManager]::SecurityProtocol = 'Tls12'; iex ((new-object net.webclient).DownloadString('https://github.com/luvit/lit/raw/%LIT_VERSION%/get-lit.ps1'))"
GOTO :end

:test
IF NOT EXIST luvit.exe CALL make.bat luvit
ECHO "Testing luvit"
SET LUVI_APP=.
luvit.exe tests\run.lua
if %errorlevel% neq 0 goto error
SET "LUVI_APP="
GOTO :end

:clean
IF EXIST luvit.exe DEL /F /Q luvit.exe
IF EXIST lit.exe DEL /F /Q lit.exe

:error
exit /b %errorlevel%

:end

@ECHO off
@SET LIT_VERSION=3.5.4

IF NOT "x%1" == "x" GOTO :%1

:luvit
IF NOT EXIST lit.exe CALL make.bat lit
ECHO "Building luvit"
lit.exe make
if %errorlevel% neq 0 goto error
IF NOT EXIST lit CALL mklink /H lit lit.exe
if %errorlevel% neq 0 goto error
IF NOT EXIST luvi CALL mklink /H luvi luvi.exe
if %errorlevel% neq 0 goto error
IF NOT EXIST luvit CALL mklink /H luvit luvit.exe
if %errorlevel% neq 0 goto error
GOTO :end

:lit
ECHO "Building lit"
PowerShell -NoProfile -ExecutionPolicy unrestricted -Command "[Net.ServicePointManager]::SecurityProtocol = 'Tls12'; iex ((new-object net.webclient).DownloadString('https://github.com/luvit/lit/raw/%LIT_VERSION%/get-lit.ps1'))"
GOTO :end

:test
IF NOT EXIST luvit.exe CALL make.bat luvit
ECHO "Testing luvit"
SET LUVI_APP=.
luvit.exe tests\run.lua
if %errorlevel% neq 0 goto error
SET "LUVI_APP="
GOTO :end

:clean
IF EXIST luvit.exe DEL /F /Q luvit.exe
IF EXIST lit.exe DEL /F /Q lit.exe

:error
exit /b %errorlevel%

:end

Create hard links on Windows (#1046)

Create hard links on Windows (#1046)


echo on

git pull
if %errorlevel% == 1 pause

set t=%temp%\build-dir-ptc

set actualDir=%CD%

rmdir %t% /s /q
mkdir %t%
mkdir %t%\target

if x%java_home%x == xx set java_home=c:\programs\currentJDK
%java_home%\bin\java -version 2>src\main\resources\make-info.txt
if %errorlevel% == 1 goto noJDK

type src\main\resources\make-info.txt

echo %date% >src\main\resources\version.txt
git add src/main/resources/version.txt
git add src/main/resources/make-info.txt
git commit -m %date%
git push
if %errorlevel% == 1 pause

xcopy src %t%\src *.* /s
copy pom.xml %t% /y

cd /D %t%

call mvn -U clean install source:jar
if %errorlevel% == 1 goto ende
echo on

del %actualDir%\target\*.jar
copy target\*.jar %actualDir%\target\ /y

goto ende

:noJDK
echo off
echo ERROR:
echo there is no link to the newest JDK in c:\programs\currentJDK
echo you can create it via c:\Programs\SysinternalsSuite\junction.exe c:\programs\currentjdk "%currentjdk%"
echo see https://technet.microsoft.com/de-de/sysinternals
goto ende

:ende

cd /D %actualDir%

echo on

git pull
if %errorlevel% == 1 pause

set t=%temp%\build-dir-ptc

set actualDir=%CD%

rmdir %t% /s /q
mkdir %t%\src
mkdir %t%\target

if x%java_home%x == xx set java_home=c:\programs\currentJDK
%java_home%\bin\java -version 2>src\main\resources\make-info.txt
if %errorlevel% == 1 goto noJDK

type src\main\resources\make-info.txt

echo %date% >src\main\resources\version.txt
git add src/main/resources/version.txt
git add src/main/resources/make-info.txt
git commit -m %date%
git push
if %errorlevel% == 1 pause

xcopy src %t%\src *.* /s
copy pom.xml %t% /y

cd /D %t%

call mvn -U clean install source:jar
if %errorlevel% == 1 goto ende
echo on

del %actualDir%\target\*.jar
copy target\*.jar %actualDir%\target\ /y

goto ende

:noJDK
echo off
echo ERROR:
echo there is no link to the newest JDK in c:\programs\currentJDK
echo you can create it via c:\Programs\SysinternalsSuite\junction.exe c:\programs\currentjdk "%currentjdk%"
echo see https://technet.microsoft.com/de-de/sysinternals
goto ende

:ende

cd /D %actualDir%

create temp source dir

create temp source dir


@setlocal
@set PROMPT=$G$S
@if not "%1" == "" goto %1

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

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

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

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

:snapshot
        zip -9 nyagos-%DATE:/=%.zip nyagos.exe lua52.dll nyagos.lua nyagos_ja.md nyagos_en.md readme.md .nyagos nyagos.d\*.lua
        goto end

:install
        @if exist installdir (
            @start make.cmd install_
        ) else (
            @echo Please do 'mklink /J installdir PATH\TO\BIN'.
        )
        @goto end

:install_
        @echo Please close NYAGOS.exe and hit ENTER.
        @pause
        copy nyagos.exe .\installdir\.
        copy nyagos.lua .\installdir\.
        copy lua52.dll  .\installdir\.
        robocopy nyagos.d .\installdir\nyagos.d /E
        goto end
:end

@setlocal
@set PROMPT=$G$S
@if not "%1" == "" goto %1

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

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

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

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

:snapshot
        zip -9 nyagos-%DATE:/=%%2.zip nyagos.exe lua52.dll nyagos.lua nyagos_ja.md nyagos_en.md readme.md .nyagos nyagos.d\*.lua
        goto end

:install
        @if exist installdir (
            @start make.cmd install_
        ) else (
            @echo Please do 'mklink /J installdir PATH\TO\BIN'.
        )
        @goto end

:install_
        @echo Please close NYAGOS.exe and hit ENTER.
        @pause
        copy nyagos.exe .\installdir\.
        copy nyagos.lua .\installdir\.
        copy lua52.dll  .\installdir\.
        robocopy nyagos.d .\installdir\nyagos.d /E
        goto end
:end

make snapshot POSTFIX で、1日に複数のバイナリパッケージを作れるように


mkdir build
cd build

REM ----------------------------------------------------------------------
IF NOT DEFINED WITH_CPLEX (SET WITH_CPLEX=0)
IF NOT DEFINED WITH_GUROBI (SET WITH_GUROBI=0)
IF %WITH_CPLEX% == "" (SET WITH_CPLEX=0)
IF %WITH_GUROBI% == "" (SET WITH_GUROBI=0)

SET OPTIMIZER_ARGS=
IF "%WITH_GUROBI%" == "1" (
    IF NOT DEFINED GUROBI_ROOT_DIR (
        ECHO "GUROBI_ROOT_DIR must be set for building!"
        exit 1
    )
    IF "%GUROBI_ROOT_DIR%" == "" (
        ECHO "GUROBI_ROOT_DIR cannot be empty for building!"
        exit 1
    ) ELSE (
        ECHO "Using GUROBI_ROOT_DIR=%GUROBI_ROOT_DIR%"
    )
    IF NOT DEFINED GUROBI_ROOT_DIR (
        ECHO "GUROBI_LIB_WIN must be set for building!"
        exit 1
    )
    IF "%GUROBI_LIB_WIN%" == "" (
        ECHO "GUROBI_LIB_WIN cannot be empty for building!"
        exit 1
    )
    REM if we build with Gurobi, we need to configure the paths.
    REM The GUROBI_ROOT_DIR should point to gurobiXYZ\win64
    ECHO "found gurobi lib %GUROBI_LIB_WIN%"
    :: ensure single double quotes with :"=
    SET OPTIMIZER_ARGS=-DWITH_GUROBI=ON -DGUROBI_ROOT_DIR="%GUROBI_ROOT_DIR:"=%" ^
      -DGUROBI_LIBRARY="%GUROBI_LIB_WIN:"=%" -DGUROBI_INCLUDE_DIR="%GUROBI_ROOT_DIR:"=%\include" ^
      -DGUROBI_CPP_LIBRARY="%GUROBI_ROOT_DIR:"=%\lib\gurobi_c++md2015.lib"
    rem set GUROBI_LIB=%%i
    rem dir "%GUROBI_ROOT_DIR%\lib\gurobi*.lib" /s/b|findstr gurobi[0-9][0-9].lib>gurobilib.tmp
    rem set /p GUROBI_LIB=<gurobilib.tmp
)

IF "%WITH_CPLEX%" == "1" (
    :: ensure single double quotes with :"=
    SET OPTIMIZER_ARGS=-DWITH_CPLEX=ON -DCPLEX_ROOT_DIR=%CPLEX_ROOT_DIR% -DCPLEX_WIN_VERSION=%CPLEX_WIN_VERSION%
)

REM ----------------------------------------------------------------------

set CONFIGURATION=Release

cmake .. -G "%CMAKE_GENERATOR%" -DCMAKE_PREFIX_PATH="%LIBRARY_PREFIX%" ^
    -DCMAKE_INSTALL_PREFIX="%LIBRARY_PREFIX%"  ^
    -DBOOST_ROOT="%LIBRARY%" ^
    -DCMAKE_CXX_FLAGS="-DBOOST_ALL_NO_LIB /EHsc" ^
    ^
    %OPTIMIZER_ARGS% ^
    ^
    -DPYTHON_EXECUTABLE=%PYTHON% ^
    -DBUILD_NIFTY_PYTHON=yes ^
    -DBUILD_CPP_TEST=no ^
    -DBUILD_CPP_EXAMPLES=no ^
    -DWITH_GLPK=no ^
    -DWITH_HDF5=yes ^
    -DWITH_LP_MP=no ^
    -DWITH_QPBO=no

cmake --build . --target ALL_BUILD --config %CONFIGURATION%
if errorlevel 1 exit 1
cmake --build . --target INSTALL --config %CONFIGURATION%
if errorlevel 1 exit 1

IF "%WITH_GUROBI%" == "1" (
    REM Rename the nifty package to 'nifty_with_gurobi'
    cd "%SP_DIR%"
    rename nifty nifty_with_gurobi
)

IF "%WITH_CPLEX%" == "1" (
    REM Rename the nifty package to 'nifty_with_cplex'
    cd "%SP_DIR%"
    rename nifty nifty_with_cplex
)

mkdir build
cd build

REM ----------------------------------------------------------------------
IF NOT DEFINED WITH_CPLEX (SET WITH_CPLEX=0)
IF NOT DEFINED WITH_GUROBI (SET WITH_GUROBI=0)
IF NOT DEFINED CPLEX_ROOT_DIR (SET CPLEX_ROOT_DIR="")
IF NOT DEFINED GUROBI_ROOT_DIR (SET GUROBI_ROOT_DIR="")
IF %WITH_CPLEX% == "" (SET WITH_CPLEX=0)
IF %WITH_GUROBI% == "" (SET WITH_GUROBI=0)

SET OPTIMIZER_ARGS=
IF "%WITH_GUROBI%" == "1" (
    IF NOT DEFINED GUROBI_ROOT_DIR (
        ECHO "GUROBI_ROOT_DIR must be set for building!"
        exit 1
    )
    IF "%GUROBI_ROOT_DIR%" == "" (
        ECHO "GUROBI_ROOT_DIR cannot be empty for building!"
        exit 1
    ) ELSE (
        ECHO "Using GUROBI_ROOT_DIR=%GUROBI_ROOT_DIR%"
    )
    IF NOT DEFINED GUROBI_ROOT_DIR (
        ECHO "GUROBI_LIB_WIN must be set for building!"
        exit 1
    )
    IF "%GUROBI_LIB_WIN%" == "" (
        ECHO "GUROBI_LIB_WIN cannot be empty for building!"
        exit 1
    )
    REM if we build with Gurobi, we need to configure the paths.
    REM The GUROBI_ROOT_DIR should point to gurobiXYZ\win64
    ECHO "found gurobi lib %GUROBI_LIB_WIN%"
    :: ensure single double quotes with :"=
    SET OPTIMIZER_ARGS=-DWITH_GUROBI=ON -DGUROBI_ROOT_DIR="%GUROBI_ROOT_DIR:"=%" ^
      -DGUROBI_LIBRARY="%GUROBI_LIB_WIN:"=%" -DGUROBI_INCLUDE_DIR="%GUROBI_ROOT_DIR:"=%\include" ^
      -DGUROBI_CPP_LIBRARY="%GUROBI_ROOT_DIR:"=%\lib\gurobi_c++md2015.lib"
    rem set GUROBI_LIB=%%i
    rem dir "%GUROBI_ROOT_DIR%\lib\gurobi*.lib" /s/b|findstr gurobi[0-9][0-9].lib>gurobilib.tmp
    rem set /p GUROBI_LIB=<gurobilib.tmp
)

IF "%WITH_CPLEX%" == "1" (
    :: ensure single double quotes with :"=
    SET OPTIMIZER_ARGS=-DWITH_CPLEX=ON -DCPLEX_ROOT_DIR="%CPLEX_ROOT_DIR:"=%" -DCPLEX_WIN_VERSION=%CPLEX_WIN_VERSION%
)

REM ----------------------------------------------------------------------

set CONFIGURATION=Release

cmake .. -G "%CMAKE_GENERATOR%" -DCMAKE_PREFIX_PATH="%LIBRARY_PREFIX%" ^
    -DCMAKE_INSTALL_PREFIX="%LIBRARY_PREFIX%"  ^
    -DBOOST_ROOT="%LIBRARY%" ^
    -DCMAKE_CXX_FLAGS="-DBOOST_ALL_NO_LIB /EHsc" ^
    ^
    %OPTIMIZER_ARGS% ^
    ^
    -DPYTHON_EXECUTABLE=%PYTHON% ^
    -DBUILD_NIFTY_PYTHON=yes ^
    -DBUILD_CPP_TEST=no ^
    -DBUILD_CPP_EXAMPLES=no ^
    -DWITH_GLPK=no ^
    -DWITH_HDF5=yes ^
    -DWITH_LP_MP=no ^
    -DWITH_QPBO=no

cmake --build . --target ALL_BUILD --config %CONFIGURATION%
if errorlevel 1 exit 1
cmake --build . --target INSTALL --config %CONFIGURATION%
if errorlevel 1 exit 1

IF "%WITH_GUROBI%" == "1" (
    REM Rename the nifty package to 'nifty_with_gurobi'
    cd "%SP_DIR%"
    rename nifty nifty_with_gurobi
)

IF "%WITH_CPLEX%" == "1" (
    REM Rename the nifty package to 'nifty_with_cplex'
    cd "%SP_DIR%"
    rename nifty nifty_with_cplex
)

set CPLEX_ROOT_DIR and GUROBI_ROOT_DIR to "", if not defined


@if "%SCM_TRACE_LEVEL%" NEQ "4" @echo off
@echo Started: %date% %time%

:: ----------------------
:: KUDU Deployment Script
:: Version: 1.0.12
:: ----------------------

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

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

:: Setup
:: -----

setlocal enabledelayedexpansion

SET ARTIFACTS=%~dp0%..\artifacts

IF NOT DEFINED DEPLOYMENT_SOURCE (
  SET DEPLOYMENT_SOURCE=%~dp0%.
)
echo "Deployment Source: %DEPLOYMENT_SOURCE%"

IF NOT DEFINED DEPLOYMENT_DIST (
    SET DEPLOYMENT_DIST=%DEPLOYMENT_SOURCE%\dist
) ELSE (
    ECHO "Deployement Dist already set"
)
echo "Deployment Dist: %DEPLOYMENT_DIST%"

IF NOT DEFINED DEPLOYMENT_TARGET (
  SET DEPLOYMENT_TARGET=%ARTIFACTS%\wwwroot
)
echo "Deployment Target: %DEPLOYMENT_TARGET%"

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

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

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

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

for /F "tokens=5 delims=.\" %%a in ("%PREVIOUS_MANIFEST_PATH%") do SET PREVIOUS_SCM_COMMIT_ID=%%a

::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: Pre-Deployment
:: ----------
@echo "Initiating Pre-Deployment: %date% %time%"
:: .deploy initial install if node_modules doesn't exist.
IF NOT EXIST %DEPLOYMENT_SOURCE%\.deploy\node_modules (
    echo "NPM Install: %DEPLOYMENT_SOURCE%\.deploy\package.json"
    pushd %DEPLOYMENT_SOURCE%\.deploy\
    npm install --production --progress=false --cache-min=432000
)

@echo "Previous Commit: %PREVIOUS_SCM_COMMIT_ID%  Current Commit: %SCM_COMMIT_ID%"
:: Only do npm install if there was a change in package.json
for /F %%f in ('git.exe diff --name-only %PREVIOUS_SCM_COMMIT_ID% %SCM_COMMIT_ID% ^| grep package.json') do (
    SET PACKAGEJSON=%%~f
    SET PKGFOLDER=!DEPLOYMENT_SOURCE!\!PACKAGEJSON:package.json=!
    echo "NPM Install: !PKGFOLDER!package.json"
    pushd "!PKGFOLDER!"
    npm install --production --progress=false --cache-min=432000
    npm install --save json-loader --progress=false --cache-min=432000
    IF !ERRORLEVEL! NEQ 0 goto error
    popd
)

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

@echo "Initiating Deployment: %date% %time%"

:: 1. Build Script
node %DEPLOYMENT_SOURCE%\.deploy\deploy.js

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

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

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

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

:exitSetErrorLevel
exit /b 1

:exitFromFunction
()

:end
endlocal
echo Finished successfully.

@if "%SCM_TRACE_LEVEL%" NEQ "4" @echo off
@echo Started: %date% %time%

:: ----------------------
:: KUDU Deployment Script
:: Version: 1.0.12
:: ----------------------

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

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

:: Setup
:: -----

setlocal enabledelayedexpansion

SET ARTIFACTS=%~dp0%..\artifacts

IF NOT DEFINED DEPLOYMENT_SOURCE (
  SET DEPLOYMENT_SOURCE=%~dp0%.
)
echo "Deployment Source: %DEPLOYMENT_SOURCE%"

IF NOT DEFINED DEPLOYMENT_DIST (
    SET DEPLOYMENT_DIST=%DEPLOYMENT_SOURCE%\dist
) ELSE (
    ECHO "Deployement Dist already set"
)
echo "Deployment Dist: %DEPLOYMENT_DIST%"

IF NOT DEFINED DEPLOYMENT_TARGET (
  SET DEPLOYMENT_TARGET=%ARTIFACTS%\wwwroot
)
echo "Deployment Target: %DEPLOYMENT_TARGET%"

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

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

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

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

for /F "tokens=5 delims=.\" %%a in ("%PREVIOUS_MANIFEST_PATH%") do SET PREVIOUS_SCM_COMMIT_ID=%%a

::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: Pre-Deployment
:: ----------
@echo "Initiating Pre-Deployment: %date% %time%"
:: .deploy initial install if node_modules doesn't exist.
IF NOT EXIST %DEPLOYMENT_SOURCE%\.deploy\node_modules (
    echo "NPM Install: %DEPLOYMENT_SOURCE%\.deploy\package.json"
    pushd %DEPLOYMENT_SOURCE%\.deploy\
    npm install --production --progress=false --cache-min=432000
    popd
)

::Initial install if node_modules doesn't exist.
IF EXIST %DEPLOYMENT_SOURCE%\package.json IF NOT EXIST %DEPLOYMENT_SOURCE%\node_modules (
    echo "NPM Install: %DEPLOYMENT_SOURCE%\package.json"
    pushd %DEPLOYMENT_SOURCE%
    npm install --production --progress=false --cache-min=432000
    popd
)

@echo "Previous Commit: %PREVIOUS_SCM_COMMIT_ID%  Current Commit: %SCM_COMMIT_ID%"
:: Only do npm install if there was a change in package.json
for /F %%f in ('git.exe diff --name-only %PREVIOUS_SCM_COMMIT_ID% %SCM_COMMIT_ID% ^| grep package.json') do (
    SET PACKAGEJSON=%%~f
    SET PKGFOLDER=!DEPLOYMENT_SOURCE!\!PACKAGEJSON:package.json=!
    echo "NPM Install: !PKGFOLDER!package.json"
    pushd "!PKGFOLDER!"
    npm install --production --progress=false --cache-min=432000
    npm install --save json-loader --progress=false --cache-min=432000
    IF !ERRORLEVEL! NEQ 0 goto error
    popd
)

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

@echo "Initiating Deployment: %date% %time%"

:: 1. Build Script
node %DEPLOYMENT_SOURCE%\.deploy\deploy.js

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

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

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

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

:exitSetErrorLevel
exit /b 1

:exitFromFunction
()

:end
endlocal
echo Finished successfully.

Build Master:2017-03-03T17:21:07.504Z

Build Master:2017-03-03T17:21:07.504Z


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

:: ----------------------
:: KUDU Deployment Script
:: Version: 1.0.13
:: ----------------------

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

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

:: Setup
:: -----

setlocal enabledelayedexpansion

SET ARTIFACTS=%~dp0%..\artifacts

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

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

echo %SET DEPLOYMENT_TARGET%

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

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

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

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

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

:SelectNodeVersion

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

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

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

  IF NOT DEFINED NODE_EXE (
    SET NODE_EXE=node
  )

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

goto :EOF

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

:Deployment
echo Handling node.js deployment.

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

:: 2. Select node version
call :SelectNodeVersion

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

echo Handling Angular build

:: 4. Build ng app
IF EXIST "%DEPLOYMENT_TARGET%\package.json" (
  pushd "%DEPLOYMENT_TARGET%"
  call :ExecuteCmd "!NODE_EXE!" ./node_modules/@angular/cli/bin/ng build --prod --env=prod --aot
  :: the next line is optional to fix 404 error see section #8
  call :ExecuteCmd cp "%DEPLOYMENT_TARGET%"/web.config "%DEPLOYMENT_TARGET%"/dist/
  IF !ERRORLEVEL! NEQ 0 goto error
  popd
)

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

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

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

:exitSetErrorLevel
exit /b 1

:exitFromFunction
()

:end
endlocal
echo Finished successfully.

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

:: ----------------------
:: KUDU Deployment Script
:: Version: 1.0.13
:: ----------------------

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

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

:: Setup
:: -----

setlocal enabledelayedexpansion

SET ARTIFACTS=%~dp0%..\artifacts

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

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

echo on
echo %SET DEPLOYMENT_TARGET%

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

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

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

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

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

:SelectNodeVersion

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

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

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

  IF NOT DEFINED NODE_EXE (
    SET NODE_EXE=node
  )

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

goto :EOF

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

:Deployment
echo Handling node.js deployment.

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

:: 2. Select node version
call :SelectNodeVersion

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

echo Handling Angular build

:: 4. Build ng app
IF EXIST "%DEPLOYMENT_TARGET%\package.json" (
  pushd "%DEPLOYMENT_TARGET%"
  call :ExecuteCmd "!NODE_EXE!" ./node_modules/@angular/cli/bin/ng build --prod --env=prod --aot
  :: the next line is optional to fix 404 error see section #8
  call :ExecuteCmd cp "%DEPLOYMENT_TARGET%"/web.config "%DEPLOYMENT_TARGET%"/dist/
  IF !ERRORLEVEL! NEQ 0 goto error
  popd
)

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

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

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

:exitSetErrorLevel
exit /b 1

:exitFromFunction
()

:end
endlocal
echo Finished successfully.

Deploy 2

Deploy 2


mkdir %DEPLOYMENT%
mkdir %DEPLOYMENT%\src\
mkdir src\WhiteLibrary\bin\

copy %NUGET%\Castle.Core.3.3.0\lib\net45\Castle.Core.dll src\WhiteLibrary\bin\
copy %NUGET%\TestStack.White.0.13.3\lib\net40\TestStack.White.dll src\WhiteLibrary\bin\
copy %NUGET%\TestStack.White.ScreenObjects.0.13.3\lib\net40\TestStack.White.Reporting.dll src\WhiteLibrary\bin\
copy %NUGET%\TestStack.White.ScreenObjects.0.13.3\lib\net40\TestStack.White.ScreenObjects.dll src\WhiteLibrary\bin\

del docs\*.* /y

[~,cmdout] = system(python src/WhiteLibrary/version.py)

IF "%cmdout%" == "True" (
    python -m robot.libdoc src\WhiteLibrary docs\keywords.html
)

xcopy docs %DEPLOYMENT%\docs\ /s /a
xcopy src %DEPLOYMENT%\src\ /s /a
copy setup.py %DEPLOYMENT%\
copy build.info %DEPLOYMENT%\

mkdir %DEPLOYMENT%
mkdir %DEPLOYMENT%\src\
mkdir src\WhiteLibrary\bin\

copy %NUGET%\Castle.Core.3.3.0\lib\net45\Castle.Core.dll src\WhiteLibrary\bin\
copy %NUGET%\TestStack.White.0.13.3\lib\net40\TestStack.White.dll src\WhiteLibrary\bin\
copy %NUGET%\TestStack.White.ScreenObjects.0.13.3\lib\net40\TestStack.White.Reporting.dll src\WhiteLibrary\bin\
copy %NUGET%\TestStack.White.ScreenObjects.0.13.3\lib\net40\TestStack.White.ScreenObjects.dll src\WhiteLibrary\bin\

python -m robot.libdoc src\WhiteLibrary docs\keywords.html

xcopy docs %DEPLOYMENT%\docs\ /s /a
xcopy src %DEPLOYMENT%\src\ /s /a
copy setup.py %DEPLOYMENT%\
copy build.info %DEPLOYMENT%\

create documentation always

create documentation always


@ECHO OFF
REM $Id: buildDevDocumentation.bat 4117 2012-03-02 12:33:23Z petno25 $

REM Now we need to add the Ghostscript bin folder to path so that formulas can be built
REM We need 32-bit Ghostscript version as it seems to be hard-coded in Doxygen (using alias does not work)
REM Lets add default path for installation on both 32 and 64 bit Windows
REM TODO: It would be nice if we would not need to rely on a specific version here, (search for available version by itself)
set PATH=C:\Program Files\gs\gs9.18\bin;C:\Program Files (x86)\gs\gs9.18\bin;%PATH%
set PATH=C:\Program Files (x86)\Graphviz2.38\bin;%PATH%

where /q gswin32c.exe
if ERRORLEVEL 1 (
  echo Error: gswin32c.exe could not be found
  echo You need to install the 32.bit version of Ghostscript
)

cd doc
if "%~1"=="" (
  echo Building user documentation!
  REM First remove output folders to be sure documentation is clean
  REM We can afford to do this as user documentation builds relatively fast
  if exist html rmdir html /s /q
  if exist latex rmdir latex /s /q

  REM Run doxygen
  doxygen Doxyfile

  echo.
  echo You can read the documentation by opening the file ./doc/html/index.html
  echo.
)

if "%~1"=="full" (
  echo Building full documentation!

  where /q dot.exe
  if ERRORLEVEL 1 (
    echo Error: dot.exe could not be found
    echo You need to install Graphviz2.38
  )

  REM Run doxygen
  doxygen Doxyfile_full

  echo.
  echo You can read the documentation by opening the file ./doc/html/index.html
  echo.
  pause
)
cd..

@ECHO OFF
REM $Id: buildDevDocumentation.bat 4117 2012-03-02 12:33:23Z petno25 $

REM Now we need to add the Ghostscript bin folder to path so that formulas can be built
REM We need 32-bit Ghostscript version as it seems to be hard-coded in Doxygen (using alias does not work)
REM Lets add default path for installation on both 32 and 64 bit Windows
REM TODO: It would be nice if we would not need to rely on a specific version here, (search for available version by itself)
set PATH=C:\Program Files\gs\gs9.18\bin;C:\Program Files (x86)\gs\gs9.18\bin;%PATH%
set PATH=C:\Program Files\gs\gs9.21\bin;C:\Program Files (x86)\gs\gs9.21\bin;%PATH%
set PATH=C:\Program Files (x86)\Graphviz2.38\bin;%PATH%

where /q gswin32c.exe
if ERRORLEVEL 1 (
  echo Error: gswin32c.exe could not be found
  echo You need to install the 32.bit version of Ghostscript
)

cd doc
if "%~1"=="" (
  echo Building user documentation!
  REM First remove output folders to be sure documentation is clean
  REM We can afford to do this as user documentation builds relatively fast
  if exist html rmdir html /s /q
  if exist latex rmdir latex /s /q

  REM Run doxygen
  doxygen Doxyfile

  echo.
  echo You can read the documentation by opening the file ./doc/html/index.html
  echo.
)

if "%~1"=="full" (
  echo Building full documentation!

  where /q dot.exe
  if ERRORLEVEL 1 (
    echo Error: dot.exe could not be found
    echo You need to install Graphviz2.38
  )

  REM Run doxygen
  doxygen Doxyfile_full

  echo.
  echo You can read the documentation by opening the file ./doc/html/index.html
  echo.
  pause
)
cd..

Add latest ghostscript 9.21 paths to build documentation script


@echo off

@REM This script was based on the original conda activate.bat

@setlocal

@set "CONDA_DEFAULT_ENV=__CONDA_ENV_DIR__"
@set PATH="%CONDA_DEFAULT_ENV%";"%CONDA_DEFAULT_ENV%\Scripts";"%CONDA_DEFAULT_ENV%\Library\bin";%PATH%

@REM Run any activate scripts
@if exist "%CONDA_DEFAULT_ENV%\etc\conda\activate.d" (
    @pushd "%CONDA_DEFAULT_ENV%\etc\conda\activate.d"
    @for %%g in (*.bat) do @call "%%g"
    @popd
)

@REM Execute the given command
%*

@endlocal

@echo off

@REM This script was based on the original conda activate.bat

@setlocal

@set "CONDA_DEFAULT_ENV=__CONDA_ENV_DIR__"
@set "PATH=%CONDA_DEFAULT_ENV%;%CONDA_DEFAULT_ENV%\Scripts;%CONDA_DEFAULT_ENV%\Library\bin;%PATH%"

@REM Run any activate scripts
@if exist "%CONDA_DEFAULT_ENV%\etc\conda\activate.d" (
    @pushd "%CONDA_DEFAULT_ENV%\etc\conda\activate.d"
    @for %%g in (*.bat) do @call "%%g"
    @popd
)

@REM Execute the given command
%*

@endlocal

Fix conda wrapper for Windows

Fix conda wrapper for Windows

The conda paths were being wrongly set with "


@echo off
dotnet pack src -c Release -o ..

fix output path

fix output path


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

:: Keep environment variables within this script
:: unless invoked with --no-local.
if x%1==x--no-local goto nolocal
if x%2==x--no-local goto nolocal
setlocal
:nolocal

set GOBUILDFAIL=0

:: we disallow local import for non-local packages, if %GOROOT% happens
:: to be under %GOPATH%, then some tests below will fail
set GOPATH=

rem TODO avoid rebuild if possible

if x%1==x--no-rebuild goto norebuild
echo # Building packages and commands.
go install -a -v std
if errorlevel 1 goto fail
echo.
:norebuild

:: we must unset GOROOT_FINAL before tests, because runtime/debug requires
:: correct access to source code, so if we have GOROOT_FINAL in effect,
:: at least runtime/debug test will fail.
set GOROOT_FINAL=

:: get CGO_ENABLED
go env > env.bat
if errorlevel 1 goto fail
call env.bat
del env.bat
echo.

echo # Testing packages.
go test std -short -timeout=120s
if errorlevel 1 goto fail
echo.

echo # runtime -cpu=1,2,4
go test runtime -short -timeout=120s -cpu=1,2,4
if errorlevel 1 goto fail
echo.

echo # sync -cpu=10
go test sync -short -timeout=120s -cpu=10
if errorlevel 1 goto fail
echo.

echo # ..\misc\dashboard\builder ..\misc\goplay
go build ..\misc\dashboard\builder ..\misc\goplay
if errorlevel 1 goto fail
echo.

echo # ..\test\bench\go1
go test ..\test\bench\go1
if errorlevel 1 goto fail
echo.

:: cgo tests
if x%CGO_ENABLED% == x0 goto nocgo
echo # ..\misc\cgo\life
go run %GOROOT%\test\run.go - ..\misc\cgo\life
if errorlevel 1 goto fail
echo.

echo # ..\misc\cgo\stdio
go run %GOROOT%\test\run.go - ..\misc\cgo\stdio
if errorlevel 1 goto fail
echo.

echo # ..\misc\cgo\test
go test ..\misc\cgo\test
if errorlevel 1 goto fail
echo.
:nocgo

echo # ..\doc\progs
go run %GOROOT%\test\run.go - ..\doc\progs
if errorlevel 1 goto fail
echo.

:: TODO: The other tests in run.bash.

echo # test
cd ..\test
set FAIL=0
go run run.go
if errorlevel 1 set FAIL=1
cd ..\src
echo.
if %FAIL%==1 goto fail

echo # Checking API compatibility.
go tool api -c ..\api\go1.txt -next ..\api\next.txt -except ..\api\except.txt
if errorlevel 1 goto fail
echo.

echo ALL TESTS PASSED
goto end

:fail
set GOBUILDFAIL=1

:end

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

:: Keep environment variables within this script
:: unless invoked with --no-local.
if x%1==x--no-local goto nolocal
if x%2==x--no-local goto nolocal
setlocal
:nolocal

set GOBUILDFAIL=0

:: we disallow local import for non-local packages, if %GOROOT% happens
:: to be under %GOPATH%, then some tests below will fail
set GOPATH=

rem TODO avoid rebuild if possible

if x%1==x--no-rebuild goto norebuild
echo # Building packages and commands.
go install -a -v std
if errorlevel 1 goto fail
echo.
:norebuild

:: we must unset GOROOT_FINAL before tests, because runtime/debug requires
:: correct access to source code, so if we have GOROOT_FINAL in effect,
:: at least runtime/debug test will fail.
set GOROOT_FINAL=

:: get CGO_ENABLED
go env > env.bat
if errorlevel 1 goto fail
call env.bat
del env.bat
echo.

echo # Testing packages.
go test std -short -timeout=120s
if errorlevel 1 goto fail
echo.

echo # runtime -cpu=1,2,4
go test runtime -short -timeout=120s -cpu=1,2,4
if errorlevel 1 goto fail
echo.

echo # sync -cpu=10
go test sync -short -timeout=120s -cpu=10
if errorlevel 1 goto fail
echo.

echo # ..\misc\dashboard\builder ..\misc\goplay
go build ..\misc\dashboard\builder ..\misc\goplay
if errorlevel 1 goto fail
echo.

echo # ..\test\bench\go1
go test ..\test\bench\go1
if errorlevel 1 goto fail
echo.

:: cgo tests
if x%CGO_ENABLED% == x0 goto nocgo
echo # ..\misc\cgo\life
go run %GOROOT%\test\run.go - ..\misc\cgo\life
if errorlevel 1 goto fail
echo.

echo # ..\misc\cgo\stdio
go run %GOROOT%\test\run.go - ..\misc\cgo\stdio
if errorlevel 1 goto fail
echo.

echo # ..\misc\cgo\test
go test ..\misc\cgo\test
if errorlevel 1 goto fail
echo.
:nocgo

echo # ..\doc\progs
go run %GOROOT%\test\run.go - ..\doc\progs
if errorlevel 1 goto fail
echo.

:: TODO: The other tests in run.bash.

echo # ..\test
cd ..\test
set FAIL=0
go run run.go
if errorlevel 1 set FAIL=1
cd ..\src
echo.
if %FAIL%==1 goto fail

echo # Checking API compatibility.
go tool api -c ..\api\go1.txt -next ..\api\next.txt -except ..\api\except.txt
if errorlevel 1 goto fail
echo.

echo ALL TESTS PASSED
goto end

:fail
set GOBUILDFAIL=1

:end

make output consistent

run.bat: make output consistent

R=golang-dev, minux.ma
CC=golang-dev
http://codereview.appspot.com/6811059


REM Copyright (c) 2017-2020, Patrick Pelissier
REM All rights reserved.
REM
REM Redistribution and use in source and binary forms, with or without
REM modification, are permitted provided that the following conditions are met:
REM + Redistributions of source code must retain the above copyright
REM   notice, this list of conditions and the following disclaimer.
REM + Redistributions in binary form must reproduce the above copyright
REM   notice, this list of conditions and the following disclaimer in the
REM   documentation and/or other materials provided with the distribution.
REM
REM THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND ANY
REM EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
REM WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
REM DISCLAIMED. IN NO EVENT SHALL THE REGENTS AND CONTRIBUTORS BE LIABLE FOR ANY
REM DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
REM (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
REM LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
REM ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
REM (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
REM SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

REM Execute the test suite for Microsoft Visual Studio
REM
REM Load Micosoft Visual Studio environement file.
IF EXIST "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvarsall.bat" (
    call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvarsall.bat" x64
)
IF EXIST "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" (
    call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" x64
)

REM Add clang-cl in the PATH. It is the default install of clang for MSVC:
REM %VCINSTALLDIR%\Tools\Llvm\bin;%VCINSTALLDIR%\Tools\Llvm\x64\bin
REM Adding x64 version
REM See https://docs.microsoft.com/de-de/cpp/build/clang-support-msbuild?view=vs-2019
SET PATH=%PATH%;%VCINSTALLDIR%\Tools\Llvm\x64\bin

REM Remove previous results
DEL *.log *.dat

REM List the expected failure (compiler internal error)
set "expectedFailure1=test-msnapshot.c"
set "expectedFailure2=test-none.c"

REM Select compiler to use (either cl or clang-cl)
set "compiler=%1"

echo "Compiler full version (%compiler%):"
%compiler% /Bv
%compiler% -v

REM Perform for each test
for %%f in (test-*.c) do (
    echo =================================================
    echo Testing %%f
    REM Copy the test file as a C++ file as CL.EXE only support C++ file
    del test.exe
    copy %%f test.cpp
    if not ERRORLEVEL 0 EXIT /B 1
    REM Compile the test suite
    REM /Zc:preprocessor is mandatory to have a compliant preprocessor
    REM /Zc:__cplusplus is needed to report the real value of __cplusplus, so that M*LIB uses the C++ atomic, and not its emulation.
    REM Enable warnings and basic optimization
    REM Inform M*LIB to use Annex K by defining __STDC_WANT_LIB_EXT1__
    echo Compiling %%f with %compiler%
    %compiler% /I.. /O2 /W3 /std:c++14 /Zc:__cplusplus /Zc:preprocessor /D__STDC_WANT_LIB_EXT1__ test.cpp > %%f.log 2>&1
    if not ERRORLEVEL 0 (
        echo *** BUILD ERROR for %%f *** >> %%f.log
        type %%f.log
        if /i "%%f" NEQ "%expectedFailure1%" if /i "%%f" NEQ "%expectedFailure2%" EXIT /B 1
        )
    REM Execute it
    echo Running %%f
    test.exe >> %%f.log 2>&1
    if not ERRORLEVEL 0 (
        echo *** RUNTIME ERROR for %%f ***  >> %%f.log
        type %%f.log
        if /i "%%f" NEQ "%expectedFailure%"  if /i "%%f" NEQ "%expectedFailure2%" EXIT /B 1
    ) ELSE (
        echo Test OK for %%f  >> %%f.log
    )
    type %%f.log
)
echo "All tests passed (except %expectedFailure1%)"
exit /B 0

REM Copyright (c) 2017-2020, Patrick Pelissier
REM All rights reserved.
REM
REM Redistribution and use in source and binary forms, with or without
REM modification, are permitted provided that the following conditions are met:
REM + Redistributions of source code must retain the above copyright
REM   notice, this list of conditions and the following disclaimer.
REM + Redistributions in binary form must reproduce the above copyright
REM   notice, this list of conditions and the following disclaimer in the
REM   documentation and/or other materials provided with the distribution.
REM
REM THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND ANY
REM EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
REM WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
REM DISCLAIMED. IN NO EVENT SHALL THE REGENTS AND CONTRIBUTORS BE LIABLE FOR ANY
REM DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
REM (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
REM LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
REM ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
REM (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
REM SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

REM Execute the test suite for Microsoft Visual Studio
REM
REM Load Micosoft Visual Studio environement file.
IF EXIST "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvarsall.bat" (
    call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvarsall.bat" x64
)
IF EXIST "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" (
    call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" x64
)

REM Add clang-cl in the PATH. It is the default install of clang for MSVC:
REM %VCINSTALLDIR%\Tools\Llvm\bin;%VCINSTALLDIR%\Tools\Llvm\x64\bin
REM Adding x64 version
REM See https://docs.microsoft.com/de-de/cpp/build/clang-support-msbuild?view=vs-2019
SET PATH=%PATH%;%VCINSTALLDIR%\Tools\Llvm\x64\bin

REM Remove previous results
DEL *.log *.dat

REM Select compiler to use (either cl or clang-cl)
set "compiler=%1"

echo "Compiler full version (%compiler%):"
%compiler% /Bv
%compiler% -v

REM Perform for each test
for %%f in (test-*.c) do (
    echo =================================================
    echo Testing %%f
    REM Copy the test file as a C++ file as CL.EXE only support C++ file
    del test.exe
    copy %%f test.cpp || EXIT /B 1
    REM Compile the test suite
    REM /Zc:preprocessor is mandatory to have a compliant preprocessor
    REM /Zc:__cplusplus is needed to report the real value of __cplusplus, so that M*LIB uses the C++ atomic, and not its emulation.
    REM Enable warnings and basic optimization
    REM Inform M*LIB to use Annex K by defining __STDC_WANT_LIB_EXT1__
    echo Compiling %%f with %compiler%
    %compiler% /I.. /O2 /W3 /std:c++14 /Zc:__cplusplus /Zc:preprocessor /D__STDC_WANT_LIB_EXT1__ test.cpp > %%f.log 2>&1  || (
        echo *** BUILD ERROR for %%f *** >> %%f.log
        type %%f.log
        EXIT /B 1
        )
    REM Execute it
    echo Running %%f
    test.exe >> %%f.log 2>&1 && echo Test OK for %%f  >> %%f.log || (
        echo *** RUNTIME ERROR for %%f ***  >> %%f.log
        type %%f.log
        EXIT /B 1
    )
    type %%f.log
)
echo "All tests passed (except %expectedFailure1%)"
exit /B 0

Rework once again how to detect a failure in an application:
  IF errorlevel 1 only works for positive error code
  IF not errorlevel 0 only works for negative error code
There are not reliable. So, use && and || instead.

Remove expected failure on test as all tests pass now
(and it was broken).


Create hagrid.bat

Create hagrid.bat


@echo Off
rem Trigger build process for NFluent
rem usage build [Target] [Configuration]. Configuration is Release by default
Rem target is either 'nightly' (default) for nightly build, 'RC' for release candidate, 'release' for release package
Rem those targets build a tested packaged and pushed it on nuget (assuming a publishing key has been setup)
Rem other targets (e.G. CI) build 'alpha package'
cls
set target=%1
if "%target%"=="" (
	set target=%NFLUENT_STREAM%
)
if "%target%"=="" (
	set target=CI
)
set config=%2
if "%config%" == "" (
   set config=Release
)

set extraOpt=""
if defined APPVEYOR (
    set extraOpt=/logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll"
)

msbuild .\.build\Build.proj /t:%target% /p:Configuration="%config%" /fl /v:m /flp:LogFile=msbuild.log;Verbosity=Diagnostic /clp:Verbosity=Diagnostic /nr:false %extraOpt%

@echo Off
rem Trigger build process for NFluent
rem usage build [Target] [Configuration]. Configuration is Release by default
Rem target is either 'nightly' (default) for nightly build, 'RC' for release candidate, 'release' for release package
Rem those targets build a tested packaged and pushed it on nuget (assuming a publishing key has been setup)
Rem other targets (e.G. CI) build 'alpha package'
cls
set target=%1
if "%target%"=="" (
	set target=%NFLUENT_STREAM%
)
if "%target%"=="" (
	set target=CI
)
set config=%2
if "%config%" == "" (
   set config=Release
)

set extraOpt=""
if defined APPVEYOR (
    set extraOpt=/logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll"
)

msbuild .\.build\Build.proj /t:%target% /p:Configuration="%config%" /fl /v:m /flp:LogFile=msbuild.log;Verbosity=d /clp:Verbosity=d /nr:false %extraOpt%

adjust msbuild log level

wip: adjust msbuild log level


@echo on

set "VSCMD_START_DIR=%CD%"
call "vcvars64.bat"

cd tests

rem set build_root=build_windows_x86_msvc
call :compile "build_windows_x86_msvc_nointr"   "-DMIPP_NO_INTRINSICS"
call :compile "build_windows_x86_msvc_sse2"     "/arch:SSE2   -D__SSE__ -D__SSE2__"
call :compile "build_windows_x86_msvc_sse3"     "/arch:SSE3   -D__SSE__ -D__SSE2__ -D__SSE3__"
call :compile "build_windows_x86_msvc_ssse3"    "/arch:SSSE3  -D__SSE__ -D__SSE2__ -D__SSE3__ -D__SSSE3__"
call :compile "build_windows_x86_msvc_sse4_1"   "/arch:SSE4.1 -D__SSE__ -D__SSE2__ -D__SSE3__ -D__SSSE3__ -D__SSE4_1__"
call :compile "build_windows_x86_msvc_sse4_2"   "/arch:SSE4.2 -D__SSE__ -D__SSE2__ -D__SSE3__ -D__SSSE3__ -D__SSE4_1__ -D__SSE4_2__"
call :compile "build_windows_x86_msvc_avx"      "/arch:AVX    -D__SSE__ -D__SSE2__ -D__SSE3__ -D__SSSE3__ -D__SSE4_1__ -D__SSE4_2__ -D__AVX__"
call :compile "build_windows_x86_msvc_avx2_fma" "/arch:AVX2   -D__SSE__ -D__SSE2__ -D__SSE3__ -D__SSSE3__ -D__SSE4_1__ -D__SSE4_2__ -D__AVX__ -D__AVX2__ -D__FMA__"
rem call :compile "build_windows_x86_msvc_avx512f"  "/arch:AVX512"

exit /B %ERRORLEVEL%

:compile
set build=%~1%
set params=%~2%
mkdir %build%
cd %build%
cmake .. -G"Visual Studio 15 2017 Win64" -DCMAKE_CXX_FLAGS="-D_CRT_SECURE_NO_DEPRECATE /EHsc %params%"
if %ERRORLEVEL% neq 0 exit /B %ERRORLEVEL%
devenv /build Release MIPP_tests.sln
if %ERRORLEVEL% neq 0 exit /B %ERRORLEVEL%
move bin\Release\* bin\
rmdir bin\Release\
cd ..
exit /B 0

@echo on

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

cd tests

rem set build_root=build_windows_x86_msvc
call :compile "build_windows_x86_msvc_nointr"   "-DMIPP_NO_INTRINSICS"
call :compile "build_windows_x86_msvc_sse2"     "/arch:SSE2   -D__SSE__ -D__SSE2__"
call :compile "build_windows_x86_msvc_sse3"     "/arch:SSE3   -D__SSE__ -D__SSE2__ -D__SSE3__"
call :compile "build_windows_x86_msvc_ssse3"    "/arch:SSSE3  -D__SSE__ -D__SSE2__ -D__SSE3__ -D__SSSE3__"
call :compile "build_windows_x86_msvc_sse4_1"   "/arch:SSE4.1 -D__SSE__ -D__SSE2__ -D__SSE3__ -D__SSSE3__ -D__SSE4_1__"
call :compile "build_windows_x86_msvc_sse4_2"   "/arch:SSE4.2 -D__SSE__ -D__SSE2__ -D__SSE3__ -D__SSSE3__ -D__SSE4_1__ -D__SSE4_2__"
call :compile "build_windows_x86_msvc_avx"      "/arch:AVX    -D__SSE__ -D__SSE2__ -D__SSE3__ -D__SSSE3__ -D__SSE4_1__ -D__SSE4_2__ -D__AVX__"
call :compile "build_windows_x86_msvc_avx2_fma" "/arch:AVX2   -D__SSE__ -D__SSE2__ -D__SSE3__ -D__SSSE3__ -D__SSE4_1__ -D__SSE4_2__ -D__AVX__ -D__AVX2__ -D__FMA__"
rem call :compile "build_windows_x86_msvc_avx512f"  "/arch:AVX512"

exit /B %ERRORLEVEL%

:compile
set build=%~1%
set params=%~2%
mkdir %build%
cd %build%
cmake .. -G"Visual Studio 15 2017 Win64" -DCMAKE_CXX_FLAGS="-D_CRT_SECURE_NO_DEPRECATE /EHsc %params%"
if %ERRORLEVEL% neq 0 exit /B %ERRORLEVEL%
devenv /build Release MIPP_tests.sln
if %ERRORLEVEL% neq 0 exit /B %ERRORLEVEL%
move bin\Release\* bin\
rmdir bin\Release\
cd ..
exit /B 0

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


"bin/mapgenerator.exe" data/message_template.msg libsecondlife/mapgenerator/template.cs libsecondlife/mapgenerator/unusedpackets.txt libsecondlife/_Packets_.cs

"bin/mapgenerator.exe" data/message_template.msg Programs/mapgenerator/template.cs Programs/mapgenerator/unusedpackets.txt OpenMetaverse/_Packets_.cs

LIBOMV-360: update mapgen.bat for the new file layout

git-svn-id: c32cf1ecefca26b8770d7b0740bc0c5c174087e4@2143 c754d5e9-d413-0410-bcdf-9574c9dba6b7