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

REM Build
call %msbuild% src\cr-message-dispatch.sln /p:Configuration="%config%" /m /v:M /fl /flp:LogFile=msbuild.log;Verbosity=Normal /nr:false
if not "%errorlevel%"=="0" goto failure

REM Package
mkdir Build
cmd /c %nuget% pack "src\core\core.csproj" -symbols -o Build -p Configuration=%config%
if not "%errorlevel%"=="0" goto failure

cmd /c %nuget% pack "src\dispatchers.eventstore\dispatchers.eventstore.csproj" -symbols -o Build -p Configuration=%config%
if not "%errorlevel%"=="0" goto failure

cmd /c %nuget% pack "src\dispatchers.snapshotting.protobuf\dispatchers.snapshotting.protobuf.csproj" -symbols -o Build -p Configuration=%config%
if not "%errorlevel%"=="0" goto failure

:success
exit 0

:failure
exit -1

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

REM Build
%msbuild% src\cr-message-dispatch.sln /p:Configuration="%config%" /m /v:M /fl /flp:LogFile=msbuild.log;Verbosity=Normal /nr:false
if not "%errorlevel%"=="0" goto failure

REM Package
mkdir Build
cmd /c %nuget% pack "src\core\core.csproj" -symbols -o Build -p Configuration=%config%
if not "%errorlevel%"=="0" goto failure

cmd /c %nuget% pack "src\dispatchers.eventstore\dispatchers.eventstore.csproj" -symbols -o Build -p Configuration=%config%
if not "%errorlevel%"=="0" goto failure

cmd /c %nuget% pack "src\dispatchers.snapshotting.protobuf\dispatchers.snapshotting.protobuf.csproj" -symbols -o Build -p Configuration=%config%
if not "%errorlevel%"=="0" goto failure

:success
exit 0

:failure
exit -1

Build script fix

Build script fix


REM work in progress
REM Setup a non-production BigFix Eval Server with SQL Developer Edition.

REM http://software.bigfix.com/download/bes/95/BigFix-BES-9.5.9.62.exe
REM http://download.microsoft.com/download/2/5/0/2508F7B4-6DDE-4C3E-B1FA-E1EB66F2F79F/SQLServer2016-SSEI-Dev.exe

SET BASEFOLDER=C:\tmp

REM Make folder if not existing:  https://stackoverflow.com/questions/4165387/create-folder-with-batch-but-only-if-it-doesnt-already-exist
if not exist "%BASEFOLDER%" mkdir %BASEFOLDER%

REM Open folder:
start "" %BASEFOLDER%

REM https://github.com/jgstew/bigfix-content/blob/master/fixlet/Install%20SQL%20Server%20Management%20Studio%2016.5.1%20-%20Windows.bes
REM Download SQL Server Management Studio:
start "" powershell -command "& { (New-Object Net.WebClient).DownloadFile('https://download.microsoft.com/download/f/e/b/feb0e6be-21ce-4f98-abee-d74065e32d0a/SSMS-Setup-ENU.exe', '%BASEFOLDER%\SSMS-Setup-ENU.exe') }" -ExecutionPolicy Bypass

REM Download BigFix Root Server:
start "" powershell -command "& { (New-Object Net.WebClient).DownloadFile('http://software.bigfix.com/download/bes/100/BigFix-BES-10.0.0.133.exe', '%BASEFOLDER%\BigFix-BES.exe') }" -ExecutionPolicy Bypass

REM Download BigFix Fixlet Debugger:
REM http://software.bigfix.com/download/bes/100/util/QNA10.0.0.133.zip
start "" powershell -command "& { (New-Object Net.WebClient).DownloadFile('http://software.bigfix.com/download/bes/100/util/QNA10.0.0.133.zip', '%BASEFOLDER%\BigFix-FixletDebugger.zip') }" -ExecutionPolicy Bypass

REM Download SQLServer Developer Edition:
powershell -command "& { (New-Object Net.WebClient).DownloadFile('https://download.microsoft.com/download/5/A/7/5A7065A2-C81C-4A31-9972-8A31AC9388C1/SQLServer2017-SSEI-Dev.exe', '%BASEFOLDER%\SQLServer-SSEI-Dev.exe') }" -ExecutionPolicy Bypass
REM Install SQLServer Developer Edition:
REM https://docs.microsoft.com/en-us/sql/database-engine/install-windows/install-sql-server-from-the-command-prompt?view=sql-server-2017
REM Download Commnad:
%BASEFOLDER%\SQLServer-SSEI-Dev.exe /MEDIAPATH="%BASEFOLDER%" /ACTION=Download /LANGUAGE=en-US /MEDIATYPE=CAB /QUIET

REM Install Command: (interactive)
%BASEFOLDER%\SQLServer-SSEI-Dev.exe /ACTION=Install /MEDIAPATH=C:\tmp /IACCEPTSQLSERVERLICENSETERMS /LANGUAGE=en-US

REM https://download.microsoft.com/download/0/5/B/05B2AF8F-906F-4C57-A58E-5780F64F9D62/SSMS-Setup-ENU.exe
REM Install SQL Server Management Studio:
%BASEFOLDER%\SSMS-Setup-ENU.exe /install /quiet /norestart

REM press any key to continue....
pause

REM  TODO: configure SQL SA account?
REM  TODO: configure SQL login from AD account / local win admin account?
REM  TODO: open firewall for MSSQL to local subnet ?
REM  TODO: open firewall for BigFix to local subnet+ ?
REM  TODO: create local MO account
REM  TODO: create BES Admin Password
REM  TODO: configure REST API creds - Web Reports - etc
REM  TODO: create custom site(s) `Shared` `Dashboards` `Private`
REM  TODO: create roles
REM  TODO: enable sites, subscribe computers
REM  TODO: install adobe flash for IE for root or console systems (DISM)
REM  TODO: setup download plugins
REM  TODO:

REM work in progress
REM Setup a non-production BigFix Eval Server with SQL Developer Edition.

REM http://software.bigfix.com/download/bes/95/BigFix-BES-9.5.9.62.exe
REM http://download.microsoft.com/download/2/5/0/2508F7B4-6DDE-4C3E-B1FA-E1EB66F2F79F/SQLServer2016-SSEI-Dev.exe

SET BASEFOLDER=C:\tmp

REM Make folder if not existing:  https://stackoverflow.com/questions/4165387/create-folder-with-batch-but-only-if-it-doesnt-already-exist
if not exist "%BASEFOLDER%" mkdir %BASEFOLDER%

REM Open folder:
start "" %BASEFOLDER%

REM https://github.com/jgstew/bigfix-content/blob/master/fixlet/Install%20SQL%20Server%20Management%20Studio%2016.5.1%20-%20Windows.bes
REM Download SQL Server Management Studio:
start "" powershell -command "& { (New-Object Net.WebClient).DownloadFile('https://download.microsoft.com/download/f/e/b/feb0e6be-21ce-4f98-abee-d74065e32d0a/SSMS-Setup-ENU.exe', '%BASEFOLDER%\SSMS-Setup-ENU.exe') }" -ExecutionPolicy Bypass

REM Download BigFix Root Server:
start "" powershell -command "& { (New-Object Net.WebClient).DownloadFile('http://software.bigfix.com/download/bes/100/BigFix-BES-10.0.0.133.exe', '%BASEFOLDER%\BigFix-BES.exe') }" -ExecutionPolicy Bypass

REM Download BigFix Fixlet Debugger:
REM http://software.bigfix.com/download/bes/100/util/QNA10.0.0.133.zip
start "" powershell -command "& { (New-Object Net.WebClient).DownloadFile('http://software.bigfix.com/download/bes/100/util/QNA10.0.0.133.zip', '%BASEFOLDER%\BigFix-FixletDebugger.zip') }" -ExecutionPolicy Bypass

REM Download SQLServer Developer Edition:
powershell -command "& { (New-Object Net.WebClient).DownloadFile('https://download.microsoft.com/download/5/A/7/5A7065A2-C81C-4A31-9972-8A31AC9388C1/SQLServer2017-SSEI-Dev.exe', '%BASEFOLDER%\SQLServer-SSEI-Dev.exe') }" -ExecutionPolicy Bypass
REM Install SQLServer Developer Edition:
REM https://docs.microsoft.com/en-us/sql/database-engine/install-windows/install-sql-server-from-the-command-prompt?view=sql-server-2017
REM Download Commnad:
%BASEFOLDER%\SQLServer-SSEI-Dev.exe /MEDIAPATH="%BASEFOLDER%" /ACTION=Download /LANGUAGE=en-US /MEDIATYPE=CAB /QUIET

REM Install Command: (interactive)
%BASEFOLDER%\SQLServer-SSEI-Dev.exe /ACTION=Install /MEDIAPATH=C:\tmp /IACCEPTSQLSERVERLICENSETERMS /LANGUAGE=en-US

REM https://download.microsoft.com/download/0/5/B/05B2AF8F-906F-4C57-A58E-5780F64F9D62/SSMS-Setup-ENU.exe
REM Install SQL Server Management Studio:
%BASEFOLDER%\SSMS-Setup-ENU.exe /install /quiet /norestart

REM press any key to continue....
pause

REM  TODO: configure SQL SA account?
REM  TODO: configure SQL login from AD account / local win admin account?
REM  TODO: open firewall for MSSQL to local subnet ?
REM  TODO: open firewall for BigFix to local subnet+ ?
REM  TODO: create local MO account
REM  TODO: create BES Admin Password
REM  TODO: set recommended BES Admin Settings
REM  TODO: create encryption keys for client encryption in BES Admin
REM  TODO: configure REST API creds - Web Reports - etc
REM  TODO: create custom site(s) `Shared` `Dashboards` `Private`
REM  TODO: create roles
REM  TODO: enable sites, subscribe computers
REM  TODO: install adobe flash for IE for root or console systems (DISM)
REM  TODO: setup download plugins
REM  TODO:

Update bigfix_setup_root_eval.bat

Update bigfix_setup_root_eval.bat


add pause

add pause


@echo off
setlocal
title Build slave
if not exist %~dp0..\..\depot_tools\. (
  echo You must put a copy of depot_tools in %~dp0..\depot_tools
  echo Did you read the instructions carefully??
  goto :EOF
)
set PATH=%~dp0..\..\depot_tools;%PATH%
set PYTHONPATH=..\third_party\buildbot_7_12;..\third_party\twisted_8_1
:: Running it once will make sure svn and python were downloaded.
call gclient.bat > nul
:: run_slave.py will overwrite the PATH and PYTHONPATH environment variables.
python %~dp0\run_slave.py --no_save -y buildbot.tac

@echo off
setlocal
title Build slave
if not exist %~dp0..\..\depot_tools\. (
  echo You must put a copy of depot_tools in %~dp0..\depot_tools
  echo Did you read the instructions carefully??
  goto :EOF
)
set PATH=%~dp0..\..\depot_tools;%PATH%
set PYTHONPATH=%~dp0..\third_party\buildbot_7_12;%~dp0..\third_party\twisted_8_1
:: Running it once will make sure svn and python were downloaded.
call gclient.bat > nul
:: run_slave.py will overwrite the PATH and PYTHONPATH environment variables.
python %~dp0\run_slave.py --no_save -y buildbot.tac

Fix path to allow running run_slave.bat from antoher dir

git-svn-id: 239fca9b83025a0b6f823aeeca02ba5be3d9fd76@62318 0039d316-1c4b-4281-b951-d872f2087c98


@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 DEPLOYMENT_TARGET_ANGULAR (
  SET DEPLOYMENT_TARGET_ANGULAR=%ARTIFACTS%\wwwroot\AzureFunctions.AngulaClient
)

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 NEXT_CLIENT_MANIFEST_PATH (
  SET NEXT_CLIENT_MANIFEST_PATH=%ARTIFACTS%\client-manifest

  IF NOT EXIST "%NEXT_CLIENT_MANIFEST_PATH%" (MKDIR "%NEXT_CLIENT_MANIFEST_PATH%")

  IF NOT DEFINED PREVIOUS_CLIENT_MANIFEST_PATH (
    SET PREVIOUS_CLIENT_MANIFEST_PATH=%ARTIFACTS%\client-manifest
  )

  IF NOT EXIST "%PREVIOUS_CLIENT_MANIFEST_PATH%" (MKDIR "%PREVIOUS_CLIENT_MANIFEST_PATH%")
)

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 ROBOCOPY "%DEPLOYMENT_SOURCE%\AzureFunctions.AngulaClient" "%DEPLOYMENT_TARGET_ANGULAR%" /E /IS
  :: http://ss64.com/nt/robocopy-exit.html
  IF %ERRORLEVEL% EQU 16 echo ***FATAL ERROR*** & goto error
  IF %ERRORLEVEL% EQU 15 echo OKCOPY + FAIL + MISMATCHES + XTRA & goto error
  IF %ERRORLEVEL% EQU 14 echo FAIL + MISMATCHES + XTRA & goto error
  IF %ERRORLEVEL% EQU 13 echo OKCOPY + FAIL + MISMATCHES & goto error
  IF %ERRORLEVEL% EQU 12 echo FAIL + MISMATCHES& goto error
  IF %ERRORLEVEL% EQU 11 echo OKCOPY + FAIL + XTRA & goto error
  IF %ERRORLEVEL% EQU 10 echo FAIL + XTRA & goto error
  IF %ERRORLEVEL% EQU 9 echo OKCOPY + FAIL & goto error
  IF %ERRORLEVEL% EQU 8 echo FAIL & goto error
  IF %ERRORLEVEL% EQU 7 echo OKCOPY + MISMATCHES + XTRA & goto error
  IF %ERRORLEVEL% EQU 6 echo MISMATCHES + XTRA & goto error
  IF %ERRORLEVEL% EQU 5 echo OKCOPY + MISMATCHES & goto error
  IF %ERRORLEVEL% EQU 4 echo MISMATCHES & goto error
  IF %ERRORLEVEL% EQU 3 echo OKCOPY + XTRA
  IF %ERRORLEVEL% EQU 2 echo XTRA
  IF %ERRORLEVEL% EQU 1 echo OKCOPY
  IF %ERRORLEVEL% EQU 0 echo No Change
)

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

  call :ExecuteCmd npm install
  IF !ERRORLEVEL! NEQ 0 (
    call :ExecuteCmd npm install
    IF !ERRORLEVEL! NEQ 0 goto error
  )

  call :ExecuteCmd ng build --output-path="./../ng2app"
  IF !ERRORLEVEL! NEQ 0 (
    call :ExecuteCmd npm run jspm:i
    IF !ERRORLEVEL! NEQ 0 goto error
  )

  REM call :ExecuteCmd npm run typings install
  REM IF !ERRORLEVEL! NEQ 0 goto error

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

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

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

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

  popd
)

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

  REM call :ExecuteCmd bower install
  REM IF !ERRORLEVEL! NEQ 0 goto error
  REM popd
