set PROTOBUF_VER=3.5.1
set CMAKE_NAME=cmake-3.3.2-win32-x86

if not exist "protobuf-%PROTOBUF_VER%\cmake\build\Release\" (
  call :installProto || exit /b 1
)

echo Compile gRPC-Java with something like:
echo -PtargetArch=x86_32 -PvcProtobufLibs=%cd%\protobuf-%PROTOBUF_VER%\cmake\build\Release -PvcProtobufInclude=%cd%\protobuf-%PROTOBUF_VER%\cmake\build\include
goto :eof

:installProto

where /q cmake
if not ERRORLEVEL 1 goto :hasCmake
if not exist "%CMAKE_NAME%" (
  call :installCmake || exit /b 1
)
set PATH=%PATH%;%cd%\%CMAKE_NAME%\bin
:hasCmake
@rem GitHub requires TLSv1.2, and for whatever reason our powershell doesn't have it enabled
powershell -command "& { [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 ; iwr https://github.com/google/protobuf/archive/v%PROTOBUF_VER%.zip -OutFile protobuf.zip }" || exit /b 1
powershell -command "& { Add-Type -AssemblyName System.IO.Compression.FileSystem; [System.IO.Compression.ZipFile]::ExtractToDirectory('protobuf.zip', '.') }" || exit /b 1
del protobuf.zip
pushd protobuf-%PROTOBUF_VER%\cmake
mkdir build
cd build
cmake -Dprotobuf_BUILD_TESTS=OFF -G "Visual Studio %VisualStudioVersion:~0,2%" .. || exit /b 1
msbuild /maxcpucount /p:Configuration=Release libprotoc.vcxproj || exit /b 1
call extract_includes.bat || exit /b 1
popd
goto :eof

:installCmake

powershell -command "& { iwr https://cmake.org/files/v3.3/%CMAKE_NAME%.zip -OutFile cmake.zip }" || exit /b 1
powershell -command "& { Add-Type -AssemblyName System.IO.Compression.FileSystem; [System.IO.Compression.ZipFile]::ExtractToDirectory('cmake.zip', '.') }" || exit /b 1
del cmake.zip
goto :eof

set PROTOBUF_VER=3.5.1
set CMAKE_NAME=cmake-3.3.2-win32-x86

if not exist "protobuf-%PROTOBUF_VER%\cmake\build\Release\" (
  call :installProto || exit /b 1
)

echo Compile gRPC-Java with something like:
echo -PtargetArch=x86_32 -PvcProtobufLibs=%cd%\protobuf-%PROTOBUF_VER%\cmake\build\Release -PvcProtobufInclude=%cd%\protobuf-%PROTOBUF_VER%\cmake\build\include
goto :eof

:installProto

where /q cmake
if not ERRORLEVEL 1 goto :hasCmake
if not exist "%CMAKE_NAME%" (
  call :installCmake || exit /b 1
)
set PATH=%PATH%;%cd%\%CMAKE_NAME%\bin
:hasCmake
@rem GitHub requires TLSv1.2, and for whatever reason our powershell doesn't have it enabled
powershell -command "$ErrorActionPreference = 'stop'; & { [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 ; iwr https://github.com/google/protobuf/archive/v%PROTOBUF_VER%.zip -OutFile protobuf.zip }" || exit /b 1
powershell -command "$ErrorActionPreference = 'stop'; & { Add-Type -AssemblyName System.IO.Compression.FileSystem; [System.IO.Compression.ZipFile]::ExtractToDirectory('protobuf.zip', '.') }" || exit /b 1
del protobuf.zip
pushd protobuf-%PROTOBUF_VER%\cmake
mkdir build
cd build
cmake -Dprotobuf_BUILD_TESTS=OFF -G "Visual Studio %VisualStudioVersion:~0,2%" .. || exit /b 1
msbuild /maxcpucount /p:Configuration=Release libprotoc.vcxproj || exit /b 1
call extract_includes.bat || exit /b 1
popd
goto :eof

:installCmake

powershell -command "$ErrorActionPreference = 'stop'; & { iwr https://cmake.org/files/v3.3/%CMAKE_NAME%.zip -OutFile cmake.zip }" || exit /b 1
powershell -command "$ErrorActionPreference = 'stop'; & { Add-Type -AssemblyName System.IO.Compression.FileSystem; [System.IO.Compression.ZipFile]::ExtractToDirectory('cmake.zip', '.') }" || exit /b 1
del cmake.zip
goto :eof

buildscripts: Use ErrorActionPreference=stop with powershell

Otherwise when an exception is thrown powershell will still exit with 0.
This is similar to set -e, except exceptions wouldn't have a status code
of their own.

Another option would have been -ErrorAction Stop, but this need to be
passed to each command inside the powershell script, so would be
functionally similar to our "|| exit" style in the .bat.


@echo off
echo Compiling: release
gcc -m32 -Wall -O0 -g -I../ -mtune=core2 -c *.c

set OBJS_CRYPTO=aes.o		aesni.o		arc4.o		asn1parse.o	asn1write.o	base64.o	bignum.o	blowfish.o	camellia.o	ccm.o		cipher.o	cipher_wrap.o	ctr_drbg.o	des.o		dhm.o		ecdh.o		ecdsa.o		ecjpake.o	ecp.o	ecp_curves.o	entropy.o	entropy_poll.o	error.o		gcm.o		havege.o	hmac_drbg.o	md.o		md2.o		md4.o		md5.o		md_wrap.o	memory_buffer_alloc.o		oid.o		padlock.o	pem.o		pk.o	pk_wrap.o	pkcs12.o	pkcs5.o		pkparse.o	pkwrite.o	platform.o	ripemd160.o	rsa.o		sha1.o		sha256.o	sha512.o	threading.o	timing.o	version.o	version_features.o	xtea.o
set OBJS_X509=	certs.o		pkcs11.o	x509.o		x509_create.o	x509_crl.o	x509_crt.o	x509_csr.o	x509write_crt.o	x509write_csr.o
set OBJS_TLS=	debug.o		net.o		ssl_cache.o	ssl_ciphersuites.o		ssl_cli.o	ssl_cookie.o	ssl_srv.o	ssl_ticket.o	ssl_tls.o

ar cr ../../lib/libmbedtls_win32.a %OBJS_CRYPTO% %OBJS_TLS% %OBJS_X509%
del *.o
pause

@echo off
echo Compiling: release
gcc -m32 -Wall -O0 -g -I../ -mtune=core2 -c *.c

set OBJS_CRYPTO=aes.o		aesni.o		arc4.o		asn1parse.o	asn1write.o	base64.o	bignum.o	blowfish.o	camellia.o	ccm.o		cipher.o	cipher_wrap.o	ctr_drbg.o	des.o		dhm.o		ecdh.o		ecdsa.o		ecjpake.o	ecp.o	ecp_curves.o	entropy.o	entropy_poll.o	error.o		gcm.o		havege.o	hmac_drbg.o	md.o		md2.o		md4.o		md5.o		md_wrap.o	memory_buffer_alloc.o		oid.o		padlock.o	pem.o		pk.o	pk_wrap.o	pkcs12.o	pkcs5.o		pkparse.o	pkwrite.o	platform.o	ripemd160.o	rsa.o		sha1.o		sha256.o	sha512.o	threading.o	timing.o	version.o	version_features.o	xtea.o
set OBJS_X509=	certs.o		pkcs11.o	x509.o		x509_create.o	x509_crl.o	x509_crt.o	x509_csr.o	x509write_crt.o	x509write_csr.o
set OBJS_TLS=	debug.o		net.o		ssl_cache.o	ssl_ciphersuites.o		ssl_cli.o	ssl_cookie.o	ssl_srv.o	ssl_ticket.o	ssl_tls.o

ar cr ../../lib/libmbedtls_win32.a %OBJS_CRYPTO% %OBJS_TLS% %OBJS_X509%
del *.o
::pause

Update build.cmd

Update build.cmd


mkdir tmp-build
if errorlevel 1 exit 1
cd tmp-build
if errorlevel 1 exit 1
cmake ../pythonfmu/pythonfmu-export -DPython3_EXECUTABLE:FILEPATH="%PYTHON%" -DCMAKE_BUILD_TYPE=Release
if errorlevel 1 exit 1
cmake --build . --config Release
if errorlevel 1 exit 1
cd ..
if errorlevel 1 exit 1

%PYTHON% -m pip install . -vv
if errorlevel 1 exit 1

mkdir tmp-build
if errorlevel 1 exit 1
cd tmp-build
if errorlevel 1 exit 1
cmake ../pythonfmu/pythonfmu-export -G "Ninja" -DPython3_EXECUTABLE:FILEPATH="%PYTHON%" -DCMAKE_BUILD_TYPE=Release
if errorlevel 1 exit 1
cmake --build . --config Release
if errorlevel 1 exit 1
cd ..
if errorlevel 1 exit 1

%PYTHON% -m pip install . -vv
if errorlevel 1 exit 1

Use Ninja as generator on Windows

Use Ninja as generator on Windows


:: Build tcplotter command-line utilities using cmake

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

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

:: Build with cmake
cmake -G "Visual Studio 15 2017" -A x64 ..
if errorlevel 1 exit 1
cmake --build .
if errorlevel 1 exit 1

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

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

:: Build tcplotter command-line utilities using cmake

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

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

:: Build with cmake
cmake -G "Visual Studio 16 2019" -A x64 ..
if errorlevel 1 exit 1
cmake --build .
if errorlevel 1 exit 1

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

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

Revert to Visual Studio 16 2019

Revert to Visual Studio 16 2019


::This is a near full-circle deployment script for PSDLE.
::It does two major things:
:: - ./chrome/7-zip.bat - Zip up the PSDLE chrome extension properly for the webstore (and then opens the webstore for uploading).
:: - ./deploy-sync.bat  - Copy psdle.js, psdle.user.js, and psdle.min.js to the gh-pages branch for everything else.
::Generally, only actual developers will find this useful. The 7-zip.bat is universally functional though.
::jsmin is expected to be in PATH
::Read deploy-sync.bat's comments for more info

@echo off

::Create min version
jsmin <psdle.js >psdle.min.js "PSDLE, (c) RePod, https://github.com/RePod/psdle/blob/master/LICENSE"
::Create userscript version
copy psdle.user.txt+psdle.js /A /D psdle.user.js /B /Y

::Move into chrome directory, zip it, then return here.
cd chrome && call "7-zip.bat" && cd ..
::Open the chrome extension editing page on webstore.
explorer "https://chrome.google.com/webstore/developer/edit/jdjhhapoddhnimgdemnpbfagndcnmhii"

::Checkout psdle.js, psdle.user.js, and psdle.min.js to gh-pages.
call "deploy-sync.bat"

pause

::This is a near full-circle deployment script for PSDLE.
::It does two major things:
:: - ./chrome/7-zip.bat - Zip up the PSDLE chrome extension properly for the webstore (and then opens the webstore for uploading).
:: - ./deploy-sync.bat  - Copy psdle.js, psdle.user.js, and psdle.min.js to the gh-pages branch for everything else.
::Generally, only actual developers will find this useful. The 7-zip.bat is universally functional though.
::jsmin is expected to be in PATH
::Read deploy-sync.bat's comments for more info

@echo off

::Update version numbers (JSON and TXT associated with proper text editors)
start /wait chrome/psdle/manifest.json
start /wait psdle.user.txt

::Create min version
jsmin <psdle.js >psdle.min.js "PSDLE, (c) RePod, https://github.com/RePod/psdle/blob/master/LICENSE"
::Create userscript version
copy psdle.user.txt+psdle.js /A /D psdle.user.js /B /Y

::Move into chrome directory, zip it, then return here.
cd chrome && call "7-zip.bat" && cd ..
::Open the chrome extension editing page on webstore.
explorer "https://chrome.google.com/webstore/developer/edit/jdjhhapoddhnimgdemnpbfagndcnmhii"

::Checkout psdle.js, psdle.user.js, and psdle.min.js to gh-pages.
call "deploy-sync.bat"

pause

Deploy - Ease version changing

Deploy - Ease version changing


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

call :ShowEnvironment Environment at start of batch file.

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

:: Verify node.js installed

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

:: Verify nuget.exe installed

IF DEFINED NUGET_CMD (
    goto NUGET_CMD_DEFINED
)

echo.
echo NUGET_CMD is undefined.
echo Searching known locations for nuget.exe
echo ---------------------------------------

:: Test if nuget.exe is in path
where nuget /q

IF "%ERRORLEVEL%" == "0" (
    echo Found nuget.exe in path.
    SET NUGET_CMD=nuget.exe
    GOTO NUGET_CMD_DEFINED
)

