@setlocal enabledelayedexpansion

REM Parse Arguments.

set RoslynRoot=%~dp0
set BuildConfiguration=Debug
:ParseArguments
if "%1" == "" goto :DoneParsing
if /I "%1" == "/?" call :Usage && exit /b 1
if /I "%1" == "/debug" set BuildConfiguration=Debug&&shift&& goto :ParseArguments
if /I "%1" == "/release" set BuildConfiguration=Release&&shift&& goto :ParseArguments
call :Usage && exit /b 1
:DoneParsing

call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" x86

REM Build the compiler so we can self host it for the full build
src\.nuget\NuGet.exe restore %RoslynRoot%/src/Toolset.sln -packagesdirectory packages
msbuild /nologo /v:m /m %RoslynRoot%/src/Compilers/Core/VBCSCompiler/VBCSCompiler.csproj /p:Configuration=%BuildConfiguration%
msbuild /nologo /v:m /m %RoslynRoot%/src/Compilers/CSharp/csc2/csc2.csproj /p:Configuration=%BuildConfiguration%
msbuild /nologo /v:m /m %RoslynRoot%/src/Compilers/VisualBasic/vbc2/vbc2.csproj /p:Configuration=%BuildConfiguration%

mkdir %RoslynRoot%\Binaries\Bootstrap
move Binaries\%BuildConfiguration%\* %RoslynRoot%\Binaries\Bootstrap
msbuild /v:m /t:Clean src/Toolset.sln /p:Configuration=%BuildConfiguration%
taskkill /F /IM vbcscompiler.exe

msbuild /v:m /m /p:BootstrapBuildPath=%RoslynRoot%\Binaries\Bootstrap BuildAndTest.proj /p:CIBuild=true /p:Configuration=%BuildConfiguration%
if ERRORLEVEL 1 (
    taskkill /F /IM vbcscompiler.exe
    echo Build failed
    exit /b 1
)

REM Kill any instances of VBCSCompiler.exe to release locked files;
REM otherwise future CI runs may fail while trying to delete those files.
taskkill /F /IM vbcscompiler.exe