REM )

:: 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%"
)

IF EXIST %WEBJOB_PATH%\templates-update.cmd (
    del %WEBJOB_PATH%\templates-update.cmd
)

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

:: 9. update build.txt
call :ExecuteCmd echo %SCM_COMMIT_ID% > %DEPLOYMENT_TARGET%\build.txt
IF !ERRORLEVEL! NEQ 0 (
  call :ExecuteCmd echo %SCM_COMMIT_ID% > %DEPLOYMENT_TARGET%\build.txt
  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

:: ----------------------
:: 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 DEPLOYMENT_TARGET_ANGULAR (
  SET DEPLOYMENT_TARGET_ANGULAR=%ARTIFACTS%\wwwroot\AzureFunctions.AngularClient
)

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 NEXT_CLIENT_MANIFEST_PATH (
  SET NEXT_CLIENT_MANIFEST_PATH=%ARTIFACTS%\client-manifest

  IF NOT EXIST "%NEXT_CLIENT_MANIFEST_PATH%" (MKDIR "%NEXT_CLIENT_MANIFEST_PATH%")

  IF NOT DEFINED PREVIOUS_CLIENT_MANIFEST_PATH (
    SET PREVIOUS_CLIENT_MANIFEST_PATH=%ARTIFACTS%\client-manifest
  )

  IF NOT EXIST "%PREVIOUS_CLIENT_MANIFEST_PATH%" (MKDIR "%PREVIOUS_CLIENT_MANIFEST_PATH%")
)

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 ROBOCOPY "%DEPLOYMENT_SOURCE%\AzureFunctions.AngularClient" "%DEPLOYMENT_TARGET_ANGULAR%" /E /IS
  :: http://ss64.com/nt/robocopy-exit.html
  IF %ERRORLEVEL% EQU 16 echo ***FATAL ERROR*** & goto error
  IF %ERRORLEVEL% EQU 15 echo OKCOPY + FAIL + MISMATCHES + XTRA & goto error
  IF %ERRORLEVEL% EQU 14 echo FAIL + MISMATCHES + XTRA & goto error
  IF %ERRORLEVEL% EQU 13 echo OKCOPY + FAIL + MISMATCHES & goto error
  IF %ERRORLEVEL% EQU 12 echo FAIL + MISMATCHES& goto error
  IF %ERRORLEVEL% EQU 11 echo OKCOPY + FAIL + XTRA & goto error
  IF %ERRORLEVEL% EQU 10 echo FAIL + XTRA & goto error
  IF %ERRORLEVEL% EQU 9 echo OKCOPY + FAIL & goto error
  IF %ERRORLEVEL% EQU 8 echo FAIL & goto error
  IF %ERRORLEVEL% EQU 7 echo OKCOPY + MISMATCHES + XTRA & goto error
  IF %ERRORLEVEL% EQU 6 echo MISMATCHES + XTRA & goto error
  IF %ERRORLEVEL% EQU 5 echo OKCOPY + MISMATCHES & goto error
  IF %ERRORLEVEL% EQU 4 echo MISMATCHES & goto error
  IF %ERRORLEVEL% EQU 3 echo OKCOPY + XTRA
  IF %ERRORLEVEL% EQU 2 echo XTRA
  IF %ERRORLEVEL% EQU 1 echo OKCOPY
  IF %ERRORLEVEL% EQU 0 echo No Change
)

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

  call :ExecuteCmd npm install
  IF !ERRORLEVEL! NEQ 0 (
    call :ExecuteCmd npm install
    IF !ERRORLEVEL! NEQ 0 goto error
  )

  call :ExecuteCmd ng build --output-path="./../ng2app"
  IF !ERRORLEVEL! NEQ 0 (
    call :ExecuteCmd npm run jspm:i
    IF !ERRORLEVEL! NEQ 0 goto error
  )

  REM call :ExecuteCmd npm run typings install
  REM IF !ERRORLEVEL! NEQ 0 goto error

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

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

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

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

  popd
)

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

  REM call :ExecuteCmd bower install
  REM IF !ERRORLEVEL! NEQ 0 goto error
  REM popd
REM )

:: 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%"
)

IF EXIST %WEBJOB_PATH%\templates-update.cmd (
    del %WEBJOB_PATH%\templates-update.cmd
)

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