:: Test is nuget.exe is in AppData
IF EXIST "%AppData%\NuGet\nuget.exe" (
    echo Found nuget.exe in AppData.
    SET NUGET_CMD="%AppData%\NuGet\nuget.exe"
    GOTO NUGET_CMD_DEFINED
)

echo.
echo Missing nuget.exe, please install nuget.exe, if already installed make sure it can be reached from current environment.
echo -----------------------------------------------------------------------------------------------------------------------
echo.
goto error

:NUGET_CMD_DEFINED

:: 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_IGNORE_PATHS (
    SET KUDU_IGNORE_PATHS=.git;.hg;.deployment;deploy.cmd
)

IF NOT DEFINED KUDU_SYNC_CMD (

    IF NOT EXIST %appdata%\npm\kuduSync.cmd (
        echo.
        echo Installing Kudu Sync
        echo --------------------
        call npm install kudusync -g --silent
        IF !ERRORLEVEL! NEQ 0 goto error
    )

    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%" (
        echo.
        echo Removing DEPLOYMENT_TEMP directory '%DEPLOYMENT_TEMP%'
        echo ----------------------------------------------------------------------------------
        rd /s /q "%DEPLOYMENT_TEMP%"
    )
    echo.
    echo Creating DEPLOYMENT_TEMP directory '%DEPLOYMENT_TEMP%'
    echo ---------------------------------------------------------------------------------------
    mkdir "%DEPLOYMENT_TEMP%"
)

echo.
echo Testing if tsd exists
echo ---------------------
where tsd /q
IF "%ERRORLEVEL%" == "0" (
    echo Found tsd.
) ELSE (
    echo.
    echo Installing tsd
    echo --------------
    call :ExecuteCmd npm install tsd --global --no-optional
    IF !ERRORLEVEL! NEQ 0 goto error
)

:: Explicitly override MSBUILD_PATH to use C# 6.0 compatible compiler.
SET MSBUILD_PATH=%ProgramFiles(x86)%\MSBuild\14.0\Bin\MSBuild.exe

call :ShowEnvironment Environment after setup.

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

echo.
echo Handling .NET Web Application deployment
echo ========================================

echo.
echo Running npm install
echo -------------------
pushd "%DEPLOYMENT_SOURCE%\source\CroquetAustralia.Website"
call :ExecuteCmd npm install --no-optional
IF !ERRORLEVEL! NEQ 0 goto error
popd

IF /I "croquet-australia.com.au.sln" NEQ "" (
    echo.
    echo Restoring NuGet packages
    echo ------------------------
    call :ExecuteCmd %NUGET_CMD% restore "%DEPLOYMENT_SOURCE%\croquet-australia.com.au.sln"
    IF !ERRORLEVEL! NEQ 0 goto error
)

IF /I "%IN_PLACE_DEPLOYMENT%" NEQ "1" (

    echo.
    echo Compiling the solution
    echo ----------------------
    call :ExecuteCmd "%MSBUILD_PATH%" "%DEPLOYMENT_SOURCE%\source\CroquetAustralia.Website\CroquetAustralia.Website.csproj" /nologo /verbosity:m /t:Build /t:pipelinePreDeployCopyAllFilesToOneFolder /p:_PackageTempDir="%DEPLOYMENT_TEMP%";AutoParameterizationWebConfigConnectionStrings=false;Configuration=Release /p:SolutionDir="%DEPLOYMENT_SOURCE%\.\\" %SCM_BUILD_ARGS%
    IF !ERRORLEVEL! NEQ 0 goto error

    echo.
    echo Running 'gulp before-kudusync'
    echo ------------------------------
    pushd %DEPLOYMENT_SOURCE%\source\CroquetAustralia.Website
    IF !ERRORLEVEL! NEQ 0 goto error
    call :ExecuteCmd call gulp before-kudusync
    SET GULP_ERRORLEVEL=%ERRORLEVEL%
    popd
    IF "%GULP_ERRORLEVEL%" NEQ "" (
        IF "%GULP_ERRORLEVEL%" NEQ "0" (
            goto error
        )
    )

    echo.
    echo Deploying website with KuduSync
    echo -------------------------------
    call :ExecuteCmd "%KUDU_SYNC_CMD%" -v 50 -f "%DEPLOYMENT_TEMP%" -t "%DEPLOYMENT_TARGET%" -n "%NEXT_MANIFEST_PATH%" -p "%PREVIOUS_MANIFEST_PATH%" -i "%KUDU_IGNORE_PATHS%"
    IF !ERRORLEVEL! NEQ 0 goto error

) ELSE (

    echo IN_PLACE_DEPLOYMENT is not supported by this batch file because I can't imagine when you would want to!
    goto error
    rem call :ExecuteCmd "%MSBUILD_PATH%" "%DEPLOYMENT_SOURCE%\source\CroquetAustralia.Website\CroquetAustralia.Website.csproj" /nologo /verbosity:m /t:Build /p:AutoParameterizationWebConfigConnectionStrings=false;Configuration=Release /p:SolutionDir="%DEPLOYMENT_SOURCE%\.\\" %SCM_BUILD_ARGS%
)

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

:: Post deployment stub
IF DEFINED POST_DEPLOYMENT_ACTION call "%POST_DEPLOYMENT_ACTION%"
IF !ERRORLEVEL! NEQ 0 goto error

goto end

:ShowEnvironment
echo.
echo ----------------------------------------------------------
echo %*
echo.
echo BATCH FILE DIRECTORY: %~dp0%
echo CD: %CD%
echo.
echo ARTIFACTS: %ARTIFACTS%
echo CLEAN_LOCAL_DEPLOYMENT_TEMP: %CLEAN_LOCAL_DEPLOYMENT_TEMP%
echo NUGET_CMD: %NUGET_CMD%
echo DEPLOYMENT_SOURCE: %DEPLOYMENT_SOURCE%
echo DEPLOYMENT_TARGET: %DEPLOYMENT_TARGET%
echo DEPLOYMENT_TEMP: %DEPLOYMENT_TEMP%
echo IN_PLACE_DEPLOYMENT: %IN_PLACE_DEPLOYMENT%
echo KUDU_IGNORE_PATHS: %KUDU_IGNORE_PATHS%
echo KUDU_SYNC_CMD: %KUDU_SYNC_CMD%
echo MSBUILD_PATH: %MSBUILD_PATH%
echo NEXT_MANIFEST_PATH: %NEXT_MANIFEST_PATH%
echo POST_DEPLOYMENT_ACTION: %POST_DEPLOYMENT_ACTION%
echo PREVIOUS_MANIFEST_PATH: %PREVIOUS_MANIFEST_PATH%
echo ----------------------------------------------------------
echo.
exit /b 0

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

call :ShowEnvironment Environment at start of batch file.

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

:: Verify node.js installed

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

:: Verify nuget.exe installed

IF DEFINED NUGET_CMD (
    goto NUGET_CMD_DEFINED
)

echo.
echo NUGET_CMD is undefined.
echo Searching known locations for nuget.exe
echo ---------------------------------------

:: Test if nuget.exe is in path
where nuget /q

IF "%ERRORLEVEL%" == "0" (
    echo Found nuget.exe in path.
    SET NUGET_CMD=nuget.exe
    GOTO NUGET_CMD_DEFINED
)

:: Test is nuget.exe is in AppData
IF EXIST "%AppData%\NuGet\nuget.exe" (
    echo Found nuget.exe in AppData.
    SET NUGET_CMD="%AppData%\NuGet\nuget.exe"
    GOTO NUGET_CMD_DEFINED
)

echo.
echo Missing nuget.exe, please install nuget.exe, if already installed make sure it can be reached from current environment.
echo -----------------------------------------------------------------------------------------------------------------------
echo.
goto error

:NUGET_CMD_DEFINED

:: 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_IGNORE_PATHS (
    SET KUDU_IGNORE_PATHS=.git;.hg;.deployment;deploy.cmd
)

IF NOT DEFINED KUDU_SYNC_CMD (

    IF NOT EXIST %appdata%\npm\kuduSync.cmd (
        echo.
        echo Installing Kudu Sync
        echo --------------------
        call npm install kudusync -g --silent
        IF !ERRORLEVEL! NEQ 0 goto error
    )

    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%" (
        echo.
        echo Removing DEPLOYMENT_TEMP directory '%DEPLOYMENT_TEMP%'
        echo ----------------------------------------------------------------------------------
        rd /s /q "%DEPLOYMENT_TEMP%"
    )
    echo.
    echo Creating DEPLOYMENT_TEMP directory '%DEPLOYMENT_TEMP%'
    echo ---------------------------------------------------------------------------------------
    mkdir "%DEPLOYMENT_TEMP%"
)

echo.
echo Testing if tsd exists
echo ---------------------
where tsd /q
IF "%ERRORLEVEL%" == "0" (
    echo Found tsd.
) ELSE (
    echo.
    echo Installing tsd
    echo --------------
    call :ExecuteCmd npm install tsd --global --no-optional
    IF !ERRORLEVEL! NEQ 0 goto error
)

:: Explicitly override MSBUILD_PATH to use C# 6.0 compatible compiler.
SET MSBUILD_PATH=%ProgramFiles(x86)%\MSBuild\14.0\Bin\MSBuild.exe

call :ShowEnvironment Environment after setup.

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

echo.
echo Handling .NET Web Application deployment
echo ========================================

echo.
echo Running npm install
echo -------------------
pushd "%DEPLOYMENT_SOURCE%\source\CroquetAustralia.Website"
call :ExecuteCmd npm install --no-optional
IF !ERRORLEVEL! NEQ 0 goto error
popd

IF /I "croquet-australia.com.au.sln" NEQ "" (
    echo.
    echo Restoring NuGet packages
    echo ------------------------
    call :ExecuteCmd %NUGET_CMD% restore "%DEPLOYMENT_SOURCE%\croquet-australia.com.au.sln"
    IF !ERRORLEVEL! NEQ 0 goto error
)

IF /I "%IN_PLACE_DEPLOYMENT%" NEQ "1" (

    echo.
    echo Compiling the solution
    echo ----------------------
    call :ExecuteCmd "%MSBUILD_PATH%" "%DEPLOYMENT_SOURCE%\source\CroquetAustralia.Website\CroquetAustralia.Website.csproj" /nologo /verbosity:m /t:Build /t:pipelinePreDeployCopyAllFilesToOneFolder /p:_PackageTempDir="%DEPLOYMENT_TEMP%";AutoParameterizationWebConfigConnectionStrings=false;Configuration=Release /p:SolutionDir="%DEPLOYMENT_SOURCE%\.\\" %SCM_BUILD_ARGS%
    IF !ERRORLEVEL! NEQ 0 goto error

    echo.
    echo Running 'gulp before-kudusync'
    echo ------------------------------
    pushd %DEPLOYMENT_SOURCE%\source\CroquetAustralia.Website
    IF !ERRORLEVEL! NEQ 0 goto error
    call :ExecuteCmd call gulp before-kudusync
    SET GULP_ERRORLEVEL=%ERRORLEVEL%
    popd
    IF "%GULP_ERRORLEVEL%" NEQ "" (
        IF "%GULP_ERRORLEVEL%" NEQ "0" (
            goto error
        )
    )

    echo.
    echo Deploying website with KuduSync
    echo -------------------------------
    call :ExecuteCmd "%KUDU_SYNC_CMD%" -v 50 -f "%DEPLOYMENT_TEMP%" -t "%DEPLOYMENT_TARGET%" -n "%NEXT_MANIFEST_PATH%" -p "%PREVIOUS_MANIFEST_PATH%" -i "%KUDU_IGNORE_PATHS%"
    IF !ERRORLEVEL! NEQ 0 goto error

) ELSE (

    echo IN_PLACE_DEPLOYMENT is not supported by this batch file because I can't imagine when you would want to!
    goto error
    rem call :ExecuteCmd "%MSBUILD_PATH%" "%DEPLOYMENT_SOURCE%\source\CroquetAustralia.Website\CroquetAustralia.Website.csproj" /nologo /verbosity:m /t:Build /p:AutoParameterizationWebConfigConnectionStrings=false;Configuration=Release /p:SolutionDir="%DEPLOYMENT_SOURCE%\.\\" %SCM_BUILD_ARGS%
)

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

:: Post deployment stub
IF DEFINED POST_DEPLOYMENT_ACTION call "%POST_DEPLOYMENT_ACTION%"
IF !ERRORLEVEL! NEQ 0 goto error

goto end