REM It is okay and expected for taskkill to fail (it's a cleanup routine).  Ensure
REM caller sees successful exit.
exit /b 0

:Usage
@echo Usage: cibuild.cmd [/debug^|/release]
@echo   /debug 	Perform debug build.  This is the default.
@echo   /release Perform release build
<<<<<<< HEAD
@goto :eof
=======
@goto :eof
>>>>>>> origin/stabilization

@setlocal enabledelayedexpansion

REM Parse Arguments.

set RoslynRoot=%~dp0
set BuildConfiguration=Debug
:ParseArguments
if "%1" == "" goto :DoneParsing
if /I "%1" == "/?" call :Usage && exit /b 1
if /I "%1" == "/debug" set BuildConfiguration=Debug&&shift&& goto :ParseArguments
if /I "%1" == "/release" set BuildConfiguration=Release&&shift&& goto :ParseArguments
call :Usage && exit /b 1
:DoneParsing

call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\Tools\VsDevCmd.bat"

REM Build the compiler so we can self host it for the full build
src\.nuget\NuGet.exe restore %RoslynRoot%/src/Toolset.sln -packagesdirectory packages
msbuild /nologo /v:m /m %RoslynRoot%/src/Compilers/Core/VBCSCompiler/VBCSCompiler.csproj /p:Configuration=%BuildConfiguration%
msbuild /nologo /v:m /m %RoslynRoot%/src/Compilers/CSharp/csc2/csc2.csproj /p:Configuration=%BuildConfiguration%
msbuild /nologo /v:m /m %RoslynRoot%/src/Compilers/VisualBasic/vbc2/vbc2.csproj /p:Configuration=%BuildConfiguration%

mkdir %RoslynRoot%\Binaries\Bootstrap
move Binaries\%BuildConfiguration%\* %RoslynRoot%\Binaries\Bootstrap
msbuild /v:m /t:Clean src/Toolset.sln /p:Configuration=%BuildConfiguration%
taskkill /F /IM vbcscompiler.exe

msbuild /v:m /m /p:BootstrapBuildPath=%RoslynRoot%\Binaries\Bootstrap BuildAndTest.proj /p:CIBuild=true /p:Configuration=%BuildConfiguration%
if ERRORLEVEL 1 (
    taskkill /F /IM vbcscompiler.exe
    echo Build failed
    exit /b 1
)

REM Kill any instances of VBCSCompiler.exe to release locked files;
REM otherwise future CI runs may fail while trying to delete those files.
taskkill /F /IM vbcscompiler.exe

REM It is okay and expected for taskkill to fail (it's a cleanup routine).  Ensure
REM caller sees successful exit.
exit /b 0

:Usage
@echo Usage: cibuild.cmd [/debug^|/release]
@echo   /debug 	Perform debug build.  This is the default.
@echo   /release Perform release build
<<<<<<< HEAD
@goto :eof
=======
@goto :eof
>>>>>>> origin/stabilization

Update cibuild.cmd to call a different script

vcvarsall.bat will call vcvars32.bat, which uses some environment
variables that are not defined. Instead call vsdevcmd.bat, which
*also* uses these environment variable, but we've already patched
up these files on our build systems to work around the issue.


@ECHO OFF
SETLOCAL
	:: SETLOCAL is on, so changes to the path not persist to the actual user's path

SET toolsFolder=%CD%\tools\
ECHO Current folder: %CD%

SET nodeVersion=6.11.2

SET nodeFileName=node-v%nodeVersion%-win-x86.7z
SET nodeExtractFolder=%toolsFolder%node.js.%nodeVersion%

SET nuGetExecutable=%CD%\tools\nuget.exe
IF NOT EXIST "%nuGetExecutable%" (
	ECHO Downloading https://dist.nuget.org/win-x86-commandline/latest/nuget.exe to %nuGetExecutable%
	powershell -Command "(New-Object Net.WebClient).DownloadFile('https://dist.nuget.org/win-x86-commandline/latest/nuget.exe', '%nuGetExecutable%')"
)

:: We need 7za.exe for BuildBelle.bat
IF NOT EXIST "%toolsFolder%7za.exe" (
	ECHO 7zip not found - fetching now
	"%nuGetExecutable%" install 7-Zip.CommandLine -OutputDirectory tools -Verbosity quiet
)

:: Put 7za.exe and vswhere.exe in a predictable path (not version specific)
FOR /f "delims=" %%A in ('dir "%toolsFolder%7-Zip.CommandLine.*" /b') DO SET "sevenZipExePath=%toolsFolder%%%A\"
MOVE "%sevenZipExePath%tools\7za.exe" "%toolsFolder%7za.exe"

IF NOT EXIST "%nodeExtractFolder%" (
	ECHO Downloading http://nodejs.org/dist/v%nodeVersion%/%nodeFileName% to %toolsFolder%%nodeFileName%
	powershell -Command "(New-Object Net.WebClient).DownloadFile('http://nodejs.org/dist/v%nodeVersion%/%nodeFileName%', '%toolsFolder%%nodeFileName%')"
	ECHO Extracting %nodeFileName% to %nodeExtractFolder%
	"%toolsFolder%\7za.exe" x "%toolsFolder%\%nodeFileName%" -o"%nodeExtractFolder%" -aos > nul
)
FOR /f "delims=" %%A in ('dir "%nodeExtractFolder%\node*" /b') DO SET "nodePath=%nodeExtractFolder%\%%A"

:build
    ECHO Adding Node to path
    REM SETLOCAL is on, so changes to the path not persist to the actual user's path
    PATH="%nodePath%";%PATH%

    ECHO Node version is:
    call node -v

    ECHO npm version is:
    call npm -v

    SET buildFolder=%CD%

    ECHO Change directory to %CD%\..\src\Umbraco.Web.UI.Client\
    CD %CD%\..\src\Umbraco.Web.UI.Client\

    ECHO Do npm install and the gulp build of Belle

    ECHO Clean npm cache
    call npm cache clean --quiet

    ECHO Installing gulp cli
    call npm install -g gulp-cli --quiet
    ECHO Installing bower
    call npm install -g bower --quiet
    ECHO Doing npm install
    call npm install --quiet
    ECHO Executing gulp build
    call gulp build --buildversion=%release%

    ECHO Move back to the build folder
    CD "%buildFolder%"

@ECHO OFF
SETLOCAL
	:: SETLOCAL is on, so changes to the path not persist to the actual user's path

SET toolsFolder=%CD%\tools\
ECHO Current folder: %CD%

SET nodeVersion=6.11.2

SET nodeFileName=node-v%nodeVersion%-win-x86.7z
SET nodeExtractFolder=%toolsFolder%node.js.%nodeVersion%

SET nuGetExecutable=%CD%\tools\nuget.exe
IF NOT EXIST "%nuGetExecutable%" (
	ECHO Downloading https://dist.nuget.org/win-x86-commandline/latest/nuget.exe to %nuGetExecutable%
	powershell -Command "(New-Object Net.WebClient).DownloadFile('https://dist.nuget.org/win-x86-commandline/latest/nuget.exe', '%nuGetExecutable%')"
)

:: We need 7za.exe for BuildBelle.bat
IF NOT EXIST "%toolsFolder%7za.exe" (
	ECHO 7zip not found - fetching now
	"%nuGetExecutable%" install 7-Zip.CommandLine -OutputDirectory tools -Verbosity quiet
)

:: Put 7za.exe and vswhere.exe in a predictable path (not version specific)
FOR /f "delims=" %%A in ('dir "%toolsFolder%7-Zip.CommandLine.*" /b') DO SET "sevenZipExePath=%toolsFolder%%%A\"
MOVE "%sevenZipExePath%tools\7za.exe" "%toolsFolder%7za.exe"

IF NOT EXIST "%nodeExtractFolder%" (
	ECHO Downloading http://nodejs.org/dist/v%nodeVersion%/%nodeFileName% to %toolsFolder%%nodeFileName%
	powershell -Command "(New-Object Net.WebClient).DownloadFile('http://nodejs.org/dist/v%nodeVersion%/%nodeFileName%', '%toolsFolder%%nodeFileName%')"
	ECHO Extracting %nodeFileName% to %nodeExtractFolder%
	"%toolsFolder%\7za.exe" x "%toolsFolder%\%nodeFileName%" -o"%nodeExtractFolder%" -aos > nul
)
FOR /f "delims=" %%A in ('dir "%nodeExtractFolder%\node*" /b') DO SET "nodePath=%nodeExtractFolder%\%%A"

:build
    ECHO Adding Node to path
    REM SETLOCAL is on, so changes to the path not persist to the actual user's path
    PATH="%nodePath%";%PATH%

    ECHO Node version is:
    call node -v

    ECHO npm version is:
    call npm -v

    SET buildFolder=%CD%

    ECHO Change directory to %CD%\..\src\Umbraco.Web.UI.Client\
    CD %CD%\..\src\Umbraco.Web.UI.Client\

    ECHO Do npm install and the gulp build of Belle

    ECHO Clean npm cache
    call npm cache clean --quiet

	ECHO Installing gulp
	call npm install -g gulp --quiet
	ECHO Installing gulp cli
    call npm install -g gulp-cli --quiet
    ECHO Installing bower
    call npm install -g bower --quiet
    ECHO Doing npm install
    call npm install --quiet
    ECHO Executing gulp build
    call gulp build --buildversion=%release%

    ECHO Move back to the build folder
    CD "%buildFolder%"

Install gulp before gulp-cli

Install gulp before gulp-cli


@echo off
:: Visual Studio environment using RB libs

set INCLUDE=%MYLOCAL%\include;%MYLOCAL%\MUMPS\include;%MYLOCAL%\eigen
set LIB=%MYLOCAL%\MUMPS\lib
:: f2py
set PATH=%PATH%;F:\Python37\Scripts

:: olcPixelGameEngine
set "OLCPATH=%~dp0..\externals\olcPixelGameEngine"
IF NOT EXIST "%OLCPATH%" (
    ECHO   - olcPixelGameEngine NOT found in %OLCPATH%!!
) ELSE (
    ECHO   - olcPixelGameEngine found.
    set "INCLUDE=%OLCPATH%;%INCLUDE%"
)

:: swig
set "SWIGPATH=%MYLOCAL%\swig"
IF NOT EXIST "%SWIGPATH%" (
    ECHO    - swig NOT found in %SWIGPATH%!!
) ELSE (
    ECHO   - swig found.
    set "PATH=%PATH%;%MYLOCAL%\swig"
)

:: visual studio [required]
set COMPILERPATH="C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build"
IF NOT EXIST %COMPILERPATH% (
    ECHO   - MSVC compiler NOT found in %COMPILERPATH%!!
    PAUSE
    EXIT /B
) ELSE (
    ECHO   - MSVC compiler found.
)

:: Intel MKL/TBB
set INTELPATH="C:\Program Files (x86)\IntelSWTools\compilers_and_libraries\windows"
IF NOT EXIST %INTELPATH% (
    ECHO   - INTEL libraries NOT found in %INTELPATH%!!
) ELSE (
    ECHO   - INTEL libraries found.
    call %INTELPATH%\mkl\bin\mklvars.bat intel64 vs2017
    call %INTELPATH%\tbb\bin\tbbvars.bat intel64 vs2017
)

:: run MSVC environment
CD /d "%~dp0"
CD ..
%comspec% /k "%COMPILERPATH%\vcvars64.bat"

add echo off

add echo off


:: Set $HOME to the current dir so msys runs here
set HOME=%cd%

:: Configure, build, test, and install using `nmake`.
bash -lc "make"
if errorlevel 1 exit 1
bash -lc "make PREFIX=$LIBRARY_PREFIX install"
if errorlevel 1 exit 1

:: Set $HOME to the current dir so msys runs here
set HOME=%cd%

:: Configure, build, test, and install using `nmake`.
bash -lc "make"
if errorlevel 1 exit 1
bash -lc "make DYNAMIC_ARCH=1 BINARY=$ARCH NO_LAPACK=0 NO_AFFINITY=1 USE_THREAD=1 PREFIX=$LIBRARY_PREFIX install"
if errorlevel 1 exit 1

Use the same arguments on Windows.

openblas: Use the same arguments on Windows.


@REM SBT launcher script
@REM
@REM Environment:
@REM JAVA_HOME - location of a JDK home dir (mandatory)
@REM SBT_OPTS  - JVM options (optional)
@REM Configuration:
@REM sbtconfig.txt found in the SBT_HOME.

@REM   ZOMG! We need delayed expansion to build up CFG_OPTS later
@setlocal enabledelayedexpansion

@echo off
set SBT_HOME=%~dp0

rem FIRST we load the config file of extra options.
set FN=%SBT_HOME%\..\conf\sbtconfig.txt
set CFG_OPTS=
FOR /F "tokens=* eol=# usebackq delims=" %%i IN ("%FN%") DO (
  set DO_NOT_REUSE_ME=%%i
  rem ZOMG (Part #2) WE use !! here to delay the expansion of
  rem CFG_OPTS, otherwise it remains "" for this loop.
  set CFG_OPTS=!CFG_OPTS! !DO_NOT_REUSE_ME!
)

rem poor man's jenv (which is not available on Windows)
IF DEFINED JAVA_HOMES (
  IF EXIST .java-version FOR /F %%A IN (.java-version) DO (
    SET JAVA_HOME=%JAVA_HOMES%\%%A
    SET JDK_HOME=%JAVA_HOMES%\%%A
  )
)
rem must set PATH or wrong javac is used for java projects
IF DEFINED JAVA_HOME SET PATH=%JAVA_HOME%\bin;%PATH%

rem users can set JAVA_OPTS via .jvmopts (sbt-extras style)
IF EXIST .jvmopts FOR /F %%A IN (.jvmopts) DO (
  SET JAVA_OPTS=%%A !JAVA_OPTS!
)

rem We use the value of the JAVACMD environment variable if defined
set _JAVACMD=%JAVACMD%

if "%_JAVACMD%"=="" (
  if not "%JAVA_HOME%"=="" (
    if exist "%JAVA_HOME%\bin\java.exe" set "_JAVACMD=%JAVA_HOME%\bin\java.exe"
  )
)

if "%_JAVACMD%"=="" set _JAVACMD=java

rem We use the value of the JAVA_OPTS environment variable if defined, rather than the config.
set _JAVA_OPTS=%JAVA_OPTS%
if "%_JAVA_OPTS%"=="" set _JAVA_OPTS=%CFG_OPTS%

FOR %%a IN (%*) DO (
  if "%%a" == "-jvm-debug" (
    set JVM_DEBUG=true
    set /a JVM_DEBUG_PORT=5005 2>nul >nul
  ) else if "!JVM_DEBUG!" == "true" (
    set /a JVM_DEBUG_PORT=%%a 2>nul >nul
    if not "%%a" == "!JVM_DEBUG_PORT!" (
      set SBT_ARGS=!SBT_ARGS! %%a
    )
  ) else (
    set SBT_ARGS=!SBT_ARGS! %%a
  )
)

if defined JVM_DEBUG_PORT (
  set _JAVA_OPTS=!_JAVA_OPTS! -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=!JVM_DEBUG_PORT!
)

call :run %SBT_ARGS%

if ERRORLEVEL 1 goto error
goto end

:run

"%_JAVACMD%" %_JAVA_OPTS% %SBT_OPTS% -cp "%SBT_HOME%sbt-launch.jar" xsbt.boot.Boot %*
goto :eof

:error
@endlocal
exit /B 1

:end
@endlocal
exit /B 0

@REM SBT launcher script
@REM
@REM Environment:
@REM JAVA_HOME - location of a JDK home dir (mandatory)
@REM SBT_OPTS  - JVM options (optional)
@REM Configuration:
@REM sbtconfig.txt found in the SBT_HOME.

@REM   ZOMG! We need delayed expansion to build up CFG_OPTS later
@setlocal enabledelayedexpansion

@echo off
set SBT_HOME=%~dp0

rem FIRST we load the config file of extra options.
set FN=%SBT_HOME%\..\conf\sbtconfig.txt
set CFG_OPTS=
FOR /F "tokens=* eol=# usebackq delims=" %%i IN ("%FN%") DO (
  set DO_NOT_REUSE_ME=%%i
  rem ZOMG (Part #2) WE use !! here to delay the expansion of
  rem CFG_OPTS, otherwise it remains "" for this loop.
  set CFG_OPTS=!CFG_OPTS! !DO_NOT_REUSE_ME!
)

rem poor man's jenv (which is not available on Windows)
IF DEFINED JAVA_HOMES (
  IF EXIST .java-version FOR /F %%A IN (.java-version) DO (
    SET JAVA_HOME=%JAVA_HOMES%\%%A
    SET JDK_HOME=%JAVA_HOMES%\%%A
  )
)
rem must set PATH or wrong javac is used for java projects
IF DEFINED JAVA_HOME SET PATH=%JAVA_HOME%\bin;%PATH%

rem users can set JAVA_OPTS via .jvmopts (sbt-extras style)
IF EXIST .jvmopts FOR /F %%A IN (.jvmopts) DO (
  SET JAVA_OPTS=%%A !JAVA_OPTS!
)

rem We use the value of the JAVACMD environment variable if defined
set _JAVACMD=%JAVACMD%

if "%_JAVACMD%"=="" (
  if not "%JAVA_HOME%"=="" (
    if exist "%JAVA_HOME%\bin\java.exe" set "_JAVACMD=%JAVA_HOME%\bin\java.exe"
  )
)

if "%_JAVACMD%"=="" set _JAVACMD=java

rem We use the value of the JAVA_OPTS environment variable if defined, rather than the config.
set _JAVA_OPTS=%JAVA_OPTS%
if "%_JAVA_OPTS%"=="" set _JAVA_OPTS=%CFG_OPTS%

:args_loop
if "%~1" == "" goto args_end

if "%~1" == "-jvm-debug" (
  set JVM_DEBUG=true
  set /a JVM_DEBUG_PORT=5005 2>nul >nul
) else if "!JVM_DEBUG!" == "true" (
  set /a JVM_DEBUG_PORT=%1 2>nul >nul
  if not "%~1" == "!JVM_DEBUG_PORT!" (
    set SBT_ARGS=!SBT_ARGS! %1
  )
) else (
  set SBT_ARGS=!SBT_ARGS! %1
)

shift
goto args_loop
:args_end

if defined JVM_DEBUG_PORT (
  set _JAVA_OPTS=!_JAVA_OPTS! -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=!JVM_DEBUG_PORT!
)

call :run %SBT_ARGS%

if ERRORLEVEL 1 goto error
goto end

:run

"%_JAVACMD%" %_JAVA_OPTS% %SBT_OPTS% -cp "%SBT_HOME%sbt-launch.jar" xsbt.boot.Boot %*
goto :eof

:error
@endlocal
exit /B 1

:end
@endlocal
exit /B 0

Use more reliable shift loop for processing args


:: Terminal API
::
:: This file is called whenever a user enters a shell.
::
:: Dependencies:
::  - pyblish-base
::  - pyblish-maya
::  - pyblish-nuke
::  - pyblish-houdini
::  - pyblish-lite
::  - pyblish-qml
::  - pyblish-mindbender
::
:: Usage:
:: 	1. Create a local `mb.bat` file and set the required environment variables
::  2. Call your `mb.bat`
::
:: Example:
::   $ mb

@echo off

if "%1"=="" goto :usage

:: External Dependencies
if "%PYBLISH_BASE%"=="" goto :missing
if "%PYBLISH_MAYA%"=="" goto :missing
if "%PYBLISH_NUKE%"=="" goto :missing
if "%PYBLISH_LITE%"=="" goto :missing
if "%PYBLISH_QML%"=="" goto :missing
if "%MINDBENDER_CORE%"=="" goto :missing
:: if "%PYBLISH_USERNAME%"=="" goto :missing

:: Clear environment.
::
:: This is IMPORTANT, if one is to attempt at running
:: an application or task from the same shell more than once.
set PYTHONPATH=
set PYBLISHPLUGINPATH=

set PYTHONPATH=%PYBLISH_BASE%;%PYTHONPATH%
set PYTHONPATH=%PYBLISH_MAYA%;%PYTHONPATH%
set PYTHONPATH=%PYBLISH_NUKE%;%PYTHONPATH%
set PYTHONPATH=%PYBLISH_LITE%;%PYTHONPATH%
set PYTHONPATH=%PYBLISH_QML%;%PYTHONPATH%
set PYTHONPATH=%MINDBENDER_CORE%;%PYTHONPATH%

set PROJECTS=%1

:: Expose pipeline executables
set PATH=%MINDBENDER_CORE%\bin;%PATH%
set PYBLISHPLUGINPATH=%MINDBENDER_CORE%\mindbender\plugins;%PYBLISHPLUGINPATH%

:: --------------------
:: User interface
:: --------------------

:: Use $ as prefix to prompt commands
:: The default PROMPT is the current working directory,
:: which can make it look a little daunting due to its length.
set PROMPT=$$

:: Go to projects directory
pushd %PROJECTS%

:: Clear screen
title Mindbender Launcher
cls

:: Print intro
echo+
echo  MEINDBENDER START ---------------------------
echo+
echo+
echo                 _,--,
echo              .-'---./_    __
echo             /o \\     '-.' /
echo             \  //    _.-'._\
echo              `"\)--"`
echo+
echo+
echo   Welcome %USERNAME%!
echo+
echo   1. Type first characters of a project, e.g. "p999_"
echo   2. Press TAB to cycle through matching projects
echo+
echo  ---------------------------------------------
echo+

:: Clearing old Variables
SET PROJECTDIR=
SET ASSET=

:: Open a persistent shell
cmd.exe /K

goto :eof

:usage
	echo Not enough arguments
	echo Example: mb.bat c:\path\to\projects

:missing
	echo ERROR: Missing environment variables.
	if "%PYBLISH_BASE%"=="" echo   - %%PYBLISH_BASE%%
	if "%PYBLISH_MAYA%"=="" echo   - %%PYBLISH_MAYA%%
	if "%PYBLISH_NUKE%"=="" echo   - %%PYBLISH_NUKE%%
	if "%PYBLISH_LITE%"=="" echo   - %%PYBLISH_LITE%%
	if "%PYBLISH_QML%"=="" echo   - %%PYBLISH_QML%%
	if "%MINDBENDER_CORE%"=="" echo   - %%MINDBENDER_CORE%%
::	if "%PYBLISH_USERNAME%"=="" echo   - %%PYBLISH_USERNAME%%

	exit /b

:: Terminal API
::
:: This file is called whenever a user enters a shell.
::
:: Dependencies:
::  - pyblish-base
::  - pyblish-maya
::  - pyblish-nuke
::  - pyblish-houdini
::  - pyblish-lite
::  - pyblish-qml
::  - pyblish-mindbender
::
:: Usage:
:: 	1. Create a local `mb.bat` file and set the required environment variables
::  2. Call your `mb.bat`
::
:: Example:
::   $ mb

@echo off

if "%1"=="" goto :usage

:: External Dependencies
if "%PYBLISH_BASE%"=="" goto :missing
if "%PYBLISH_MAYA%"=="" goto :missing
if "%PYBLISH_NUKE%"=="" goto :missing
if "%PYBLISH_LITE%"=="" goto :missing
if "%PYBLISH_QML%"=="" goto :missing
if "%MINDBENDER_CORE%"=="" goto :missing
:: if "%PYBLISH_USERNAME%"=="" goto :missing

:: Clear environment.
::
:: This is IMPORTANT, if one is to attempt at running
:: an application or task from the same shell more than once.
set PYTHONPATH=
set PYBLISHPLUGINPATH=

set PYTHONPATH=%PYBLISH_BASE%;%PYTHONPATH%
set PYTHONPATH=%PYBLISH_MAYA%;%PYTHONPATH%
set PYTHONPATH=%PYBLISH_NUKE%;%PYTHONPATH%
set PYTHONPATH=%PYBLISH_LITE%;%PYTHONPATH%
set PYTHONPATH=%PYBLISH_QML%;%PYTHONPATH%
set PYTHONPATH=%MINDBENDER_CORE%;%PYTHONPATH%

set PROJECTS=%1

:: Expose pipeline executables
set PATH=%MINDBENDER_CORE%\bin;%PATH%
set PYBLISHPLUGINPATH=%MINDBENDER_CORE%\mindbender\plugins;%PYBLISHPLUGINPATH%

:: --------------------
:: User interface
:: --------------------

:: Use $ as prefix to prompt commands
:: The default PROMPT is the current working directory,
:: which can make it look a little daunting due to its length.
set PROMPT=$$

:: Go to projects directory
pushd %PROJECTS%

:: Clear screen
title Mindbender Launcher
cls

:: Print intro
echo+
echo  MEINDBENDER START ---------------------------
echo+
echo+
echo                 _,--,
echo              .-'---./_    __
echo             /o \\     '-.' /
echo             \  //    _.-'._\
echo              `"\)--"`
echo+
echo+
echo   Welcome %USERNAME%!
echo+
echo   1. Type first characters of a project, e.g. "p999_"
echo   2. Press TAB to cycle through matching projects
echo   3. Press SPACE and specify whether to enter "assets" or "film"
echo+
echo  ---------------------------------------------
echo+

:: Clearing old Variables
SET PROJECTDIR=
SET ASSET=

:: Open a persistent shell
cmd.exe /K

goto :eof

:usage
	echo Not enough arguments
	echo Example: mb.bat c:\path\to\projects

:missing
	echo ERROR: Missing environment variables.
	if "%PYBLISH_BASE%"=="" echo   - %%PYBLISH_BASE%%
	if "%PYBLISH_MAYA%"=="" echo   - %%PYBLISH_MAYA%%
	if "%PYBLISH_NUKE%"=="" echo   - %%PYBLISH_NUKE%%
	if "%PYBLISH_LITE%"=="" echo   - %%PYBLISH_LITE%%
	if "%PYBLISH_QML%"=="" echo   - %%PYBLISH_QML%%
	if "%MINDBENDER_CORE%"=="" echo   - %%MINDBENDER_CORE%%
::	if "%PYBLISH_USERNAME%"=="" echo   - %%PYBLISH_USERNAME%%

	exit /b

Update help in _mb.bat

Update help in _mb.bat


set ZIP_FILENAME=DarunGrim 3.1 Beta.zip
REM Clean Up
rmdir /Q /S Src
rmdir /Q /S Bin
del /Q "%ZIP_FILENAME%"

mkdir Src\bin
copy ..\DarunGrim2\* Src\bin\
copy ..\..\Publish\Docs\*.pdf Src\bin

call CopySrc.bat

del Src\*.pyc
REM Generate binaries
cp SetupDist.py Src
pushd Src
c:\python26\python SetupDist.py py2exe
popd

REM Prepare binary directory
REM Copy necessary files
copy ..\..\Src\UI\Web\DarunGrim3Sample01.cfg Src\bin\DarunGrim3.cfg

REM Clean up some unncessary files
del /Q Src\Bin\w9xpopen.exe
del /Q Src\Bin\Test.exe
del /Q Src\Bin\tcl*.dll
del /Q Src\Bin\tk*.dll
rmdir /Q /S Src\Bin\tcl

REM Put data directory to binary directory
xcopy /y /s /I ..\..\Src\UI\Web\data Src\bin\data

REM move bin directory location
rmdir /Q /S Bin
mv Src\Bin Bin

REM zip a package
pushd Bin
zip -r "..\%ZIP_FILENAME%" *
pause

set ZIP_FILENAME=DarunGrim 3.1 Beta.zip
REM Clean Up
rmdir /Q /S Src
rmdir /Q /S Bin
del /Q "%ZIP_FILENAME%"

mkdir Src\bin
copy ..\DarunGrim2\* Src\bin\
copy ..\..\Publish\Docs\*.pdf Src\bin

call CopySrc.bat

del Src\*.pyc
REM Generate binaries
cp SetupDist.py Src
pushd Src
c:\python26\python SetupDist.py py2exe
popd

REM Prepare binary directory
REM Copy necessary files
copy ..\..\Src\UI\Web\DarunGrim3Sample01.cfg Src\bin\DarunGrim3.cfg

REM Clean up some unncessary files
del /Q Src\Bin\w9xpopen.exe
del /Q Src\Bin\Test.exe
del /Q Src\Bin\tcl*.dll
del /Q Src\Bin\tk*.dll
rmdir /Q /S Src\Bin\tcl

REM Put data directory to binary directory
xcopy /y /s /I ..\..\Src\UI\Web\data Src\bin\data
xcopy /D /S /I /Y ..\Plugin Src\bin\Plugin\

REM move bin directory location
rmdir /Q /S Bin
mv Src\Bin Bin

REM zip a package
pushd Bin
zip -r "..\%ZIP_FILENAME%" *
pause

Copy plugin directory

Copy plugin directory


@echo off

cd %~dp0
cd ..

chcp 65001

ECHO Checking for database updates
php bin/console propel:migration:diff
php bin/console propel:migration:migrate

ECHO Clearing caches
php bin/console cache:clear --no-warmup --env=prod

ECHO Launching eXpansion
php bin\console eXpansion:run -vvv --env=prod

@echo off

cd %~dp0
cd ..

chcp 65001

ECHO Checking for database updates
php bin/console propel:migration:diff --env=prod
php bin/console propel:migration:migrate --env=prod

ECHO Clearing caches
php bin/console cache:clear --no-warmup --env=prod

ECHO Launching eXpansion
php bin\console eXpansion:run -vvv --env=prod

Fix windows run not using prod mode for all commands


@ECHO off
SETLOCAL

REM Set environment variables.
SET TABPY_ROOT=%CD%
SET INSTALL_LOG=%TABPY_ROOT%\tabpy-server\install.log
SET SAVE_PYTHONPATH=%PYTHONPATH%

ECHO Checking for presence of Python in the system path variable.
python --version >nul 2>&1
IF %ERRORLEVEL% NEQ 0 (
    ECHO     Cannot find Python.exe.  Check that Python is installed and is in the system PATH environment variable.
    SET RET=1
    GOTO:END
)

REM Install requirements using Python setup tools.
ECHO Installing any missing dependencies...

CD %TABPY_ROOT%\tabpy-server
ECHO Installing tabpy-server dependencies...>%INSTALL_LOG%
python setup.py install>>%INSTALL_LOG% 2>&1

CD %TABPY_ROOT%\tabpy-tools
ECHO: >> %INSTALL_LOG%
ECHO Installing tabpy-tools dependencies...>>%INSTALL_LOG%
python setup.py install>>%INSTALL_LOG% 2>&1

CD %TABPY_ROOT%
SET INSTALL_LOG_MESSAGE=    Check %INSTALL_LOG% for details.
IF %ERRORLEVEL% NEQ 0 (
    IF %CD% NEQ %TABPY_ROOT% (
        CD %TABPY_ROOT%
    )
    ECHO     failed
    ECHO %INSTALL_LOG_MESSAGE%
    SET RET=1
    GOTO:END
) ELSE (
    ECHO     success
    ECHO %INSTALL_LOG_MESSAGE%
)

REM Parse optional CLI arguments: config file
ECHO Parsing parameters...
SET PYTHONPATH=%TABPY_ROOT%\tabpy-server;%TABPY_ROOT%\tabpy-tools;%PATH%
SET STARTUP_CMD=python tabpy-server\tabpy_server\tabpy.py
IF [%1] NEQ [] (
    ECHO     Using config file at %TABPY_ROOT%\tabpy-server\tabpy_server\%1
    SET STARTUP_CMD=%STARTUP_CMD% --config=%1
)

ECHO Starting TabPy server...
ECHO;
%STARTUP_CMD%
IF %ERRORLEVEL% NEQ 0 (
    ECHO      Failed to start TabPy server.
    SET RET=1
    GOTO:END
)

SET RET=%ERRORLEVEL%
GOTO:END

:END
    SET PYTHONPATH=%SAVE_PYTHONPATH%
    CD %TABPY_ROOT%
    EXIT /B %RET%
    ENDLOCAL

@ECHO off
SETLOCAL

REM Set environment variables.
SET TABPY_ROOT=%CD%
SET INSTALL_LOG=%TABPY_ROOT%\tabpy-server\install.log
SET SAVE_PYTHONPATH=%PYTHONPATH%

ECHO Checking for presence of Python in the system path variable.
python --version >nul 2>&1
IF %ERRORLEVEL% NEQ 0 (
    ECHO     Cannot find Python.exe.  Check that Python is installed and is in the system PATH environment variable.
    SET RET=1
    GOTO:END
)

REM Install requirements using Python setup tools.
ECHO Installing any missing dependencies...

CD %TABPY_ROOT%\tabpy-server
ECHO Installing tabpy-server dependencies...>%INSTALL_LOG%
python setup.py install>>%INSTALL_LOG% 2>&1

CD %TABPY_ROOT%\tabpy-tools
ECHO: >> %INSTALL_LOG%
ECHO Installing tabpy-tools dependencies...>>%INSTALL_LOG%
python setup.py install>>%INSTALL_LOG% 2>&1

CD %TABPY_ROOT%
SET INSTALL_LOG_MESSAGE=    Check %INSTALL_LOG% for details.
IF %ERRORLEVEL% NEQ 0 (
    IF %CD% NEQ %TABPY_ROOT% (
        CD %TABPY_ROOT%
    )
    ECHO     failed
    ECHO %INSTALL_LOG_MESSAGE%
    SET RET=1
    GOTO:END
) ELSE (
    ECHO     success
    ECHO %INSTALL_LOG_MESSAGE%
)

REM Parse optional CLI arguments: config file
ECHO Parsing parameters...
SET PYTHONPATH=%TABPY_ROOT%\tabpy-server;%TABPY_ROOT%\tabpy-tools;%PYTHONPATH%
SET STARTUP_CMD=python tabpy-server\tabpy_server\tabpy.py
IF [%1] NEQ [] (
    ECHO     Using config file at %TABPY_ROOT%\tabpy-server\tabpy_server\%1
    SET STARTUP_CMD=%STARTUP_CMD% --config=%1
)

ECHO Starting TabPy server...
ECHO;
%STARTUP_CMD%
IF %ERRORLEVEL% NEQ 0 (
    ECHO      Failed to start TabPy server.
    SET RET=1
    GOTO:END
)

SET RET=%ERRORLEVEL%
GOTO:END

:END
    SET PYTHONPATH=%SAVE_PYTHONPATH%
    CD %TABPY_ROOT%
    EXIT /B %RET%
    ENDLOCAL

Update PYTHONPATH for tabpy-tools in startup.cmd


python %RECIPE_DIR%\download-chromedriver
if errorlevel 1 exit 1

7z x chromedriver.zip -ochromedriver
if errorlevel 1 exit 1

REM Add chromedriver to PATH so chromedriver_binary install can find it
set PATH=%PATH%:%CD%\chromedriver
python -m pip install --no-deps --ignore-installed .

python %RECIPE_DIR%\download-chromedriver.py
if errorlevel 1 exit 1

7z x chromedriver.zip -ochromedriver
if errorlevel 1 exit 1

REM Add chromedriver to PATH so chromedriver_binary install can find it
set PATH=%PATH%:%CD%\chromedriver
python -m pip install --no-deps --ignore-installed .

Fix script path in win

Fix script path in win


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

set version=
if not "%BuildCounter%" == "" (
   set version=--version-suffix ci-%BuildCounter%
)

REM (optional) build.bat is in the root of our repo, cd to the correct folder where sources/projects are
echo %cd%

REM Restore
call dotnet restore
if not "%errorlevel%"=="0" goto failure

REM Build
REM - Option 1: Run dotnet build for every source folder in the project
REM   e.g. call dotnet build <path> --configuration %config%
REM - Option 2: Let msbuild handle things and build the solution
"%programfiles(x86)%\MSBuild\14.0\Bin\MSBuild.exe" NugetyCore\NugetyCore.sln /p:Configuration="%config%" /m /v:M /fl /flp:LogFile=msbuild.log;Verbosity=Normal /nr:false
REM call dotnet build --configuration %config%
if not "%errorlevel%"=="0" goto failure

REM Unit tests
call dotnet test NugetyCore\src\NugetyCore.Tests --configuration %config%
if not "%errorlevel%"=="0" goto failure

:success
exit 0

:failure
exit -1

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

set version=
if not "%BuildCounter%" == "" (
   set version=--version-suffix ci-%BuildCounter%
)

REM (optional) build.bat is in the root of our repo, cd to the correct folder where sources/projects are
echo %cd%

REM Restore
call dotnet restore
if not "%errorlevel%"=="0" goto failure

REM Build
REM - Option 1: Run dotnet build for every source folder in the project
REM   e.g. call dotnet build <path> --configuration %config%
REM - Option 2: Let msbuild handle things and build the solution
"%programfiles(x86)%\MSBuild\14.0\Bin\MSBuild.exe" NugetyCore\NugetyCore.sln /p:Configuration="%config%" /m /v:M /fl /flp:LogFile=msbuild.log;Verbosity=Normal /nr:false
REM call dotnet build --configuration %config%
if not "%errorlevel%"=="0" goto failure

REM Unit tests
cd NugetyCore\src\NugetyCore.Tests
call dotnet test  --configuration %config%
if not "%errorlevel%"=="0" goto failure

:success
exit 0

:failure
exit -1

change to test directory before running tests


@echo off

rem Set external libraries directory.
set EXT_DIR=%cd%\..\..\..\..\extern

if not exist %EXT_DIR% (
	set EXT_DIR=
	echo ERROR: External libs dir is not set.
	pause
	goto END
)

rem Add installation directory pathes.
set INCLUDE=%EXT_DIR%\include;%INCLUDE%
set LIB=%EXT_DIR%\lib;%LIB%

rem Add Evil lib path
set EvilInclude=%cd%\..\..\proto\evil\src\lib
set EvilCommon=%cd%\..\..\proto\evil\win32\common
set EvilOut=%cd%\..\..\proto\evil\win32\%PROJECT_TYPE%\out

rem Add Eina lib path
set EinaInclude=%cd%\..\..\eina\src\include
set EinaCommon=%cd%\..\..\eina\win32\common
set EinaOut=%cd%\..\..\eina\win32\%PROJECT_TYPE%\out

set INCLUDE=%EvilCommon%;%EvilInclude%;%EvilInclude%\dlfcn;%EvilInclude%\mman;%INCLUDE%
set INCLUDE=%EinaCommon%;%EinaInclude%;%INCLUDE%
set LIB=%EinaOut%;%EvilOut%;%LIB%

:END

@echo off

rem Set external libraries directory.
set EXT_DIR=%cd%\..\..\..\extern

if not exist %EXT_DIR% (
	set EXT_DIR=
	echo ERROR: External libs dir is not set.
	pause
	goto END
)

rem Add installation directory pathes.
set INCLUDE=%EXT_DIR%\include;%INCLUDE%
set LIB=%EXT_DIR%\lib;%LIB%

rem Add Evil lib path
set EvilInclude=%cd%\..\..\evil\src\lib
set EvilCommon=%cd%\..\..\evil\win32\common
set EvilOut=%cd%\..\..\evil\win32\%PROJECT_TYPE%\out

rem Add Eina lib path
set EinaInclude=%cd%\..\..\eina\src\include
set EinaCommon=%cd%\..\..\eina\win32\common
set EinaOut=%cd%\..\..\eina\win32\%PROJECT_TYPE%\out

set INCLUDE=%EvilCommon%;%EvilInclude%;%EvilInclude%\dlfcn;%EvilInclude%\mman;%INCLUDE%
set INCLUDE=%EinaCommon%;%EinaInclude%;%INCLUDE%
set LIB=%EinaOut%;%EvilOut%;%LIB%

:END

set correctly the relative path of the extern directory,
so that it fits the one used in the tutorial.

git-svn-id: 12692bf5fc2024d371e0c35b324993c653e304d8@39101 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33


REM Run from dev command line

@ECHO OFF

VERIFY ON

D:
cd \ProjectsPersonal\OnlyT
rd OnlyT\bin /q /s
rd Installer\Output /q /s

REM build

ECHO.
ECHO Publishing OnlyT
dotnet publish OnlyT\OnlyT.csproj -p:PublishProfile=FolderProfile -c:Release
IF %ERRORLEVEL% NEQ 0 goto ERROR

ECHO.
ECHO Publishing OnlyTFirewallPorts
dotnet publish OnlyTFirewallPorts\OnlyTFirewallPorts.csproj -p:PublishProfile=FolderProfile -c:Release
IF %ERRORLEVEL% NEQ 0 goto ERROR

ECHO.
ECHO Copying items into delivery
xcopy OnlyTFirewallPorts\bin\Release\net5.0\publish\*.* OnlyT\bin\Release\net5.0-windows\publish /q /s /y /d
IF %ERRORLEVEL% NEQ 0 goto ERROR

ECHO.
ECHO Removing unwanted x64 DLLs
del OnlyT\bin\Release\net5.0-windows\publish\libmp3lame.64.dll
IF %ERRORLEVEL% NEQ 0 goto ERROR

ECHO.
ECHO Removing unwanted translations
rd OnlyT\bin\Release\net5.0-windows\publish\id-ID /q /s
IF %ERRORLEVEL% NEQ 0 goto ERROR

ECHO.
ECHO Create installer
"D:\Program Files (x86)\Inno Setup 6\iscc" Installer\onlytsetup.iss
IF %ERRORLEVEL% NEQ 0 goto ERROR

ECHO.
ECHO Create portable zip
powershell Compress-Archive -Path OnlyT\bin\Release\net5.0-windows\publish\* -DestinationPath Installer\Output\OnlyTPortable.zip
IF %ERRORLEVEL% NEQ 0 goto ERROR

goto SUCCESS

:ERROR
ECHO.
ECHO ******************
ECHO An ERROR occurred!
ECHO ******************

:SUCCESS

PAUSE

REM Run from dev command line

@ECHO OFF

VERIFY ON

D:
cd \ProjectsPersonal\OnlyT
rd OnlyT\bin /q /s
rd Installer\Output /q /s

REM build

ECHO.
ECHO Publishing OnlyT
dotnet publish OnlyT\OnlyT.csproj -p:PublishProfile=FolderProfile -c:Release
IF %ERRORLEVEL% NEQ 0 goto ERROR

ECHO.
ECHO Publishing OnlyTFirewallPorts
dotnet publish OnlyTFirewallPorts\OnlyTFirewallPorts.csproj -p:PublishProfile=FolderProfile -c:Release
IF %ERRORLEVEL% NEQ 0 goto ERROR

ECHO.
ECHO Copying items into delivery
xcopy OnlyTFirewallPorts\bin\Release\net6.0\publish\*.* OnlyT\bin\Release\net6.0-windows\publish /q /s /y /d
IF %ERRORLEVEL% NEQ 0 goto ERROR

ECHO.
ECHO Removing unwanted x64 DLLs
del OnlyT\bin\Release\net6.0-windows\publish\libmp3lame.64.dll
IF %ERRORLEVEL% NEQ 0 goto ERROR

ECHO.
ECHO Removing unwanted translations
rd OnlyT\bin\Release\net6.0-windows\publish\id-ID /q /s
IF %ERRORLEVEL% NEQ 0 goto ERROR

ECHO.
ECHO Create installer
"D:\Program Files (x86)\Inno Setup 6\iscc" Installer\onlytsetup.iss
IF %ERRORLEVEL% NEQ 0 goto ERROR

ECHO.
ECHO Create portable zip
powershell Compress-Archive -Path OnlyT\bin\Release\net6.0-windows\publish\* -DestinationPath Installer\Output\OnlyTPortable.zip
IF %ERRORLEVEL% NEQ 0 goto ERROR

goto SUCCESS

:ERROR
ECHO.
ECHO ******************
ECHO An ERROR occurred!
ECHO ******************

:SUCCESS

PAUSE

Update paths in createdeliverables.cmd

chore: Update paths in createdeliverables.cmd


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

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

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

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

:: Setup
:: -----

setlocal enabledelayedexpansion

SET ARTIFACTS=%~dp0%..\artifacts

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

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

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

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

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

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

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

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

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

for /F %%f in ('git.exe diff --name-only %PREVIOUS_SCM_COMMIT_ID% %SCM_COMMIT_ID% ^| grep package.json') do (
    SET PACKAGE_JSON=%%~f
    echo "package.json : %PACKAGE_JSON%"
    echo "NPM Install: %DEPLOYMENT_SOURCE%\%PACKAGE_JSON:~-12%"
    pushd "%DEPLOYMENT_SOURCE%\%PACKAGE_JSON:~-12%"
    npm install --production --progress=false --cache-min=432000
    npm install --save json-loader --progress=false --cache-min=432000
    IF !ERRORLEVEL! NEQ 0 goto error
    popd
)

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

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

:: 1. Build Script
node .deploy/deploy.js

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

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

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

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

:exitSetErrorLevel
exit /b 1

:exitFromFunction
()

:end
endlocal
echo Finished successfully.

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

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

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

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

:: Setup
:: -----

setlocal enabledelayedexpansion

SET ARTIFACTS=%~dp0%..\artifacts

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

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

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

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

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

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

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

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

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

for /F %%f in ('git.exe diff --name-only %PREVIOUS_SCM_COMMIT_ID% %SCM_COMMIT_ID% ^| grep package.json') do (
    SET PACKAGE_JSON=%%~f
    echo %PACKAGE_JSON%
    echo %%f
    echo %%~f
    echo "NPM Install: %DEPLOYMENT_SOURCE%\%PACKAGE_JSON:~-12%"
    pushd "%DEPLOYMENT_SOURCE%\%PACKAGE_JSON:~-12%"
    npm install --production --progress=false --cache-min=432000
    npm install --save json-loader --progress=false --cache-min=432000
    IF !ERRORLEVEL! NEQ 0 goto error
    popd
)

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

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

:: 1. Build Script
node .deploy/deploy.js

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

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

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

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

:exitSetErrorLevel
exit /b 1

:exitFromFunction
()

:end
endlocal
echo Finished successfully.

Build Master:2017-02-28T18:33:30.828Z

Build Master:2017-02-28T18:33:30.828Z


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

:: ----------------------
:: KUDU Deployment Script
:: Version: 0.1.11
:: ----------------------

:: 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

:: FOR_ORCHARD, we changed to this from temp
SET SITE_DIR=%~dp0%..

echo SITE_DIR: "%SITE_DIR%"

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

IF NOT DEFINED DEPLOYMENT_TARGET (
  SET DEPLOYMENT_TARGET=%SITE_DIR%\wwwroot
)
echo DEPLOYMENT_TARGET: "%DEPLOYMENT_TARGET%"

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

  IF NOT DEFINED PREVIOUS_MANIFEST_PATH (
    SET PREVIOUS_MANIFEST_PATH=%SITE_DIR%\manifest
  )
)
echo NEXT_MANIFEST_PATH: "%NEXT_MANIFEST_PATH%"
echo PREVIOUS_MANIFEST_PATH: "%PREVIOUS_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="%DEPLOYMENT_SOURCE%\build\precompiled"
  SET CLEAN_LOCAL_DEPLOYMENT_TEMP=true
)

IF DEFINED CLEAN_LOCAL_DEPLOYMENT_TEMP (

  echo Cleaning local deployment temp.

  IF EXIST "%DEPLOYMENT_TEMP%" rd /s /q "%DEPLOYMENT_TEMP%"
  mkdir "%DEPLOYMENT_TEMP%"
)

IF NOT DEFINED MSBUILD_PATH (
  SET MSBUILD_PATH=%WINDIR%\Microsoft.NET\Framework\v4.0.30319\msbuild.exe
)

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

echo Handling .NET Web Application deployment.

:: 1. Restore NuGet packages
IF /I "src\Orchard.sln" NEQ "" (

  echo Restoring NuGet packages

  call :ExecuteCmd nuget restore "%DEPLOYMENT_SOURCE%\src\Orchard.sln"
  IF !ERRORLEVEL! NEQ 0 goto error
)

:: 2. Build to the temporary path
IF /I "%IN_PLACE_DEPLOYMENT%" NEQ "1" (

  echo Running build precompiled

  call :ExecuteCmd "%MSBUILD_PATH%" "%DEPLOYMENT_SOURCE%\orchard.proj" /nologo /verbosity:m /t:Precompiled /p:AutoParameterizationWebConfigConnectionStrings=false;Configuration=Release /p:SolutionDir="%DEPLOYMENT_SOURCE%\src\\" %SCM_BUILD_ARGS%

) ELSE (

  echo Warning: we don't usually performing build precompiled for in place deployment

  call :ExecuteCmd "%MSBUILD_PATH%" "%DEPLOYMENT_SOURCE%\orchard.proj" /nologo /verbosity:m /t:Precompiled /p:AutoParameterizationWebConfigConnectionStrings=false;Configuration=Release /p:SolutionDir="%DEPLOYMENT_SOURCE%\src\\" %SCM_BUILD_ARGS%
)

IF !ERRORLEVEL! NEQ 0 goto error

:: 3. KuduSync
IF /I "%IN_PLACE_DEPLOYMENT%" NEQ "1" (

  echo Copying build results to wwwroot

  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
)

::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

:: Post deployment stub
IF DEFINED POST_DEPLOYMENT_ACTION call "%POST_DEPLOYMENT_ACTION%"
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: 0.1.11
:: ----------------------

:: 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

:: FOR_ORCHARD, we changed to this from temp
SET SITE_DIR=%~dp0%..

echo SITE_DIR: "%SITE_DIR%"

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

IF NOT DEFINED DEPLOYMENT_TARGET (
  SET DEPLOYMENT_TARGET=%SITE_DIR%\wwwroot
)
echo DEPLOYMENT_TARGET: "%DEPLOYMENT_TARGET%"

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

  IF NOT DEFINED PREVIOUS_MANIFEST_PATH (
    SET PREVIOUS_MANIFEST_PATH=%SITE_DIR%\manifest
  )
)
echo NEXT_MANIFEST_PATH: "%NEXT_MANIFEST_PATH%"
echo PREVIOUS_MANIFEST_PATH: "%PREVIOUS_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="%DEPLOYMENT_SOURCE%\build\precompiled"
  SET CLEAN_LOCAL_DEPLOYMENT_TEMP=true
)