:: 9. update build.txt
call :ExecuteCmd echo %SCM_COMMIT_ID% > %DEPLOYMENT_TARGET%\build.txt
IF !ERRORLEVEL! NEQ 0 (
  call :ExecuteCmd echo %SCM_COMMIT_ID% > %DEPLOYMENT_TARGET%\build.txt
  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.

Fix AgularClient folder name

Fix AgularClient folder name


@echo off
:: palisades.lakes (at) gmail (dot) com
:: 2017-10-09

::set GC=-XX:+AggressiveHeap -XX:+UseStringDeduplication
set GC=

set COMPRESSED=
::set COMPRESSED=-XX:CompressedClassSpaceSize=3g

set TRACE=
::set TRACE=-XX:+PrintGCDetails -XX:+TraceClassUnloading -XX:+TraceClassLoading

set PROF=
::set PROF=-Xrunhprof:cpu=samples,depth=128,thread=y,doe=y

::set THRUPUT=-d64 -server -XX:+AggressiveOpts
set THRUPUT=-d64 -server
::set THRUPUT=

::set XMX=-Xms29g -Xmx29g -Xmn11g
set XMX=-Xms12g -Xmx12g -Xmn5g

set OPENS=--add-opens java.base/java.lang=ALL-UNNAMED
set CP=-cp ./src/scripts/clojure;./src/test/clojure;lib/*

set JAVA_HOME=%JAVA9%
set JAVA="%JAVA_HOME%\bin\java"

set CMD=%JAVA% %THRUPUT% -ea -dsa -Xbatch %GC% %PROF% %XMX% %COMPRESSED% %TRACE% %OPENS% %CP% clojure.main %*
::echo %CMD%
%CMD%

@echo off
:: palisades.lakes (at) gmail (dot) com
:: 2018-06-26

::set GC=-XX:+AggressiveHeap -XX:+UseStringDeduplication
set GC=

set COMPRESSED=
::set COMPRESSED=-XX:CompressedClassSpaceSize=3g

set TRACE=
::set TRACE=-XX:+PrintGCDetails -XX:+TraceClassUnloading -XX:+TraceClassLoading

set PROF=
::set PROF=-Xrunhprof:cpu=samples,depth=128,thread=y,doe=y

::set THRUPUT=-d64 -server -XX:+AggressiveOpts
set THRUPUT=-server
::set THRUPUT=

::set XMX=-Xms29g -Xmx29g -Xmn11g
set XMX=-Xms12g -Xmx12g -Xmn5g

set OPENS=--add-opens java.base/java.lang=ALL-UNNAMED
set CP=-cp ./src/scripts/clojure;./src/test/clojure;lib/*

set JAVA_HOME=%JAVA10%
set JAVA="%JAVA_HOME%\bin\java"

set CMD=%JAVA% %THRUPUT% -ea -dsa -Xbatch %GC% %PROF% %XMX% %COMPRESSED% %TRACE% %OPENS% %CP% clojure.main %*
::echo %CMD%
%CMD%

update to jdk10

update to jdk10


set HERE=%~dp0

echo HERE %HERE%
echo APPVEYOR_PROJECT_NAME %APPVEYOR_PROJECT_NAME%
echo CONFIGURATION %CONFIGURATION%
echo PLATFORM %PLATFORM%
echo APPVEYOR_BUILD_VERSION %APPVEYOR_BUILD_VERSION%
echo APPVEYOR_REPO_COMMIT %APPVEYOR_REPO_COMMIT%
echo APPVEYOR_REPO_COMMIT_MESSAGE  %APPVEYOR_REPO_COMMIT_MESSAGE%

7z a %HERE%%CONFIGURATION%.zip %HERE%\src\bin\%CONFIGURATION%\*

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

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

:ok
exit /b 0

:ko
exit /b 5

set HERE=%~dp0

echo HERE %HERE%
echo APPVEYOR_PROJECT_NAME %APPVEYOR_PROJECT_NAME%
echo CONFIGURATION %CONFIGURATION%
echo PLATFORM %PLATFORM%
echo APPVEYOR_BUILD_VERSION %APPVEYOR_BUILD_VERSION%
echo APPVEYOR_REPO_COMMIT %APPVEYOR_REPO_COMMIT%
echo APPVEYOR_REPO_COMMIT_MESSAGE  %APPVEYOR_REPO_COMMIT_MESSAGE%
echo APPVEYOR_BUILD_NUMBER  %APPVEYOR_BUILD_NUMBER%

7z a %HERE%%CONFIGURATION%.zip %HERE%\src\bin\%CONFIGURATION%\*

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

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

:ok
exit /b 0

:ko
exit /b 5

build number for release artifact

build number for release artifact


python setup.py py2exe
echo exe file created in folder dist folder

Create runme.bat

Create runme.bat

Batch file for windows to create exe file using py2exe.


### application.bat - 2015 - Guillet ###
 echo "Copyright Thomas Guillet - 2015"

version = "2"
build_hour = "11H00"

echo "Build ${build_hour}"
echo "version ${version}"

### application.bat - 2015 - Thibault ROGER ###
 echo "Copyright Thomas Guillet - 2015"

version = "2"
build_hour = "11H00"

echo "Build ${build_hour}"
echo "version ${version}"

update header for new member

update header for new member


set AR=llvm-ar
set LD=lld-link
set CXX=clang++
set CC=clang
set ac_cv_have_decl__BitScanForward=yes

FOR /F "delims=" %%i IN ('cygpath.exe -u "%PREFIX%"') DO set "PREFIX=%%i"
bash -lc "./configure --with-int=imath CFLAGS='-O3 -Dstrdup=_strdup'"
bash -lc "make"
bash -lc "make check"
bash -lc "make install-strip"

set AR=llvm-ar
set LD=lld-link
set CXX=clang++
set CC=clang
set ac_cv_have_decl__BitScanForward=yes

FOR /F "delims=" %%i IN ('cygpath.exe -u "%PREFIX%"') DO set "PREFIX=%%i"
bash -lc "cd $SRC_DIR &&  ./configure --with-int=imath CFLAGS='-O3 -Dstrdup=_strdup' --prefix=$PREFIX/Library"
bash -lc "cd $SRC_DIR && make -j$CPU_COUNT"
bash -lc "cd $SRC_DIR && make check"
bash -lc "cd $SRC_DIR && make install-strip"

rm "%LIBRARY_LIB%/libisl.la"
mv "%LIBRARY_LIB%/libisl.a" "%LIBRARY_LIB%/isl.lib"

Fix win build script

Fix win build script


@echo off
rem ----------------------------------------------------------------------------
rem
rem This variable should be set to the directory where is installed ProActive
rem

IF NOT DEFINED PA_SCHEDULER set PA_SCHEDULER=%CD%\..\..

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

if NOT DEFINED JAVA_HOME goto javahome
if "%JAVA_HOME%" == "" goto javahome

rem ----
rem Set up the classpath using classes dir or jar files
rem ----

IF DEFINED CLASSPATHEXT (
	SET CLASSPATH=%CLASSPATHEXT%
) ELSE (
	SET CLASSPATH=.
)

rem Check if classes exists and is not empty
IF EXIST "%PA_SCHEDULER%\classes\scheduler" (
	SET CLASSPATH=%CLASSPATH%;%PA_SCHEDULER%\classes\resource-manager;%PA_SCHEDULER%\classes\scheduler
	SET JARS=%PA_SCHEDULER%\lib\
	FOR %%j IN ("%PA_SCHEDULER%\lib\*.jar") DO SET JARS=!JARS!;%%j
	rem Use jar index to avoid 'command too long'
	SET JARS=!JARS!;%PA_SCHEDULER%\lib\ProActive\ProActive.jar
	FOR %%j IN ("%PA_SCHEDULER%\lib\common\*.jar") DO SET JARS=!JARS!;%%j
) ELSE (
	rem Jars needed by the scheduler
	FOR %%j IN ("%PA_SCHEDULER%\dist\lib\*.jar") DO SET JARS=!JARS!;%%j
)

SET CLASSPATH=%CLASSPATH%;%JARS%

set JAVA_CMD="%JAVA_HOME%\bin\java.exe" -Dproactive.home="%PA_SCHEDULER%" -Dproactive.configuration="%PA_SCHEDULER%\config\proactive\ProActiveConfiguration.xml" -Dpa.scheduler.home="%PA_SCHEDULER%" -Dpa.rm.home="%PA_SCHEDULER%" -Djava.security.manager -Djava.security.policy="%PA_SCHEDULER%\config\scheduler.java.policy" -Dlog4j.configuration="file:///%PA_SCHEDULER%/config/scheduler-log4j"

rem Adding java tools to the path
SET OK=1
FOR /F "delims=;" %%i IN ("%PATH%") DO (
IF /I "%%i" == "%JAVA_HOME%\bin" SET OK=0
)
IF /I %OK%==1 SET PATH=%JAVA_HOME%\bin;%PATH%

goto end

:javahome
echo.
echo The environment variable JAVA_HOME must be set the current jdk distribution
echo installed on your computer.
echo Use
echo    set JAVA_HOME=<the directory where is the JDK>
goto end

:end

@echo off
rem ----------------------------------------------------------------------------
rem
rem This variable should be set to the directory where is installed ProActive
rem

IF NOT DEFINED PA_SCHEDULER set PA_SCHEDULER=%CD%\..\..

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

if NOT DEFINED JAVA_HOME goto javahome
if "%JAVA_HOME%" == "" goto javahome

rem ----
rem Set up the classpath using classes dir or jar files
rem ----

IF DEFINED CLASSPATHEXT (
	SET CLASSPATH=%CLASSPATHEXT%
) ELSE (
	SET CLASSPATH=.
)

rem Check if classes exists and is not empty
IF EXIST "%PA_SCHEDULER%\classes\scheduler" (
	SET CLASSPATH=%CLASSPATH%;%PA_SCHEDULER%\classes\resource-manager;%PA_SCHEDULER%\classes\scheduler
	SET JARS=%PA_SCHEDULER%\lib\
	FOR %%j IN ("%PA_SCHEDULER%\lib\*.jar") DO SET JARS=!JARS!;%%j
	rem Use jar index to avoid 'command too long'
	SET JARS=!JARS!;%PA_SCHEDULER%\lib\ProActive\ProActive.jar
	FOR %%j IN ("%PA_SCHEDULER%\lib\common\*.jar") DO SET JARS=!JARS!;%%j
) ELSE (
	rem Jars needed by the scheduler
	FOR %%j IN ("%PA_SCHEDULER%\dist\lib\*.jar") DO SET JARS=!JARS!;%%j
)

SET CLASSPATH=%CLASSPATH%;%JARS%

set JAVA_CMD="%JAVA_HOME%\bin\java.exe" -Dproactive.home="%PA_SCHEDULER%" -Dproactive.configuration="%PA_SCHEDULER%\config\proactive\ProActiveConfiguration.xml" -Dpa.scheduler.home="%PA_SCHEDULER%" -Dpa.rm.home="%PA_SCHEDULER%" -Djava.security.manager -Djava.security.policy="%PA_SCHEDULER%\config\scheduler.java.policy" -Dlog4j.configuration="file:%PA_SCHEDULER%/config/scheduler-log4j"

rem Adding java tools to the path
SET OK=1
FOR /F "delims=;" %%i IN ("%PATH%") DO (
IF /I "%%i" == "%JAVA_HOME%\bin" SET OK=0
)
IF /I %OK%==1 SET PATH=%JAVA_HOME%\bin;%PATH%

goto end

:javahome
echo.
echo The environment variable JAVA_HOME must be set the current jdk distribution
echo installed on your computer.
echo Use
echo    set JAVA_HOME=<the directory where is the JDK>
goto end

:end

Fix SCHEDULING-163

Fix SCHEDULING-163

git-svn-id: 27916816d6cfa57849e9a885196bf7392b80e1ac@11217 28e8926c-6b08-0410-baaa-805c5e19b8d6


:loop
py -3.5 Twitch_Harmonbot.py
goto loop
PAUSE

:loop
py -3.6 Twitch_Harmonbot.py
goto loop
PAUSE

Upgrade Twitch Harmonbot to Python 3.6

Upgrade Twitch Harmonbot to Python 3.6


mkdir .hpc
ghc --make -isrc -i. src\Main.hs -w -fhpc -odir .hpc -hidir .hpc -threaded -o .hpc\hlint-test
del hlint-test.tix
.hpc\hlint-test --help
.hpc\hlint-test --test
.hpc\hlint-test src --report=.hpc\report.html +RTS -N2
hpc.exe markup hlint-test.tix --destdir=.hpc
hpc.exe report hlint-test.tix
del hlint-test.tix
start .hpc\hpc_index_fun.html

Add a script to automate HPC checking

Add a script to automate HPC checking


MKDIR build\windows
CD build\windows
cmake -DCMAKE_CONFIGURATION_TYPES="Release" -DCMAKE_INSTALL_PREFIX="%LIBRARY_PREFIX%" ..\..
ECHO VS files have been generated in build\windows
cmake --build .

MKDIR build\windows
CD build\windows

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

ECHO VS files have been generated in build\windows

cmake --build . --config Release

add cmake config

add cmake config


@rem Copyright 2018 Google LLC. All rights reserved.
@rem
@rem Licensed under the Apache License, Version 2.0 (the "License");
@rem you may not use this file except in compliance with the License.
@rem 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.

@echo "Starting Windows build"

cd /d %~dp0
cd ..

@rem The image we're currently running has a broken version of Node.js enabled
@rem by nvm (v10.15.3), which has no npm bin. This hack uses the functional
@rem Node v8.9.1 to install npm@latest, it then uses this version of npm to
@rem install npm for v10.15.3.
call nvm use v8.9.1 || goto :error
call node C:\Users\kbuilder\AppData\Roaming\nvm-ps\versions\v8.9.1\node_modules\npm-bootstrap\bin\npm-cli.js i npm -g || goto :error
call nvm use v10.15.3 || goto :error
call node C:\Users\kbuilder\AppData\Roaming\nvm-ps\versions\v8.9.1\node_modules\npm\bin\npm-cli.js i npm -g || goto :error

call npm install || goto :error
call npm run test || goto :error

goto :EOF

:error
exit /b 1

@rem Copyright 2018 Google LLC. All rights reserved.
@rem
@rem Licensed under the Apache License, Version 2.0 (the "License");
@rem you may not use this file except in compliance with the License.
@rem 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.

@echo "Starting Windows build"

cd /d %~dp0
cd ..

@rem npm path is not currently set in our image, we should fix this next time
@rem we upgrade Node.js in the image:
SET PATH=%PATH%;/cygdrive/c/Program Files/nodejs/npm

call nvm use v12.14.1
call which node

call npm install || goto :error
call npm run test || goto :error

goto :EOF

:error
exit /b 1

build: update windows configuration to match new vm


@rem Copyright 2018 gRPC authors.
@rem
@rem Licensed under the Apache License, Version 2.0 (the "License");
@rem you may not use this file except in compliance with the License.
@rem 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.

@echo "Starting Windows build"

cd /d %~dp0
cd ..

call npm install -g npm@5 || goto :error

call npm install || goto :error
call npm run test || goto :error

goto :EOF

:error
exit /b 1

@rem Copyright 2018 Google LLC. All rights reserved.
@rem
@rem Licensed under the Apache License, Version 2.0 (the "License");
@rem you may not use this file except in compliance with the License.
@rem 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.

@echo "Starting Windows build"

cd /d %~dp0
cd ..

call npm install -g npm@latest || goto :error
call npm install || goto :error
call npm run test || goto :error

goto :EOF

:error
exit /b 1

use latest npm on Windows (#41)

chore: use latest npm on Windows (#41)


@rem Copyright 2018 Google LLC. All rights reserved.
@rem
@rem Licensed under the Apache License, Version 2.0 (the "License");
@rem you may not use this file except in compliance with the License.
@rem 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.

@echo "Starting Windows build"

cd /d %~dp0
cd ..

call npm install -g npm@latest || goto :error
call npm install || goto :error
call npm run test || goto :error

goto :EOF

:error
exit /b 1

@rem Copyright 2018 Google LLC. All rights reserved.
@rem
@rem Licensed under the Apache License, Version 2.0 (the "License");
@rem you may not use this file except in compliance with the License.
@rem 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.

@echo "Starting Windows build"

cd /d %~dp0
cd ..

@rem The image we're currently running has a broken version of Node.js enabled
@rem by nvm (v10.15.3), which has no npm bin. This hack uses the functional
@rem Node v8.9.1 to install npm@latest, it then uses this version of npm to
@rem install npm for v10.15.3.
call nvm use v8.9.1 || goto :error
call node C:\Users\kbuilder\AppData\Roaming\nvm-ps\versions\v8.9.1\node_modules\npm-bootstrap\bin\npm-cli.js i npm -g || goto :error
call nvm use v10.15.3 || goto :error
call node C:\Users\kbuilder\AppData\Roaming\nvm-ps\versions\v8.9.1\node_modules\npm\bin\npm-cli.js i npm -g || goto :error

call npm install || goto :error
call npm run test || goto :error

goto :EOF

:error
exit /b 1

build: patch Windows container, fixing Node 10 (#219)


@ECHO ON
vagrant plugin install vagrant-auto_network
@ECHO OFF
ECHO -----------------------------------------
ECHO Welcome to the microbit-vagrants control.
ECHO -----------------------------------------
ECHO 1 - Espruino
ECHO 2 - MicroPython
ECHO 3 - RIOT-OS Environment
ECHO 4 - PXT
ECHO 5 - Exit
SET /P C=Type the number you want from above then press enter:
IF %C%==1 GOTO ESPRUINO
IF %C%==2 GOTO MICROPYTHON
IF %C%==3 GOTO RIOT
IF %C%==4 GOTO PXT
IF %C%==5 EXIT

:ESPRUINO
@ECHO ON
cd Espruino
vagrant up
:MICROPYTHON
@ECHO ON
cd micropython
vagrant up
:RIOT
@ECHO ON
cd RIOT
vagrant up
:PXT
@ECHO ON
cd PXT
vagrant up

Add very simple vagrant plugin install for the autonetwork


REM Add other things if could be automated, RUN THIS AS ADMIN
@echo off
echo Check for Admn
net sessions
if %errorlevel%==0 (
echo Success
) else (
echo No admin
pause
exit
)
REM Windows Defender scan
cd C:\Program Files\Windows Defender\
MpCmdRun.exe -Scan 2
REM Listing possible penetrations
cd C:\
echo Staring to output active processes to dir C:\!
wmic process list brief > BriefProcesses.txt
if %errorlevel%==1 echo Brief Processes failed to write
wmic process list full >FullProcesses.txt
if %errorlevel%==1 echo Full Processes failed to write
wmic startup list full > StartupLists.txt
if %errorlevel%==1 echo Startup Processes failed to write
net start > StartedProcesses.txt
if %errorlevel%==1 echo Started processes failed to write
reg export HKLM\Software\Microsoft\Windows\CurrentVersion\Run  Run.reg
if %errorlevel%==1 echo Run processes failed to write
REM Passwords must be 10 digits
net accounts /minpwlen:10
REM Passwords must be changed every 30 days
net accounts /maxpwage:30
REM Passwords can only be changed after 1 day has passed
net accounts /minpwage:1
REM Display current password policy
net accounts
REM Turn on UAC
reg add HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System /v EnableLUA /t REG_DWORD /d 1 /f
REM No Remote Desktop
reg add "HKLM\SYSTEM\CurrentControlSet\Control\Terminal Server" /v fDenyTSConnections /t REG_DWORD /d 1 /f
reg add "HKLM\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp" /v UserAuthentication /t REG_DWORD /d 0 /f
REM Windows auomatic updates
reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\Auto Update" /v AUOptions /t REG_DWORD /d 3 /f
REM Removing good ol' insecure stuff
dism /online /disable-feature /featurename:IIS-WebServerRole >NUL
dism /online /disable-feature /featurename:IIS-WebServer >NUL
dism /online /disable-feature /featurename:IIS-CommonHttpFeatures >NUL
dism /online /disable-feature /featurename:IIS-HttpErrors >NUL
dism /online /disable-feature /featurename:IIS-HttpRedirect >NUL
dism /online /disable-feature /featurename:IIS-ApplicationDevelopment >NUL
dism /online /disable-feature /featurename:IIS-NetFxExtensibility >NUL
dism /online /disable-feature /featurename:IIS-NetFxExtensibility45 >NUL
dism /online /disable-feature /featurename:IIS-HealthAndDiagnostics >NUL
dism /online /disable-feature /featurename:IIS-HttpLogging >NUL
dism /online /disable-feature /featurename:IIS-LoggingLibraries >NUL
dism /online /disable-feature /featurename:IIS-RequestMonitor >NUL
dism /online /disable-feature /featurename:IIS-HttpTracing >NUL
dism /online /disable-feature /featurename:IIS-Security >NUL
dism /online /disable-feature /featurename:IIS-URLAuthorization >NUL
dism /online /disable-feature /featurename:IIS-RequestFiltering >NUL
dism /online /disable-feature /featurename:IIS-IPSecurity >NUL
dism /online /disable-feature /featurename:IIS-Performance >NUL
dism /online /disable-feature /featurename:IIS-HttpCompressionDynamic >NUL
dism /online /disable-feature /featurename:IIS-WebServerManagementTools >NUL
dism /online /disable-feature /featurename:IIS-ManagementScriptingTools >NUL
dism /online /disable-feature /featurename:IIS-IIS6ManagementCompatibility >NUL
dism /online /disable-feature /featurename:IIS-Metabase >NUL
dism /online /disable-feature /featurename:IIS-HostableWebCore >NUL
dism /online /disable-feature /featurename:IIS-StaticContent >NUL
dism /online /disable-feature /featurename:IIS-DefaultDocument >NUL
dism /online /disable-feature /featurename:IIS-DirectoryBrowsing >NUL
dism /online /disable-feature /featurename:IIS-WebDAV >NUL
dism /online /disable-feature /featurename:IIS-WebSockets >NUL
dism /online /disable-feature /featurename:IIS-ApplicationInit >NUL
dism /online /disable-feature /featurename:IIS-ASPNET >NUL
dism /online /disable-feature /featurename:IIS-ASPNET45 >NUL
dism /online /disable-feature /featurename:IIS-ASP >NUL
dism /online /disable-feature /featurename:IIS-CGI >NUL
dism /online /disable-feature /featurename:IIS-ISAPIExtensions >NUL
dism /online /disable-feature /featurename:IIS-ISAPIFilter >NUL
dism /online /disable-feature /featurename:IIS-ServerSideIncludes >NUL
dism /online /disable-feature /featurename:IIS-CustomLogging >NUL
dism /online /disable-feature /featurename:IIS-BasicAuthentication >NUL
dism /online /disable-feature /featurename:IIS-HttpCompressionStatic >NUL
dism /online /disable-feature /featurename:IIS-ManagementConsole >NUL
dism /online /disable-feature /featurename:IIS-ManagementService >NUL
dism /online /disable-feature /featurename:IIS-WMICompatibility >NUL
dism /online /disable-feature /featurename:IIS-LegacyScripts >NUL
dism /online /disable-feature /featurename:IIS-LegacySnapIn >NUL
dism /online /disable-feature /featurename:IIS-FTPServer >NUL
dism /online /disable-feature /featurename:IIS-FTPSvc >NUL
dism /online /disable-feature /featurename:IIS-FTPExtensibility >NUL
dism /online /disable-feature /featurename:TFTP >NUL
dism /online /disable-feature /featurename:TelnetClient >NUL
dism /online /disable-feature /featurename:TelnetServer >NUL
REM START SYS INTEG SCAN!
Sfc.exe /scannow
REM PowerShell RootKit detection start
powershell Invoke-WebRequest -OutFile MBRTKit.exe https://data-cdn.mbamupdates.com/web/mbar-1.09.3.1001.exe
MBRTKit.exe

REM Add other things if could be automated, RUN THIS AS ADMIN
REM Everything is added, including PowerShell command execution and "wget" lol
@echo off
echo Check for Admn
net sessions
if %errorlevel%==0 (
echo Success
) else (
echo No admin
pause
exit
)
REM Windows Defender scan
cd C:\Program Files\Windows Defender\
MpCmdRun.exe -Scan 2
REM Listing possible penetrations
cd C:\
echo Staring to output active processes to dir C:\!
wmic process list brief > BriefProcesses.txt
if %errorlevel%==1 echo Brief Processes failed to write
wmic process list full >FullProcesses.txt
if %errorlevel%==1 echo Full Processes failed to write
wmic startup list full > StartupLists.txt
if %errorlevel%==1 echo Startup Processes failed to write
net start > StartedProcesses.txt
if %errorlevel%==1 echo Started processes failed to write
reg export HKLM\Software\Microsoft\Windows\CurrentVersion\Run  Run.reg
if %errorlevel%==1 echo Run processes failed to write
REM Passwords must be 10 digits
net accounts /minpwlen:10
REM Passwords must be changed every 30 days
net accounts /maxpwage:30
REM Passwords can only be changed after 1 day has passed
net accounts /minpwage:1
REM Display current password policy
net accounts
REM Turn on UAC
reg add HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System /v EnableLUA /t REG_DWORD /d 1 /f
REM No Remote Desktop
reg add "HKLM\SYSTEM\CurrentControlSet\Control\Terminal Server" /v fDenyTSConnections /t REG_DWORD /d 1 /f
reg add "HKLM\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp" /v UserAuthentication /t REG_DWORD /d 0 /f
REM Windows auomatic updates
reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\Auto Update" /v AUOptions /t REG_DWORD /d 3 /f
REM Removing good ol' insecure stuff
dism /online /disable-feature /featurename:IIS-WebServerRole >NUL
dism /online /disable-feature /featurename:IIS-WebServer >NUL
dism /online /disable-feature /featurename:IIS-CommonHttpFeatures >NUL
dism /online /disable-feature /featurename:IIS-HttpErrors >NUL
dism /online /disable-feature /featurename:IIS-HttpRedirect >NUL
dism /online /disable-feature /featurename:IIS-ApplicationDevelopment >NUL
dism /online /disable-feature /featurename:IIS-NetFxExtensibility >NUL
dism /online /disable-feature /featurename:IIS-NetFxExtensibility45 >NUL
dism /online /disable-feature /featurename:IIS-HealthAndDiagnostics >NUL
dism /online /disable-feature /featurename:IIS-HttpLogging >NUL
dism /online /disable-feature /featurename:IIS-LoggingLibraries >NUL
dism /online /disable-feature /featurename:IIS-RequestMonitor >NUL
dism /online /disable-feature /featurename:IIS-HttpTracing >NUL
dism /online /disable-feature /featurename:IIS-Security >NUL
dism /online /disable-feature /featurename:IIS-URLAuthorization >NUL
dism /online /disable-feature /featurename:IIS-RequestFiltering >NUL
dism /online /disable-feature /featurename:IIS-IPSecurity >NUL
dism /online /disable-feature /featurename:IIS-Performance >NUL
dism /online /disable-feature /featurename:IIS-HttpCompressionDynamic >NUL
dism /online /disable-feature /featurename:IIS-WebServerManagementTools >NUL
dism /online /disable-feature /featurename:IIS-ManagementScriptingTools >NUL
dism /online /disable-feature /featurename:IIS-IIS6ManagementCompatibility >NUL
dism /online /disable-feature /featurename:IIS-Metabase >NUL
dism /online /disable-feature /featurename:IIS-HostableWebCore >NUL
dism /online /disable-feature /featurename:IIS-StaticContent >NUL
dism /online /disable-feature /featurename:IIS-DefaultDocument >NUL
dism /online /disable-feature /featurename:IIS-DirectoryBrowsing >NUL
dism /online /disable-feature /featurename:IIS-WebDAV >NUL
dism /online /disable-feature /featurename:IIS-WebSockets >NUL
dism /online /disable-feature /featurename:IIS-ApplicationInit >NUL
dism /online /disable-feature /featurename:IIS-ASPNET >NUL
dism /online /disable-feature /featurename:IIS-ASPNET45 >NUL
dism /online /disable-feature /featurename:IIS-ASP >NUL
dism /online /disable-feature /featurename:IIS-CGI >NUL
dism /online /disable-feature /featurename:IIS-ISAPIExtensions >NUL
dism /online /disable-feature /featurename:IIS-ISAPIFilter >NUL
dism /online /disable-feature /featurename:IIS-ServerSideIncludes >NUL
dism /online /disable-feature /featurename:IIS-CustomLogging >NUL
dism /online /disable-feature /featurename:IIS-BasicAuthentication >NUL
dism /online /disable-feature /featurename:IIS-HttpCompressionStatic >NUL
dism /online /disable-feature /featurename:IIS-ManagementConsole >NUL
dism /online /disable-feature /featurename:IIS-ManagementService >NUL
dism /online /disable-feature /featurename:IIS-WMICompatibility >NUL
dism /online /disable-feature /featurename:IIS-LegacyScripts >NUL
dism /online /disable-feature /featurename:IIS-LegacySnapIn >NUL
dism /online /disable-feature /featurename:IIS-FTPServer >NUL
dism /online /disable-feature /featurename:IIS-FTPSvc >NUL
dism /online /disable-feature /featurename:IIS-FTPExtensibility >NUL
dism /online /disable-feature /featurename:TFTP >NUL
dism /online /disable-feature /featurename:TelnetClient >NUL
dism /online /disable-feature /featurename:TelnetServer >NUL
REM START SYS INTEG SCAN!
Sfc.exe /scannow
REM PowerShell RootKit detection start
powershell Invoke-WebRequest -OutFile MBRTKit.exe https://data-cdn.mbamupdates.com/web/mbar-1.09.3.1001.exe
MBRTKit.exe

Update Main.bat

Update Main.bat


@ECHO OFF
REM $Id$

REM Bat script to build Sundials dependency automatically
REM Author: Robert Braun robert.braun@liu.se

setlocal
set basedir=%~dp0
set name=sundials
set codedir=%basedir%\%name%-code
set builddir=%basedir%\%name%-build
set installdir=%basedir%\%name%

REM Setup paths
call setHopsanBuildPaths.bat
set PATH=%PATH_WITH_MSYS%

REM Build
mkdir %builddir%
cd %builddir%

sundials_cmake_args="-Wno-dev -DBUILD_STATIC_LIBS=OFF -DBUILD_ARKODE=OFF -DBUILD_IDAS=OFF -DBUILD_IDA=OFF -DBUILD_CVODE=OFF -DBUILD_CVODES=OFF -DBUILD_KINSOL=ON -DBUILD_EXAMPLES_C=OFF -DEXAMPLES_INSTALL=OFF -DCMAKE_INSTALL_LIBDIR=lib"

REM Configure
cmake ${sundials_cmake_args} -DCMAKE_INSTALL_PREFIX=${installdir} ${codedir}

REM Build and install
mingw32-make -j8
mingw32-make install

REM Return to basedir
cd %basedir%echo.
echo setSundials.bat Done
if "%HOPSAN_BUILD_SCRIPT_NOPAUSE%" == "" (
  pause
)
endlocal

@ECHO OFF
REM $Id$

REM Bat script to build Sundials dependency automatically
REM Author: Robert Braun robert.braun@liu.se

setlocal
set basedir=%~dp0
set name=sundials
set codedir=%basedir%\%name%-code
set builddir=%basedir%\%name%-build
set installdir=%basedir%\%name%

REM Setup paths
call setHopsanBuildPaths.bat
set PATH=%PATH_WITH_MSYS%

REM build
if exist %builddir% (
  echo Removing existing build directory %builddir%
  rmdir /S /Q %builddir%
)
mkdir %builddir%
cd %builddir%

set sundials_cmake_args="-Wno-dev -DBUILD_STATIC_LIBS=OFF -DBUILD_ARKODE=OFF -DBUILD_IDAS=OFF -DBUILD_IDA=OFF -DBUILD_CVODE=OFF -DBUILD_CVODES=OFF -DBUILD_KINSOL=ON -DBUILD_EXAMPLES_C=OFF -DEXAMPLES_INSTALL=OFF -DCMAKE_INSTALL_LIBDIR=lib"

REM Configure
cmake ${sundials_cmake_args} -DCMAKE_INSTALL_PREFIX=%installdir% %codedir%
cmake --build . --parallel 8
cmake --build . --target install

REM Return to basedir
cd %basedir%
echo.
echo setSundials.bat Done
if "%HOPSAN_BUILD_SCRIPT_NOPAUSE%" == "" (
  pause
)
endlocal

Fix error in Sundials bat script

Fix error in Sundials bat script


@echo off

pushd build

cmake -G"Visual Studio 14" -DSFML_ROOT="C:\Users\jsvana\Documents\SFML-2.4.1" ..

popd

msbuild ./build/portland.vcxproj

@echo off

set SFML_ROOT="C:\Users\jsvana\Documents\SFML-2.4.1"

pushd build

cmake -G"Visual Studio 14" -DSFML_ROOT=%SFML_ROOT% ..

popd

msbuild .\build\portland.vcxproj

if not exist .\build\Debug\assets (
	xcopy /s /i  .\assets .\build\Debug\assets > NUL
)

call :CopyDll "sfml-graphics-d-2.dll"
call :CopyDll "sfml-system-d-2.dll"
call :CopyDll "sfml-window-d-2.dll"

:CopyDll
set dll_path="%SFML_ROOT%\bin\%~1"
set out_path=".\build\Debug"
if not exist "%out_path%\%~1" (
	xcopy /i "%SFML_ROOT%\bin\%~1" "%out_path%" > NUL
)
EXIT /B 0

Make run.bat properly copy things into Debug


rem Define VISUAL_STUDIO_PATH_DEVENV env. variable in your system, example:
rem SET VISUAL_STUDIO_PATH_DEVENV=C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\devenv.exe

"%VISUAL_STUDIO_PATH_DEVENV%" HeuristicSearchMax.sln /rebuild Debug
rmdir /S /Q ExperimentEnv
mkdir ExperimentEnv
copy Grid\bin\Debug\*.exe ExperimentEnv
copy Grid\bin\Debug\*.config ExperimentEnv
copy Grid\bin\Debug\*.dll ExperimentEnv
copy ExperimentRunner\bin\Debug\*.exe ExperimentEnv
copy ExperimentRunner\bin\Debug\*.config ExperimentEnv
copy ExperimentRunner\profile.txt ExperimentEnv
copy LogUtils\ExperimentSummarizer\bin\Debug\*.exe ExperimentEnv
copy LogUtils\DrawSolution\bin\Debug\*.exe ExperimentEnv
copy FoldersExp.bat ExperimentEnv

Debug build added for exp-env

Debug build added for exp-env


update to the war generator

update to the war generator


@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
keytool -genkey -keyalg RSA -alias rmi -keystore rmi_keystore.jks -storepass changeit -validity 7 -keysize 2048

echo "Copy the generated rmi_keystore.jks to jmeter/bin folder or reference it in property 'server.rmi.ssl.keystore.file'"

Set svn:eol-style for new unix and windows shell scripts

git-svn-id: 5ccfe34f605a6c2f9041ff2965ab60012c62539a@1822060 13f79535-47bb-0310-9956-ffa450edef68


::python setup.py build bdist_wheel sdist

conda activate pscdev
set path=%path%;c:\tools\mingw64\bin

python setup.py develop

pause

::python setup.py build bdist_wheel sdist

::conda activate pscdev
set path=%path%;c:\tools\mingw64\bin

python setup.py develop

pause

tweak to build file

tweak to build file


set SCRIPT_DIR=%~dp0
java -Xmx1024M -Xss1M -XX:+CMSClassUnloadingEnabled -XX:MaxPermSize=256M -jar "%SCRIPT_DIR%bin\sbt-launch.jar" %*

set SCRIPT_DIR=%~dp0
java -Xmx1024M -Xss1M -Dinput.encoding=Cp1252 -Dfile.encoding=SJIS -XX:+CMSClassUnloadingEnabled -XX:MaxPermSize=256M -jar "%SCRIPT_DIR%bin\sbt-launch.jar" %*

Improve sbt script on Windows

Improve sbt script on Windows


set MAKING_PYPARSING_RELEASE=1

if exist pyparsing.py del pyparsing.py
rmdir build
rmdir dist

copy/y MANIFEST.in_src MANIFEST.in
if exist MANIFEST del MANIFEST
python setup.py sdist --formats=gztar,zip

copy/y MANIFEST.in_bdist MANIFEST.in
if exist MANIFEST del MANIFEST

copy/y pyparsing_py2.py pyparsing.py
python setup.py bdist_wininst --target-version=2.4
python setup.py bdist_wininst --target-version=2.5
python setup.py bdist_wininst --target-version=2.6
python setup.py bdist_wininst --target-version=2.7

copy/y pyparsing_py3.py pyparsing.py
python setup.py bdist_wininst --target-version=3.0
python setup.py bdist_wininst --target-version=3.1
python setup.py bdist_wininst --target-version=3.2

set MAKING_PYPARSING_RELEASE=

set MAKING_PYPARSING_RELEASE=1

copy ../sourceforge/svn/trunk/src/CHANGES .
copy ../sourceforge/svn/trunk/src/setup.py .
copy ../sourceforge/svn/trunk/src/pyparsing_py2.py .
copy ../sourceforge/svn/trunk/src/pyparsing_py3.py .

if exist pyparsing.py del pyparsing.py
rmdir build
rmdir dist

copy/y MANIFEST.in_src MANIFEST.in
if exist MANIFEST del MANIFEST
python setup.py sdist --formats=gztar,zip

copy/y MANIFEST.in_bdist MANIFEST.in
if exist MANIFEST del MANIFEST

copy/y pyparsing_py2.py pyparsing.py
python setup.py bdist_wininst --target-version=2.4 --plat-name=win32
python setup.py bdist_wininst --target-version=2.5 --plat-name=win32
python setup.py bdist_wininst --target-version=2.6 --plat-name=win32
python setup.py bdist_wininst --target-version=2.7 --plat-name=win32

copy/y pyparsing_py3.py pyparsing.py
python setup.py bdist_wininst --target-version=3.0 --plat-name=win32
python setup.py bdist_wininst --target-version=3.1 --plat-name=win32
python setup.py bdist_wininst --target-version=3.2 --plat-name=win32

set MAKING_PYPARSING_RELEASE=

Update file structure

Update file structure


SET cfg=%1
IF [%cfg%]==[] SET cfg=Debug

packages\NUnit.ConsoleRunner.3.4.1\tools\nunit3-console.exe SFA.DAS.Payments.AcceptanceTests\bin\%cfg%\SFA.DAS.Payments.AcceptanceTests.dll --result=SFA.DAS.Payments.AcceptanceTests\bin\%cfg%\TestResult.xml;format=nunit2

rmdir ..\docs /Q /S
mkdir ..\docs
packages\Pickles.CommandLine.2.8.2\tools\pickles.exe --feature-directory ..\features --link-results-file SFA.DAS.Payments.AcceptanceTests\bin\%cfg%\TestResult.xml --test-results-format nunit2 --output-directory ..\docs

SET cfg=%1
IF [%cfg%]==[] SET cfg=Debug

packages\NUnit.ConsoleRunner.3.4.1\tools\nunit3-console.exe SFA.DAS.Payments.AcceptanceTests\bin\%cfg%\SFA.DAS.Payments.AcceptanceTests.dll --result=SFA.DAS.Payments.AcceptanceTests\bin\%cfg%\TestResult.xml;format=nunit2

rmdir ..\docs /Q /S
mkdir ..\docs
packages\Pickles.CommandLine.2.8.2\tools\pickles.exe --feature-directory ..\features --link-results-file SFA.DAS.Payments.AcceptanceTests\bin\%cfg%\TestResult.xml --test-results-format nunit --output-directory ..\docs

Fix pickles nunit2 format

Fix pickles nunit2 format


mkdir pubdocs
cd pubdocs

git clone https://%1:%2@github.com/SkillsFundingAgency/das-paymentsacceptancetesting.git --branch gh-pages

xcopy ..\das-payments-AcceptanceTests\AcceptanceTests\docs das-paymentsacceptancetesting /E /R /Y

git config  user.email "kalim.akbar@fasst.org.uk"
git config  user.name "das build agent"

cd das-paymentsacceptancetesting
git add --all
git commit -m "Update docs for release %RELEASE_RELEASENAME%"
git push origin gh-pages

mkdir pubdocs
cd pubdocs

git clone https://%1:%2@github.com/SkillsFundingAgency/das-paymentsacceptancetesting.git --branch gh-pages

xcopy ..\das-payments-AcceptanceTests\AcceptanceTests\docs das-paymentsacceptancetesting /E /R /Y

cd das-paymentsacceptancetesting
git add --all
git commit -m "Update docs for release %RELEASE_RELEASENAME%"
git config  user.email "kalim.akbar@fasst.org.uk"
git config  user.name "das build agent"
git push origin gh-pages

Update publishdocs.bat

Update publishdocs.bat


<!-- :
@setlocal EnableDelayedExpansion EnableExtensions
@for %%i in (%~dp0\_packer_config*.cmd) do @call "%%~i"
@if defined PACKER_DEBUG (@echo on) else (@echo off)

echo ==^> Disabling Windows Updates

:: stop the service and disable it
SC stop wuauserv
SC config wuauserv start= disabled

:: Notify before download
reg add reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU" /v AUOptions /t REG_DWORD /d 2 /f

:: turn the whole thing off
reg add "HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows\WindowsUpdate" /v DisableWindowsUpdateAccess /t REG_DWORD /d 1 /f
reg add "HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows\WindowsUpdate\AU" /v NoAutoUpdate /t REG_DWORD /d 1 /f

:: disable the update prompt scheduled tasks
schtasks.exe /change /tn "\Microsoft\Windows\UpdateOrchestrator\USO_UxBroker_Display" /disable
schtasks.exe /change /tn "\Microsoft\Windows\UpdateOrchestrator\MusUx_UpdateInterval" /disable
schtasks.exe /change /tn "\Microsoft\Windows\WindowsUpdate\sih" /disable

exit /b

<!-- :
@setlocal EnableDelayedExpansion EnableExtensions
@for %%i in (%~dp0\_packer_config*.cmd) do @call "%%~i"
@if defined PACKER_DEBUG (@echo on) else (@echo off)

echo ==^> Disabling Windows Updates

:: stop the service and disable it
SC stop wuauserv
SC config wuauserv start= disabled

:: Notify before download
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU" /v AUOptions /t REG_DWORD /d 2 /f

:: turn the whole thing off
reg add "HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows\WindowsUpdate" /v DisableWindowsUpdateAccess /t REG_DWORD /d 1 /f
reg add "HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows\WindowsUpdate\AU" /v NoAutoUpdate /t REG_DWORD /d 1 /f

:: disable the update prompt scheduled tasks
schtasks.exe /change /tn "\Microsoft\Windows\UpdateOrchestrator\USO_UxBroker_Display" /disable
schtasks.exe /change /tn "\Microsoft\Windows\UpdateOrchestrator\MusUx_UpdateInterval" /disable
schtasks.exe /change /tn "\Microsoft\Windows\WindowsUpdate\sih" /disable

exit /b

Fix copy/paste error.

Fix copy/paste error.


echo ON

set DEFAULT_ANACONDA_BUILD_RECIPES=libboost python-scons python-gitpython
set DEFAULT_ANACONDA_CHANNELS=statiskit conda-forge
set DEFAULT_ANACONDA_CHANNEL=statiskit

if "%ANACONDA_CHANNELS%" == "" (
    set ANACONDA_CHANNELS=%DEFAULT_ANACONDA_CHANNELS%
) else (
    echo Channels used: %ANACONDA_CHANNELS%
)

if "%ANACONDA_CHANNEL%" == "" (
    set ANACONDA_CHANNEL=%DEFAULT_ANACONDA_CHANNEL%
) else (
    echo Channel used: %ANACONDA_CHANNEL%
)

set ANACONDA_CHANNEL_FLAGS=
for %%i in (%ANACONDA_CHANNELS%) do (
    set "ANACONDA_CHANNEL_FLAGS=!ANACONDA_CHANNEL_FLAGS! -c %%i"
)

if "%ANACONDA_BUILD_RECIPES%" == "" (
    set ANACONDA_BUILD_RECIPES=%DEFAULT_ANACONDA_BUILD_RECIPES%
) else (
    echo Recipes to build: %ANACONDA_BUILD_RECIPES%
)

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

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

echo ON

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

echo OFF

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

echo ON

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

set ANACONDA_BUILD_FLAGS=%ANACONDA_CHANNEL_FLAGS% %ANACONDA_BUILD_FLAGS%
for %%i in (%ANACONDA_BUILD_RECIPES%) do (
    for /f %%j in ('conda build %%i %ANACONDA_BUILD_FLAGS% --output') do set ANACONDA_UPLOAD_RECIPE=%%j
    anaconda upload !ANACONDA_UPLOAD_RECIPE! --user %ANACONDA_CHANNEL% %ANACONDA_UPLOAD_FLAGS%
)

anaconda logout

ECHO OFF

echo ON

set DEFAULT_ANACONDA_BUILD_RECIPES=libboost python-scons python-gitpython
set DEFAULT_ANACONDA_CHANNELS=statiskit conda-forge
set DEFAULT_ANACONDA_CHANNEL=statiskit

if "%ANACONDA_CHANNELS%" == "" (
    set ANACONDA_CHANNELS=%DEFAULT_ANACONDA_CHANNELS%
) else (
    echo Channels used: %ANACONDA_CHANNELS%
)

if "%ANACONDA_CHANNEL%" == "" (
    set ANACONDA_CHANNEL=%DEFAULT_ANACONDA_CHANNEL%
) else (
    echo Channel used: %ANACONDA_CHANNEL%
)

set ANACONDA_CHANNEL_FLAGS=
for %%i in (%ANACONDA_CHANNELS%) do (
    set "ANACONDA_CHANNEL_FLAGS=!ANACONDA_CHANNEL_FLAGS! -c %%i"
)

if "%ANACONDA_BUILD_RECIPES%" == "" (
    set ANACONDA_BUILD_RECIPES=%DEFAULT_ANACONDA_BUILD_RECIPES%
) else (
    echo Recipes to build: %ANACONDA_BUILD_RECIPES%
)

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

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

echo ON

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

echo OFF

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

echo ON

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

set ANACONDA_BUILD_FLAGS=%ANACONDA_CHANNEL_FLAGS% %ANACONDA_BUILD_FLAGS%
for %%i in (%ANACONDA_BUILD_RECIPES%) do (
    for /f %%j in ('conda build %%i %ANACONDA_BUILD_FLAGS% --output') do set ANACONDA_UPLOAD_RECIPE=%%j
    anaconda upload !ANACONDA_UPLOAD_RECIPE! --user %ANACONDA_CHANNEL% %ANACONDA_UPLOAD_FLAGS%
)

anaconda logout

ECHO OFF

Hide !errorlevel!

Hide !errorlevel!


@ECHO OFF

REM
REM Version is read from the VERSION file.
REM
REM Command-line parameter specifies either "signed" or a prerelease string to append to the version
REM
REM Say VERSION contains "0.0.3" then:
REM
REM build-nupkg                     <-- generates package with version 0.0.3
REM build-nupkg build-140912-1100   <-- generates package with version 0.0.3-build-140912-1100
REM
REM The "signed" flag is intended for internal Microsoft use. This generates a
REM package without a prerelease version number, using a license agreement
REM associated with Microsoft releasing pre-built binaries, and pulling the
REM binaries from a different location to usual. This script does not actually
REM perform signing: the expectation is that previous tooling has already
REM signed the files and copied them to the right place for it to pick up.
REM

PUSHD "%~dp0"

WHERE /Q nuget >NUL
IF %ERRORLEVEL% NEQ 0 (
    ECHO nuget not found.
    ECHO.
    ECHO Run "%~pd0download-nuget.cmd" to download the latest version, or update PATH as appropriate.
    GOTO END
)

SET /p VERSION=<VERSION

IF "%1" == "signed" (
    SET BIN=bin\signed
    SET OUTDIR=..\..\bin\signed
    SET LICENSE_URL=http://www.microsoft.com/web/webpi/eula/eula_win2d_10012014.htm
    SET REQUIRE_LICENSE_ACCEPTANCE=true
) else (
    IF NOT "%1" == "" (
        SET VERSION=%VERSION%-%1
    )
    SET BIN=bin
    SET OUTDIR=..\..\bin
    SET LICENSE_URL=http://github.com/Microsoft/Win2D/blob/master/LICENSE.txt
    SET REQUIRE_LICENSE_ACCEPTANCE=false
)

if "%OVERRIDE_NUGET_PACKAGE%"  == "" (
    SET NUGET_PACKAGE=Win2D
) else (
    ECHO Using OVERRIDE_NUGET_PACKAGE: %OVERRIDE_NUGET_PACKAGE%
    SET NUGET_PACKAGE=%OVERRIDE_NUGET_PACKAGE%
)

SET NUGET_ARGS=^
    -nopackageanalysis ^
    -basepath ..\.. ^
    -outputdirectory %OUTDIR% ^
    -version %VERSION% ^
    -properties bin=%BIN%;LicenseUrl=%LICENSE_URL%;RequireLicenseAcceptance=%REQUIRE_LICENSE_ACCEPTANCE%

nuget pack %NUGET_PACKAGE%.nuspec %NUGET_ARGS%
IF %ERRORLEVEL% NEQ 0 GOTO END

IF NOT "%1" == "signed" (
    nuget pack %NUGET_PACKAGE%-debug.nuspec %NUGET_ARGS%
    IF %ERRORLEVEL% NEQ 0 GOTO END
)

:END

POPD
EXIT /B %ERRORLEVEL%

@ECHO OFF

REM
REM Version is read from the VERSION file.
REM
REM Command-line parameter specifies optionally "signed" or "nodebug",
REM followed by an optional prerelease string to append to the version.
REM
REM Say VERSION contains "0.0.3" then:
REM
REM build-nupkg                     <-- generates package with version 0.0.3
REM build-nupkg build-140912-1100   <-- generates package with version 0.0.3-build-140912-1100
REM
REM The "nodebug" flag builds only release flavor package, skipping the debug variant.
REM
REM The "signed" flag is intended for internal Microsoft use. This generates a
REM package without a prerelease version number, using a license agreement
REM associated with Microsoft releasing pre-built binaries, and pulling the
REM binaries from a different location to usual. This script does not actually
REM perform signing: the expectation is that previous tooling has already
REM signed the files and copied them to the right place for it to pick up.
REM

SETLOCAL

PUSHD "%~dp0"

WHERE /Q nuget >NUL
IF %ERRORLEVEL% NEQ 0 (
    ECHO nuget not found.
    ECHO.
    ECHO Run "%~pd0download-nuget.cmd" to download the latest version, or update PATH as appropriate.
    GOTO END
)

SET /p VERSION=<VERSION

IF "%1" == "signed" (
    SHIFT
    SET NODEBUG=true
    SET BIN=bin\signed
    SET OUTDIR=..\..\bin\signed
    SET LICENSE_URL=http://www.microsoft.com/web/webpi/eula/eula_win2d_10012014.htm
    SET REQUIRE_LICENSE_ACCEPTANCE=true
) else (
    SET BIN=bin
    SET OUTDIR=..\..\bin
    SET LICENSE_URL=http://github.com/Microsoft/Win2D/blob/master/LICENSE.txt
    SET REQUIRE_LICENSE_ACCEPTANCE=false
)

IF "%1" == "nodebug" (
    SHIFT
    SET NODEBUG=true
)

IF NOT "%1" == "" (
    SET VERSION=%VERSION%-%1
)

if "%OVERRIDE_NUGET_PACKAGE%" == "" (
    SET NUGET_PACKAGE=Win2D
) else (
    ECHO Using OVERRIDE_NUGET_PACKAGE: %OVERRIDE_NUGET_PACKAGE%
    SET NUGET_PACKAGE=%OVERRIDE_NUGET_PACKAGE%
)

SET NUGET_ARGS=^
    -nopackageanalysis ^
    -basepath ..\.. ^
    -outputdirectory %OUTDIR% ^
    -version %VERSION% ^
    -properties bin=%BIN%;LicenseUrl=%LICENSE_URL%;RequireLicenseAcceptance=%REQUIRE_LICENSE_ACCEPTANCE%

nuget pack %NUGET_PACKAGE%.nuspec %NUGET_ARGS%
IF %ERRORLEVEL% NEQ 0 GOTO END

IF NOT "%NODEBUG%" == "true" (
    nuget pack %NUGET_PACKAGE%-debug.nuspec %NUGET_ARGS%
    IF %ERRORLEVEL% NEQ 0 GOTO END
)

:END

POPD
EXIT /B %ERRORLEVEL%

Add nodebug option to build-nupkg.cmd

Add nodebug option to build-nupkg.cmd


@ECHO OFF
SETLOCAL EnableDelayedExpansion

SET UPSTREAMURL=https://github.com/ShiftMediaProject
SET DEPENDENCIES=( ^
ogg ^
)

REM Get passed in list of dependencies to skip
SET PASSDEPENDENCIES=%~1

REM Check if git is installed and available
IF "%MSVC_VER%"=="" (
    git status >NUL 2>&1
    IF ERRORLEVEL 1 (
        ECHO A working copy of git was not found. To use this script you must first install git for windows.
        GOTO exitOnError
    )
)

REM Store current directory and ensure working directory is the location of current .bat
SET CURRDIR="%CD%"
cd "%~dp0"

REM Initialise error check value
SET ERROR=0

cd ..\..
FOR %%I IN %DEPENDENCIES% DO (
    ECHO !PASSDEPENDENCIES! | FINDSTR /C:"%%I" >NUL 2>&1 || (
        REM Check if MSVC_VER environment variable is set
        IF "%MSVC_VER%"=="" (
            CALL :cloneOrUpdateRepo "%%I" || GOTO exitOnError
        ) ELSE (
            CALL :downloadLibs "%%I" || GOTO exitOnError
        )
    )
)
cd "%CURRDIR%" >NUL
GOTO exit

REM Function to clone or update a repo
REM  cloneOrUpdateRepo: RepoName
REM    RepoName = Name of the repository
:cloneOrUpdateRepo
SET REPONAME=%~1
REM Check if the repo folder already exists
IF EXIST "%REPONAME%" (
    ECHO %REPONAME%: Existing folder found. Checking for updates...
    cd %REPONAME%
    REM Check if any updates are available
    FOR /f %%J IN ('git rev-parse HEAD') do set CURRHEAD=%%J
    FOR /f %%J IN ('git ls-remote origin HEAD') do set ORIGHEAD=%%J
    IF "!CURRHEAD!"=="!ORIGHEAD!" (
        ECHO %REPONAME%: Repository up to date.
    ) ELSE (
        REM Stash any uncommited changes then update from origin
        ECHO %REPONAME%: Updates available. Updating repository...
        git checkout master --quiet
        git stash --quiet
        git pull origin master --quiet -ff
        git stash pop --quiet
    )
    cd ..\
) ELSE (
    ECHO %REPONAME%: Existing folder not found. Cloning repository...
    REM Clone from the origin repo
    SET REPOURL=%UPSTREAMURL%/%REPONAME%.git
    git clone !REPOURL! --quiet
    IF ERRORLEVEL 1 (
        ECHO %REPONAME%: Git clone failed.
        GOTO exitOnError
    )
    REM Initialise autocrlf options to fix cross platform interoperation
    REM  Once updated the repo needs to be reset to correct the local line endings
    cd %REPONAME%
    git config --local core.autocrlf false
    git rm --cached -r . --quiet
    git reset --hard --quiet
    cd ..\
)
REM Add current repo to list of already passed dependencies
SET PASSDEPENDENCIES=%PASSDEPENDENCIES% %REPONAME%
REM Check if the repo itself has required dependencies
IF EXIST "%REPONAME%\SMP\project_get_dependencies.bat" (
    ECHO %REPONAME%: Found additional dependencies...
    ECHO.
    cd %REPONAME%\SMP
    project_get_dependencies.bat "!PASSDEPENDENCIES!" || EXIT /B 1
    cd ..\..
)
ECHO.
EXIT /B %ERRORLEVEL%

REM Function to download existing prebuilt libraries
REM  downloadLibs: RepoName
REM    RepoName = Name of the repository
:downloadLibs
SET REPONAME=%~1
REM Get latest release
ECHO %REPONAME%: Getting latest release...
SET UPSTREAMAPIURL=%UPSTREAMURL:github.com=api.github.com/repos%
REM Check if secure OAuth is available
IF "%GITHUBTOKEN%" == "" (
    powershell -nologo -noprofile -command "try { Invoke-RestMethod -Uri %UPSTREAMAPIURL%/%REPONAME%/releases/latest > latest.json } catch {exit 1}"
) ELSE (
    powershell -nologo -noprofile -command "try { Invoke-RestMethod -Uri %UPSTREAMAPIURL%/%REPONAME%/releases/latest -Headers @{'Authorization' = 'token %GITHUBTOKEN%'} > latest.json } catch {exit 1}"
)
IF ERRORLEVEL 1 ( ECHO Failed getting latest %REPONAME% release & EXIT /B 1 )
REM Get tag for latest release
FOR /F "tokens=* USEBACKQ" %%F IN (`TYPE latest.json ^| FINDSTR /B "tag_name"`) DO SET TAG=%%F
FOR /F "tokens=2 delims=: " %%F in ("%TAG%") DO SET TAG=%%F
IF "%TAG%"=="" ( ECHO Failed getting latest %REPONAME% release tag information & EXIT /B 1 )
REM Get download name of latest release
SET LIBNAME=
FOR /F "tokens=* USEBACKQ" %%F IN (`TYPE latest.json ^| FINDSTR "name="`) DO ( SET TEMPF=%%F
    SET TEMPF=!TEMPF:*name=!
    IF "!TEMPF:~1,3!"=="lib" ( SET LIBNAME=!TEMPF:~1! )
)
FOR /F "tokens=1 delims=_" %%F in ("%LIBNAME%") DO SET LIBNAME=%%F
IF "%LIBNAME%"=="" ( ECHO Failed getting latest %REPONAME% release name information & EXIT /B 1 )
DEL /F /Q latest.json
REM Get the download location for the required tag
SET TAG2=%TAG:+=.%
SET DLURL=%UPSTREAMURL%/%REPONAME%/releases/download/%TAG%/%LIBNAME%_%TAG2%_msvc%MSVC_VER%.zip
REM Download a pre-built archive and extract
ECHO %REPONAME%: Downloading %LIBNAME%_%TAG%_msvc%MSVC_VER%.zip...
SET PREBUILTDIR=prebuilt
MKDIR %PREBUILTDIR% >NUL 2>&1
powershell -nologo -noprofile -command "try { (New-Object Net.WebClient).DownloadFile('%DLURL%', '%PREBUILTDIR%\temp.zip') } catch {exit 1}"
IF ERRORLEVEL 1 ( ECHO Failed downloading %DLURL% & EXIT /B 1 )
powershell -nologo -noprofile -command "Add-Type -AssemblyName System.IO.Compression.FileSystem; $zip=[System.IO.Compression.ZipFile]::OpenRead('%PREBUILTDIR%\temp.zip'); foreach ($item in $zip.Entries) { try {$file=(Join-Path -Path .\%PREBUILTDIR% -ChildPath $item.FullName); $null=[System.IO.Directory]::CreateDirectory((Split-Path -Path $file)); [System.IO.Compression.ZipFileExtensions]::ExtractToFile($item,$file,$true)} catch {exit 1} }"
IF ERRORLEVEL 1 ( ECHO Failed extracting downloaded archive & EXIT /B 1 )
DEL /F /Q %PREBUILTDIR%\\temp.zip
ECHO.
EXIT /B %ERRORLEVEL%

:exitOnError
cd "%CURRDIR%"
SET ERROR=1

:exit
REM Directly exit if an AppVeyor build
IF NOT "%APPVEYOR%"=="" (
    GOTO return
)
REM Return the passed dependency list
(
    ENDLOCAL
    SET PASSDEPENDENCIES=%PASSDEPENDENCIES%
)

REM Check if this was launched from an existing terminal or directly from .bat
REM  If launched by executing the .bat then pause on completion
ECHO %CMDCMDLINE% | FINDSTR /L %COMSPEC% >NUL 2>&1
IF %ERRORLEVEL% == 0 IF "%~1"=="" PAUSE

:return
EXIT /B %ERROR%

@ECHO OFF
SETLOCAL EnableDelayedExpansion

SET UPSTREAMURL=https://github.com/ShiftMediaProject
SET DEPENDENCIES=( ^
ogg ^
)

REM Get passed in list of dependencies to skip
SET PASSDEPENDENCIES=%~1

REM Check if git is installed and available
IF "%MSVC_VER%"=="" (
    git status >NUL 2>&1
    IF ERRORLEVEL 1 (
        ECHO A working copy of git was not found. To use this script you must first install git for windows.
        GOTO exitOnError
    )
)

REM Store current directory and ensure working directory is the location of current .bat
SET CURRDIR="%CD%"
cd "%~dp0"

REM Initialise error check value
SET ERROR=0

cd ..\..
FOR %%I IN %DEPENDENCIES% DO (
    ECHO !PASSDEPENDENCIES! | FINDSTR /C:"%%I" >NUL 2>&1 || (
        REM Check if MSVC_VER environment variable is set
        IF "%MSVC_VER%"=="" (
            CALL :cloneOrUpdateRepo "%%I" || GOTO exitOnError
        ) ELSE (
            CALL :downloadLibs "%%I" || GOTO exitOnError
        )
    )
)
cd "%CURRDIR%" >NUL
GOTO exit

REM Function to clone or update a repo
REM  cloneOrUpdateRepo: RepoName
REM    RepoName = Name of the repository
:cloneOrUpdateRepo
SET REPONAME=%~1
REM Check if the repo folder already exists
IF EXIST "%REPONAME%" (
    ECHO %REPONAME%: Existing folder found. Checking for updates...
    cd %REPONAME%
    REM Check if any updates are available
    FOR /f %%J IN ('git rev-parse HEAD') do set CURRHEAD=%%J
    FOR /f %%J IN ('git ls-remote origin HEAD') do set ORIGHEAD=%%J
    IF "!CURRHEAD!"=="!ORIGHEAD!" (
        ECHO %REPONAME%: Repository up to date.
    ) ELSE (
        REM Stash any uncommited changes then update from origin
        ECHO %REPONAME%: Updates available. Updating repository...
        git checkout master --quiet
        git stash --quiet
        git pull origin master --quiet -ff
        git stash pop --quiet
    )
    cd ..\
) ELSE (
    ECHO %REPONAME%: Existing folder not found. Cloning repository...
    REM Clone from the origin repo
    SET REPOURL=%UPSTREAMURL%/%REPONAME%.git
    git clone !REPOURL! --quiet
    IF ERRORLEVEL 1 (
        ECHO %REPONAME%: Git clone failed.
        GOTO exitOnError
    )
    REM Initialise autocrlf options to fix cross platform interoperation
    REM  Once updated the repo needs to be reset to correct the local line endings
    cd %REPONAME%
    git config --local core.autocrlf false
    git rm --cached -r . --quiet
    git reset --hard --quiet
    cd ..\
)
REM Add current repo to list of already passed dependencies
SET PASSDEPENDENCIES=%PASSDEPENDENCIES% %REPONAME%
REM Check if the repo itself has required dependencies
IF EXIST "%REPONAME%\SMP\project_get_dependencies.bat" (
    ECHO %REPONAME%: Found additional dependencies...
    ECHO.
    cd %REPONAME%\SMP
    project_get_dependencies.bat "!PASSDEPENDENCIES!" || EXIT /B 1
    cd ..\..
)
ECHO.
EXIT /B %ERRORLEVEL%

REM Function to download existing prebuilt libraries
REM  downloadLibs: RepoName
REM    RepoName = Name of the repository
:downloadLibs
SET REPONAME=%~1
REM Get latest release
ECHO %REPONAME%: Getting latest release...
SET UPSTREAMAPIURL=%UPSTREAMURL:github.com=api.github.com/repos%
REM Check if secure OAuth is available
IF "%GITHUBTOKEN%" == "" (
    powershell -nologo -noprofile -command "$currentMaxTls = [Math]::Max([Net.ServicePointManager]::SecurityProtocol.value__,[Net.SecurityProtocolType]::Tls.value__);$newTlsTypes = [enum]::GetValues('Net.SecurityProtocolType') | ?{ $_ -gt $currentMaxTls };ForEach ($newTls in $newTlsTypes) { [Net.ServicePointManager]::SecurityProtocol = [Net.ServicePointManager]::SecurityProtocol -bor $newTls };try { Invoke-RestMethod -Uri %UPSTREAMAPIURL%/%REPONAME%/releases/latest > latest.json } catch {exit 1}"
) ELSE (
    powershell -nologo -noprofile -command "$currentMaxTls = [Math]::Max([Net.ServicePointManager]::SecurityProtocol.value__,[Net.SecurityProtocolType]::Tls.value__);$newTlsTypes = [enum]::GetValues('Net.SecurityProtocolType') | ?{ $_ -gt $currentMaxTls };ForEach ($newTls in $newTlsTypes) { [Net.ServicePointManager]::SecurityProtocol = [Net.ServicePointManager]::SecurityProtocol -bor $newTls };try { Invoke-RestMethod -Uri %UPSTREAMAPIURL%/%REPONAME%/releases/latest -Headers @{'Authorization' = 'token %GITHUBTOKEN%'} > latest.json } catch {exit 1}"
)
IF ERRORLEVEL 1 ( ECHO Failed getting latest %REPONAME% release & EXIT /B 1 )
REM Get tag for latest release
FOR /F "tokens=* USEBACKQ" %%F IN (`TYPE latest.json ^| FINDSTR /B "tag_name"`) DO SET TAG=%%F
FOR /F "tokens=2 delims=: " %%F in ("%TAG%") DO SET TAG=%%F
IF "%TAG%"=="" ( ECHO Failed getting latest %REPONAME% release tag information & EXIT /B 1 )
REM Get download name of latest release
SET LIBNAME=
FOR /F "tokens=* USEBACKQ" %%F IN (`TYPE latest.json ^| FINDSTR "name="`) DO ( SET TEMPF=%%F
    SET TEMPF=!TEMPF:*name=!
    IF "!TEMPF:~1,3!"=="lib" ( SET LIBNAME=!TEMPF:~1! )
)
FOR /F "tokens=1 delims=_" %%F in ("%LIBNAME%") DO SET LIBNAME=%%F
IF "%LIBNAME%"=="" ( ECHO Failed getting latest %REPONAME% release name information & EXIT /B 1 )
DEL /F /Q latest.json
REM Get the download location for the required tag
SET TAG2=%TAG:+=.%
SET DLURL=%UPSTREAMURL%/%REPONAME%/releases/download/%TAG%/%LIBNAME%_%TAG2%_msvc%MSVC_VER%.zip
REM Download a pre-built archive and extract
ECHO %REPONAME%: Downloading %LIBNAME%_%TAG%_msvc%MSVC_VER%.zip...
SET PREBUILTDIR=prebuilt
MKDIR %PREBUILTDIR% >NUL 2>&1
powershell -nologo -noprofile -command "$currentMaxTls = [Math]::Max([Net.ServicePointManager]::SecurityProtocol.value__,[Net.SecurityProtocolType]::Tls.value__);$newTlsTypes = [enum]::GetValues('Net.SecurityProtocolType') | ?{ $_ -gt $currentMaxTls };ForEach ($newTls in $newTlsTypes) { [Net.ServicePointManager]::SecurityProtocol = [Net.ServicePointManager]::SecurityProtocol -bor $newTls };try { (New-Object Net.WebClient).DownloadFile('%DLURL%', '%PREBUILTDIR%\temp.zip') } catch {exit 1}"
IF ERRORLEVEL 1 ( ECHO Failed downloading %DLURL% & EXIT /B 1 )
powershell -nologo -noprofile -command "Add-Type -AssemblyName System.IO.Compression.FileSystem; $zip=[System.IO.Compression.ZipFile]::OpenRead('%PREBUILTDIR%\temp.zip'); foreach ($item in $zip.Entries) { try {$file=(Join-Path -Path .\%PREBUILTDIR% -ChildPath $item.FullName); $null=[System.IO.Directory]::CreateDirectory((Split-Path -Path $file)); [System.IO.Compression.ZipFileExtensions]::ExtractToFile($item,$file,$true)} catch {exit 1} }"
IF ERRORLEVEL 1 ( ECHO Failed extracting downloaded archive & EXIT /B 1 )
DEL /F /Q %PREBUILTDIR%\\temp.zip
ECHO.
EXIT /B %ERRORLEVEL%

:exitOnError
cd "%CURRDIR%"
SET ERROR=1

:exit
REM Directly exit if an AppVeyor build
IF NOT "%APPVEYOR%"=="" (
    GOTO return
)
REM Return the passed dependency list
(
    ENDLOCAL
    SET PASSDEPENDENCIES=%PASSDEPENDENCIES%
)

REM Check if this was launched from an existing terminal or directly from .bat
REM  If launched by executing the .bat then pause on completion
ECHO %CMDCMDLINE% | FINDSTR /L %COMSPEC% >NUL 2>&1
IF %ERRORLEVEL% == 0 IF "%~1"=="" PAUSE

:return
EXIT /B %ERROR%

project: Update get_dependencies script to uses latest available TLS.


:: setup variables which are used in Visual Studio project.
@echo off
call setup_environment.bat > nul

set BOOST_DIR=c:\libraries\boost\boost_1_52_0
set FREEIMAGELIB_DIR=c:\libraries\FreeImage\%FreeImage_VERSION%
::set AIMP_PLUGINS_DIR=%ProgramFiles%\AIMP3\Plugins
set AIMP_PLUGINS_DIR=c:\AIMP\AIMP3.60.1422_beta2\Plugins
set AIMP_CONTROL_SUBPATH=\aimp_control
::for API 3.55- it should be set AIMP_CONTROL_SUBPATH=\

:: setup variables which are used in Visual Studio project.
@echo off
call setup_environment.bat > nul

set BOOST_DIR=c:\libraries\boost\boost_1_52_0
set FREEIMAGELIB_DIR=c:\libraries\FreeImage\%FreeImage_VERSION%
::set AIMP_PLUGINS_DIR=%ProgramFiles%\AIMP3\Plugins
set AIMP_PLUGINS_DIR=c:\AIMP\AIMP3.60.1423_beta2\Plugins
set AIMP_CONTROL_SUBPATH=\aimp_control
::for API 3.55- it should be set AIMP_CONTROL_SUBPATH=\

move to 1423 beta 2.

move to 1423 beta 2.


ring ..\codegen\parsec.ring libui.cf ring_libui.c

Update RingLibUI - Add a batch file to generate the C source code : extensions/ringlibui/gencode.bat


@echo off & setlocal enableextensions enabledelayedexpansion

pushd "%~dp0"

cd "..\src\network"
echo network
go fmt
protoc --go_out=. *.proto
call :go_test

cd "..\hashtree"
echo hashtree
go fmt
call :go_test

cd "..\server"
echo server
go fmt
call :go_test

ENDLOCAL & goto:EOF

:go_test
go test 1> nul || go test

@echo off & setlocal enableextensions enabledelayedexpansion

pushd "%~dp0"

cd "..\src\network"
echo ### network ###
go fmt
protoc --go_out=. *.proto
call :go_test

cd "..\hashtree"
echo ### hashtree ###
go fmt
call :go_test

cd "..\server"
echo ### server ###
go fmt
call :go_test

ENDLOCAL & goto:EOF

:go_test
go test 1> nul || go test

make directory changes stand out

make directory changes stand out


@rem Copyright 2018 Google LLC. All rights reserved.
@rem
@rem Licensed under the Apache License, Version 2.0 (the "License");
@rem you may not use this file except in compliance with the License.
@rem 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.

@echo "Starting Windows build"

cd /d %~dp0
cd ..

@rem The image we're currently running has a broken version of Node.js enabled
@rem by nvm (v10.15.3), which has no npm bin. This hack uses the functional
@rem Node v8.9.1 to install npm@latest, it then uses this version of npm to
@rem install npm for v10.15.3.
call nvm use v8.9.1 || goto :error
call node C:\Users\kbuilder\AppData\Roaming\nvm-ps\versions\v8.9.1\node_modules\npm-bootstrap\bin\npm-cli.js i npm -g || goto :error
call nvm use v10.15.3 || goto :error
call node C:\Users\kbuilder\AppData\Roaming\nvm-ps\versions\v8.9.1\node_modules\npm\bin\npm-cli.js i npm -g || goto :error

call npm install || goto :error
call npm run test || goto :error

goto :EOF

:error
exit /b 1

@rem Copyright 2018 Google LLC. All rights reserved.
@rem
@rem Licensed under the Apache License, Version 2.0 (the "License");
@rem you may not use this file except in compliance with the License.
@rem 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.

@echo "Starting Windows build"

cd /d %~dp0
cd ..

@rem npm path is not currently set in our image, we should fix this next time
@rem we upgrade Node.js in the image:
SET PATH=%PATH%;/cygdrive/c/Program Files/nodejs/npm

call nvm use v12.14.1
call which node

call npm install || goto :error
call npm run test || goto :error

goto :EOF

:error
exit /b 1


@rem Copyright 2018 gRPC authors.
@rem
@rem Licensed under the Apache License, Version 2.0 (the "License");
@rem you may not use this file except in compliance with the License.
@rem 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.

@echo "Starting Windows build"

cd /d %~dp0
cd ..

call npm install -g npm@5 || goto :error

call npm install || goto :error
call npm run test || goto :error

goto :EOF

:error
exit /b 1

@rem Copyright 2018 Google LLC. All rights reserved.
@rem
@rem Licensed under the Apache License, Version 2.0 (the "License");
@rem you may not use this file except in compliance with the License.
@rem 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.

@echo "Starting Windows build"

cd /d %~dp0
cd ..

call npm install -g npm@latest || goto :error
call npm install || goto :error
call npm run test || goto :error

goto :EOF

:error
exit /b 1

use latest npm on Windows (#154)

chore: use latest npm on Windows (#154)


@echo off
setlocal enableextensions enabledelayedexpansion

	cd /D %APPVEYOR_BUILD_FOLDER%
	if %errorlevel% neq 0 exit /b 3

	set STABILITY=staging
	set DEPS_DIR=%PHP_BUILD_CACHE_BASE_DIR%\deps-%PHP_REL%-%PHP_SDK_VC%-%PHP_SDK_ARCH%
	rem SDK is cached, deps info is cached as well
	echo Updating dependencies in %DEPS_DIR%
	cmd /c phpsdk_deps --update --no-backup --branch %PHP_REL% --stability %STABILITY% --deps %DEPS_DIR%
	if %errorlevel% neq 0 exit /b 3

	rem Something went wrong, most likely when concurrent builds were to fetch deps
	rem updates. It might be, that some locking mechanism is needed.
	if not exist "%DEPS_DIR%" (
		cmd /c phpsdk_deps --update --force --no-backup --branch %PHP_REL% --stability %STABILITY% --deps %DEPS_DIR%
	)
	if %errorlevel% neq 0 exit /b 3

	if "%ZTS_STATE%"=="enable" set ZTS_SHORT=ts
	if "%ZTS_STATE%"=="disable" set ZTS_SHORT=nts
	if "%ZTS_STATE%"=="enable" set ZTS_IN_FILENAME=
	if "%ZTS_STATE%"=="disable" set ZTS_IN_FILENAME=-nts
	if "%PHP_SDK_ARCH%"=="x86" set ARCH_IN_FILENAME=
	if "%PHP_SDK_ARCH%"=="x64" set ARCH_IN_FILENAME=-x86_64

	cd /d C:\projects\php-src

	cmd /c buildconf.bat --force

	if %errorlevel% neq 0 exit /b 3

	cmd /c configure.bat --disable-all --with-mp=auto --enable-cli --%ZTS_STATE%-zts --with-tideways-xhprof=shared --enable-object-out-dir=%PHP_BUILD_OBJ_DIR% --with-config-file-scan-dir=%APPVEYOR_BUILD_FOLDER%\build\modules.d --with-prefix=%APPVEYOR_BUILD_FOLDER%\build --with-php-build=%DEPS_DIR%

	if %errorlevel% neq 0 exit /b 3

	nmake /NOLOGO
	if %errorlevel% neq 0 exit /b 3

	nmake install

	if %errorlevel% neq 0 exit /b 3

	mkdir c:\tests_tmp
	set TEST_PHP_EXECUTABLE=%APPVEYOR_BUILD_FOLDER%\build\php.exe
	set TEST_PHP_JUNIT=c:\tests_tmp\tests-junit.xml
	if "%OPCACHE%" equ "1" set TEST_PHP_ARGS=!TEST_PHP_ARGS! -d zend_extension=%APPVEYOR_BUILD_FOLDER%\build\ext\php_opcache.so -d opcache.enable=1 -d opcache.enable_cli=1
	set TEST_PHP_ARGS=-n -d -foo=1 -d zend_extension=%APPVEYOR_BUILD_FOLDER%\build\ext\php_tideways_xhprof.dll
	set SKIP_DBGP_TESTS=1
	set SKIP_IPV6_TESTS=1
	set REPORT_EXIT_STATUS=1
	echo !TEST_PHP_EXECUTABLE! !TEST_PHP_ARGS! -v
	echo !TEST_PHP_EXECUTABLE! -n run-tests.php -q -x --show-diff --show-slow 1000 --set-timeout 120 -g FAIL,XFAIL,BORK,WARN,LEAK,SKIP --temp-source c:\tests_tmp --temp-target c:\tests_tmp %APPVEYOR_BUILD_FOLDER%\tests
	!TEST_PHP_EXECUTABLE! !TEST_PHP_ARGS! -v
	!TEST_PHP_EXECUTABLE! -n run-tests.php -q -x --show-diff %APPVEYOR_BUILD_FOLDER%\tests

	set EXIT_CODE=%errorlevel%
	powershell -Command "$wc = New-Object 'System.Net.WebClient'; $wc.UploadFile('https://ci.appveyor.com/api/testresults/junit/%APPVEYOR_JOB_ID%', 'c:\tests_tmp\tests-junit.xml')"
	if %EXIT_CODE% neq 0 exit /b 3

	cd /d %APPVEYOR_BUILD_FOLDER%

	if not exist "%APPVEYOR_BUILD_FOLDER%\build\ext\php_tideways_xhprof.dll" exit /b 3

	xcopy %APPVEYOR_BUILD_FOLDER%\LICENSE %APPVEYOR_BUILD_FOLDER%\php_tideways_xhprof-%PHP_REL%-!ZTS_SHORT!-%PHP_BUILD_CRT%-%PHP_SDK_ARCH%\ /y /f
	echo F|xcopy %APPVEYOR_BUILD_FOLDER%\build\ext\php_tideways_xhprof.dll %APPVEYOR_BUILD_FOLDER%\php_tideways_xhprof-%PHP_REL%-!ZTS_SHORT!-%PHP_BUILD_CRT%-%PHP_SDK_ARCH%\php_tideways_xhprof-%APPVEYOR_REPO_TAG_NAME%-%PHP_REL%-%PHP_BUILD_CRT%!ZTS_IN_FILENAME!!ARCH_IN_FILENAME!.dll /y /f
	7z a php_tideways_xhprof-%APPVEYOR_REPO_TAG_NAME%-%PHP_REL%-%PHP_BUILD_CRT%!ZTS_IN_FILENAME!!ARCH_IN_FILENAME!.zip %APPVEYOR_BUILD_FOLDER%\php_tideways_xhprof-%PHP_REL%-!ZTS_SHORT!-%PHP_BUILD_CRT%-%PHP_SDK_ARCH%\*
	appveyor PushArtifact php_tideways_xhprof-%APPVEYOR_REPO_TAG_NAME%-%PHP_REL%-%PHP_BUILD_CRT%!ZTS_IN_FILENAME!!ARCH_IN_FILENAME!.zip -FileName php_tideways_xhprof-%APPVEYOR_REPO_TAG_NAME%-%PHP_REL%-%PHP_BUILD_CRT%!ZTS_IN_FILENAME!!ARCH_IN_FILENAME!.zip

	rem move build\ext\php_tideways_xhprof.dll artifacts\php_tideways_xhprof-%PHP_REL%-!ZTS_SHORT!-%PHP_BUILD_CRT%-%PHP_SDK_ARCH%.dll
endlocal

@echo off
setlocal enableextensions enabledelayedexpansion

	cd /D %APPVEYOR_BUILD_FOLDER%
	if %errorlevel% neq 0 exit /b 3

	set STABILITY=staging
	set DEPS_DIR=%PHP_BUILD_CACHE_BASE_DIR%\deps-%PHP_REL%-%PHP_SDK_VC%-%PHP_SDK_ARCH%
	rem SDK is cached, deps info is cached as well
	echo Updating dependencies in %DEPS_DIR%
	cmd /c phpsdk_deps --update --no-backup --branch %PHP_REL% --stability %STABILITY% --deps %DEPS_DIR%
	if %errorlevel% neq 0 exit /b 3

	rem Something went wrong, most likely when concurrent builds were to fetch deps
	rem updates. It might be, that some locking mechanism is needed.
	if not exist "%DEPS_DIR%" (
		cmd /c phpsdk_deps --update --force --no-backup --branch %PHP_REL% --stability %STABILITY% --deps %DEPS_DIR%
	)
	if %errorlevel% neq 0 exit /b 3

	if "%ZTS_STATE%"=="enable" set ZTS_SHORT=ts
	if "%ZTS_STATE%"=="disable" set ZTS_SHORT=nts
	if "%ZTS_STATE%"=="enable" set ZTS_IN_FILENAME=
	if "%ZTS_STATE%"=="disable" set ZTS_IN_FILENAME=-nts
	if "%PHP_SDK_ARCH%"=="x86" set ARCH_IN_FILENAME=
	if "%PHP_SDK_ARCH%"=="x64" set ARCH_IN_FILENAME=-x86_64

	cd /d C:\projects\php-src

	cmd /c buildconf.bat --force

	if %errorlevel% neq 0 exit /b 3

	cmd /c configure.bat --disable-all --with-mp=auto --enable-cli --%ZTS_STATE%-zts --with-tideways_xhprof=shared --enable-object-out-dir=%PHP_BUILD_OBJ_DIR% --with-config-file-scan-dir=%APPVEYOR_BUILD_FOLDER%\build\modules.d --with-prefix=%APPVEYOR_BUILD_FOLDER%\build --with-php-build=%DEPS_DIR%

	if %errorlevel% neq 0 exit /b 3

	nmake /NOLOGO
	if %errorlevel% neq 0 exit /b 3

	nmake install

	if %errorlevel% neq 0 exit /b 3

	mkdir c:\tests_tmp
	set TEST_PHP_EXECUTABLE=%APPVEYOR_BUILD_FOLDER%\build\php.exe
	set TEST_PHP_JUNIT=c:\tests_tmp\tests-junit.xml
	if "%OPCACHE%" equ "1" set TEST_PHP_ARGS=!TEST_PHP_ARGS! -d zend_extension=%APPVEYOR_BUILD_FOLDER%\build\ext\php_opcache.so -d opcache.enable=1 -d opcache.enable_cli=1
	set TEST_PHP_ARGS=-n -d -foo=1 -d zend_extension=%APPVEYOR_BUILD_FOLDER%\build\ext\php_tideways_xhprof.dll
	set SKIP_DBGP_TESTS=1
	set SKIP_IPV6_TESTS=1
	set REPORT_EXIT_STATUS=1
	echo !TEST_PHP_EXECUTABLE! !TEST_PHP_ARGS! -v
	echo !TEST_PHP_EXECUTABLE! -n run-tests.php -q -x --show-diff --show-slow 1000 --set-timeout 120 -g FAIL,XFAIL,BORK,WARN,LEAK,SKIP --temp-source c:\tests_tmp --temp-target c:\tests_tmp %APPVEYOR_BUILD_FOLDER%\tests
	!TEST_PHP_EXECUTABLE! !TEST_PHP_ARGS! -v
	!TEST_PHP_EXECUTABLE! -n run-tests.php -q -x --show-diff %APPVEYOR_BUILD_FOLDER%\tests

	set EXIT_CODE=%errorlevel%
	powershell -Command "$wc = New-Object 'System.Net.WebClient'; $wc.UploadFile('https://ci.appveyor.com/api/testresults/junit/%APPVEYOR_JOB_ID%', 'c:\tests_tmp\tests-junit.xml')"
	if %EXIT_CODE% neq 0 exit /b 3

	cd /d %APPVEYOR_BUILD_FOLDER%

	if not exist "%APPVEYOR_BUILD_FOLDER%\build\ext\php_tideways_xhprof.dll" exit /b 3

	xcopy %APPVEYOR_BUILD_FOLDER%\LICENSE %APPVEYOR_BUILD_FOLDER%\php_tideways_xhprof-%PHP_REL%-!ZTS_SHORT!-%PHP_BUILD_CRT%-%PHP_SDK_ARCH%\ /y /f
	echo F|xcopy %APPVEYOR_BUILD_FOLDER%\build\ext\php_tideways_xhprof.dll %APPVEYOR_BUILD_FOLDER%\php_tideways_xhprof-%PHP_REL%-!ZTS_SHORT!-%PHP_BUILD_CRT%-%PHP_SDK_ARCH%\php_tideways_xhprof-%APPVEYOR_REPO_TAG_NAME%-%PHP_REL%-%PHP_BUILD_CRT%!ZTS_IN_FILENAME!!ARCH_IN_FILENAME!.dll /y /f
	7z a php_tideways_xhprof-%APPVEYOR_REPO_TAG_NAME%-%PHP_REL%-%PHP_BUILD_CRT%!ZTS_IN_FILENAME!!ARCH_IN_FILENAME!.zip %APPVEYOR_BUILD_FOLDER%\php_tideways_xhprof-%PHP_REL%-!ZTS_SHORT!-%PHP_BUILD_CRT%-%PHP_SDK_ARCH%\*
	appveyor PushArtifact php_tideways_xhprof-%APPVEYOR_REPO_TAG_NAME%-%PHP_REL%-%PHP_BUILD_CRT%!ZTS_IN_FILENAME!!ARCH_IN_FILENAME!.zip -FileName php_tideways_xhprof-%APPVEYOR_REPO_TAG_NAME%-%PHP_REL%-%PHP_BUILD_CRT%!ZTS_IN_FILENAME!!ARCH_IN_FILENAME!.zip

	rem move build\ext\php_tideways_xhprof.dll artifacts\php_tideways_xhprof-%PHP_REL%-!ZTS_SHORT!-%PHP_BUILD_CRT%-%PHP_SDK_ARCH%.dll
endlocal

Fix configure flag

Fix configure flag