:ShowEnvironment
echo.
echo ----------------------------------------------------------
echo %*
echo.
echo BATCH FILE DIRECTORY: %~dp0%
echo CD: %CD%
echo.
echo ARTIFACTS: %ARTIFACTS%
echo CLEAN_LOCAL_DEPLOYMENT_TEMP: %CLEAN_LOCAL_DEPLOYMENT_TEMP%
echo NUGET_CMD: %NUGET_CMD%
echo DEPLOYMENT_SOURCE: %DEPLOYMENT_SOURCE%
echo DEPLOYMENT_TARGET: %DEPLOYMENT_TARGET%
echo DEPLOYMENT_TEMP: %DEPLOYMENT_TEMP%
echo IN_PLACE_DEPLOYMENT: %IN_PLACE_DEPLOYMENT%
echo KUDU_IGNORE_PATHS: %KUDU_IGNORE_PATHS%
echo KUDU_SYNC_CMD: %KUDU_SYNC_CMD%
echo MSBUILD_PATH: %MSBUILD_PATH%
echo NEXT_MANIFEST_PATH: %NEXT_MANIFEST_PATH%
echo POST_DEPLOYMENT_ACTION: %POST_DEPLOYMENT_ACTION%
echo PREVIOUS_MANIFEST_PATH: %PREVIOUS_MANIFEST_PATH%
echo.
echo node version:
node --version
echo npm version:
npm --version

echo ----------------------------------------------------------
echo.
exit /b 0

:: 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 node and npm version info to Azure build


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

:: ----------------------
:: KUDU Deployment Script
:: Version: 1.0.15
:: ----------------------

:: 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
)
goto Deployment

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

:Deployment
echo Handling python deployment.

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

IF NOT EXIST "%DEPLOYMENT_TARGET%\requirements.txt" goto postPython
IF EXIST "%DEPLOYMENT_TARGET%\.skipPythonDeployment" goto postPython

:: 2. Select Python version
SET PYTHON_EXE="D:\python34\python.exe"

:: 3. Create virtual environment
IF NOT EXIST "%DEPLOYMENT_TARGET%\env" (
  echo Creating virtual environment.
  %PYTHON_EXE% -m venv --without-pip "%DEPLOYMENT_TARGET%\env"
  IF !ERRORLEVEL! NEQ 0 goto error
  "%DEPLOYMENT_TARGET%\env\scripts\python" -m ensurepip
  IF !ERRORLEVEL! NEQ 0 goto error
  "%DEPLOYMENT_TARGET%\env\scripts\python" -m pip install --upgrade pip setuptools
  IF !ERRORLEVEL! NEQ 0 goto error
)

echo Got pip version:
"%DEPLOYMENT_TARGET%\env\scripts\python" -m pip --version

:: 4. Install packages
echo Installing requirements.
"%DEPLOYMENT_TARGET%\env\scripts\python" -m pip install -r requirements.txt
IF !ERRORLEVEL! NEQ 0 goto error

:: 5. Copy web.config
IF EXIST "%DEPLOYMENT_SOURCE%\web.config" (
  echo Overwriting web.config
  copy /y "%DEPLOYMENT_SOURCE%\web.config" "%DEPLOYMENT_TARGET%\web.config"
)

:postPython

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

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

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

:exitSetErrorLevel
exit /b 1

:exitFromFunction
()

:end
endlocal
echo Finished successfully.

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

:: ----------------------
:: KUDU Deployment Script
:: Version: 1.0.15
:: ----------------------

:: 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
)
goto Deployment

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

:Deployment
echo Handling python deployment.

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

:: 2. Select Python version
SET PYTHON_EXE="D:\python34\python.exe"

:: 3. Create virtual environment
IF NOT EXIST "%DEPLOYMENT_TARGET%\env" (
  echo Creating virtual environment.
  %PYTHON_EXE% -m venv --without-pip "%DEPLOYMENT_TARGET%\env"
  IF !ERRORLEVEL! NEQ 0 goto error
  "%DEPLOYMENT_TARGET%\env\scripts\python" -m ensurepip
  IF !ERRORLEVEL! NEQ 0 goto error
  "%DEPLOYMENT_TARGET%\env\scripts\python" -m pip install --upgrade pip setuptools
  IF !ERRORLEVEL! NEQ 0 goto error
)

echo Got pip version:
"%DEPLOYMENT_TARGET%\env\scripts\python" -m pip --version

:: 4. Install packages
echo Installing requirements.
"%DEPLOYMENT_TARGET%\env\scripts\python" -m pip install -r requirements.txt
IF !ERRORLEVEL! NEQ 0 goto error

:: 5. Copy web.config
IF EXIST "%DEPLOYMENT_SOURCE%\web.config" (
  echo Overwriting web.config
  copy /y "%DEPLOYMENT_SOURCE%\web.config" "%DEPLOYMENT_TARGET%\web.config"
)

:postPython

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

Remove unused guards

Remove unused guards


:: @if "%SCM_TRACE_LEVEL%" NEQ "4" @echo off
@echo on
:: ----------------------
:: KUDU Deployment Script
:: Version: 1.0.3
:: ----------------------

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

SET DEPLOYMENT_SOURCE=%DEPLOYMENT_SOURCE%\AllReadyApp

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

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

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

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

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

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

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

echo Custom Deployment script for combined csproj and xproj deployment.

:: Remove wwwroot if deploying to default location
IF "%DEPLOYMENT_TARGET%" == "%WEBROOT_PATH%" (
    FOR /F %%i IN ("%DEPLOYMENT_TARGET%") DO IF "%%~nxi"=="wwwroot" (
    SET DEPLOYMENT_TARGET=%%~dpi
    )
)

:: Remove trailing slash if present
IF "%DEPLOYMENT_TARGET:~-1%"=="\" (
    SET DEPLOYMENT_TARGET=%DEPLOYMENT_TARGET:~0,-1%
)

:: 1. Set DNX Path
set DNVM_CMD_PATH_FILE="%USERPROFILE%\.dnx\temp-set-envvars.cmd"
set DNX_RUNTIME="%USERPROFILE%\.dnx\runtimes\dnx-clr-win-x86.1.0.0-beta8"

:: 2. Install DNX
call :ExecuteCmd PowerShell -NoProfile -NoLogo -ExecutionPolicy unrestricted -Command "[System.Threading.Thread]::CurrentThread.CurrentCulture = ''; [System.Threading.Thread]::CurrentThread.CurrentUICulture = '';$CmdPathFile='%DNVM_CMD_PATH_FILE%';& '%SCM_DNVM_PS_PATH%' " install 1.0.0-beta8 -arch x86 -r clr %SCM_DNVM_INSTALL_OPTIONS%
IF !ERRORLEVEL! NEQ 0 goto error

:: 3. Run DNU Restore, Nuget restore for specific projects
call %DNX_RUNTIME%\bin\dnu restore "%DEPLOYMENT_SOURCE%" %SCM_DNU_RESTORE_OPTIONS%
IF !ERRORLEVEL! NEQ 0 goto error
call :ExecuteCmd nuget restore "%DEPLOYMENT_SOURCE%\NotificationsProcessor\packages.config" -SolutionDirectory "%DEPLOYMENT_SOURCE%" -source https://www.nuget.org/api/v2/
IF !ERRORLEVEL! NEQ 0 goto error

:: 4. Run Our Custom build steps:
call :ExecuteCmd "%MSBUILD_PATH%" "%DEPLOYMENT_SOURCE%\AllReady.Models\AllReady.Models.csproj"
IF !ERRORLEVEL! NEQ 0 goto error
call %DNX_RUNTIME%\bin\dnu build "%DEPLOYMENT_SOURCE%\wrap\AllReady.Models\project.json"
IF !ERRORLEVEL! NEQ 0 goto error
call %DNX_RUNTIME%\bin\dnu build "%DEPLOYMENT_SOURCE%\Web-App\AllReady\project.json"
IF !ERRORLEVEL! NEQ 0 goto error
call %DNX_RUNTIME%\bin\dnu build "%DEPLOYMENT_SOURCE%\Web-App\AllReady.UnitTest\project.json"
IF !ERRORLEVEL! NEQ 0 goto error
call :ExecuteCmd "%MSBUILD_PATH%" "%DEPLOYMENT_SOURCE%\NotificationsProcessor\NotificationsProcessor.csproj"

:: 4.1. Publish the site:
call %DNX_RUNTIME%\bin\dnu publish ".\Web-App\AllReady\project.json" --runtime %DNX_RUNTIME% --out "%DEPLOYMENT_TEMP%" %SCM_DNU_PUBLISH_OPTIONS%
IF !ERRORLEVEL! NEQ 0 goto error

:: 5. KuduSync
call %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
@echo on
:: ----------------------
:: KUDU Deployment Script
:: Version: 1.0.3
:: ----------------------

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

SET DEPLOYMENT_SOURCE=%DEPLOYMENT_SOURCE%\AllReadyApp

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

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

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

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

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

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

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

echo Custom Deployment script for combined csproj and xproj deployment.

:: Remove wwwroot if deploying to default location
IF "%DEPLOYMENT_TARGET%" == "%WEBROOT_PATH%" (
    FOR /F %%i IN ("%DEPLOYMENT_TARGET%") DO IF "%%~nxi"=="wwwroot" (
    SET DEPLOYMENT_TARGET=%%~dpi
    )
)

:: Remove trailing slash if present
IF "%DEPLOYMENT_TARGET:~-1%"=="\" (
    SET DEPLOYMENT_TARGET=%DEPLOYMENT_TARGET:~0,-1%
)

:: 1. Set DNX Path
set DNVM_CMD_PATH_FILE="%USERPROFILE%\.dnx\temp-set-envvars.cmd"
set DNX_RUNTIME="%USERPROFILE%\.dnx\runtimes\dnx-clr-win-x86.1.0.0-beta8"

:: 2. Install DNX
call :ExecuteCmd PowerShell -NoProfile -NoLogo -ExecutionPolicy unrestricted -Command "[System.Threading.Thread]::CurrentThread.CurrentCulture = ''; [System.Threading.Thread]::CurrentThread.CurrentUICulture = '';$CmdPathFile='%DNVM_CMD_PATH_FILE%';& '%SCM_DNVM_PS_PATH%' " install 1.0.0-beta8 -arch x86 -r clr %SCM_DNVM_INSTALL_OPTIONS%
IF !ERRORLEVEL! NEQ 0 goto error

:: 3. Run DNU Restore, Nuget restore for specific projects
call %DNX_RUNTIME%\bin\dnu restore "%DEPLOYMENT_SOURCE%" %SCM_DNU_RESTORE_OPTIONS%
IF !ERRORLEVEL! NEQ 0 goto error
call :ExecuteCmd nuget restore "%DEPLOYMENT_SOURCE%\NotificationsProcessor\packages.config" -SolutionDirectory "%DEPLOYMENT_SOURCE%" -source https://www.nuget.org/api/v2/
IF !ERRORLEVEL! NEQ 0 goto error

:: 4. Run Our Custom build steps:
call :ExecuteCmd "%MSBUILD_PATH%" "%DEPLOYMENT_SOURCE%\AllReady.Models\AllReady.Models.csproj"
IF !ERRORLEVEL! NEQ 0 goto error
call %DNX_RUNTIME%\bin\dnu build "%DEPLOYMENT_SOURCE%\wrap\AllReady.Models\project.json"
IF !ERRORLEVEL! NEQ 0 goto error
call %DNX_RUNTIME%\bin\dnu build "%DEPLOYMENT_SOURCE%\Web-App\AllReady\project.json"
IF !ERRORLEVEL! NEQ 0 goto error
call %DNX_RUNTIME%\bin\dnu build "%DEPLOYMENT_SOURCE%\Web-App\AllReady.UnitTest\project.json"
IF !ERRORLEVEL! NEQ 0 goto error
call :ExecuteCmd "%MSBUILD_PATH%" "%DEPLOYMENT_SOURCE%\NotificationsProcessor\NotificationsProcessor.csproj"

:: 4.1. Publish the site:
call %DNX_RUNTIME%\bin\dnu publish "%DEPLOYMENT_SOURCE%\Web-App\AllReady\project.json" --runtime %DNX_RUNTIME% --out "%DEPLOYMENT_TEMP%" %SCM_DNU_PUBLISH_OPTIONS%
IF !ERRORLEVEL! NEQ 0 goto error

:: 5. KuduSync
call %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 deployment source var to the publish command


@setlocal
@echo off

REM Your version of csc.exe must be in the path.
set PATH=C:\Windows\Microsoft.NET\Framework64\v4.0.30319;%PATH%

mkdir bin 2>NUL
csc.exe -version