echo DEPLOYMENT_TEMP: "%DEPLOYMENT_TEMP%"

IF DEFINED CLEAN_LOCAL_DEPLOYMENT_TEMP (

  echo Cleaning local deployment temp.

  IF EXIST "%DEPLOYMENT_TEMP%" rd /s /q "%DEPLOYMENT_TEMP%"
  mkdir "%DEPLOYMENT_TEMP%"
)

IF NOT DEFINED MSBUILD_PATH (
  SET MSBUILD_PATH=%WINDIR%\Microsoft.NET\Framework\v4.0.30319\msbuild.exe
)

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

echo Handling .NET Web Application deployment.

:: 1. Restore NuGet packages
IF /I "src\Orchard.sln" NEQ "" (

  echo Restoring NuGet packages

  call :ExecuteCmd nuget restore "%DEPLOYMENT_SOURCE%\src\Orchard.sln"
  IF !ERRORLEVEL! NEQ 0 goto error
)

:: 2. Build to the temporary path
IF /I "%IN_PLACE_DEPLOYMENT%" NEQ "1" (

  echo Running build precompiled

  call :ExecuteCmd "%MSBUILD_PATH%" "%DEPLOYMENT_SOURCE%\orchard.proj" /nologo /verbosity:m /t:Precompiled /p:AutoParameterizationWebConfigConnectionStrings=false;Configuration=Release /p:SolutionDir="%DEPLOYMENT_SOURCE%\src\\" %SCM_BUILD_ARGS%

) ELSE (

  echo Warning: we don't usually performing build precompiled for in place deployment

  call :ExecuteCmd "%MSBUILD_PATH%" "%DEPLOYMENT_SOURCE%\orchard.proj" /nologo /verbosity:m /t:Precompiled /p:AutoParameterizationWebConfigConnectionStrings=false;Configuration=Release /p:SolutionDir="%DEPLOYMENT_SOURCE%\src\\" %SCM_BUILD_ARGS%
)