cd NATS
csc.exe /nologo /out:..\bin\NATS.Client.DLL /target:library /doc:..\bin\NATS.Client.XML /keyfile:NATS.Client.snk /optimize+ *.cs Properties\*.cs

cd ..\examples\publish
csc.exe /nologo /out:..\..\bin\Publish.exe /r:..\..\bin\NATS.Client.dll /target:exe /optimize+ *.cs Properties\*.cs

cd ..\subscribe
csc.exe /nologo /out:..\..\bin\Subscribe.exe /r:..\..\bin\NATS.Client.dll /target:exe /optimize+ *.cs Properties\*.cs

cd ..\queuegroup
csc.exe /nologo /out:..\..\bin\Queuegroup.exe /r:..\..\bin\NATS.Client.dll /target:exe /optimize+ *.cs Properties\*.cs

cd ..\requestor
csc.exe /nologo /out:..\..\bin\Requestor.exe /r:..\..\bin\NATS.Client.dll /target:exe /optimize+ *.cs Properties\*.cs

cd ..\replier
csc.exe /nologo /out:..\..\bin\replier.exe /r:..\..\bin\NATS.Client.dll /target:exe /optimize+ *.cs Properties\*.cs

cd ..\benchmark
csc.exe /nologo /out:..\..\bin\benchmark.exe /r:..\..\bin\NATS.Client.dll /target:exe /optimize+ *.cs Properties\*.cs

cd ..\..\

@setlocal
@echo off

REM Your version of csc.exe must be in the path.
set PATH=C:\Windows\Microsoft.NET\Framework64\v4.0.30319;%PATH%

mkdir bin 2>NUL

cd NATS
csc.exe /nologo /out:..\bin\NATS.Client.DLL /target:library /doc:..\bin\NATS.Client.XML /keyfile:NATS.Client.snk /optimize+ *.cs Properties\*.cs

cd ..\examples\publish
csc.exe /nologo /out:..\..\bin\Publish.exe /r:..\..\bin\NATS.Client.dll /target:exe /optimize+ *.cs Properties\*.cs

cd ..\subscribe
csc.exe /nologo /out:..\..\bin\Subscribe.exe /r:..\..\bin\NATS.Client.dll /target:exe /optimize+ *.cs Properties\*.cs

cd ..\queuegroup
csc.exe /nologo /out:..\..\bin\Queuegroup.exe /r:..\..\bin\NATS.Client.dll /target:exe /optimize+ *.cs Properties\*.cs

cd ..\requestor
csc.exe /nologo /out:..\..\bin\Requestor.exe /r:..\..\bin\NATS.Client.dll /target:exe /optimize+ *.cs Properties\*.cs

cd ..\replier
csc.exe /nologo /out:..\..\bin\replier.exe /r:..\..\bin\NATS.Client.dll /target:exe /optimize+ *.cs Properties\*.cs

cd ..\benchmark
csc.exe /nologo /out:..\..\bin\benchmark.exe /r:..\..\bin\NATS.Client.dll /target:exe /optimize+ *.cs Properties\*.cs

cd ..\..\

Remove version check.

Remove version check.


@echo off
%windir%\Microsoft.Net\Framework\v4.0.30319\msbuild GitVersioner.sln  /property:Configuration=Release /property:Platform="Any CPU"
if exist bin\release\gitversioner.exe bin\release\gitversioner.exe ba

@echo off
%windir%\Microsoft.Net\Framework\v4.0.30319\msbuild GitVersioner.sln /m /property:Configuration=Release /property:Platform="Any CPU"
if exist bin\release\gitversioner.exe bin\release\gitversioner.exe ba

add /m to build.bat

add /m to build.bat


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

if "%NuGet%" == "" (
   set NuGet=nuget\nuget.exe
)

if "%MsBuildExe%" == "" (
   set MsBuildExe=%WINDIR%\Microsoft.NET\Framework\v4.0.30319\msbuild
)

REM Package restore
%NuGet% restore RecurringDates.sln -OutputDirectory "%cd%\packages" -NonInteractive

REM Build
%MsBuildExe% RecurringDates.sln /p:Configuration="%config%" /m /v:M /fl /flp:LogFile=msbuild.log;Verbosity=Normal /nr:false

REM Dynamically restore the required test runner
%NuGet% install NUnit.Runners -Version 2.6.4 -OutputDirectory packages
set NUnitExe="%cd%\packages\NUnit.Runners.2.6.4\tools\nunit-console.exe"

REM Test

%NUnitExe% "%cd%\RecurringDates.UnitTests\bin\%config%\RecurringDates.UnitTests.dll"

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

if "%NuGet%" == "" (
   set NuGet=nuget\nuget.exe
)

if "%MsBuildExe%" == "" (
   set MsBuildExe=%WINDIR%\Microsoft.NET\Framework\v4.0.30319\msbuild
)

REM Package restore
"%NuGet%" restore RecurringDates.sln -OutputDirectory "%cd%\packages" -NonInteractive

REM Build
"%MsBuildExe%" RecurringDates.sln /p:Configuration="%config%" /m /v:M /fl /flp:LogFile=msbuild.log;Verbosity=Normal /nr:false

REM Dynamically restore the required test runner
"%NuGet%" install NUnit.Runners -Version 2.6.4 -OutputDirectory packages
set NUnitExe="%cd%\packages\NUnit.Runners.2.6.4\tools\nunit-console.exe"

REM Test

"%NUnitExe%" "%cd%\RecurringDates.UnitTests\bin\%config%\RecurringDates.UnitTests.dll"

build.bat: Add quotes for paths that may contain spaces


@ECHO OFF
PowerShell -NoProfile -NoLogo -ExecutionPolicy unrestricted -Command "[System.Threading.Thread]::CurrentThread.CurrentCulture = ''; [System.Threading.Thread]::CurrentThread.CurrentUICulture = '';& '%~dp0build.ps1' %*"

@ECHO OFF
PowerShell -NoProfile -NoLogo -ExecutionPolicy unrestricted -Command "[System.Threading.Thread]::CurrentThread.CurrentCulture = ''; [System.Threading.Thread]::CurrentThread.CurrentUICulture = '';& '%~dp0build.ps1' %*; exit $LASTEXITCODE"

Return the error code from build.cmd

Return the error code from build.cmd


@echo off

set MSBuild="%ProgramFiles(x86)%\Microsoft Visual Studio\2017\Enterprise\MSBuild\15.0\Bin\MSBuild.exe"
set OutDir="%~dp0bin"

if not exist %OutDir% mkdir %OutDir%
%MSBuild% /nologo /m /v:m /nr:false /flp:logfile=bin\msbuild.log;verbosity=normal /t:Restore /t:Build /p:OutDir=%OutDir% %*

@echo off

for /d %%F in ("%ProgramFiles(x86)%\Microsoft Visual Studio\2017\*") DO (
 set MSBuild="%%F\MSBuild\15.0\Bin\MSBuild.exe"
 goto validate
)

:validate

if exist %MSBuild% goto build
echo ERROR: You need Visual Studio 2017 to build.
exit

:build

set OutDir="%~dp0bin"

if not exist %OutDir% mkdir %OutDir%
%MSBuild% /nologo /m /v:m /nr:false /flp:logfile=bin\msbuild.log;verbosity=normal /t:Restore /t:Build /p:OutDir=%OutDir% %*
exit

Make build discover the correct version of MSBuild


@echo off
set lighttpd_dir=%~dp0..\third_party\lighttpd\win

REM copy lighttpd.exe to lighttpd_server.exe, because we don't want it to be
REM killed by taskkill.

REM Since xcopy is stupid, tell it that lighttpd_server.exe is a file and not
REM a directory using the echo hack.
echo f | xcopy /D %lighttpd_dir%\lighttpd.exe %lighttpd_dir%\lighttpd_server.exe

REM copy the cygwin dll to the lighttpd folder because otherwise it wont work.

xcopy /D %lighttpd_dir%\..\no_dll\CygWin1.dll %lighttpd_dir%

REM Start the server, using the conf file in the slave directory.

:RESTART
echo Starting %lighttpd_dir%\lighttpd_server.exe -f %~dp0\lighttpd.conf -m %lighttpd_dir%\lib
%lighttpd_dir%\lighttpd_server.exe -f %~dp0\lighttpd.conf -m %lighttpd_dir%\lib -D
goto :RESTART

@echo off
set lighttpd_dir=%~dp0..\third_party\lighttpd\win

REM copy lighttpd.exe to lighttpd_server.exe, because we don't want it to be
REM killed by taskkill.

REM Since xcopy is stupid, tell it that lighttpd_server.exe is a file and not
REM a directory using the echo hack.
echo f | xcopy /D /Y %lighttpd_dir%\lighttpd.exe %lighttpd_dir%\lighttpd_server.exe

REM copy the cygwin dll to the lighttpd folder because otherwise it wont work.

xcopy /D /Y %lighttpd_dir%\..\no_dll\CygWin1.dll %lighttpd_dir%

REM Start the server, using the conf file in the slave directory.

:RESTART
echo Starting %lighttpd_dir%\lighttpd_server.exe -f %~dp0\lighttpd.conf -m %lighttpd_dir%\lib
%lighttpd_dir%\lighttpd_server.exe -f %~dp0\lighttpd.conf -m %lighttpd_dir%\lib -D
goto :RESTART

Add /Y to xcopy of cygwin1.dll in lighttpd dir

So that when we make a copy in the win\ folder the batch file
won't hang waiting for confirmation.

The 5-ish step process:
- Make this batch file not hang if the dest already exists
- Copy no_dll\cygwin1.dll to the win\ folder in the lighttpd DEPS tree
- Remove third_party/cygwin
- Remove the xcopy in run_webserver.bat
- Remove the copy of cygwin1.dll in no_dll subdirectory.

BUG=123026
R=dpranke@chromium.org, iannucci@chromium.org

Review URL: https://codereview.chromium.org/138633005

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


@echo off
python process_init.py
python process_global_variables.py
python process_strings.py
python process_skills.py
python process_music.py
python process_animations.py
python process_meshes.py
python process_sounds.py
python process_skins.py
python process_map_icons.py
python process_factions.py
python process_items.py
python process_scenes.py
python process_troops.py
python process_particle_sys.py
python process_scene_props.py
python process_tableau_materials.py
python process_presentations.py
python process_party_tmps.py
python process_parties.py
python process_quests.py
python process_info_pages.py
python process_scripts.py
python process_mission_tmps.py
python process_game_menus.py
python process_simple_triggers.py
python process_dialogs.py
python process_global_variables_unused.py
python process_postfx.py
echo.
echo ______________________________
echo.
echo Script processing has ended.
echo Press any key to exit. . .
pause>nul

Add files via upload

Add files via upload

compile


:: Copyright 2015 Rouslan Solomakhin
::
:: Licensed under the Apache License, Version 2.0 (the "License")
:: you may not use this file except in compliance with the License.
:: You may obtain a copy of the License at
::
::     http://www.apache.org/licenses/LICENSE-2.0
::
:: Unless required by applicable law or agreed to in writing, software
:: distributed under the License is distributed on an "AS IS" BASIS,
:: WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
:: See the License for the specific language governing permissions and
:: limitations under the License.

@echo off
set ALTERNATE_EDITOR=emacs.exe
set EDITOR=c:\vim\gvim.exe
set GYP_DEFINES=component=shared_library fastbuild=2 disable_nacl=1 disable_pnacl=1
set GYP_GENERATORS=ninja
set HOME=%USERPROFILE%
set JAVA_HOME=%SYSTEMDRIVE%\java\jdk
set GOPATH=%SYSTEMDRIVE%\src\go

doskey e=start /b %EDITOR% $*

if not "%PATH%" == "%PATH:depot_tools=%" (
  goto skip_path
)

for /d %%g in (%SYSTEMDRIVE%\src\depot_tools\git*chromium*) do set PATH=%PATH%;%%g\cmd
set PATH=%PATH%;%GOPATH%\bin
set PATH=%PATH%;%HOME%\.third_party\cask\bin
set PATH=%PATH%;%JAVA_HOME%\bin
set PATH=%PATH%;%SYSTEMDRIVE%\console2
set PATH=%PATH%;%SYSTEMDRIVE%\emacs\bin
set PATH=%PATH%;%SYSTEMDRIVE%\Go\bin
set PATH=%PATH%;%SYSTEMDRIVE%\maven\bin
set PATH=%PATH%;%SYSTEMDRIVE%\src\depot_tools
set PATH=%PATH%;%SYSTEMDRIVE%\vim

:skip_path

where cl > NUL 2>&1
if errorlevel 1 (
  if exist "%ProgramFiles(x86)%\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" (
    call "%ProgramFiles(x86)%\Microsoft Visual Studio 14.0\VC\vcvarsall.bat"
  )
)

if not exist c:\src\depot_tools\win_toolchain\vs2013_files (
  set DEPOT_TOOLS_WIN_TOOLCHAIN=0
)

if exist local-env.bat (
  call local-env.bat
)

:: Copyright 2015 Rouslan Solomakhin
::
:: Licensed under the Apache License, Version 2.0 (the "License")
:: you may not use this file except in compliance with the License.
:: You may obtain a copy of the License at
::
::     http://www.apache.org/licenses/LICENSE-2.0
::
:: Unless required by applicable law or agreed to in writing, software
:: distributed under the License is distributed on an "AS IS" BASIS,
:: WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
:: See the License for the specific language governing permissions and
:: limitations under the License.

@echo off
set ALTERNATE_EDITOR=emacs.exe
set EDITOR=c:\vim\gvim.exe
set GYP_DEFINES=component=shared_library fastbuild=2 disable_nacl=1 disable_pnacl=1
set GYP_GENERATORS=ninja
set HOME=%USERPROFILE%
set JAVA_HOME=%SYSTEMDRIVE%\java\jdk
set GOPATH=%SYSTEMDRIVE%\src\go

doskey e=start /b %EDITOR% $*

if not "%PATH%" == "%PATH:depot_tools=%" (
  goto skip_path
)

for /d %%g in (%SYSTEMDRIVE%\src\depot_tools\git*chromium*) do set PATH=%PATH%;%%g\bin
set PATH=%PATH%;%GOPATH%\bin
set PATH=%PATH%;%HOME%\.third_party\cask\bin
set PATH=%PATH%;%JAVA_HOME%\bin
set PATH=%PATH%;%SYSTEMDRIVE%\console2
set PATH=%PATH%;%SYSTEMDRIVE%\emacs\bin
set PATH=%PATH%;%SYSTEMDRIVE%\Go\bin
set PATH=%PATH%;%SYSTEMDRIVE%\maven\bin
set PATH=%PATH%;%SYSTEMDRIVE%\src\depot_tools
set PATH=%PATH%;%SYSTEMDRIVE%\vim

:skip_path

where cl > NUL 2>&1
if errorlevel 1 (
  if exist "%ProgramFiles(x86)%\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" (
    call "%ProgramFiles(x86)%\Microsoft Visual Studio 14.0\VC\vcvarsall.bat"
  )
)

if not exist c:\src\depot_tools\win_toolchain\vs2013_files (
  set DEPOT_TOOLS_WIN_TOOLCHAIN=0
)

if exist local-env.bat (
  call local-env.bat
)

Correct git path.

Correct git path.


@echo off
if "%parent%"=="" set parent=%~0
if "%console_mode%"=="" (set console_mode=1& for %%x in (%cmdcmdline%) do if /i "%%~x"=="/c" set console_mode=0)

cmake -P cmake/configure.cmake
if %errorlevel% neq 0 (
  if "%parent%"=="%~0" ( if "%console_mode%"=="0" pause )
  exit /B %errorlevel%
)

cmake -P cmake/build.cmake
if %errorlevel% neq 0 (
  if "%parent%"=="%~0" ( if "%console_mode%"=="0" pause )
  exit /B %errorlevel%
)

if "%parent%"=="%~0" ( if "%console_mode%"=="0" pause )

@echo off
if "%parent%"=="" set parent=%~0
if "%console_mode%"=="" (set console_mode=1& for %%x in (%cmdcmdline%) do if /i "%%~x"=="/c" set console_mode=0)

set archB="x32"
if "%1"=="x64" (set archB="%1")

cmake -DARCHITECTUREBUILD=%archB% -P cmake/configure.cmake
if %errorlevel% neq 0 (
  if "%parent%"=="%~0" ( if "%console_mode%"=="0" pause )
  exit /B %errorlevel%
)

cmake -DARCHITECTUREBUILD=%archB% -P cmake/build.cmake
if %errorlevel% neq 0 (
  if "%parent%"=="%~0" ( if "%console_mode%"=="0" pause )
  exit /B %errorlevel%
)

if "%parent%"=="%~0" ( if "%console_mode%"=="0" pause )

Set input flag for build.bat.

Set input flag for build.bat.


@echo off

dotnet restore

dotnet build

dotnet test  ".\test\FastExpressionCompiler.UnitTests"
dotnet test  ".\test\FastExpressionCompiler.IssueTests"

dotnet pack ".\src\FastExpressionCompiler" -c Release -o "./dist"

@echo off

dotnet restore

dotnet build

dotnet test  ".\test\FastExpressionCompiler.UnitTests" -c Release
dotnet test  ".\test\FastExpressionCompiler.IssueTests" -c Release

dotnet pack ".\src\FastExpressionCompiler" -c Release -o "./dist"

test run to Release

changed: test run to Release


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

set version=
if not "%PackageVersion%" == "" (
   set version=-Version %PackageVersion%
)

REM Package restore
call %NuGet% restore "src\ITCO.SboAddon.Framework\packages.config" -OutputDirectory %cd%\packages -NonInteractive

REM Build
"%programfiles(x86)%\MSBuild\14.0\Bin\MSBuild.exe" "src\ITCO.SboAddon.Framework.sln" /p:Configuration="%config%" /m /v:M /fl /flp:LogFile=msbuild.log;Verbosity=Normal /nr:false
if not "%errorlevel%"=="0" goto failure

REM Package
mkdir Build
call %nuget% pack "src\ITCO.SboAddon.Framework\ITCO.SboAddon.Framework.csproj" -symbols -o Build -p Configuration=%config% %version%
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 "%PackageVersion%" == "" (
   set version=-Version %PackageVersion%
)

REM Package restore
call %NuGet% restore "src\ITCO.SboAddon.Framework\packages.config" -OutputDirectory %cd%\src\packages -NonInteractive

REM Build
"%programfiles(x86)%\MSBuild\14.0\Bin\MSBuild.exe" "src\ITCO.SboAddon.Framework.sln" /p:Configuration="%config%" /m /v:M /fl /flp:LogFile=msbuild.log;Verbosity=Normal /nr:false
if not "%errorlevel%"=="0" goto failure

REM Package
mkdir Build
call %nuget% pack "src\ITCO.SboAddon.Framework\ITCO.SboAddon.Framework.csproj" -symbols -o Build -p Configuration=%config% %version%
if not "%errorlevel%"=="0" goto failure

:success
exit 0

:failure
exit -1

build src path fix

build src path fix


@setlocal
@cd SLOTaxService
@msbuild /t:build /p:Configuration=Release /nologo /v:m
@if %errorlevel% neq 0 exit /b %errorlevel%
@cd ..

@cd SLOTaxGuiTest
@msbuild /t:build /p:Configuration=Release /nologo /v:m
@if %errorlevel% neq 0 exit /b %errorlevel%
@cd ..

@setlocal

@cd SLOTaxGuiTest40
@msbuild /t:build /p:Configuration=Release /nologo /v:m
@if %errorlevel% neq 0 exit /b %errorlevel%
@cd ..

@cd SLOTaxGuiTest
@msbuild /t:build /p:Configuration=Release /nologo /v:m
@if %errorlevel% neq 0 exit /b %errorlevel%
@cd ..

@rd FinalOutput /s /q
@md FinalOutput
@cd FinalOutput
@md Net40
@md Net45

@cd ..

@copy SLOTaxGuiTest40\bin\Release\*.exe FinalOutput\Net40
@copy SLOTaxGuiTest40\bin\Release\*.dll FinalOutput\Net40
@copy SLOTaxGuiTest40\bin\Release\*.config FinalOutput\Net40
@del FinalOutput\Net40\*vshost*

@copy SLOTaxGuiTest\bin\Release\*.exe FinalOutput\Net45
@copy SLOTaxGuiTest\bin\Release\*.dll FinalOutput\Net45
@copy SLOTaxGuiTest\bin\Release\*.config FinalOutput\Net45
@del FinalOutput\Net45\*vshost*

Build .Net 4.0 and .Net 4.5 projects

Build .Net 4.0 and .Net 4.5 projects


@echo off

rem Set build parameters.
set _CONFIG_=/p:Configuration=Debug
set _PLATFORM_=

rem Use .NET Framework SDK 4.5 by default.
set TARGET_SDK=

rem But if there's 4.5.1 use that one instead.
if exist "C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5.1" set TARGET_SDK=/p:TargetFrameworkVersion=v4.5.1

msbuild echoer.sln %_CONFIG_% %_PLATFORM_% %TARGET_SDK%

@echo off

rem Set configuration to debug, but allow the user to override it.
set _CONFIG_=/p:Configuration=Debug
if not [%1]==[] set _CONFIG_=/p:Configuration=%1

rem Set platform to the default one specified in the project.
set _PLATFORM_=

rem Use .NET Framework SDK 4.5 by default.
set TARGET_SDK=

rem But if there's 4.5.1 use that one instead.
if exist "C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5.1" set TARGET_SDK=/p:TargetFrameworkVersion=v4.5.1

msbuild echoer.sln %_CONFIG_% %_PLATFORM_% %TARGET_SDK%

Improve build script.

Improve build script.


@echo off
SETLOCAL EnableExtensions EnableDelayedExpansion

set BUILD_TYPE=release
if /i "%1" == "debug" (
    SET BUILD_TYPE=debug
)
set ROOT_DIR=%CD%
set 3RD_PARTY_LIBRARIES_REPO_URL=https://github.com/Vitallium/phantomjs-3rdparty-win
set 3RD_PARTY_LIBRARIES_REPO_BRANCH=msvc2013

if /i BUILD_TYPE == "debug" (
    set 3RD_PARTY_LIBRARIES_REPO_BRANCH=msvc2013_debug
)

set BUILD_DATESTAMP=%date:~-4,4%%date:~-7,2%%date:~-10,2%
set BUILD_TIMESTAMP=%time:~-11,2%%time:~-8,2%

:: replace leading space with 0
set BUILD_TIMESTAMP=%BUILD_TIMESTAMP: =0%
set QT_LOG_FILE=!ROOT_DIR!\build_qt_!BUILD_DATESTAMP!-!BUILD_TIMESTAMP!.log
set WEBKIT_LOG_FILE=!ROOT_DIR!\build_webkit_!BUILD_DATESTAMP!_!BUILD_TIMESTAMP!.log
set PHANTOMJS_LOG_FILE=!ROOT_DIR!\build_phantomjs_!BUILD_DATESTAMP!_!BUILD_TIMESTAMP!.log
set MAKE_TOOL=nmake

echo:
echo Build type: !BUILD_TYPE!
call :build
ENDLOCAL

@exit /B 0

rem ========================================================================================================
:build
SETLOCAL EnableExtensions EnableDelayedExpansion
set _3RDPARTY=!ROOT_DIR!\src\qt\3rdparty

for %%X in (git.exe) do (set GIT_FOUND=%%~$PATH:X)
if defined GIT_FOUND (
    echo.
    echo GIT found. Getting 3rd party libraries.
    if not exist !_3RDPARTY! call git clone -b !3RD_PARTY_LIBRARIES_REPO_BRANCH! !3RD_PARTY_LIBRARIES_REPO_URL! !_3RDPARTY!
) else (
    ECHO.
    CALL :exitB "Git is missing! Can't proceed. Please install Git."
    GOTO :eof
)

:: prepare 3rdparty libraries
:: setup INCLUDE and LIB environment variables
:: OpenSSL
set OPENSSL_DIR=!_3RDPARTY!\openssl
set OPENSSL_LIB=!OPENSSL_DIR!\lib
set OPENSSL_INCLUDE=!OPENSSL_DIR!\include

:: ICU
set ICU_DIR=!_3RDPARTY!\libicu
set ICU_LIB=!ICU_DIR!\lib
set ICU_INCLUDE=!ICU_DIR!\include

:: libxml
set LIBXML_DIR=!_3RDPARTY!\libxml
set LIBXML_LIB=!LIBXML_DIR!\lib
set LIBXML_INCLUDE=!LIBXML_DIR!\include\libxml2

:: sqlite
set SQLITE3SRCDIR=!ROOT_DIR!\src\qt\qtbase\src\3rdparty\sqlite

set LIB=!OPENSSL_LIB!;!ICU_LIB!;!LIBXML_LIB!;%LIB%
set INCLUDE=!OPENSSL_INCLUDE!;!ICU_INCLUDE!;!LIBXML_INCLUDE!;%INCLUDE%
set PATH=!_3RDPARTY!\gnuwin32\bin;%PATH%

echo LIB: %LIB%
echo INCLUDE: %INCLUDE%