IF !ERRORLEVEL! NEQ 0 goto error

:: 3. KuduSync
IF /I "%IN_PLACE_DEPLOYMENT%" NEQ "1" (

  echo Copying build results to wwwroot
  echo "%DEPLOYMENT_TEMP%"
  echo "%DEPLOYMENT_TARGET%"
  echo "%NEXT_MANIFEST_PATH%"
  echo "%PREVIOUS_MANIFEST_PATH%"

  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
)

::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

:: Post deployment stub
IF DEFINED POST_DEPLOYMENT_ACTION call "%POST_DEPLOYMENT_ACTION%"
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.

Add useful echos

Add useful echos


@setlocal enabledelayedexpansion

REM Parse Arguments.

set RoslynRoot=%~dp0
set BuildConfiguration=Debug
:ParseArguments
if "%1" == "" goto :DoneParsing
if /I "%1" == "/?" call :Usage && exit /b 1
if /I "%1" == "/debug" set BuildConfiguration=Debug&&shift&& goto :ParseArguments
if /I "%1" == "/release" set BuildConfiguration=Release&&shift&& goto :ParseArguments
if /I "%1" == "/test32" set Test64=false&&shift&& goto :ParseArguments
if /I "%1" == "/test64" set Test64=true&&shift&& goto :ParseArguments
call :Usage && exit /b 1
:DoneParsing

call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\Tools\VsDevCmd.bat"

REM Build the compiler so we can self host it for the full build
nuget.exe restore -nocache -verbosity quiet %RoslynRoot%build/ToolsetPackages/project.json
nuget.exe restore -nocache -verbosity quiet %RoslynRoot%build/Toolset.sln
msbuild /nologo /v:m /m %RoslynRoot%build/Toolset.sln /p:Configuration=%BuildConfiguration%