for %%X in (jom.exe) do (set JOMFOUND=%%~$PATH:X)
if defined JOMFOUND (
    set MAKE_TOOL=jom
) else (
    set MAKE_TOOL=nmake
)

pushd !ROOT_DIR!\src\qt
call preconfig.cmd !BUILD_TYPE! 2>&1 >> !QT_LOG_FILE!
popd

set PATH=!ROOT_DIR!\src\qt\qtbase\bin;%PATH%
for %%X in (qmake.exe) do (set QMAKE_FOUND=%%~$PATH:X)
if defined QMAKE_FOUND (
    echo.
    echo qmake found. Building QtWebkit
) else (
    ECHO.
    CALL :exitB "qmake.exe is missing! Can't proceed."
    GOTO :eof
)

pushd !ROOT_DIR!\src\qt\qtwebkit
call qmake.exe
%MAKE_TOOL% %BUILD_TYPE% 2>&1 >> !WEBKIT_LOG_FILE!
popd

pushd !ROOT_DIR!\src
call qmake.exe
%MAKE_TOOL% %BUILD_TYPE% 2>&1 >> !PHANTOMJS_LOG_FILE!
popd
if EXIST !ROOT_DIR!\bin\phantomjs.exe (
    echo.
    echo Build has finished
    echo.
) else (
    echo:
    echo Unable to find phantomjs.exe. Please, check log files:
    echo Qt: !QT_LOG_FILE!
    echo Webkit: !WEBKIT_LOG_FILE!
    echo PhantomJS: !PHANTOMJS_LOG_FILE!
    echo:
)
EXIT /b

rem ========================================================================================================
:: %1 an error message
:exitB
echo:
echo Error: %1
echo:
echo Contact vitaliy.slobodin@gmail.com
@exit /B 0

Add build script for Windows

Add build script for Windows


@c:\WINDOWS\Microsoft.NET\Framework\v3.5\csc /nologo /debug+ /t:library /define:TRACE /out:bin\ReverseProxy.dll code\ReverseProxy.cs

if not exist out (md out)
c:\WINDOWS\Microsoft.NET\Framework\v3.5\csc /nologo /debug+ /t:library /define:TRACE /out:out\ReverseProxy.dll code\ReverseProxy.cs

Build into "out" directory

Build into "out" directory


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

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

Rename Zafir packages to WebSharper

Rename Zafir packages to WebSharper


@REM === hi console ===
@REM Copyright 2014-2015 @k33g_org
@REM echo %CD% 	-> current directory
@REM echo %~dp0	-> base directory
java -jar %~dp0/hi.jar %~dp0 %CD% %0%

@REM === hi console ===
@REM Copyright 2014-2015 @k33g_org
@REM echo %CD% 	-> current directory
@REM echo %~dp0	-> base directory
java -jar %~dp0/hi.jar %~dp0 %CD% %1

Update hi.bat

Update hi.bat

fix


set SCRIPT=%0

rem determine Elasticsearch home; to do this, we strip from the path until we
rem find bin, and then strip bin (there is an assumption here that there is no
rem nested directory under bin also named bin)
for %%I in (%SCRIPT%) do set ES_HOME=%%~dpI

:es_home_loop
for %%I in ("%ES_HOME:~1,-1%") do set DIRNAME=%%~nxI
if not "%DIRNAME%" == "bin" (
  for %%I in ("%ES_HOME%..") do set ES_HOME=%%~dpfI
  goto es_home_loop
)
for %%I in ("%ES_HOME%..") do set ES_HOME=%%~dpfI

rem now set the classpath
set ES_CLASSPATH=!ES_HOME!\lib\*

rem now set the path to java
if defined JAVA_HOME (
  set JAVA="%JAVA_HOME%\bin\java.exe"
) else (
  for %%I in (java.exe) do set JAVA="%%~$PATH:I"
)

if not exist %JAVA% (
  echo could not find java; set JAVA_HOME or ensure java is in PATH 1>&2
  exit /b 1
)

rem do not let JAVA_TOOL_OPTIONS slip in (as the JVM does by default)
if defined JAVA_TOOL_OPTIONS (
  echo warning: ignoring JAVA_TOOL_OPTIONS=%JAVA_TOOL_OPTIONS%
  set JAVA_TOOL_OPTIONS=
)

rem JAVA_OPTS is not a built-in JVM mechanism but some people think it is so we
rem warn them that we are not observing the value of %JAVA_OPTS%
if defined JAVA_OPTS (
  (echo|set /p=warning: ignoring JAVA_OPTS=%JAVA_OPTS%; )
  echo pass JVM parameters via ES_JAVA_OPTS
)

rem check the Java version
%JAVA% -cp "%ES_CLASSPATH%" "org.elasticsearch.tools.launchers.JavaVersionChecker" || exit /b 1

set HOSTNAME=%COMPUTERNAME%

if not defined ES_PATH_CONF (
  set ES_PATH_CONF=!ES_HOME!\config
)

rem now make ES_PATH_CONF absolute
for %%I in ("%ES_PATH_CONF%..") do set ES_PATH_CONF=%%~dpfI

set ES_DISTRIBUTION_FLAVOR=${es.distribution.flavor}
set ES_DISTRIBUTION_TYPE=${es.distribution.type}

if not defined ES_TMPDIR (
  set ES_TMPDIR=!TMP!\elasticsearch
)

set SCRIPT=%0

rem determine Elasticsearch home; to do this, we strip from the path until we
rem find bin, and then strip bin (there is an assumption here that there is no
rem nested directory under bin also named bin)
for %%I in (%SCRIPT%) do set ES_HOME=%%~dpI

:es_home_loop
for %%I in ("%ES_HOME:~1,-1%") do set DIRNAME=%%~nxI
if not "%DIRNAME%" == "bin" (
  for %%I in ("%ES_HOME%..") do set ES_HOME=%%~dpfI
  goto es_home_loop
)
for %%I in ("%ES_HOME%..") do set ES_HOME=%%~dpfI

rem now set the classpath
set ES_CLASSPATH=!ES_HOME!\lib\*

rem now set the path to java
if defined JAVA_HOME (
  set JAVA="%JAVA_HOME%\bin\java.exe"
) else (
  for %%I in (java.exe) do set JAVA="%%~$PATH:I"
)

if not exist %JAVA% (
  echo could not find java; set JAVA_HOME or ensure java is in PATH 1>&2
  exit /b 1
)

rem do not let JAVA_TOOL_OPTIONS slip in (as the JVM does by default)
if defined JAVA_TOOL_OPTIONS (
  echo warning: ignoring JAVA_TOOL_OPTIONS=%JAVA_TOOL_OPTIONS%
  set JAVA_TOOL_OPTIONS=
)

rem JAVA_OPTS is not a built-in JVM mechanism but some people think it is so we
rem warn them that we are not observing the value of %JAVA_OPTS%
if defined JAVA_OPTS (
  (echo|set /p=warning: ignoring JAVA_OPTS=%JAVA_OPTS%; )
  echo pass JVM parameters via ES_JAVA_OPTS
)

rem check the Java version
%JAVA% -cp "%ES_CLASSPATH%" "org.elasticsearch.tools.launchers.JavaVersionChecker" || exit /b 1

set HOSTNAME=%COMPUTERNAME%

if not defined ES_PATH_CONF (
  set ES_PATH_CONF=!ES_HOME!\config
)

rem now make ES_PATH_CONF absolute
for %%I in ("%ES_PATH_CONF%..") do set ES_PATH_CONF=%%~dpfI

set ES_DISTRIBUTION_FLAVOR=${es.distribution.flavor}
set ES_DISTRIBUTION_TYPE=${es.distribution.type}

if not defined ES_TMPDIR (
  set ES_TMPDIR=!TMP!\elasticsearch
  if not exist "!ES_TMPDIR!" (
    mkdir "!ES_TMPDIR!"
  )
)

Create default ES_TMPDIR on Windows (#30325)

If the elasticsearch-env bash script chooses $ES_TMPDIR
then it also creates the directory.  This change makes
elasticsearch-env.bat do the same thing: if %ES_TMPDIR%
is chosen by the script then the script will ensure it
exists, but if %ES_TMPDIR% is already set then the user
is responsible for creating it.

Relates #27609
Relates #28217


@echo off & setlocal

set SLN=lz4mt.sln
call "%VS110COMNTOOLS%\vsvars32.bat"

pushd platform_msvc2012
msbuild %SLN% /nologo /v:q /t:Rebuild /p:Platform=Win32 /p:Configuration=Release
msbuild %SLN% /nologo /v:q /t:Rebuild /p:Platform=Win32 /p:Configuration=Debug
msbuild %SLN% /nologo /v:q /t:Rebuild /p:Platform=x64 /p:Configuration=Release
msbuild %SLN% /nologo /v:q /t:Rebuild /p:Platform=x64 /p:Configuration=Debug
popd

.\platform_msvc2012\win32\release\lz4mt.exe -H

Add build.bat for MSVC2012

Add build.bat for MSVC2012


@echo off
setlocal EnableDelayedExpansion
set R2_BASE=""
set frida_version=15.1.3
if "%PLATFORM%" == "x64" (set frida_os_arch=x86_64) else (set frida_os_arch=x86)
for /f %%i in ('radare2 -H R2_USER_PLUGINS') do set R2_PLUGDIR=%%i
REM for /f %%i in ('where radare2') do set R2_BASE=%%i\..
set R2_BASE=%cd%\radare2
set DEBUG=/O2
set INSTALL=

for /f %%i in ('radare2 -qv') do set R2V=%%i

if not exist %R2_BASE% (
	echo radare2 not found
	set /p R2_BASE="Please enter full path of radare2 installation: "
	set /p R2_PLUGDIR="Please enter full path of radare2 plugin dir (radare2 -H): "
)

echo Using R2_BASE: %R2_BASE%
set R2_INC=/I"%R2_BASE%\include" /I"%R2_BASE%\include\libr" /I"%R2_BASE%\include\libr\sdb"

for %%i in (%*) do (
	if "%%i"=="debug" (set DEBUG=/Z7)
	if "%%i"=="install" (set INSTALL=1)
)

copy config.h.w64 config.h
call npm install
cd src
cat .\_agent.js | xxd -i > .\_agent.h || (echo "xxd not in path?" & exit /b 1)
REM radare2 -nfqcpc _agent.js | grep 0x > _agent.h || (echo "radare2.exe must be in path & exit /b 1)

mkdir frida > nul 2>&1
cd frida

set FRIDA_SDK_URL="https://github.com/frida/frida/releases/download/!frida_version!/frida-core-devkit-!frida_version!-windows-!frida_os_arch!.exe"

if not exist ".\frida-core-sdk-!frida_version!-!frida_os_arch!.exe" (
	echo Downloading Frida Core Sdk

	powershell -command "(New-Object System.Net.WebClient).DownloadFile($env:FRIDA_SDK_URL, ""frida-core-sdk.exe-!frida_version!-!frida_os_arch!"")" ^
	|| wget -q --show-progress %FRIDA_SDK_URL% .\frida-core-sdk.exe -O .\frida-core-sdk-!frida_version!-!frida_os_arch!.exe || python -m wget %FRIDA_SDK_URL% -o frida-core-sdk-!frida_version!-!frida_os_arch!.exe

	echo Extracting...
	.\frida-core-sdk-!frida_version!-!frida_os_arch!.exe || (echo Failed to extract & exit /b 1)
)
cd ..

echo Compiling...
echo cl %DEBUG% /MT /nologo /LD /Gy /D_USRDLL /D_WINDLL io_frida.c %R2_INC% /I"%cd%" /I"%cd%\frida" "%cd%\frida\frida-core.lib" "%R2_BASE%\lib\*.lib"
cl %DEBUG% /MT /nologo /LD /Gy /D_USRDLL /D_WINDLL io_frida.c %R2_INC% /I"%cd%" /I"%cd%\frida" "%cd%\frida\frida-core.lib" "%R2_BASE%\lib\*.lib" || (echo Compilation Failed & exit /b 1)

zip ..\r2frida-%R2V%-w64.zip io_frida.dll
if not "%INSTALL%"=="" (
	echo Installing...
	mkdir "%R2_PLUGDIR%" > nul 2>&1
	echo Copying 'io_frida.dll' to %R2_PLUGDIR%
	copy io_frida.dll "%R2_PLUGDIR%\io_frida.dll"
	if not "%DEBUG%"=="/O2" (
		echo Copying 'io_frida.pdb' to %R2_PLUGDIR%
		cp io_frida.pdb "%R2_PLUGDIR%\io_frida.pdb"
	)
)

@echo off
setlocal EnableDelayedExpansion
set R2_BASE=""
set frida_version=15.1.3
if "%PLATFORM%" == "x64" (set frida_os_arch=x86_64) else (set frida_os_arch=x86)
for /f %%i in ('radare2 -H R2_USER_PLUGINS') do set R2_PLUGDIR=%%i
REM for /f %%i in ('where radare2') do set R2_BASE=%%i\..
set R2_BASE=%cd%\radare2
set DEBUG=/O2
set INSTALL=

for /f %%i in ('radare2 -qv') do set R2V=%%i

if not exist %R2_BASE% (
	echo radare2 not found
	set /p R2_BASE="Please enter full path of radare2 installation: "
	set /p R2_PLUGDIR="Please enter full path of radare2 plugin dir (radare2 -H): "
)

echo Using R2_BASE: %R2_BASE%
set R2_INC=/I"%R2_BASE%\include" /I"%R2_BASE%\include\libr" /I"%R2_BASE%\include\libr\sdb"

for %%i in (%*) do (
	if "%%i"=="debug" (set DEBUG=/Z7)
	if "%%i"=="install" (set INSTALL=1)
)

copy config.h.w64 config.h
call npm install
cd src
cat .\_agent.js | xxd -i > .\_agent.h || (echo "xxd not in path?" & exit /b 1)
REM radare2 -nfqcpc _agent.js | grep 0x > _agent.h || (echo "radare2.exe must be in path & exit /b 1)

mkdir frida > nul 2>&1
cd frida

set FRIDA_SDK_URL="https://github.com/frida/frida/releases/download/!frida_version!/frida-core-devkit-!frida_version!-windows-!frida_os_arch!.exe"

if not exist ".\frida-core-sdk-!frida_version!-!frida_os_arch!.exe" (
	echo Downloading Frida Core Sdk

	powershell -command "(New-Object System.Net.WebClient).DownloadFile($env:FRIDA_SDK_URL, ""frida-core-sdk.exe-!frida_version!-!frida_os_arch!"")" ^
	|| wget -q --show-progress %FRIDA_SDK_URL% .\frida-core-sdk.exe -O .\frida-core-sdk-!frida_version!-!frida_os_arch!.exe || python -m wget %FRIDA_SDK_URL% -o frida-core-sdk-!frida_version!-!frida_os_arch!.exe

	echo Extracting...
	.\frida-core-sdk-!frida_version!-!frida_os_arch!.exe || (echo Failed to extract & exit /b 1)
)
cd ..

echo Compiling...
echo cl %DEBUG% /MT /nologo /LD /Gy /D_USRDLL /D_WINDLL /DFRIDA_VERSION_STRING="!frida_version!" io_frida.c %R2_INC% /I"%cd%" /I"%cd%\frida" "%cd%\frida\frida-core.lib" "%R2_BASE%\lib\*.lib"
cl %DEBUG% /MT /nologo /LD /Gy /D_USRDLL /D_WINDLL /DFRIDA_VERSION_STRING="""!frida_version!""" io_frida.c %R2_INC% /I"%cd%" /I"%cd%\frida" "%cd%\frida\frida-core.lib" "%R2_BASE%\lib\*.lib" || (echo Compilation Failed & exit /b 1)

del ..\r2frida-%R2V%-w64.zip
zip ..\r2frida-%R2V%-w64.zip io_frida.dll
if not "%INSTALL%"=="" (
	echo Installing...
	mkdir "%R2_PLUGDIR%" > nul 2>&1
	echo Copying 'io_frida.dll' to %R2_PLUGDIR%
	copy io_frida.dll "%R2_PLUGDIR%\io_frida.dll"
	if not "%DEBUG%"=="/O2" (
		echo Copying 'io_frida.pdb' to %R2_PLUGDIR%
		cp io_frida.pdb "%R2_PLUGDIR%\io_frida.pdb"
	)
)

Fix windows build (#340)

Fix windows build (#340)


@echo off
rem Rime build script for msvc toolchain.
rem 2014-12-30  Chen Gong <chen.sst@gmail.com>

setlocal
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=build
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=build-static
  set build_librime=1
  set build_shared=OFF
)
if "%1" == "shared" (
  set build=build
  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

set THIRDPARTY="%RIME_ROOT%"\thirdparty

rem set CURL=%THIRDPARTY%\bin\curl.exe
rem set DOWNLOAD="%CURL%" --remote-name-all

set LEVELDB_REPOSITORY=lotem/leveldb

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-date_time --with-filesystem --with-system --with-regex --with-signals --with-thread
  if %ERRORLEVEL% NEQ 0 goto ERROR
  rem bjam toolset=msvc-12.0 variant=release link=static threading=multi runtime-link=static address-model=64 --stagedir=stage_x64 stage --with-date_time --with-filesystem --with-system --with-regex --with-signals --with-thread
  rem if %ERRORLEVEL% NEQ 0 goto ERROR
)

if %build_thirdparty% == 1 (
  echo building glog.
  cd %THIRDPARTY%\src\glog
  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 %THIRDPARTY%\include\glog\
  if %ERRORLEVEL% NEQ 0 goto ERROR
  copy /Y Release\libglog.lib %THIRDPARTY%\lib\
  if %ERRORLEVEL% NEQ 0 goto ERROR
  copy /Y Release\libglog.dll %THIRDPARTY%\bin\
  if %ERRORLEVEL% NEQ 0 goto ERROR

  echo building leveldb.
  cd %THIRDPARTY%\src\
  echo "checking out 'windows' branch from %LEVELDB_REPOSITORY%"
  git clone -b windows git@github.com:%LEVELDB_REPOSITORY%.git leveldb-windows
  if %ERRORLEVEL% NEQ 0 goto ERROR
  cd leveldb-windows
  echo BOOST_ROOT=%BOOST_ROOT%
  msbuild.exe leveldb.sln /p:Configuration=Release
  if %ERRORLEVEL% NEQ 0 goto ERROR
  echo built. copying artifacts.
  xcopy /S /I /Y include\leveldb %THIRDPARTY%\include\leveldb\
  if %ERRORLEVEL% NEQ 0 goto ERROR
  copy /Y Release\leveldb.lib %THIRDPARTY%\lib\
  if %ERRORLEVEL% NEQ 0 goto ERROR

  echo building yaml-cpp.
  cd %THIRDPARTY%\src\yaml-cpp
  if not exist build mkdir build
  cd build
  cmake -DMSVC_SHARED_RT=OFF ..
  if %ERRORLEVEL% NEQ 0 goto ERROR
  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 %THIRDPARTY%\include\yaml-cpp\
  if %ERRORLEVEL% NEQ 0 goto ERROR
  copy /Y Release\libyaml-cppmt.lib %THIRDPARTY%\lib\
  if %ERRORLEVEL% NEQ 0 goto ERROR

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

  echo building marisa.
  cd %THIRDPARTY%\src\marisa-trie\vs2013
  msbuild.exe vs2013.sln /p:Configuration=Release
  if %ERRORLEVEL% NEQ 0 goto ERROR
  echo built. copying artifacts.
  xcopy /S /I /Y ..\lib\marisa %THIRDPARTY%\include\marisa\
  xcopy /Y ..\lib\marisa.h %THIRDPARTY%\include\
  if %ERRORLEVEL% NEQ 0 goto ERROR
  copy /Y Release\libmarisa.lib %THIRDPARTY%\lib\
  if %ERRORLEVEL% NEQ 0 goto ERROR
  copy /Y Release\marisa-*.exe %THIRDPARTY%\bin\
  if %ERRORLEVEL% NEQ 0 goto ERROR

  echo building opencc.
  cd %THIRDPARTY%\src\opencc
  if not exist build mkdir build
  cd build
  cmake .. -DCMAKE_INSTALL_PREFIX="" -DBUILD_SHARED_LIBS=OFF
  echo patching src\libopencc.vcxproj for static linking runtime.
  sed -i "s/MultiThreadedDLL/MultiThreaded/" src\libopencc.vcxproj
  sed -i "s/MultiThreadedDLL/MultiThreaded/" src\tools\opencc.vcxproj
  sed -i "s/MultiThreadedDLL/MultiThreaded/" src\tools\opencc_dict.vcxproj
  msbuild.exe opencc.sln /t:libopencc;opencc;opencc_dict;Dictionaries /p:Configuration=Release
  if %ERRORLEVEL% NEQ 0 goto ERROR
  echo built. copying artifacts.
  cd ..
  if not exist %THIRDPARTY%\include\opencc mkdir %THIRDPARTY%\include\opencc
  copy /Y src\*.h* %THIRDPARTY%\include\opencc\
  if %ERRORLEVEL% NEQ 0 goto ERROR
  copy /Y build\src\Release\opencc.lib %THIRDPARTY%\lib
  if %ERRORLEVEL% NEQ 0 goto ERROR
  copy /Y build\src\tools\Release\opencc.exe %THIRDPARTY%\bin
  copy /Y build\src\tools\Release\opencc_dict.exe %THIRDPARTY%\bin
  if %ERRORLEVEL% NEQ 0 goto ERROR
  if not exist %THIRDPARTY%\data\opencc mkdir %THIRDPARTY%\data\opencc
  copy /Y data\config\*.json %THIRDPARTY%\data\opencc
  copy /Y build\data\*.ocd %THIRDPARTY%\data\opencc
  if %ERRORLEVEL% NEQ 0 goto ERROR
)

if %build_librime% == 0 goto EXIT

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% -DBOOST_USE_CXX11=ON

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

@echo off
rem Rime build script for msvc toolchain.
rem 2014-12-30  Chen Gong <chen.sst@gmail.com>

setlocal
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=build
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=build-static
  set build_librime=1
  set build_shared=OFF
)
if "%1" == "shared" (
  set build=build
  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

set THIRDPARTY="%RIME_ROOT%"\thirdparty

rem set CURL=%THIRDPARTY%\bin\curl.exe
rem set DOWNLOAD="%CURL%" --remote-name-all

set LEVELDB_REPOSITORY=lotem/leveldb

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-date_time --with-filesystem --with-system --with-regex --with-signals --with-thread --with-locale
  if %ERRORLEVEL% NEQ 0 goto ERROR
  rem bjam toolset=msvc-12.0 variant=release link=static threading=multi runtime-link=static address-model=64 --stagedir=stage_x64 stage --with-date_time --with-filesystem --with-system --with-regex --with-signals --with-thread
  rem if %ERRORLEVEL% NEQ 0 goto ERROR
)

if %build_thirdparty% == 1 (
  echo building glog.
  cd %THIRDPARTY%\src\glog
  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 %THIRDPARTY%\include\glog\
  if %ERRORLEVEL% NEQ 0 goto ERROR
  copy /Y Release\libglog.lib %THIRDPARTY%\lib\
  if %ERRORLEVEL% NEQ 0 goto ERROR
  copy /Y Release\libglog.dll %THIRDPARTY%\bin\
  if %ERRORLEVEL% NEQ 0 goto ERROR

  echo building leveldb.
  cd %THIRDPARTY%\src\
  echo "checking out 'windows' branch from %LEVELDB_REPOSITORY%"
  git clone -b windows git@github.com:%LEVELDB_REPOSITORY%.git leveldb-windows
  if %ERRORLEVEL% NEQ 0 goto ERROR
  cd leveldb-windows
  echo BOOST_ROOT=%BOOST_ROOT%
  msbuild.exe leveldb.sln /p:Configuration=Release
  if %ERRORLEVEL% NEQ 0 goto ERROR
  echo built. copying artifacts.
  xcopy /S /I /Y include\leveldb %THIRDPARTY%\include\leveldb\
  if %ERRORLEVEL% NEQ 0 goto ERROR
  copy /Y Release\leveldb.lib %THIRDPARTY%\lib\
  if %ERRORLEVEL% NEQ 0 goto ERROR

  echo building yaml-cpp.
  cd %THIRDPARTY%\src\yaml-cpp
  if not exist build mkdir build
  cd build
  cmake -DMSVC_SHARED_RT=OFF ..
  if %ERRORLEVEL% NEQ 0 goto ERROR
  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 %THIRDPARTY%\include\yaml-cpp\
  if %ERRORLEVEL% NEQ 0 goto ERROR
  copy /Y Release\libyaml-cppmt.lib %THIRDPARTY%\lib\
  if %ERRORLEVEL% NEQ 0 goto ERROR

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

  echo building marisa.
  cd %THIRDPARTY%\src\marisa-trie\vs2013
  msbuild.exe vs2013.sln /p:Configuration=Release
  if %ERRORLEVEL% NEQ 0 goto ERROR
  echo built. copying artifacts.
  xcopy /S /I /Y ..\lib\marisa %THIRDPARTY%\include\marisa\
  xcopy /Y ..\lib\marisa.h %THIRDPARTY%\include\
  if %ERRORLEVEL% NEQ 0 goto ERROR
  copy /Y Release\libmarisa.lib %THIRDPARTY%\lib\
  if %ERRORLEVEL% NEQ 0 goto ERROR
  copy /Y Release\marisa-*.exe %THIRDPARTY%\bin\
  if %ERRORLEVEL% NEQ 0 goto ERROR

  echo building opencc.
  cd %THIRDPARTY%\src\opencc
  if not exist build mkdir build
  cd build
  cmake .. -DCMAKE_INSTALL_PREFIX="" -DBUILD_SHARED_LIBS=OFF
  echo patching src\libopencc.vcxproj for static linking runtime.
  sed -i "s/MultiThreadedDLL/MultiThreaded/" src\libopencc.vcxproj
  sed -i "s/MultiThreadedDLL/MultiThreaded/" src\tools\opencc.vcxproj
  sed -i "s/MultiThreadedDLL/MultiThreaded/" src\tools\opencc_dict.vcxproj
  msbuild.exe opencc.sln /t:libopencc;opencc;opencc_dict;Dictionaries /p:Configuration=Release
  if %ERRORLEVEL% NEQ 0 goto ERROR
  echo built. copying artifacts.
  cd ..
  if not exist %THIRDPARTY%\include\opencc mkdir %THIRDPARTY%\include\opencc
  copy /Y src\*.h* %THIRDPARTY%\include\opencc\
  if %ERRORLEVEL% NEQ 0 goto ERROR
  copy /Y build\src\Release\opencc.lib %THIRDPARTY%\lib
  if %ERRORLEVEL% NEQ 0 goto ERROR
  copy /Y build\src\tools\Release\opencc.exe %THIRDPARTY%\bin
  copy /Y build\src\tools\Release\opencc_dict.exe %THIRDPARTY%\bin
  if %ERRORLEVEL% NEQ 0 goto ERROR
  if not exist %THIRDPARTY%\data\opencc mkdir %THIRDPARTY%\data\opencc
  copy /Y data\config\*.json %THIRDPARTY%\data\opencc
  copy /Y build\data\*.ocd %THIRDPARTY%\data\opencc
  if %ERRORLEVEL% NEQ 0 goto ERROR
)

if %build_librime% == 0 goto EXIT

if defined CMAKE_INSTALL_PATH set PATH=%PATH%;%CMAKE_INSTALL_PATH%

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% -DBOOST_USE_CXX11=ON

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

Add --with-locale/CMAKE_INSTALL_PATH

Add --with-locale/CMAKE_INSTALL_PATH

修正目前的版本中编译报错的问题.

1. 编译 `boost` 时增加 `locale` 模块.
2. 在 `PATH` 中增加  `CMAKE_INSTALL_PATH`.


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

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

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

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

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

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

Create build.bat

Create build.bat

Added build file for NuGet


@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

@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\Tests\NugetyCore.Tests
call dotnet test  --configuration %config%
if not "%errorlevel%"=="0" goto failure

:success
exit 0

:failure
exit -1

Fix build because test folder has been moved


@echo off
cd %~dp0

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

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

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

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

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

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

@echo off
cd %~dp0

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

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

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

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

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

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

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


@ECHO OFF
PowerShell -NoProfile -NoLogo -ExecutionPolicy unrestricted -Command "[System.Threading.Thread]::CurrentThread.CurrentCulture = ''; [System.Threading.Thread]::CurrentThread.CurrentUICulture = '';& '%~dp0build.ps1' %*"

@ECHO OFF
PowerShell -NoProfile -NoLogo -ExecutionPolicy unrestricted -Command "[System.Threading.Thread]::CurrentThread.CurrentCulture = ''; [System.Threading.Thread]::CurrentThread.CurrentUICulture = '';& '%~dp0build.ps1' %*; exit $LASTEXITCODE"

Return the error code from build.cmd

Return the error code from build.cmd


@echo off
powershell -NoProfile -ExecutionPolicy Unrestricted -Command ^
$ErrorActionPreference = 'Stop'; ^
if (!(Get-Command NuGet -ErrorAction SilentlyContinue) -and !(Test-Path '.\.nuget\NuGet.exe')) { ^
	Write-Host 'Downloading NuGet.exe'; ^
	(New-Object system.net.WebClient).DownloadFile('https://www.nuget.org/nuget.exe', '.nuget\NuGet.exe'); ^
} ^
if (Test-Path '.\.nuget\NuGet.exe') { ^
	Set-Alias NuGet (Resolve-Path .nuget\NuGet.exe); ^
} ^
Write-Host 'Restoring NuGet packages'; ^
NuGet restore; ^
. '.\packages\PowerTasks.1.1.0\Functions.ps1'; ^
$basePath = Resolve-Path .; ^
Set-Location '.\PDiffy'; ^
$basePath = Split-Path (Split-Path (Resolve-Path $basePath -Relative)); ^
$projectName = 'PDiffy'; ^
$packagesPath = '..\packages'; ^
$invokeBuildPath = Get-RequiredPackagePath Invoke-Build $basePath\.nuget; ^
& $invokeBuildPath\tools\Invoke-Build.ps1 %* -File .Tasks.ps1;
exit /b %ERRORLEVEL%

add pt.bat

add pt.bat


cd \
cd "C:\Users\fred\Documents\Visual Studio 2012\Projects"
cd AddFeatures
git pull origin master
cd ..
cd CodeGeneration
git pull origin master
cd ..
cd PaperBoy
git pull origin master
cd ..
cd fredatgithub.github.io
git pull origin master
cd ..
cd MyFavoriteQuotes
git pull origin master
cd ..
cd WinFormTemplate
git pull origin master
cd ..
cd UsefulFunctions
git pull origin master
cd ..
cd YouTubeVideoName
git pull origin master
cd ..
cd CharacterPermutations
git pull origin master
cd ..
cd MRUManager
git pull origin master
cd ..
cd uptime
git pull origin master
cd ..
cd Matrix
git pull origin master
cd ..
cd Chronometre
git pull origin master
cd ..

Remove useless command

Remove useless command


cd /d %~dp0
REM ************************************************************
REM IMPORTANT!
REM Memba.Blog is the original project where any modifications
REM of locked read-only files should be completed.
REM ************************************************************

REM ------------------------------------------------------------
REM Root files
REM ------------------------------------------------------------

REM copy all dot files
ATTRIB -R .\.*
COPY ..\..\Memba\Memba.Blog\.* .\ /Y
ATTRIB +R .\.*

REM build.cmd
ATTRIB -R .\build.cmd
COPY ..\..\Memba\Memba.Blog\build.cmd .\ /Y
ATTRIB +R .\build.cmd

REM TODO Coverage

REM Dockerfile
ATTRIB -R .\Dockerfile
COPY ..\..\Memba\Memba.Blog\Dockerfile .\ /Y
ATTRIB +R .\Dockerfile

REM gruntfile.js
ATTRIB -R .\gruntfile.js
COPY ..\..\Memba\Memba.Blog\gruntfile.js .\ /Y
ATTRIB +R .\gruntfile.js

REM LICENSE
ATTRIB -R .\LICENSE-GPLv3
COPY ..\..\Memba\Memba.Blog\LICENSE-GPLv3 .\ /Y
ATTRIB +R .\LICENSE-GPLv3

REM webpack
ATTRIB -R .\webpack.config.js
COPY ..\..\Memba\Memba.Blog\webpack.config.js .\ /Y
ATTRIB +R .\webpack.config.js

REM setup.cmd
ATTRIB -R .\setup.cmd
COPY ..\..\Memba\Memba.Blog\setup.cmd .\ /Y
ATTRIB +R .\setup.cmd

REM ------------------------------------------------------------
REM Support Directories
REM ------------------------------------------------------------

REM Copy Javascript files
XCOPY ..\..\Memba\Memba.Blog\js .\js /C /E /I /R /Y
ATTRIB +R .\js\*.* /S

REM Copy styles
XCOPY ..\..\Memba\Memba.Blog\styles .\styles /C /E /I /R /Y
COPY .\graphics\kidoju.home.jpg .\styles\images\jumbotron.jpg
ATTRIB +R .\styles\*.* /S

REM Copy tests
XCOPY ..\..\Memba\Memba.Blog\test .\test /C /E /I /R /Y
ATTRIB +R .\test\*.* /S

REM Copy web modules
XCOPY ..\..\Memba\Memba.Blog\web_modules .\web_modules /C /E /I /R /Y
ATTRIB +R .\web_modules\*.* /S

REM ------------------------------------------------------------
REM Web Application
REM ------------------------------------------------------------

XCOPY ..\..\Memba\Memba.Blog\webapp .\webapp /C /E /I /R /Y /EXCLUDE:excludelist.txt
ATTRIB +R .\webapp\*.* /S
ATTRIB -R .\webapp\cache\*.*
ATTRIB -R .\webapp\config\*.json
ATTRIB -R .\webapp\public\*.png
ATTRIB -R .\webapp\public\*.ico
ATTRIB -R .\webapp\public\assets\*.*
ATTRIB -R .\webapp\views\home.ejs
ATTRIB -R .\webapp\views\logo.ejs

cd /d %~dp0
REM ************************************************************
REM IMPORTANT!
REM Memba.Blog is the original project where any modifications
REM of locked read-only files should be completed.
REM ************************************************************

REM ------------------------------------------------------------
REM Root files
REM ------------------------------------------------------------

REM copy all dot files
ATTRIB -R .\.*
COPY ..\..\Memba\Memba.Blog\.* .\ /Y
ATTRIB +R .\.*

REM build.cmd and BUILD.md
ATTRIB -R .\build.*
COPY ..\..\Memba\Memba.Blog\build.* .\ /Y
ATTRIB +R .\build.*

REM TODO Coverage

REM Dockerfile
ATTRIB -R .\Dockerfile
COPY ..\..\Memba\Memba.Blog\Dockerfile .\ /Y
ATTRIB +R .\Dockerfile

REM gruntfile.js
ATTRIB -R .\gruntfile.js
COPY ..\..\Memba\Memba.Blog\gruntfile.js .\ /Y
ATTRIB +R .\gruntfile.js

REM LICENSE
ATTRIB -R .\LICENSE-GPLv3
COPY ..\..\Memba\Memba.Blog\LICENSE-GPLv3 .\ /Y
ATTRIB +R .\LICENSE-GPLv3

REM setup.cmd
ATTRIB -R .\setup.cmd
COPY ..\..\Memba\Memba.Blog\setup.cmd .\ /Y
ATTRIB +R .\setup.cmd

REM UPDATE.md
ATTRIB -R .\UPDATE.md
COPY ..\..\Memba\Memba.Blog\UPDATE.md .\ /Y
ATTRIB +R .\UPDATE.md

REM webpack
ATTRIB -R .\webpack.config.js
COPY ..\..\Memba\Memba.Blog\webpack.config.js .\ /Y
ATTRIB +R .\webpack.config.js

REM ------------------------------------------------------------
REM Support Directories
REM ------------------------------------------------------------

REM Copy Javascript files
XCOPY ..\..\Memba\Memba.Blog\js .\js /C /E /I /R /Y
ATTRIB +R .\js\*.* /S

REM Copy styles
XCOPY ..\..\Memba\Memba.Blog\styles .\styles /C /E /I /R /Y
COPY .\graphics\kidoju.home.jpg .\styles\images\jumbotron.jpg
ATTRIB +R .\styles\*.* /S

REM Copy tests
XCOPY ..\..\Memba\Memba.Blog\test .\test /C /E /I /R /Y
ATTRIB +R .\test\*.* /S

REM Copy web modules
XCOPY ..\..\Memba\Memba.Blog\web_modules .\web_modules /C /E /I /R /Y
ATTRIB +R .\web_modules\*.* /S

REM ------------------------------------------------------------
REM Web Application
REM ------------------------------------------------------------

XCOPY ..\..\Memba\Memba.Blog\webapp .\webapp /C /E /I /R /Y /EXCLUDE:excludelist.txt
ATTRIB +R .\webapp\*.* /S
ATTRIB -R .\webapp\cache\*.*
ATTRIB -R .\webapp\config\*.json
ATTRIB -R .\webapp\public\*.png
ATTRIB -R .\webapp\public\*.ico
ATTRIB -R .\webapp\public\assets\*.*
ATTRIB -R .\webapp\views\home.ejs
ATTRIB -R .\webapp\views\logo.ejs

Copy BUILD.md and UPDATE.md

Copy BUILD.md and UPDATE.md