mkdir %RoslynRoot%Binaries\Bootstrap
move Binaries\%BuildConfiguration%\* %RoslynRoot%Binaries\Bootstrap
msbuild /v:m /t:Clean build/Toolset.sln /p:Configuration=%BuildConfiguration%
taskkill /F /IM vbcscompiler.exe

msbuild /v:m /m /p:BootstrapBuildPath=%RoslynRoot%Binaries\Bootstrap BuildAndTest.proj /p:Configuration=%BuildConfiguration% /p:Test64=%Test64%
if ERRORLEVEL 1 (
    taskkill /F /IM vbcscompiler.exe
    echo Build failed
    exit /b 1
)

REM Kill any instances of VBCSCompiler.exe to release locked files;
REM otherwise future CI runs may fail while trying to delete those files.
taskkill /F /IM vbcscompiler.exe

REM Verify that our project.lock.json files didn't change as a result of
REM restore.  If they do then the commit changed the dependencies without
REM updating the lock files.
git diff --exit-code --quiet
if ERRORLEVEL 1 (
    echo Commit changed dependencies without updating project.lock.json
    git diff --exit-code
    exit /b 1
)

REM It is okay and expected for taskkill to fail (it's a cleanup routine).  Ensure
REM caller sees successful exit.
exit /b 0

:Usage
@echo Usage: cibuild.cmd [/debug^|/release]
@echo   /debug 	Perform debug build.  This is the default.
@echo   /release Perform release build
@echo   /test32 Run unit tests in the 32-bit runner.  This is the default.
@echo   /test64 Run units tests in the 64-bit runner.
@goto :eof

@setlocal enabledelayedexpansion

REM Parse Arguments.

set RoslynRoot=%~dp0
set BuildConfiguration=Debug
:ParseArguments
if "%1" == "" goto :DoneParsing
if /I "%1" == "/?" call :Usage && exit /b 1
if /I "%1" == "/debug" set BuildConfiguration=Debug&&shift&& goto :ParseArguments
if /I "%1" == "/release" set BuildConfiguration=Release&&shift&& goto :ParseArguments
if /I "%1" == "/test32" set Test64=false&&shift&& goto :ParseArguments
if /I "%1" == "/test64" set Test64=true&&shift&& goto :ParseArguments
call :Usage && exit /b 1
:DoneParsing

call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\Tools\VsDevCmd.bat"

REM Build the compiler so we can self host it for the full build
nuget.exe restore -nocache -verbosity quiet %RoslynRoot%build/ToolsetPackages/project.json
nuget.exe restore -nocache -verbosity quiet %RoslynRoot%build/Toolset.sln
REM Set the build version only so the assembly version is set to the semantic version,
REM which allows analyzers to laod because the compiler has binding redirects to the
REM semantic version
msbuild /nologo /v:m /m /p:BuildVersion=0.0.0.0 %RoslynRoot%build/Toolset.sln /p:Configuration=%BuildConfiguration%

mkdir %RoslynRoot%Binaries\Bootstrap
move Binaries\%BuildConfiguration%\* %RoslynRoot%Binaries\Bootstrap
msbuild /v:m /t:Clean build/Toolset.sln /p:Configuration=%BuildConfiguration%
taskkill /F /IM vbcscompiler.exe

msbuild /v:m /m /p:BootstrapBuildPath=%RoslynRoot%Binaries\Bootstrap BuildAndTest.proj /p:Configuration=%BuildConfiguration% /p:Test64=%Test64%
if ERRORLEVEL 1 (
    taskkill /F /IM vbcscompiler.exe
    echo Build failed
    exit /b 1
)

REM Kill any instances of VBCSCompiler.exe to release locked files;
REM otherwise future CI runs may fail while trying to delete those files.
taskkill /F /IM vbcscompiler.exe

REM Verify that our project.lock.json files didn't change as a result of
REM restore.  If they do then the commit changed the dependencies without
REM updating the lock files.
git diff --exit-code --quiet
if ERRORLEVEL 1 (
    echo Commit changed dependencies without updating project.lock.json
    git diff --exit-code
    exit /b 1
)

REM It is okay and expected for taskkill to fail (it's a cleanup routine).  Ensure
REM caller sees successful exit.
exit /b 0

:Usage
@echo Usage: cibuild.cmd [/debug^|/release]
@echo   /debug 	Perform debug build.  This is the default.
@echo   /release Perform release build
@echo   /test32 Run unit tests in the 32-bit runner.  This is the default.
@echo   /test64 Run units tests in the 64-bit runner.
@goto :eof

Change the build version in the Toolset bootstrap build so analyzers can run


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

:: ----------------------
:: KUDU Deployment Script
:: Version: 0.2.2
:: ----------------------

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

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

:: Setup
:: -----

setlocal enabledelayedexpansion

SET ARTIFACTS=%~dp0%..\artifacts

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

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

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

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

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

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

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

IF NOT DEFINED MSBUILD_PATH (
  SET MSBUILD_PATH=%WINDIR%\Microsoft.NET\Framework\v4.0.30319\msbuild.exe
)

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

echo Handling .NET Web Application deployment.

:: 1. Restore NuGet packages
IF /I "Solutions\Tenant" NEQ "" (
  call :ExecuteCmd nuget restore "%DEPLOYMENT_SOURCE%\Solutions\Tenant"
  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%\Solutions\Tenant" /nologo /verbosity:m /t:Build /t:pipelinePreDeployCopyAllFilesToOneFolder /p:_PackageTempDir="%DEPLOYMENT_TEMP%";AutoParameterizationWebConfigConnectionStrings=false;Configuration=Release /p:SolutionDir="%DEPLOYMENT_SOURCE%\Solutions\\" %SCM_BUILD_ARGS%
) ELSE (
  call :ExecuteCmd "%MSBUILD_PATH%" "%DEPLOYMENT_SOURCE%\Solutions\Tenant" /nologo /verbosity:m /t:Build /p:AutoParameterizationWebConfigConnectionStrings=false;Configuration=Release /p:SolutionDir="%DEPLOYMENT_SOURCE%\Solutions\\" %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
)

::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

:: Post deployment stub
IF DEFINED POST_DEPLOYMENT_ACTION call "%POST_DEPLOYMENT_ACTION%"
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: 0.2.2
:: ----------------------

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

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

:: Setup
:: -----

setlocal enabledelayedexpansion

SET ARTIFACTS=%~dp0%..\artifacts

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

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

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

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

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

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

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

IF NOT DEFINED MSBUILD_PATH (
  SET MSBUILD_PATH=%WINDIR%\Microsoft.NET\Framework\v4.0.30319\msbuild.exe
)

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

echo Handling .NET Web Application deployment.

:: 1. Restore NuGet packages
IF /I "Solutions\Tenant Information Portal\src\DashBoard.sln" NEQ "" (
  call :ExecuteCmd nuget restore "%DEPLOYMENT_SOURCE%\Solutions\Tenant Information Portal\src\DashBoard.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%\Solutions\Tenant Information Portal\src\TIP.DashBoard\TIP.Dashboard.csproj" /nologo /verbosity:m /t:Build /t:pipelinePreDeployCopyAllFilesToOneFolder /p:_PackageTempDir="%DEPLOYMENT_TEMP%";AutoParameterizationWebConfigConnectionStrings=false;Configuration=Release /p:SolutionDir="%DEPLOYMENT_SOURCE%\Solutions\Tenant Information Portal\src\\" %SCM_BUILD_ARGS%
) ELSE (
  call :ExecuteCmd "%MSBUILD_PATH%" "%DEPLOYMENT_SOURCE%\Solutions\Tenant Information Portal\src\TIP.DashBoard\TIP.Dashboard.csproj" /nologo /verbosity:m /t:Build /p:AutoParameterizationWebConfigConnectionStrings=false;Configuration=Release /p:SolutionDir="%DEPLOYMENT_SOURCE%\Solutions\Tenant Information Portal\src\\" %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
)

::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

:: Post deployment stub
IF DEFINED POST_DEPLOYMENT_ACTION call "%POST_DEPLOYMENT_ACTION%"
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 path

fix path


java -jar Collate-TUI.jar collate from src/main to collated/main include java, fxml, css
java -jar Collate-TUI.jar collate from src/test to collated/test include java
java -jar Collate-TUI.jar collate from unused to collated/unused include java, fxml, css

Fix checkstyle violation in collate.bat

Fix checkstyle violation in collate.bat


@echo off
rem rime build script for msvc toolchain.
rem
rem 2012-11-25 <chen.sst@gmail.com>

set BACK=%CD%

if exist env.bat call env.bat

set OLD_PATH=%PATH%
if defined DEV_PATH set PATH=%OLD_PATH%;%DEV_PATH%
path
echo.

if not defined RIME_ROOT set RIME_ROOT=%CD%
echo RIME_ROOT=%RIME_ROOT%
echo.

echo BOOST_ROOT=%BOOST_ROOT%
echo.

set build=vcbuild
set build_boost=0
set build_thirdparty=0
set build_librime=0
set build_shared=ON
set build_test=OFF
set enable_logging=ON

if "%1" == "" set build_librime=1

:parse_cmdline_options
if "%1" == "" goto end_parsing_cmdline_options
if "%1" == "boost" set build_boost=1
if "%1" == "thirdparty" set build_thirdparty=1
if "%1" == "librime" set build_librime=1
if "%1" == "static" (
  set build=vcbuild-static
  set build_librime=1
  set build_shared=OFF
)
if "%1" == "shared" (
  set build=vcbuild
  set build_librime=1
  set build_shared=ON
)
if "%1" == "test" (
  set build_librime=1
  set build_test=ON
)
if "%1" == "nologging" (
  set build_librime=1
  set enable_logging=OFF
)
shift
goto parse_cmdline_options
:end_parsing_cmdline_options

rem set CURL=%RIME_ROOT%\thirdparty\bin\curl.exe
rem set DOWNLOAD="%CURL%" --remote-name-all
rem set GOOGLECODE_SVN=http://rimeime.googlecode.com/svn/trunk/

if %build_boost% == 1 (
  cd %BOOST_ROOT%
  if not exist bjam.exe call bootstrap.bat
  if %ERRORLEVEL% NEQ 0 goto ERROR
  bjam toolset=msvc-12.0 variant=release link=static threading=multi runtime-link=static stage --with-chrono --with-date_time --with-filesystem --with-system --with-regex --with-signals --with-thread
  if %ERRORLEVEL% NEQ 0 goto ERROR
  bjam toolset=msvc-12.0 variant=release link=static threading=multi runtime-link=static address-model=64 --stagedir=stage_x64 stage --with-chrono --with-date_time --with-filesystem --with-system --with-regex --with-signals --with-thread
  if %ERRORLEVEL% NEQ 0 goto ERROR
)

if %build_thirdparty% == 1 (
  echo building glog.
  cd "%RIME_ROOT%"\thirdparty\src\glog
  rem devenv google-glog-vc10.sln /build "Release"
  msbuild.exe google-glog-vc12.sln /p:Configuration=Release
  if %ERRORLEVEL% NEQ 0 goto ERROR
  echo built. copying artifacts.
  xcopy /S /I /Y src\windows\glog "%RIME_ROOT%"\thirdparty\include\glog\
  if %ERRORLEVEL% NEQ 0 goto ERROR
  copy /Y Release\libglog.lib "%RIME_ROOT%"\thirdparty\lib\
  if %ERRORLEVEL% NEQ 0 goto ERROR
  copy /Y Release\libglog.dll "%RIME_ROOT%"\thirdparty\bin\
  if %ERRORLEVEL% NEQ 0 goto ERROR

  echo building kyotocabinet.
  cd "%RIME_ROOT%"\thirdparty\src\kyotocabinet
  nmake -f VC12makefile
  if %ERRORLEVEL% NEQ 0 goto ERROR
  nmake -f VC12makefile binpkg
  if %ERRORLEVEL% NEQ 0 goto ERROR
  echo built. copying artifacts.
  copy /Y output\include\*.h "%RIME_ROOT%"\thirdparty\include\
  if %ERRORLEVEL% NEQ 0 goto ERROR
  copy /Y output\lib\*.lib "%RIME_ROOT%"\thirdparty\lib\
  if %ERRORLEVEL% NEQ 0 goto ERROR
  copy /Y output\bin\*.* "%RIME_ROOT%"\thirdparty\bin\
  if %ERRORLEVEL% NEQ 0 goto ERROR

  echo building yaml-cpp.
  cd "%RIME_ROOT%"\thirdparty\src\yaml-cpp
  if not exist build mkdir build
  cd build
  cmake -DMSVC_SHARED_RT=OFF ..
  if %ERRORLEVEL% NEQ 0 goto ERROR
  rem devenv YAML_CPP.sln /build "Release"
  msbuild.exe YAML_CPP.sln /p:Configuration=Release
  if %ERRORLEVEL% NEQ 0 goto ERROR
  echo built. copying artifacts.
  xcopy /S /I /Y ..\include\yaml-cpp "%RIME_ROOT%"\thirdparty\include\yaml-cpp\
  if %ERRORLEVEL% NEQ 0 goto ERROR
  copy /Y Release\libyaml-cppmt.lib "%RIME_ROOT%"\thirdparty\lib\
  if %ERRORLEVEL% NEQ 0 goto ERROR

  echo building gtest.
  cd "%RIME_ROOT%"\thirdparty\src\gtest
  if not exist build mkdir build
  cd build
  cmake ..
  if %ERRORLEVEL% NEQ 0 goto ERROR
  rem devenv gtest.sln /build "Release"
  msbuild.exe gtest.sln /p:Configuration=Release
  if %ERRORLEVEL% NEQ 0 goto ERROR
  echo built. copying artifacts.
  xcopy /S /I /Y ..\include\gtest "%RIME_ROOT%"\thirdparty\include\gtest\
  if %ERRORLEVEL% NEQ 0 goto ERROR
  copy /Y Release\gtest*.lib "%RIME_ROOT%"\thirdparty\lib\
  if %ERRORLEVEL% NEQ 0 goto ERROR

  echo skipped building opencc.

  cd "%RIME_ROOT%"\thirdparty\src\opencc-windows
  call generate_vc_lib_file.bat
  if %ERRORLEVEL% NEQ 0 goto ERROR

  cd "%RIME_ROOT%"\thirdparty\include
  if not exist opencc mkdir opencc
  cd opencc
  rem if not exist opencc.h %DOWNLOAD% %GOOGLECODE_SVN%misc/opencc/opencc.h
  rem if not exist opencc_types.h %DOWNLOAD% %GOOGLECODE_SVN%misc/opencc/opencc_types.h
  copy /Y "%RIME_ROOT%"\thirdparty\src\opencc-windows\opencc.h .
  copy /Y "%RIME_ROOT%"\thirdparty\src\opencc-windows\opencc_types.h .
  if %ERRORLEVEL% NEQ 0 goto ERROR
  cd "%RIME_ROOT%"\thirdparty\lib
  rem if not exist opencc.lib %DOWNLOAD% %GOOGLECODE_SVN%misc/opencc/vc10/opencc.lib
  copy /Y "%RIME_ROOT%"\thirdparty\src\opencc-windows\opencc.lib .
  if %ERRORLEVEL% NEQ 0 goto ERROR
  cd "%RIME_ROOT%"\thirdparty\bin
  rem if not exist opencc.dll %DOWNLOAD% %GOOGLECODE_SVN%misc/opencc/opencc.dll
  rem if not exist opencc.exe %DOWNLOAD% %GOOGLECODE_SVN%misc/opencc/opencc.exe
  rem if not exist opencc_dict.exe %DOWNLOAD% %GOOGLECODE_SVN%misc/opencc/opencc_dict.exe
  copy /Y "%RIME_ROOT%"\thirdparty\src\opencc-windows\opencc.dll .
  copy /Y "%RIME_ROOT%"\thirdparty\src\opencc-windows\opencc.exe .
  copy /Y "%RIME_ROOT%"\thirdparty\src\opencc-windows\opencc_dict.exe .
  if %ERRORLEVEL% NEQ 0 goto ERROR
)

if %build_librime% == 0 goto EXIT

set CMAKE_INCLUDE_PATH=%RIME_ROOT%\thirdparty\include
echo CMAKE_INCLUDE_PATH=%CMAKE_INCLUDE_PATH%
echo.
set CMAKE_LIBRARY_PATH=%RIME_ROOT%\thirdparty\lib
echo CMAKE_LIBRARY_PATH=%CMAKE_LIBRARY_PATH%
echo.

rem TODO: select a cmake generator
rem set CMAKE_GENERATOR="MinGW Makefiles"
rem set CMAKE_GENERATOR="Eclipse CDT4 - MinGW Makefiles"
rem set CMAKE_GENERATOR="Visual Studio 9 2008"
set CMAKE_GENERATOR="Visual Studio 12"

set BUILD_DIR=%RIME_ROOT%\%build%
if not exist %BUILD_DIR% mkdir %BUILD_DIR%

set RIME_CMAKE_FLAGS=-DBUILD_STATIC=ON -DBUILD_SHARED_LIBS=%build_shared% -DBUILD_TEST=%build_test% -DENABLE_LOGGING=%enable_logging%

cd %BUILD_DIR%
echo cmake -G %CMAKE_GENERATOR% %RIME_CMAKE_FLAGS% %RIME_ROOT%
cmake -G %CMAKE_GENERATOR% %RIME_CMAKE_FLAGS% %RIME_ROOT%
if %ERRORLEVEL% NEQ 0 goto ERROR

echo.
echo building librime.
if exist msbuild.log del msbuild.log
msbuild.exe rime.sln /p:Configuration=Release /fl
if %ERRORLEVEL% NEQ 0 goto ERROR

echo.
echo ready.
echo.
goto EXIT

:ERROR
echo.
echo error building la rime.
echo.

:EXIT
set PATH=%OLD_PATH%
cd %RIME_ROOT%
rem pause

@echo off
rem rime build script for msvc toolchain.
rem
rem 2012-11-25 <chen.sst@gmail.com>

set BACK=%CD%

if exist env.bat call env.bat

set OLD_PATH=%PATH%
if defined DEV_PATH set PATH=%OLD_PATH%;%DEV_PATH%
path
echo.

if not defined RIME_ROOT set RIME_ROOT=%CD%
echo RIME_ROOT=%RIME_ROOT%
echo.

echo BOOST_ROOT=%BOOST_ROOT%
echo.

set build=vcbuild
set build_boost=0
set build_thirdparty=0
set build_librime=0
set build_shared=ON
set build_test=OFF
set enable_logging=ON

if "%1" == "" set build_librime=1

:parse_cmdline_options
if "%1" == "" goto end_parsing_cmdline_options
if "%1" == "boost" set build_boost=1
if "%1" == "thirdparty" set build_thirdparty=1
if "%1" == "librime" set build_librime=1
if "%1" == "static" (
  set build=vcbuild-static
  set build_librime=1
  set build_shared=OFF
)
if "%1" == "shared" (
  set build=vcbuild
  set build_librime=1
  set build_shared=ON
)
if "%1" == "test" (
  set build_librime=1
  set build_test=ON
)
if "%1" == "nologging" (
  set build_librime=1
  set enable_logging=OFF
)
shift
goto parse_cmdline_options
:end_parsing_cmdline_options

rem set CURL=%RIME_ROOT%\thirdparty\bin\curl.exe
rem set DOWNLOAD="%CURL%" --remote-name-all
rem set GOOGLECODE_SVN=http://rimeime.googlecode.com/svn/trunk/

if %build_boost% == 1 (
  cd %BOOST_ROOT%
  if not exist bjam.exe call bootstrap.bat
  if %ERRORLEVEL% NEQ 0 goto ERROR
  bjam toolset=msvc-12.0 variant=release link=static threading=multi runtime-link=static stage --with-chrono --with-date_time --with-filesystem --with-system --with-regex --with-signals --with-thread
  if %ERRORLEVEL% NEQ 0 goto ERROR
  bjam toolset=msvc-12.0 variant=release link=static threading=multi runtime-link=static address-model=64 --stagedir=stage_x64 stage --with-chrono --with-date_time --with-filesystem --with-system --with-regex --with-signals --with-thread
  if %ERRORLEVEL% NEQ 0 goto ERROR
)

if %build_thirdparty% == 1 (
  echo building glog.
  cd "%RIME_ROOT%"\thirdparty\src\glog
  rem devenv google-glog-vc10.sln /build "Release"
  msbuild.exe google-glog-vc12.sln /p:Configuration=Release
  if %ERRORLEVEL% NEQ 0 goto ERROR
  echo built. copying artifacts.
  xcopy /S /I /Y src\windows\glog "%RIME_ROOT%"\thirdparty\include\glog\
  if %ERRORLEVEL% NEQ 0 goto ERROR
  copy /Y Release\libglog.lib "%RIME_ROOT%"\thirdparty\lib\
  if %ERRORLEVEL% NEQ 0 goto ERROR
  copy /Y Release\libglog.dll "%RIME_ROOT%"\thirdparty\bin\
  if %ERRORLEVEL% NEQ 0 goto ERROR

  echo building kyotocabinet.
  cd "%RIME_ROOT%"\thirdparty\src\kyotocabinet
  nmake -f VC12makefile
  if %ERRORLEVEL% NEQ 0 goto ERROR
  nmake -f VC12makefile binpkg
  if %ERRORLEVEL% NEQ 0 goto ERROR
  echo built. copying artifacts.
  copy /Y output\include\*.h "%RIME_ROOT%"\thirdparty\include\
  if %ERRORLEVEL% NEQ 0 goto ERROR
  copy /Y output\lib\*.lib "%RIME_ROOT%"\thirdparty\lib\
  if %ERRORLEVEL% NEQ 0 goto ERROR
  copy /Y output\bin\*.* "%RIME_ROOT%"\thirdparty\bin\
  if %ERRORLEVEL% NEQ 0 goto ERROR

  echo building yaml-cpp.
  cd "%RIME_ROOT%"\thirdparty\src\yaml-cpp
  if not exist build mkdir build
  cd build
  cmake -DMSVC_SHARED_RT=OFF ..
  if %ERRORLEVEL% NEQ 0 goto ERROR
  rem devenv YAML_CPP.sln /build "Release"
  msbuild.exe YAML_CPP.sln /p:Configuration=Release
  if %ERRORLEVEL% NEQ 0 goto ERROR
  echo built. copying artifacts.
  xcopy /S /I /Y ..\include\yaml-cpp "%RIME_ROOT%"\thirdparty\include\yaml-cpp\
  if %ERRORLEVEL% NEQ 0 goto ERROR
  copy /Y Release\libyaml-cppmt.lib "%RIME_ROOT%"\thirdparty\lib\
  if %ERRORLEVEL% NEQ 0 goto ERROR

  echo building gtest.
  cd "%RIME_ROOT%"\thirdparty\src\gtest
  if not exist build mkdir build
  cd build
  cmake ..
  if %ERRORLEVEL% NEQ 0 goto ERROR
  rem devenv gtest.sln /build "Release"
  msbuild.exe gtest.sln /p:Configuration=Release
  if %ERRORLEVEL% NEQ 0 goto ERROR
  echo built. copying artifacts.
  xcopy /S /I /Y ..\include\gtest "%RIME_ROOT%"\thirdparty\include\gtest\
  if %ERRORLEVEL% NEQ 0 goto ERROR
  copy /Y Release\gtest*.lib "%RIME_ROOT%"\thirdparty\lib\
  if %ERRORLEVEL% NEQ 0 goto ERROR

  echo skipped building opencc.

  cd "%RIME_ROOT%"\thirdparty\src\opencc-windows
  call generate_vc_lib_file.bat
  if %ERRORLEVEL% NEQ 0 goto ERROR

  cd "%RIME_ROOT%"\thirdparty\include
  if not exist opencc mkdir opencc
  cd opencc
  rem if not exist opencc.h %DOWNLOAD% %GOOGLECODE_SVN%misc/opencc/opencc.h
  rem if not exist opencc_types.h %DOWNLOAD% %GOOGLECODE_SVN%misc/opencc/opencc_types.h
  copy /Y "%RIME_ROOT%"\thirdparty\src\opencc-windows\opencc.h .
  copy /Y "%RIME_ROOT%"\thirdparty\src\opencc-windows\opencc_types.h .
  if %ERRORLEVEL% NEQ 0 goto ERROR
  cd "%RIME_ROOT%"\thirdparty\lib
  rem if not exist opencc.lib %DOWNLOAD% %GOOGLECODE_SVN%misc/opencc/vc10/opencc.lib
  copy /Y "%RIME_ROOT%"\thirdparty\src\opencc-windows\opencc.lib .
  if %ERRORLEVEL% NEQ 0 goto ERROR
  cd "%RIME_ROOT%"\thirdparty\bin
  rem if not exist opencc.dll %DOWNLOAD% %GOOGLECODE_SVN%misc/opencc/opencc.dll
  rem if not exist opencc.exe %DOWNLOAD% %GOOGLECODE_SVN%misc/opencc/opencc.exe
  rem if not exist opencc_dict.exe %DOWNLOAD% %GOOGLECODE_SVN%misc/opencc/opencc_dict.exe
  copy /Y "%RIME_ROOT%"\thirdparty\src\opencc-windows\opencc.dll .
  copy /Y "%RIME_ROOT%"\thirdparty\src\opencc-windows\opencc.exe .
  copy /Y "%RIME_ROOT%"\thirdparty\src\opencc-windows\opencc_dict.exe .
  if %ERRORLEVEL% NEQ 0 goto ERROR
)

if %build_librime% == 0 goto EXIT

set CMAKE_INCLUDE_PATH=%RIME_ROOT%\thirdparty\include
echo CMAKE_INCLUDE_PATH=%CMAKE_INCLUDE_PATH%
echo.
set CMAKE_LIBRARY_PATH=%RIME_ROOT%\thirdparty\lib
echo CMAKE_LIBRARY_PATH=%CMAKE_LIBRARY_PATH%
echo.

rem TODO: select a cmake generator
rem set CMAKE_GENERATOR="MinGW Makefiles"
rem set CMAKE_GENERATOR="Eclipse CDT4 - MinGW Makefiles"
rem set CMAKE_GENERATOR="Visual Studio 9 2008"
set CMAKE_GENERATOR="Visual Studio 12"

set BUILD_DIR=%RIME_ROOT%\%build%
if not exist %BUILD_DIR% mkdir %BUILD_DIR%

set RIME_CMAKE_FLAGS=-DBUILD_STATIC=ON -DBUILD_SHARED_LIBS=%build_shared% -DBUILD_TEST=%build_test% -DENABLE_LOGGING=%enable_logging%

cd %BUILD_DIR%
echo cmake -G %CMAKE_GENERATOR% %RIME_CMAKE_FLAGS% %RIME_ROOT%
call cmake -G %CMAKE_GENERATOR% %RIME_CMAKE_FLAGS% %RIME_ROOT%
if %ERRORLEVEL% NEQ 0 goto ERROR

echo.
echo building librime.
if exist msbuild.log del msbuild.log
msbuild.exe rime.sln /p:Configuration=Release /fl
if %ERRORLEVEL% NEQ 0 goto ERROR

echo.
echo ready.
echo.
goto EXIT

:ERROR
echo.
echo error building la rime.
echo.

:EXIT
set PATH=%OLD_PATH%
cd %RIME_ROOT%
rem pause

vcbuild.bat: fix unexpected exit after running cmake.


.\Tools\nant\bin\NAnt.exe -D:project.config=release clean package nugetpushbat

Build nuget packages at the same time.

GaRelease.bat: Build nuget packages at the same time.


Create t.bat

Create t.bat


@echo off
set "USAGE=[OPTION]... ( FILE [--and FILE]... [--to FILE] )..."
set "DESCRIPTION=format Ceylon source code"
set "LONG_USAGE=    ceylon format source"
set "LONG_USAGE=%LONG_USAGE%"
set "LONG_USAGE=%LONG_USAGE%or, if you’re worried about it breaking your source code (which shouldn’t happen –"
set "LONG_USAGE=%LONG_USAGE%if anything bad happens, error recovery kicks in and the original file is destroyed)"
set "LONG_USAGE=%LONG_USAGE%or you just want to test it out:"
set "LONG_USAGE=%LONG_USAGE%"
set "LONG_USAGE=%LONG_USAGE%    ceylon format source --to source-formatted"
set "LONG_USAGE=%LONG_USAGE%"
set "LONG_USAGE=%LONG_USAGE%You can also format multiple folders at the same time:"
set "LONG_USAGE=%LONG_USAGE%"
set "LONG_USAGE=%LONG_USAGE%    ceylon format source --and test-source --to formatted"
set "LONG_USAGE=%LONG_USAGE%"
set "LONG_USAGE=%LONG_USAGE%which will recreate the ‘source’ and ‘test-source’ folders inside the new ‘formatted’ folder."
set "LONG_USAGE=%LONG_USAGE%"
set "LONG_USAGE=%LONG_USAGE%OPTIONS"
set "LONG_USAGE=%LONG_USAGE%"
set "LONG_USAGE=%LONG_USAGE%--help"
set "LONG_USAGE=%LONG_USAGE%    Print this help message."
set "LONG_USAGE=%LONG_USAGE%    (--help=options prints help for the various options.)"
set "LONG_USAGE=%LONG_USAGE%"
set "LONG_USAGE=%LONG_USAGE%--version"
set "LONG_USAGE=%LONG_USAGE%    Print version information. The first line is always just the module name and version"
set "LONG_USAGE=%LONG_USAGE%    in the format that ‘ceylon run’ understands (“ceylon.formatter/x.y.z”), which might be"
set "LONG_USAGE=%LONG_USAGE%    useful for scripts."
set "LONG_USAGE=%LONG_USAGE%"
set "LONG_USAGE=%LONG_USAGE%--${option name}=${option value}"
set "LONG_USAGE=%LONG_USAGE%    Set a formatting option. The most useful ones are:"
set "LONG_USAGE=%LONG_USAGE%    "
set "LONG_USAGE=%LONG_USAGE%    --maxLineLength"
set "LONG_USAGE=%LONG_USAGE%        The maximum line length, or “unlimited”."
set "LONG_USAGE=%LONG_USAGE%    "
set "LONG_USAGE=%LONG_USAGE%    --indentMode"
set "LONG_USAGE=%LONG_USAGE%        The indentation mode. Syntax: “x spaces” or “y-wide tabs” or “mix x-wide tabs, y spaces”."
set "LONG_USAGE=%LONG_USAGE%    "
set "LONG_USAGE=%LONG_USAGE%    --lineBreak"
set "LONG_USAGE=%LONG_USAGE%        “lf”, “crlf”, or “os” for the operating system’s native line breaks."
set "LONG_USAGE=%LONG_USAGE%    "
set "LONG_USAGE=%LONG_USAGE%    For a full list of options, see the output from ‘--help=options’"
set "LONG_USAGE=%LONG_USAGE%    or the documentation of the FormattingOptions class."

call %CEYLON_HOME%\bin\ceylon-sh-setup.bat %*

if "%errorlevel%" == "1" (
    exit /b 0
)
%CEYLON% run ceylon.formatter/1.1.1 "%*"

@echo off
setlocal EnableDelayedExpansion

set "USAGE=[OPTION]... ( FILE [--and FILE]... [--to FILE] )..."
set "DESCRIPTION=format Ceylon source code"
set LONG_USAGE=    ceylon run ceylon.formatter source^

^

or, if you're worried about it breaking your source code (which shouldn't happen --^

if anything bad happens, error recovery kicks in and the original file is destroyed)^

or you just want to test it out:^

^

    ceylon run ceylon.formatter source --to source-formatted^

^

You can also format multiple folders at the same time:^

^

    ceylon run ceylon.formatter source --and test-source --to formatted^

^

which will recreate the 'source' and 'test-source' folders inside the new 'formatted' folder.^

^

OPTIONS^

^

--help^

    Print this help message.^

    (--help=options prints help for the various options.)^

^

--version^

    Print version information. The first line is always just the module name and version^

    in the format that 'ceylon run' understands ("ceylon.formatter/x.y.z"), which might be^

    useful for scripts.^

^

--${option name}=${option value}^

    Set a formatting option. The most useful ones are:^

    ^

    --maxLineLength^

        The maximum line length, or "unlimited".^

    ^

    --indentMode^

        The indentation mode. Syntax: "x spaces" or "y-wide tabs" or "mix x-wide tabs, y spaces".^

    ^

    --lineBreak^

        "lf", "crlf", or "os" for the operating system's native line breaks.^

    ^

    For a full list of options, see the output from '--help=options'^

    or the documentation of the FormattingOptions class.^

call %CEYLON_HOME%\bin\ceylon-sh-setup.bat %*

if "%errorlevel%" == "1" (
    exit /b 0
)
%CEYLON% run ceylon.formatter/1.1.1 "%*"

Fix ceylon-format.bat script

Fix ceylon-format.bat script

- Remove unicode characters, because codepages and ancient technology
- Fix multiline variable syntax – this was a huge pain to get right,
  huge thanks to @sgalles who patiently tested about a dozen attempts on
  his Windows machine while I was blindly fumbling around on Linux.

@Quintesse should probably look at this – the syntax from the example
script doesn’t seem to work.


SET UACOMPLIANCETEST="C:\Program Files (x86)\OPC Foundation\UA 1.02\Compliance Test Tool\uacompliancetest.exe"
SET CTTFILE=".\CTT\Node-OPCUA-Server\Node-OPCUA-Server.ctt.xml"
SET SELECTION=".\CTT\Node-OPCUA-Server\nano-profile.selection.xml"
SET RESULT="tmp\nano-ctt-result.xml"

%UACOMPLIANCETEST% --close --hidden --settings %CTTFILE% --selection %SELECTION% --result %RESULT%
IF %ERRORLEVEL% EQU 1 ECHO Warning detected!
IF %ERRORLEVEL% EQU 0 ECHO OK, no problems found!
IF %ERRORLEVEL% EQU -1 ECHO FAIL, check the logs!

c:\tools\msxsl %RESULT% CTT\CTT2XUNIT.xsl -o tmp\a.xml

REM JUNIT VIEWSE (npm install junit-viewer -g)
REM junit-viewer --results=tmp\a.xml --port=8080

SET UACOMPLIANCETEST="C:\Program Files (x86)\OPC Foundation\UA 1.03\Compliance Test Tool\uacompliancetest.exe"
SET CTTFILE=".\CTT\Node-OPCUA-Server\Node-OPCUA-Server.ctt.xml"
SET SELECTION=".\CTT\Node-OPCUA-Server\nano-profile.selection.xml"
SET RESULT="tmp\nano-ctt-result.xml"

%UACOMPLIANCETEST% --close --hidden --settings %CTTFILE% --selection %SELECTION% --result %RESULT%
IF %ERRORLEVEL% EQU 1 ECHO Warning detected!
IF %ERRORLEVEL% EQU 0 ECHO OK, no problems found!
IF %ERRORLEVEL% EQU -1 ECHO FAIL, check the logs!

c:\tools\msxsl %RESULT% CTT\CTT2XUNIT.xsl -o tmp\a.xml

REM JUNIT VIEWSE (npm install junit-viewer -g)
REM junit-viewer --results=tmp\a.xml --port=8080

update CTT batch file to version 1.03

update CTT batch file to version 1.03


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

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

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

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

Move to Ruby 2.0 on windows.

Move to Ruby 2.0 on windows.


@echo off
REM Copyright (c) .NET Foundation and contributors. All rights reserved.
REM Licensed under the MIT license. See LICENSE file in the project root for full license information.

REM Get normalized version of parent path
for %%i in (%~dp0..\) DO (
    SET CLI_REPO_ROOT=%%~dpi
)

title CLI Test (%CLI_REPO_ROOT%)

REM Add Stage 2 CLI to path
set PATH=%CLI_REPO_ROOT%bin\2\win10-x64\dotnet

set DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1
set DOTNET_MULTILEVEL_LOOKUP=0
set NUGET_PACKAGES=%CLI_REPO_ROOT%.nuget\packages
set TEST_PACKAGES=%CLI_REPO_ROOT%bin\2\win10-x64\test\packages
set TEST_ARTIFACTS=%CLI_REPO_ROOT%bin\2\win10-x64\test\artifacts
set PreviousStageProps=%CLI_REPO_ROOT%bin\2\win10-x64\PreviousStage.props

@echo off
REM Copyright (c) .NET Foundation and contributors. All rights reserved.
REM Licensed under the MIT license. See LICENSE file in the project root for full license information.

REM Get normalized version of parent path
for %%i in (%~dp0..\) DO (
    SET CLI_REPO_ROOT=%%~dpi
)

title CLI Test (%CLI_REPO_ROOT%)

REM Add Stage 2 CLI to path
set PATH=%CLI_REPO_ROOT%bin\2\win10-x64\dotnet;%PATH%

set DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1
set DOTNET_MULTILEVEL_LOOKUP=0
set NUGET_PACKAGES=%CLI_REPO_ROOT%.nuget\packages
set TEST_PACKAGES=%CLI_REPO_ROOT%bin\2\win10-x64\test\packages
set TEST_ARTIFACTS=%CLI_REPO_ROOT%bin\2\win10-x64\test\artifacts
set PreviousStageProps=%CLI_REPO_ROOT%bin\2\win10-x64\PreviousStage.props

Append to existing PATH in build env scripts/cli-test-env.bat

We were clobbering the path down to just one directory


@echo off

if [%1]==[] goto USAGE
goto MKVIRTUALENV

:USAGE
echo.
echo  Pass a name to create a new virtualenv
echo.
goto END

:MKVIRTUALENV
if not defined WORKON_HOME (
    set WORKON_HOME=%USERPROFILE%\Envs
)

if defined PYTHONHOME (
	goto KEEPON
)
for %%i in (python.exe) do set PYTHONHOME=%%~dp$PATH:i
:KEEPON

call :GET_ENVNAME %*

SETLOCAL EnableDelayedExpansion

pushd "%WORKON_HOME%" 2>NUL && popd
@if errorlevel 1 (
    mkdir "%WORKON_HOME%"
)

pushd "%WORKON_HOME%\%ENVNAME%" 2>NUL && popd
@if not errorlevel 1 (
    echo.
    echo  virtualenv "%ENVNAME%" already exists
    echo.
    goto end
)

pushd "%WORKON_HOME%"
REM As of Python 2.7, calling virtualenv.exe causes a new window to open,
REM so call the script directly
REM virtualenv.exe %*
python.exe "%PYTHONHOME%\Scripts\virtualenv-script.py" %* 2>NUL
popd

REM Add unsetting of VIRTUAL_ENV to deactivate.bat
echo set VIRTUAL_ENV=>>"%WORKON_HOME%\%ENVNAME%\Scripts\deactivate.bat"

ENDLOCAL & "%WORKON_HOME%\%ENVNAME%\Scripts\activate.bat"
echo.
goto END

:GET_ENVNAME
  set "ENVNAME=%~1"
  shift
  if not "%~1"=="" goto GET_ENVNAME
goto :eof

:END

@echo off

if [%1]==[] goto USAGE
goto MKVIRTUALENV

:USAGE
echo.
echo  Pass a name to create a new virtualenv
echo.
goto END

:MKVIRTUALENV
if not defined WORKON_HOME (
    set WORKON_HOME=%USERPROFILE%\Envs
)

if defined PYTHONHOME (
	goto KEEPON
)
for %%i in (python.exe) do set PYTHONHOME=%%~dp$PATH:i
:KEEPON

call :GET_ENVNAME %*

SETLOCAL EnableDelayedExpansion

pushd "%WORKON_HOME%" 2>NUL && popd
@if errorlevel 1 (
    mkdir "%WORKON_HOME%"
)

pushd "%WORKON_HOME%\%ENVNAME%" 2>NUL && popd
@if not errorlevel 1 (
    echo.
    echo  virtualenv "%ENVNAME%" already exists
    echo.
    goto end
)

pushd "%WORKON_HOME%"
REM As of Python 2.7, calling virtualenv.exe causes a new window to open,
REM so call the script directly
REM virtualenv.exe %*
python.exe "%PYTHONHOME%\Scripts\virtualenv-script.py" %* 2>NUL
popd

REM Edit PYTHONPATH to include the VIRTUAL_ENV scripts.
REM This should be a change adopted by virtualenv.
>>"%WORKON_HOME%\%ENVNAME%\Scripts\activate.bat" (
	echo.
	echo.if defined _OLD_VIRTUAL_PYTHONPATH (
	echo.	set PYTHONPATH=%%_OLD_VIRTUAL_PYTHONPATH%%
	echo.	goto SKIPPYTHONPATH
	echo.^)
	echo.
	echo.set _OLD_VIRTUAL_PYTHONPATH=%%PYTHONPATH%%
	echo.
	echo.:SKIPPYTHONPATH
	echo.set PYTHONPATH=%%VIRTUAL_ENV%%\Scripts;%%VIRTUAL_ENV%%\Lib;%%VIRTUAL_ENV%%\Lib\site-packages;%%PYTHONPATH%%
)

REM Add unsetting of VIRTUAL_ENV to deactivate.bat
>>"%WORKON_HOME%\%ENVNAME%\Scripts\deactivate.bat" (
	echo.
	echo.if defined _OLD_VIRTUAL_PYTHONPATH (
	echo.	set PYTHONPATH=%%_OLD_VIRTUAL_PYTHONPATH%%
	echo.^)
	echo.set VIRTUAL_ENV=
)

ENDLOCAL & "%WORKON_HOME%\%ENVNAME%\Scripts\activate.bat"
echo.
goto END

:GET_ENVNAME
  set "ENVNAME=%~1"
  shift
  if not "%~1"=="" goto GET_ENVNAME
goto :eof

:END

Set and unset pythonpath according to active virtualenv


@rem Common file shared between external.bat and external-amd64.bat.  Responsible for
@rem fetching external components into the root\.. buildbot directories.

cd ..
@rem XXX: If you need to force the buildbots to start from a fresh environment, uncomment
@rem the following, check it in, then check it out, comment it out, then check it back in.
@rem if exist bzip2-1.0.6 rd /s/q bzip2-1.0.6
@rem if exist tcltk rd /s/q tcltk
@rem if exist tcltk64 rd /s/q tcltk64
@rem if exist tcl8.4.12 rd /s/q tcl8.4.12
@rem if exist tcl8.4.16 rd /s/q tcl8.4.16
@rem if exist tcl-8.4.18.1 rd /s/q tcl-8.4.18.1
@rem if exist tk8.4.12 rd /s/q tk8.4.12
@rem if exist tk8.4.16 rd /s/q tk8.4.16
@rem if exist tk-8.4.18.1 rd /s/q tk-8.4.18.1
@rem if exist db-4.4.20 rd /s/q db-4.4.20
@rem if exist db-4.7.25.0 rd /s/q db-4.7.25.0
if exist openssl-0.9.8x rd /s/q openssl-0.9.8x
@rem if exist sqlite-3.6.21 rd /s/q sqlite-3.6.21

@rem bzip
if not exist bzip2-1.0.6 (
   rd /s/q bzip2-1.0.5
  svn export http://svn.python.org/projects/external/bzip2-1.0.6
)

@rem Berkeley DB
if exist db-4.4.20 rd /s/q db-4.4.20
if not exist db-4.7.25.0 svn export http://svn.python.org/projects/external/db-4.7.25.0

@rem OpenSSL
if not exist openssl-0.9.8x svn export http://svn.python.org/projects/external/openssl-0.9.8x

@rem tcl/tk
if not exist tcl-8.5.2.1 (
   rd /s/q tcltk tcltk64
   svn export http://svn.python.org/projects/external/tcl-8.5.2.1
)
if not exist tk-8.5.2.0 svn export http://svn.python.org/projects/external/tk-8.5.2.0

@rem sqlite3
if not exist sqlite-3.6.21 (
  rd /s/q sqlite-source-3.3.4
  svn export http://svn.python.org/projects/external/sqlite-3.6.21
)

@rem Common file shared between external.bat and external-amd64.bat.  Responsible for
@rem fetching external components into the root\.. buildbot directories.

cd ..
@rem XXX: If you need to force the buildbots to start from a fresh environment, uncomment
@rem the following, check it in, then check it out, comment it out, then check it back in.
@rem if exist bzip2-1.0.6 rd /s/q bzip2-1.0.6
@rem if exist tcltk rd /s/q tcltk
@rem if exist tcltk64 rd /s/q tcltk64
@rem if exist tcl8.4.12 rd /s/q tcl8.4.12
@rem if exist tcl8.4.16 rd /s/q tcl8.4.16
@rem if exist tcl-8.4.18.1 rd /s/q tcl-8.4.18.1
@rem if exist tk8.4.12 rd /s/q tk8.4.12
@rem if exist tk8.4.16 rd /s/q tk8.4.16
@rem if exist tk-8.4.18.1 rd /s/q tk-8.4.18.1
@rem if exist db-4.4.20 rd /s/q db-4.4.20
@rem if exist db-4.7.25.0 rd /s/q db-4.7.25.0
@rem if exist openssl-0.9.8x rd /s/q openssl-0.9.8x
@rem if exist sqlite-3.6.21 rd /s/q sqlite-3.6.21

@rem bzip
if not exist bzip2-1.0.6 (
   rd /s/q bzip2-1.0.5
  svn export http://svn.python.org/projects/external/bzip2-1.0.6
)

@rem Berkeley DB
if exist db-4.4.20 rd /s/q db-4.4.20
if not exist db-4.7.25.0 svn export http://svn.python.org/projects/external/db-4.7.25.0

@rem OpenSSL
if not exist openssl-0.9.8x svn export http://svn.python.org/projects/external/openssl-0.9.8x

@rem tcl/tk
if not exist tcl-8.5.2.1 (
   rd /s/q tcltk tcltk64
   svn export http://svn.python.org/projects/external/tcl-8.5.2.1
)
if not exist tk-8.5.2.0 svn export http://svn.python.org/projects/external/tk-8.5.2.0

@rem sqlite3
if not exist sqlite-3.6.21 (
  rd /s/q sqlite-source-3.3.4
  svn export http://svn.python.org/projects/external/sqlite-3.6.21
)

Stop refetching OpenSSL.

Stop refetching OpenSSL.


cd staging
git clone -b master --depth=1 --single-branch "https://github.com/CsoundQt/CsoundQt.git"
cd CsoundQt
dir
qmake.exe qcs.pro ^
    CONFIG+=html_webengine ^
    CONFIG+=thread ^
    CONFIG+=perfThread_build ^
    CONFIG+=csound6 ^
    CONFIG+=build64 ^
    CONFIG+=QCS_QT59 ^
    QT+=xml ^
    DEFINES+="USE_DOUBLE=1" ^
    DEFINES+="USE_QT_GT_58=1" ^
    CSOUND_API_INCLUDE_DIR="%APPVEYOR_BUILD_FOLDER%\\include" ^
    CSOUND_INTERFACES_INCLUDE_DIR="%APPVEYOR_BUILD_FOLDER%\\interfaces" ^
    CSOUND_LIBRARY_DIR="%APPVEYOR_BUILD_FOLDER%\\msvc\\csound-vs\\RelWithDebInfo" ^
    DEFAULT_CSOUND_LIBS=csound64.lib ^
    CSOUND_LIBRARY=csound64.lib ^
    LCSOUND=%APPVEYOR_BUILD_FOLDER%\\msvc\\csound-vs\\RelWithDebInfo\\csound64.lib ^
    LIBS+="%VCPKGDir%\\installed\\x64-windows\\lib\\libsndfile-1.lib" ^
    LIBS+="%APPVEYOR_BUILD_FOLDER%\\msvc\\csound-vs\\RelWithDebInfo\\csound64.lib" ^
    LIBS+="Ole32.lib" ^
    -after ^
    CSOUND_INTERFACES_INCLUDE_DIR+="%~dp0deps\\include" ^
    CSOUND_INTERFACES_INCLUDE_DIR+="%APPVEYOR_BUILD_FOLDER%\\deps\\include" ^
    CSOUND_INTERFACES_INCLUDE_DIR+="%VCPKGDir%\\installed\\x64-windows\\include" ^
    INCLUDEPATH+="%VCPKGDir%\\installed\\x64-windows\\include"
nmake.exe /A
move "bin\\CsoundQt*.*" "..\\..\\csound-vs\\RelWithDebInfo\\"
cd ..\..

cd staging
git clone -b master --depth=1 --single-branch "https://github.com/CsoundQt/CsoundQt.git"
cd CsoundQt
dir
qmake.exe qcs.pro ^
    CONFIG+=html_webengine ^
    CONFIG+=thread ^
    CONFIG+=perfThread_build ^
    CONFIG+=csound6 ^
    CONFIG+=build64 ^
    CONFIG+=QCS_QT59 ^
    QT+=xml ^
    DEFINES+="USE_DOUBLE=1" ^
    DEFINES+="USE_QT_GT_58=1" ^
    CSOUND_API_INCLUDE_DIR="%APPVEYOR_BUILD_FOLDER%\\include" ^
    CSOUND_INTERFACES_INCLUDE_DIR="%APPVEYOR_BUILD_FOLDER%\\interfaces" ^
    CSOUND_LIBRARY_DIR="%APPVEYOR_BUILD_FOLDER%\\msvc\\csound-vs\\RelWithDebInfo" ^
    DEFAULT_CSOUND_LIBS=csound64.lib ^
    CSOUND_LIBRARY=csound64.lib ^
    LCSOUND=%APPVEYOR_BUILD_FOLDER%\\msvc\\csound-vs\\RelWithDebInfo\\csound64.lib ^
    LIBS+="%VCPKGDir%\\installed\\x64-windows-static\\lib\\libsndfile.lib" ^
    LIBS+="%APPVEYOR_BUILD_FOLDER%\\msvc\\csound-vs\\RelWithDebInfo\\csound64.lib" ^
    LIBS+="Ole32.lib" ^
    -after ^
    CSOUND_INTERFACES_INCLUDE_DIR+="%~dp0deps\\include" ^
    CSOUND_INTERFACES_INCLUDE_DIR+="%APPVEYOR_BUILD_FOLDER%\\deps\\include" ^
    CSOUND_INTERFACES_INCLUDE_DIR+="%VCPKGDir%\\installed\\x64-windows-static\\include" ^
    INCLUDEPATH+="%VCPKGDir%\\installed\\x64-windows-static\\include"
nmake.exe /A
move "bin\\CsoundQt*.*" "..\\..\\csound-vs\\RelWithDebInfo\\"
cd ..\..

fix for csoundqt build as part of installer


echo TODO: This is a mess. The CsoundQt build system needs some work and then this should be brought into appveyor.yaml.
cd staging\CsoundQt
echo "INCLUDE:" %INCLUDE%
set INCLUDE=%INCLUDE%%VCPKGDir%\installed\x64-windows\include;
echo "INCLUDE:" %INCLUDE%
echo "CSOUND_LIBRARY_DIR:" %~dp0csound-vs\Release
dir %~dp0csound-vs\Release
qmake.exe qcs.pro ^
    CONFIG+=html_webengine ^
    CONFIG+=perfThread_build ^
    CONFIG+=QCS_QT59 ^
    QT+=xml ^
    DEFINES+="USE_DOUBLE=1" ^
    DEFINES+="USE_QT_GT_59=1" ^
    CSOUND_API_INCLUDE_DIR="%APPVEYOR_BUILD_FOLDER%\\include" ^
    CSOUND_INTERFACES_INCLUDE_DIR="%APPVEYOR_BUILD_FOLDER%\\interfaces" ^
    CSOUND_LIBRARY_DIR=%APPVEYOR_BUILD_FOLDER%\\msvc\\csound-vs\\Release" ^
    DEFAULT_CSOUND_LIBS=csound64.lib ^
    CSOUND_LIBRARY=csound64.lib ^
    -after ^
    LCSOUND=%APPVEYOR_BUILD_FOLDER%\\msvc\\csound-vs\\Release\\csound64.lib ^
    LIBS+="%VCPKGDir%\\installed\\x64-windows\\lib\\libsndfile-1.lib" ^
    LIBS+=%APPVEYOR_BUILD_FOLDER%\\msvc\\csound-vs\\Release\\csound64.lib ^
    CSOUND_INTERFACES_INCLUDE_DIR+="%~dp0deps\\include" ^
    CSOUND_INTERFACES_INCLUDE_DIR+="%APPVEYOR_BUILD_FOLDER%\\deps\\include" ^
    CSOUND_INTERFACES_INCLUDE_DIR+="%VCPKGDir%\\installed\\x64-windows\\include" ^
    INCLUDEPATH+="%VCPKGDir%\\installed\\x64-windows\\include"
nmake.exe
copy "bin\\CsoundQt*.*" "..\\..\\csound-vs\\Release\\"
cd ..\..

echo TODO: This is a mess. The CsoundQt build system needs some work and then this should be brought into appveyor.yaml.
cd staging\CsoundQt
echo "INCLUDE:" %INCLUDE%
set INCLUDE=%INCLUDE%%VCPKGDir%\installed\x64-windows\include;
echo "INCLUDE:" %INCLUDE%
echo "CSOUND_LIBRARY_DIR:" %~dp0csound-vs\Release
dir %~dp0csound-vs\Release
qmake.exe qcs.pro ^
    CONFIG+=html_webengine ^
    CONFIG+=perfThread_build ^
    CONFIG+=QCS_QT59 ^
    QT+=xml ^
    DEFINES+="USE_DOUBLE=1" ^
    DEFINES+="USE_QT_GT_59=1" ^
    CSOUND_API_INCLUDE_DIR="%APPVEYOR_BUILD_FOLDER%\\include" ^
    CSOUND_INTERFACES_INCLUDE_DIR="%APPVEYOR_BUILD_FOLDER%\\interfaces" ^
    CSOUND_LIBRARY_DIR=%APPVEYOR_BUILD_FOLDER%\\msvc\\csound-vs\\Release" ^
    DEFAULT_CSOUND_LIBS=csound64.lib ^
    CSOUND_LIBRARY=csound64.lib ^
    -after ^
    LCSOUND=%APPVEYOR_BUILD_FOLDER%\\msvc\\csound-vs\\Release\\csound64.lib ^
    LIBS+="%VCPKGDir%\\installed\\x64-windows\\lib\\libsndfile-1.lib" ^
    CSOUND_INTERFACES_INCLUDE_DIR+="%~dp0deps\\include" ^
    CSOUND_INTERFACES_INCLUDE_DIR+="%APPVEYOR_BUILD_FOLDER%\\deps\\include" ^
    CSOUND_INTERFACES_INCLUDE_DIR+="%VCPKGDir%\\installed\\x64-windows\\include" ^
    INCLUDEPATH+="%VCPKGDir%\\installed\\x64-windows\\include"
nmake.exe
copy "bin\\CsoundQt*.*" "..\\..\\csound-vs\\Release\\"
cd ..\..

Configure for Qt SDK version 5.9.

Configure for Qt SDK version 5.9.


:: Start with bootstrap
cd tools\build
CALL bootstrap.bat mingw
:: CALL .\b2 install --prefix=%LIBRARY_BIN%
cd ..\..

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

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

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

:: Start with bootstrap
cd tools\build
dir .
CALL bootstrap.bat mingw
IF errorlevel 1 exit 1
dir .
:: CALL .\b2 install --prefix=%LIBRARY_BIN%
cd ..\..

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

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

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

Update bld.bat

Update bld.bat