@echo off

echo Building dependencies...

if exist lib (rd lib /q /s)
md lib
cd lib
md Debug
md Release
cd ../
REM ######################################################################################################
echo Building protobuf...

if exist protobuf (rd protobuf /q /s)
git clone -b 2.7.0 https://github.com/google/protobuf.git

cd protobuf/cmake
md build
cd build
cmake -G "Visual Studio 14 Win64" -Dprotobuf_BUILD_SHARED_LIBS=ON -Dprotobuf_BUILD_TESTS=OFF ..
"%VS140COMNTOOLS%..\IDE\Devenv" protobuf.sln /build "Debug|x64"
"%VS140COMNTOOLS%..\IDE\Devenv" protobuf.sln /build "Release|x64"
copy Debug\*.dll ..\..\..\lib\Debug /Y
copy Debug\*.lib ..\..\..\lib\Debug /Y
copy Release\*.dll ..\..\..\lib\Release /Y
copy Release\*.lib ..\..\..\lib\Release /Y
cd ..\..\..\
REM ######################################################################################################
echo Building libevent...

if exist libevent (rd libevent /q /s)
git clone -b master https://github.com/libevent/libevent.git

cd libevent
md build
cd build
cmake -G "Visual Studio 14 Win64" -DEVENT__DISABLE_OPENSSL=ON ..
"%VS140COMNTOOLS%..\IDE\Devenv" libevent.sln /build "Debug|x64" /project event_core_static.vcxproj
"%VS140COMNTOOLS%..\IDE\Devenv" libevent.sln /build "Release|x64" /project event_core_static.vcxproj
"%VS140COMNTOOLS%..\IDE\Devenv" libevent.sln /build "Debug|x64" /project event_static.vcxproj
"%VS140COMNTOOLS%..\IDE\Devenv" libevent.sln /build "Release|x64" /project event_static.vcxproj
"%VS140COMNTOOLS%..\IDE\Devenv" libevent.sln /build "Debug|x64" /project event_extra_static.vcxproj
"%VS140COMNTOOLS%..\IDE\Devenv" libevent.sln /build "Release|x64" /project event_extra_static.vcxproj
copy lib\Debug\*.lib ..\..\lib\Debug /Y
copy lib\Release\*.lib ..\..\lib\Release /Y
cd ..\..\
REM ######################################################################################################
echo Building glog...
if exist glog (rd glog /q /s)
git clone -b v035 https://github.com/google/glog.git

cd glog
md build
cd build
cmake -G "Visual Studio 14 Win64" ..
"%VS140COMNTOOLS%..\IDE\Devenv" google-glog.sln /build "Debug|x64"
"%VS140COMNTOOLS%..\IDE\Devenv" google-glog.sln /build "Release|x64"
copy Debug\*.lib ..\..\lib\Debug /Y
copy Release\*.lib ..\..\lib\Release /Y
cd ..\..\
REM ######################################################################################################
echo Building evpp...

if exist evpp (rd evpp /q /s)
git clone -b master https://github.com/ArkGame/evpp.git

cd evpp
cd vsprojects
"%VS140COMNTOOLS%..\IDE\Devenv" libevpp.sln /build "Debug|x64" /project evpp_static.vcxproj
"%VS140COMNTOOLS%..\IDE\Devenv" libevpp.sln /build "Release|x64" /project evpp_static.vcxproj
cd ..\..\
REM ####################################################################################################
REM back to root dir
cd ../

@echo off

echo Building dependencies...

echo Building evpp...

cd evpp
cd vsprojects
"%VS140COMNTOOLS%..\IDE\Devenv" libevpp.sln /build "Debug|x64" /project libevpp.vcxproj
"%VS140COMNTOOLS%..\IDE\Devenv" libevpp.sln /build "Release|x64" /project libevpp.vcxproj
cd ..\..\
REM ####################################################################################################
REM back to root dir
cd ../

modify evpp build bat

modify evpp build bat

Former-commit-id: 2ab61b4ad3e1952964bddc9c16bd7f796e72042f
Former-commit-id: 8963a691856e5fac602c548770a653eff0087dcb [formerly 634badd744043316ef1f7276507512d50c0cfc3f] [formerly 027db863fdcf6a203b8f7b8b4ed48fdaa1a1ede2 [formerly 29f0b9ada565178e70414890ef08bcbf7a219d3f]]
Former-commit-id: 485b2899ff0a7263894bd821a3cd98a7c5287cd6 [formerly 241a82653b328331364f77275fec0081f13b16f3]
Former-commit-id: c7b820ff842845ee8da7d9ddc04b01aa72ead784
Former-commit-id: 53c7ed91800f3bed197ded7ed9b83142554898e7


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

title Enabling Windows Remote Management. Please wait...

echo ==^> Turning off User Account Control (UAC)
:: see http://www.howtogeek.com/howto/windows-vista/enable-or-disable-uac-from-the-windows-vista-command-line/
reg ADD HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System /v EnableLUA /t REG_DWORD /d 0 /f
@if errorlevel 1 echo ==^> WARNING: Error %ERRORLEVEL% was returned by: reg ADD HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System /v EnableLUA /t REG_DWORD /d 0 /f

title Enabling Windows Remote Management. Please wait...

echo ==^> Setting the PowerShell ExecutionPolicy to RemoteSigned (64 bit)
powershell -Command "Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Force" <NUL
@if errorlevel 1 echo ==^> WARNING: Error %ERRORLEVEL% was returned by: powershell -Command "Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Force"

if exist %SystemRoot%\SysWOW64\cmd.exe (
  echo ==^> Setting the PowerShell ExecutionPolicy to RemoteSigned (32 bit)
  %SystemRoot%\SysWOW64\cmd.exe /c powershell -Command "Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Force" <NUL
  @if errorlevel 1 echo ==^> WARNING: Error %ERRORLEVEL% was returned by: powershell -Command "Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Force" <NUL
)

systeminfo 2>nul | findstr /b /c:"OS Name" | findstr /c:"Windows 7" >nul
if errorlevel 1 goto skip_fixnetwork

if not exist a:\fixnetwork.ps1 echo ==^> ERROR: File not found: a:\fixnetwork.ps1

echo ==^> Setting the Network Location to private
:: see http://blogs.msdn.com/b/powershell/archive/2009/04/03/setting-network-location-to-private.aspx
powershell -File a:\fixnetwork.ps1 <NUL
@if errorlevel 1 echo ==^> WARNING: Error %ERRORLEVEL% was returned by: powershell -File a:\fixnetwork.ps1

:skip_fixnetwork

echo ==^> Changing remote UAC account policy
reg add HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\system /v LocalAccountTokenFilterPolicy /t REG_DWORD /d 1 /f
@if errorlevel 1 echo ==^> WARNING: Error %ERRORLEVEL% was returned by: reg add HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\system /v LocalAccountTokenFilterPolicy /t REG_DWORD /d 1 /f

echo ==^> Blocking WinRM port 5985 on the firewall
netsh advfirewall firewall add rule name="winrm"  dir=in action=block protocol=TCP localport=5985
@if errorlevel 1 echo ==^> WARNING: Error %ERRORLEVEL% was returned by: netsh advfirewall firewall add rule name="winrm"  dir=in action=block protocol=TCP localport=5985

echo ==^> Configuring Windows Remote Management (WinRM) service

call winrm quickconfig -q
@if errorlevel 1 echo ==^> WARNING: Error %ERRORLEVEL% was returned by: winrm quickconfig -q

call winrm quickconfig -transport:http
@if errorlevel 1 echo ==^> WARNING: Error %ERRORLEVEL% was returned by: winrm quickconfig -transport:http

call winrm set winrm/config @{MaxTimeoutms="1800000"}
@if errorlevel 1 echo ==^> WARNING: Error %ERRORLEVEL% was returned by: winrm set winrm/config @{MaxTimeoutms="1800000"}

call winrm set winrm/config/winrs @{MaxMemoryPerShellMB="800"}
@if errorlevel 1 echo ==^> WARNING: Error %ERRORLEVEL% was returned by: winrm set winrm/config/winrs @{MaxMemoryPerShellMB="1024"}

call winrm set winrm/config/service @{AllowUnencrypted="true"}
@if errorlevel 1 echo ==^> WARNING: Error %ERRORLEVEL% was returned by: winrm set winrm/config/service @{AllowUnencrypted="true"}

call winrm set winrm/config/service/auth @{Basic="true"}
@if errorlevel 1 echo ==^> WARNING: Error %ERRORLEVEL% was returned by: winrm set winrm/config/service/auth @{Basic="true"}

call winrm set winrm/config/client/auth @{Basic="true"}
@if errorlevel 1 echo ==^> WARNING: Error %ERRORLEVEL% was returned by: winrm set winrm/config/client/auth @{Basic="true"}

call winrm set winrm/config/listener?Address=*+Transport=HTTP @{Port="5985"}
@if errorlevel 1 echo ==^> WARNING: Error %ERRORLEVEL% was returned by: winrm set winrm/config/listener?Address=*+Transport=HTTP @{Port="5985"}

sc config winrm start= auto
@if errorlevel 1 echo ==^> WARNING: Error %ERRORLEVEL% was returned by: sc config winrm start= auto

:: wait for winrm service to finish starting
timeout 5

sc query winrm | findstr "RUNNING" >nul
if errorlevel 1 goto winrm_not_running

echo ==^> Stopping winrm service

sc stop winrm

:is_winrm_running

timeout 1

sc query winrm | findstr "STOPPED" >nul
if errorlevel 1 goto is_winrm_running

:winrm_not_running

echo ==^> Unblocking WinRM port 5985 on the firewall
netsh advfirewall firewall delete rule name="winrm"
@if errorlevel 1 echo ==^> WARNING: Error %ERRORLEVEL% was returned by: netsh advfirewall firewall delete rule name="winrm"

netsh advfirewall firewall set rule group="remote administration" new enable=yes
@if errorlevel 1 echo ==^> WARNING: Error %ERRORLEVEL% was returned by: netsh advfirewall firewall set rule group="remote administration" new enable=yes

echo ==^> Opening WinRM port 5985 on the firewall
:: see http://social.technet.microsoft.com/Forums/windowsserver/en-US/a1e65f0f-2550-49ae-aee2-56a9bdcfb8fb/windows-7-remote-administration-firewall-group?forum=winserverManagement
netsh advfirewall firewall set rule group="Windows Remote Management" new enable=yes
@if errorlevel 1 echo ==^> WARNING: Error %ERRORLEVEL% was returned by: netsh advfirewall firewall set rule group="Windows Remote Management" new enable=yes

netsh advfirewall firewall add rule name="winrm"  dir=in action=allow protocol=TCP localport=5985
@if errorlevel 1 echo ==^> WARNING: Error %ERRORLEVEL% was returned by: netsh advfirewall firewall add rule name="winrm"  dir=in action=allow protocol=TCP localport=5985

:exit0

ver>nul

goto :exit

:exit1

verify other 2>nul

:exit

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

title Enabling Windows Remote Management. Please wait...

echo ==^> Turning off User Account Control (UAC)
:: see http://www.howtogeek.com/howto/windows-vista/enable-or-disable-uac-from-the-windows-vista-command-line/
reg ADD HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System /v EnableLUA /t REG_DWORD /d 0 /f
@if errorlevel 1 echo ==^> WARNING: Error %ERRORLEVEL% was returned by: reg ADD HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System /v EnableLUA /t REG_DWORD /d 0 /f

title Enabling Windows Remote Management. Please wait...

echo ==^> Setting the PowerShell ExecutionPolicy to RemoteSigned (64 bit)
powershell -Command "Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Force" <NUL
@if errorlevel 1 echo ==^> WARNING: Error %ERRORLEVEL% was returned by: powershell -Command "Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Force"

if exist %SystemRoot%\SysWOW64\cmd.exe (
  echo ==^> Setting the PowerShell ExecutionPolicy to RemoteSigned (32 bit)
  %SystemRoot%\SysWOW64\cmd.exe /c powershell -Command "Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Force" <NUL
  @if errorlevel 1 echo ==^> WARNING: Error %ERRORLEVEL% was returned by: powershell -Command "Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Force" <NUL
)

systeminfo 2>nul | findstr /b /c:"OS Name" | findstr /c:"Windows 7" >nul
if errorlevel 1 goto skip_fixnetwork

if not exist a:\fixnetwork.ps1 echo ==^> ERROR: File not found: a:\fixnetwork.ps1

echo ==^> Setting the Network Location to private
:: see http://blogs.msdn.com/b/powershell/archive/2009/04/03/setting-network-location-to-private.aspx
powershell -File a:\fixnetwork.ps1 <NUL
@if errorlevel 1 echo ==^> WARNING: Error %ERRORLEVEL% was returned by: powershell -File a:\fixnetwork.ps1

:skip_fixnetwork

echo ==^> Changing remote UAC account policy
reg add HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\system /v LocalAccountTokenFilterPolicy /t REG_DWORD /d 1 /f
@if errorlevel 1 echo ==^> WARNING: Error %ERRORLEVEL% was returned by: reg add HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\system /v LocalAccountTokenFilterPolicy /t REG_DWORD /d 1 /f

echo ==^> Blocking WinRM port 5985 on the firewall
netsh advfirewall firewall add rule name="winrm"  dir=in action=block protocol=TCP localport=5985
@if errorlevel 1 echo ==^> WARNING: Error %ERRORLEVEL% was returned by: netsh advfirewall firewall add rule name="winrm"  dir=in action=block protocol=TCP localport=5985

echo ==^> Configuring Windows Remote Management (WinRM) service

call winrm quickconfig -q
@if errorlevel 1 echo ==^> WARNING: Error %ERRORLEVEL% was returned by: winrm quickconfig -q

call winrm quickconfig -transport:http
@if errorlevel 1 echo ==^> WARNING: Error %ERRORLEVEL% was returned by: winrm quickconfig -transport:http

call winrm set winrm/config @{MaxTimeoutms="1800000"}
@if errorlevel 1 echo ==^> WARNING: Error %ERRORLEVEL% was returned by: winrm set winrm/config @{MaxTimeoutms="1800000"}

call winrm set winrm/config/winrs @{MaxMemoryPerShellMB="800"}
@if errorlevel 1 echo ==^> WARNING: Error %ERRORLEVEL% was returned by: winrm set winrm/config/winrs @{MaxMemoryPerShellMB="1024"}

call winrm set winrm/config/service @{AllowUnencrypted="true"}
@if errorlevel 1 echo ==^> WARNING: Error %ERRORLEVEL% was returned by: winrm set winrm/config/service @{AllowUnencrypted="true"}

call winrm set winrm/config/service/auth @{Basic="true"}
@if errorlevel 1 echo ==^> WARNING: Error %ERRORLEVEL% was returned by: winrm set winrm/config/service/auth @{Basic="true"}

call winrm set winrm/config/client/auth @{Basic="true"}
@if errorlevel 1 echo ==^> WARNING: Error %ERRORLEVEL% was returned by: winrm set winrm/config/client/auth @{Basic="true"}

call winrm set winrm/config/listener?Address=*+Transport=HTTP @{Port="5985"}
@if errorlevel 1 echo ==^> WARNING: Error %ERRORLEVEL% was returned by: winrm set winrm/config/listener?Address=*+Transport=HTTP @{Port="5985"}

sc config winrm start= auto
@if errorlevel 1 echo ==^> WARNING: Error %ERRORLEVEL% was returned by: sc config winrm start= auto

:: wait for winrm service to finish starting
timeout 5

sc query winrm | findstr "RUNNING" >nul
if errorlevel 1 goto winrm_not_running

echo ==^> Stopping winrm service

sc stop winrm

:is_winrm_running

timeout 1

sc query winrm | findstr "STOPPED" >nul
if errorlevel 1 goto is_winrm_running

:winrm_not_running

echo ==^> Unblocking WinRM port 5985 on the firewall
netsh advfirewall firewall delete rule name="winrm"
@if errorlevel 1 echo ==^> WARNING: Error %ERRORLEVEL% was returned by: netsh advfirewall firewall delete rule name="winrm"

echo ==^> Opening WinRM port 5985 on the firewall
:: see http://social.technet.microsoft.com/Forums/windowsserver/en-US/a1e65f0f-2550-49ae-aee2-56a9bdcfb8fb/windows-7-remote-administration-firewall-group?forum=winserverManagement
ver | findstr /i "6\.[2-9]\."
if not %errorlevel% equ 0 (
  :: pre win 8/server 2012
  netsh advfirewall firewall set rule group="remote administration" new enable=yes
  @if errorlevel 1 echo ==^> WARNING: Error %ERRORLEVEL% was returned by: netsh advfirewall firewall set rule group="remote administration" new enable=yes
) else (
  :: win 8+/server 2012+
  netsh advfirewall firewall set rule group="Windows Remote Management" new enable=yes
  @if errorlevel 1 echo ==^> WARNING: Error %ERRORLEVEL% was returned by: netsh advfirewall firewall set rule group="Windows Remote Management" new enable=yes
)

netsh advfirewall firewall add rule name="winrm"  dir=in action=allow protocol=TCP localport=5985
@if errorlevel 1 echo ==^> WARNING: Error %ERRORLEVEL% was returned by: netsh advfirewall firewall add rule name="winrm"  dir=in action=allow protocol=TCP localport=5985

:exit0

ver>nul

goto :exit

:exit1

verify other 2>nul

:exit

add firewall group handling based on win os version


@echo off
del /F TestApp.exe
call gradlew clean -POS=windows
call gradlew build -POS=windows
echo F | xcopy /Q /Y /F build\exe\testApp\TestApp.exe TestApp.exe
call TestApp.exe > output.log
rem call TestApp.exe --useJSONFormat > outputJSON.log
rem call TestApp.exe --nosha256 > outputnoSha.log

@echo off
del /F TestApp.exe
call gradlew clean -POS=windows
call gradlew build -POS=windows
echo F | xcopy /Q /Y /F build\exe\testApp\TestApp.exe TestApp.exe
rem call TestApp.exe > output.log
call TestApp.exe --noOpenCL > outputnoCL.log
rem call TestApp.exe --useJSONFormat > outputJSON.log
rem call TestApp.exe --nosha256 > outputnoSha.log

Add No OpenCL Run Configuration

Add No OpenCL Run Configuration


mkdir build
cd build

set CONFIGURATION=Release

cmake .. -G "%CMAKE_GENERATOR%" ^
         -DCMAKE_PREFIX_PATH=%PREFIX% ^
         -DCMAKE_INSTALL_PREFIX="%LIBRARY_PREFIX" ^
         -DBOOST_ROOT="%LIBRARY_PREFIX%" ^
         -DWITH_BLOSC=ON ^
         -DWITH_ZLIB=ON ^
         -DWITH_BZIP2=ON ^
         -DWITH_XZ=ON ^
         -DPYTHON_EXECUTABLE="%PYTHON%"

cmake --build . --config %CONFIGURATION%

set PY_VER=$(python -c "import sys; print('{}.{}'.format(*sys.version_info[:2]))")
xcopy %SRC_DIR%/build/python/z5py %LIBRARY%/lib/python%PY_VER%/site-packages/ /E

mkdir build
cd build

set CONFIGURATION=Release

cmake .. -G "%CMAKE_GENERATOR%" ^
         -DCMAKE_BUILD_TYPE:STRING=%CONFIGURATION%
         -DCMAKE_PREFIX_PATH:PATH=%PREFIX% ^
         -DCMAKE_INSTALL_PREFIX:PATH="%LIBRARY_PREFIX" ^
         -DBOOST_ROOT:PATH="%LIBRARY_PREFIX%" ^
         -DWITH_BLOSC:BOOL=ON ^
         -DWITH_ZLIB:BOOL=ON ^
         -DWITH_BZIP2:BOOL=ON ^
         -DWITH_XZ:BOOL=ON ^
         -DPYTHON_EXECUTABLE:PATH="%PYTHON%"

cmake --build . --config %CONFIGURATION%

set PY_VER=$(python -c "import sys; print('{}.{}'.format(*sys.version_info[:2]))")
xcopy %SRC_DIR%/build/python/z5py %LIBRARY%/lib/python%PY_VER%/site-packages/ /E

Add variable annotations to bld.bat

Add variable annotations to bld.bat


Load JMF and DLLs

Load JMF and DLLs

git-svn-id: f13e20fb8540f76a08799c0051229138c0279aa7@6677 b35dd754-fafc-0310-a699-88a17e54d16e


SET MSBUILD=C:\Windows\Microsoft.NET\Framework\v3.5\MSBuild.exe

REM SET BUILD=Debug
SET BUILD=Release

%MSBUILD% build.msbuild

COPY ..\src\ServiceStack.ServiceInterface\bin\%BUILD%\ServiceStack.dll ..\NuGet\ServiceStack\lib
COPY ..\src\ServiceStack.ServiceInterface\bin\%BUILD%\ServiceStack.pdb ..\NuGet\ServiceStack\lib
COPY ..\src\ServiceStack.ServiceInterface\bin\%BUILD%\ServiceStack.xml ..\NuGet\ServiceStack\lib
COPY ..\src\ServiceStack.ServiceInterface\bin\%BUILD%\ServiceStack.ServiceInterface.* ..\NuGet\ServiceStack\lib
COPY ..\src\ServiceStack.RazorEngine\bin\%BUILD%\ServiceStack.RazorEngine.* ..\NuGet\ServiceStack\lib

COPY ..\src\ServiceStack.ServiceInterface\bin\%BUILD%\ServiceStack.Common.* ..\NuGet\ServiceStack.Common\lib
COPY ..\src\ServiceStack.ServiceInterface\bin\%BUILD%\ServiceStack.Interfaces.* ..\NuGet\ServiceStack.Common\lib

COPY ..\src\ServiceStack.ServiceInterface\bin\%BUILD%\*.* ..\..\chaweet\api\lib
COPY ..\src\ServiceStack.ServiceInterface\bin\%BUILD%\*.* ..\..\SocialApiBootstrap\lib

COPY ..\src\ServiceStack.RazorEngine\bin\%BUILD%\*.* ..\..\ServiceStack.Examples\lib
COPY ..\src\ServiceStack.ServiceInterface\bin\%BUILD%\*.* ..\..\ServiceStack.Examples\lib
COPY ..\src\ServiceStack\bin\%BUILD%\*.* ..\..\ServiceStack.Contrib\lib
COPY ..\src\ServiceStack\bin\%BUILD%\*.* ..\..\ServiceStack.RedisWebServices\lib

COPY ..\src\ServiceStack\bin\%BUILD%\ServiceStack.Interfaces.dll ..\..\ServiceStack.Redis\lib
COPY ..\src\ServiceStack\bin\%BUILD%\ServiceStack.Text.dll ..\..\ServiceStack.Redis\lib
COPY ..\src\ServiceStack\bin\%BUILD%\ServiceStack.Text.pdb ..\..\ServiceStack.Redis\lib
COPY ..\src\ServiceStack\bin\%BUILD%\ServiceStack.Common.dll ..\..\ServiceStack.Redis\lib
COPY ..\src\ServiceStack\bin\%BUILD%\ServiceStack.Common.pdb ..\..\ServiceStack.Redis\lib

COPY ..\src\ServiceStack\bin\%BUILD%\ServiceStack.Interfaces.dll ..\..\ServiceStack.OrmLite\lib
COPY ..\src\ServiceStack\bin\%BUILD%\ServiceStack.Text.dll ..\..\ServiceStack.OrmLite\lib
COPY ..\src\ServiceStack\bin\%BUILD%\ServiceStack.Text.pdb ..\..\ServiceStack.OrmLite\lib
COPY ..\src\ServiceStack\bin\%BUILD%\ServiceStack.Common.dll ..\..\ServiceStack.OrmLite\lib
COPY ..\src\ServiceStack\bin\%BUILD%\ServiceStack.Common.pdb ..\..\ServiceStack.OrmLite\lib

COPY ..\..\ServiceStack.OrmLite\NuGet\ServiceStack.OrmLite.SqlServer\lib\*.* ..\release\latest\ServiceStack
COPY ..\..\ServiceStack.Redis\NuGet\lib\*.* ..\release\latest\ServiceStack
COPY ..\..\ServiceStack.Text\NuGet\lib\*.* ..\release\latest\ServiceStack
COPY ..\NuGet\ServiceStack\lib\*.* ..\release\latest\ServiceStack
COPY ..\NuGet\ServiceStack.Common\lib\*.* ..\release\latest\ServiceStack

SET MSBUILD=C:\Windows\Microsoft.NET\Framework\v3.5\MSBuild.exe

REM SET BUILD=Debug
SET BUILD=Release

%MSBUILD% build.msbuild

COPY ..\src\ServiceStack.ServiceInterface\bin\%BUILD%\ServiceStack.dll ..\NuGet\ServiceStack\lib
COPY ..\src\ServiceStack.ServiceInterface\bin\%BUILD%\ServiceStack.pdb ..\NuGet\ServiceStack\lib
COPY ..\src\ServiceStack.ServiceInterface\bin\%BUILD%\ServiceStack.xml ..\NuGet\ServiceStack\lib
COPY ..\src\ServiceStack.ServiceInterface\bin\%BUILD%\ServiceStack.ServiceInterface.* ..\NuGet\ServiceStack\lib
COPY ..\src\ServiceStack.RazorEngine\bin\%BUILD%\ServiceStack.RazorEngine.* ..\NuGet\ServiceStack\lib

COPY ..\src\ServiceStack.ServiceInterface\bin\%BUILD%\ServiceStack.Common.* ..\NuGet\ServiceStack.Common\lib
COPY ..\src\ServiceStack.ServiceInterface\bin\%BUILD%\ServiceStack.Interfaces.* ..\NuGet\ServiceStack.Common\lib

COPY ..\src\ServiceStack.ServiceInterface\bin\%BUILD%\*.* ..\..\chaweet\api\lib

COPY ..\src\ServiceStack.RazorEngine\bin\%BUILD%\*.* ..\..\ServiceStack.Examples\lib
COPY ..\src\ServiceStack.ServiceInterface\bin\%BUILD%\*.* ..\..\ServiceStack.Examples\lib
COPY ..\src\ServiceStack\bin\%BUILD%\*.* ..\..\ServiceStack.Contrib\lib
COPY ..\src\ServiceStack\bin\%BUILD%\*.* ..\..\ServiceStack.RedisWebServices\lib

COPY ..\src\ServiceStack\bin\%BUILD%\ServiceStack.Interfaces.dll ..\..\ServiceStack.Redis\lib
COPY ..\src\ServiceStack\bin\%BUILD%\ServiceStack.Text.dll ..\..\ServiceStack.Redis\lib
COPY ..\src\ServiceStack\bin\%BUILD%\ServiceStack.Text.pdb ..\..\ServiceStack.Redis\lib
COPY ..\src\ServiceStack\bin\%BUILD%\ServiceStack.Common.dll ..\..\ServiceStack.Redis\lib
COPY ..\src\ServiceStack\bin\%BUILD%\ServiceStack.Common.pdb ..\..\ServiceStack.Redis\lib

COPY ..\src\ServiceStack\bin\%BUILD%\ServiceStack.Interfaces.dll ..\..\ServiceStack.OrmLite\lib
COPY ..\src\ServiceStack\bin\%BUILD%\ServiceStack.Text.dll ..\..\ServiceStack.OrmLite\lib
COPY ..\src\ServiceStack\bin\%BUILD%\ServiceStack.Text.pdb ..\..\ServiceStack.OrmLite\lib
COPY ..\src\ServiceStack\bin\%BUILD%\ServiceStack.Common.dll ..\..\ServiceStack.OrmLite\lib
COPY ..\src\ServiceStack\bin\%BUILD%\ServiceStack.Common.pdb ..\..\ServiceStack.OrmLite\lib

COPY ..\..\ServiceStack.OrmLite\NuGet\ServiceStack.OrmLite.SqlServer\lib\*.* ..\release\latest\ServiceStack
COPY ..\..\ServiceStack.Redis\NuGet\lib\*.* ..\release\latest\ServiceStack
COPY ..\..\ServiceStack.Text\NuGet\lib\*.* ..\release\latest\ServiceStack
COPY ..\NuGet\ServiceStack\lib\*.* ..\release\latest\ServiceStack
COPY ..\NuGet\ServiceStack.Common\lib\*.* ..\release\latest\ServiceStack

COPY ..\src\ServiceStack.ServiceInterface\bin\%BUILD%\*.* ..\..\SocialApiBootstrap\lib
COPY ..\..\ServiceStack.OrmLite\NuGet\ServiceStack.OrmLite.SqlServer\lib\*.* ..\..\SocialApiBootstrap\lib
COPY ..\..\ServiceStack.Redis\NuGet\lib\*.* ..\..\SocialApiBootstrap\lib

change build to push dlls in demo proj

change build to push dlls in demo proj


dotnet build ..\src\JsonApiSerializer\JsonApiSerializer.csproj --configuration=Release
dotnet pack ..\src\JsonApiSerializer\JsonApiSerializer.csproj --configuration=Release --output ../../artifacts

Update package script to rebuild in release mode.


@echo off

set BOOST_ROOT=D:/dev/boost_1_64_0
set BOOST_LIBRARYDIR=D:/dev/boost_1_64_0/lib/stage
set INCLUDE=%BOOST_ROOT%
set QL_DIR=%CD%\QuantLib
set QLEXT_DIR=%CD%\QuantLib-Ext
set BUILD_TYPE=Debug
set ADDRESS_MODEL=Win64

cd QuantLib

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

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

cd build

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

if %errorlevel% neq 0 exit /b 1

msbuild Project.sln /target:QuantLib_Static /m /p:Configuration=%BUILD_TYPE% /p:Platform=%PLATFORM%

if %errorlevel% neq 0 exit /b 1

cd ..\..\QuantLib-Ext

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

cd build

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

if %errorlevel% neq 0 exit /b 1

msbuild QuantLibExt.sln /target:QuantLibExt /m /p:Configuration=%BUILD_TYPE% /p:Platform=%PLATFORM%

if %errorlevel% neq 0 exit /b 1

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

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

if %errorlevel% neq 0 exit /b 1

cd ..\..

@echo on

@echo off

set BOOST_ROOT=D:/dev/boost_1_64_0
set BOOST_LIBRARYDIR=D:/dev/boost_1_64_0/lib/stage
set INCLUDE=%BOOST_ROOT%
set QL_DIR=%CD%\QuantLib
set QLEXT_DIR=%CD%\QuantLib-Ext
set BUILD_TYPE=Debug
set ADDRESS_MODEL=Win64

cd QuantLib

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

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

cd build

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

if %errorlevel% neq 0 exit /b 1

msbuild Project.sln /target:QuantLib_Static /m /p:Configuration=%BUILD_TYPE% /p:Platform=%PLATFORM%

if %errorlevel% neq 0 exit /b 1

cd ..\..\QuantLib-Ext

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

cd build

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

if %errorlevel% neq 0 exit /b 1

msbuild QuantLibExt.sln /target:QuantLibExt /m /p:Configuration=%BUILD_TYPE% /p:Platform=%PLATFORM%

if %errorlevel% neq 0 exit /b 1

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

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

if %errorlevel% neq 0 exit /b 1

cd ..\..

@echo on

remove install

remove install


@echo off
setlocal

REM Script for building the LLVM installer on Windows,
REM used for the the weekly snapshots at http://www.llvm.org/builds.
REM
REM Usage: build_llvm_package.bat <revision>

REM Prerequisites:
REM
REM   Visual Studio 2017, CMake, Ninja, SVN, GNUWin32,
REM   NSIS with the strlen_8192 patch,
REM   Visual Studio 2017 SDK and Nuget (for the clang-format plugin),
REM   Perl (for the OpenMP run-time).

REM You need to modify the paths below:
set vsdevcmd=C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\Tools\VsDevCmd.bat

set revision=%1
set branch=trunk
set package_version=8.0.0-r%revision%
set clang_format_vs_version=8.0.0.%revision%
set build_dir=llvm_package_%revision%

echo Branch: %branch%
echo Revision: %revision%
echo Package version: %package_version%
echo Clang format plugin version: %clang_format_vs_version%
echo Build dir: %build_dir%
echo.
pause

mkdir %build_dir%
cd %build_dir%

echo Checking out %branch% at r%revision%...
svn.exe export -r %revision% http://llvm.org/svn/llvm-project/llvm/%branch% llvm || exit /b
svn.exe export -r %revision% http://llvm.org/svn/llvm-project/cfe/%branch% llvm/tools/clang || exit /b
svn.exe export -r %revision% http://llvm.org/svn/llvm-project/clang-tools-extra/%branch% llvm/tools/clang/tools/extra || exit /b
svn.exe export -r %revision% http://llvm.org/svn/llvm-project/lld/%branch% llvm/tools/lld || exit /b
svn.exe export -r %revision% http://llvm.org/svn/llvm-project/compiler-rt/%branch% llvm/projects/compiler-rt || exit /b
svn.exe export -r %revision% http://llvm.org/svn/llvm-project/openmp/%branch% llvm/projects/openmp || exit /b

REM Setting CMAKE_CL_SHOWINCLUDES_PREFIX to work around PR27226.
set cmake_flags=-DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_ASSERTIONS=ON -DLLVM_USE_CRT_RELEASE=MT -DLLVM_INSTALL_TOOLCHAIN_ONLY=ON -DCLANG_FORMAT_VS_VERSION=%clang_format_vs_version% -DPACKAGE_VERSION=%package_version% -DCMAKE_CL_SHOWINCLUDES_PREFIX="Note: including file: "

REM TODO: Run all tests, including lld and compiler-rt.

set "VSCMD_START_DIR=%CD%"
call "%vsdevcmd%" -arch=x86
set CC=
set CXX=
mkdir build32_stage0
cd build32_stage0
REM Work around VS2017 bug by using MinSizeRel.
cmake -GNinja %cmake_flags% -DCMAKE_BUILD_TYPE=MinSizeRel ..\llvm || exit /b
ninja all || ninja all || ninja all || exit /b
ninja check || ninja check || ninja check || exit /b
ninja check-clang || ninja check-clang || ninja check-clang ||  exit /b
cd..

mkdir build32
cd build32
set CC=..\build32_stage0\bin\clang-cl
set CXX=..\build32_stage0\bin\clang-cl
cmake -GNinja %cmake_flags% ..\llvm || exit /b
ninja all || ninja all || ninja all || exit /b
ninja check || ninja check || ninja check || exit /b
ninja check-clang || ninja check-clang || ninja check-clang ||  exit /b
ninja package || exit /b
cd ..

REM The plug-in is built separately as it uses a statically linked clang-format.exe.
mkdir build_vsix
cd build_vsix
set CC=..\build32_stage0\bin\clang-cl
set CXX=..\build32_stage0\bin\clang-cl
cmake -GNinja %cmake_flags% -DBUILD_CLANG_FORMAT_VS_PLUGIN=ON ..\llvm || exit /b
ninja clang_format_vsix || exit /b
copy ..\llvm\tools\clang\tools\clang-format-vs\ClangFormat\bin\Release\ClangFormat.vsix ClangFormat-r%revision%.vsix
cd ..

set "VSCMD_START_DIR=%CD%"
call "%vsdevcmd%" -arch=amd64
set CC=
set CXX=
mkdir build64_stage0
cd build64_stage0
REM Work around VS2017 bug by using MinSizeRel.
cmake -GNinja %cmake_flags% -DCMAKE_BUILD_TYPE=MinSizeRel ..\llvm || exit /b
ninja all || ninja all || ninja all || exit /b
ninja check || ninja check || ninja check || exit /b
ninja check-clang || ninja check-clang || ninja check-clang ||  exit /b
cd..

mkdir build64
cd build64
set CC=..\build64_stage0\bin\clang-cl
set CXX=..\build64_stage0\bin\clang-cl
cmake -GNinja %cmake_flags% ..\llvm || exit /b
ninja all || ninja all || ninja all || exit /b
ninja check || ninja check || ninja check || exit /b
ninja check-clang || ninja check-clang || ninja check-clang ||  exit /b
ninja package || exit /b
cd ..

@echo off
setlocal

REM Script for building the LLVM installer on Windows,
REM used for the the weekly snapshots at http://www.llvm.org/builds.
REM
REM Usage: build_llvm_package.bat <revision>

REM Prerequisites:
REM
REM   Visual Studio 2017, CMake, Ninja, SVN, GNUWin32, SWIG, Python 3,
REM   NSIS with the strlen_8192 patch,
REM   Visual Studio 2017 SDK and Nuget (for the clang-format plugin),
REM   Perl (for the OpenMP run-time).
REM
REM
REM   For LLDB, SWIG version <= 3.0.8 needs to be used to work around
REM   https://github.com/swig/swig/issues/769

REM You need to modify the paths below:
set vsdevcmd=C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\Tools\VsDevCmd.bat

set python32_dir=C:\Users\%USERNAME%\AppData\Local\Programs\Python\Python36-32
set python64_dir=C:\Users\%USERNAME%\AppData\Local\Programs\Python\Python36

set revision=%1
set branch=trunk
set package_version=8.0.0-r%revision%
set clang_format_vs_version=8.0.0.%revision%
set build_dir=llvm_package_%revision%

echo Branch: %branch%
echo Revision: %revision%
echo Package version: %package_version%
echo Clang format plugin version: %clang_format_vs_version%
echo Build dir: %build_dir%
echo.
pause

mkdir %build_dir%
cd %build_dir%

echo Checking out %branch% at r%revision%...
svn.exe export -r %revision% http://llvm.org/svn/llvm-project/llvm/%branch% llvm || exit /b
svn.exe export -r %revision% http://llvm.org/svn/llvm-project/cfe/%branch% llvm/tools/clang || exit /b
svn.exe export -r %revision% http://llvm.org/svn/llvm-project/clang-tools-extra/%branch% llvm/tools/clang/tools/extra || exit /b
svn.exe export -r %revision% http://llvm.org/svn/llvm-project/lld/%branch% llvm/tools/lld || exit /b
svn.exe export -r %revision% http://llvm.org/svn/llvm-project/compiler-rt/%branch% llvm/projects/compiler-rt || exit /b
svn.exe export -r %revision% http://llvm.org/svn/llvm-project/openmp/%branch% llvm/projects/openmp || exit /b
svn.exe export -r %revision% http://llvm.org/svn/llvm-project/lldb/%branch% llvm/tools/lldb || exit /b

REM Setting CMAKE_CL_SHOWINCLUDES_PREFIX to work around PR27226.
set cmake_flags=-DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_ASSERTIONS=ON -DLLVM_INSTALL_TOOLCHAIN_ONLY=ON -DCMAKE_INSTALL_UCRT_LIBRARIES=ON -DCLANG_FORMAT_VS_VERSION=%clang_format_vs_version% -DPACKAGE_VERSION=%package_version% -DLLDB_RELOCATABLE_PYTHON=1 -DLLDB_TEST_COMPILER=%cd%\build32_stage0\bin\clang.exe -DCMAKE_CL_SHOWINCLUDES_PREFIX="Note: including file: "

REM TODO: Run all tests, including lld and compiler-rt.

set "VSCMD_START_DIR=%CD%"
call "%vsdevcmd%" -arch=x86
set CC=
set CXX=
mkdir build32_stage0
cd build32_stage0
REM Work around VS2017 bug by using MinSizeRel.
cmake -GNinja %cmake_flags% -DPYTHON_HOME=%python32_dir% -DCMAKE_BUILD_TYPE=MinSizeRel ..\llvm || exit /b
ninja all || ninja all || ninja all || exit /b
ninja check || ninja check || ninja check || exit /b
ninja check-clang || ninja check-clang || ninja check-clang ||  exit /b
cd..

mkdir build32
cd build32
set CC=..\build32_stage0\bin\clang-cl
set CXX=..\build32_stage0\bin\clang-cl
cmake -GNinja %cmake_flags% -DPYTHON_HOME=%python32_dir% ..\llvm || exit /b
ninja all || ninja all || ninja all || exit /b
ninja check || ninja check || ninja check || exit /b
ninja check-clang || ninja check-clang || ninja check-clang ||  exit /b
ninja package || exit /b
cd ..

REM The plug-in is built separately as it uses a statically linked clang-format.exe.
mkdir build_vsix
cd build_vsix
set CC=..\build32_stage0\bin\clang-cl
set CXX=..\build32_stage0\bin\clang-cl
cmake -GNinja %cmake_flags% -DLLVM_USE_CRT_RELEASE=MT -DBUILD_CLANG_FORMAT_VS_PLUGIN=ON -DPYTHON_HOME=%python32_dir% ..\llvm || exit /b
ninja clang_format_vsix || exit /b
copy ..\llvm\tools\clang\tools\clang-format-vs\ClangFormat\bin\Release\ClangFormat.vsix ClangFormat-r%revision%.vsix
cd ..

set "VSCMD_START_DIR=%CD%"
call "%vsdevcmd%" -arch=amd64
set CC=
set CXX=
mkdir build64_stage0
cd build64_stage0
REM Work around VS2017 bug by using MinSizeRel.
cmake -GNinja %cmake_flags% -DPYTHON_HOME=%python64_dir% -DCMAKE_BUILD_TYPE=MinSizeRel ..\llvm || exit /b
ninja all || ninja all || ninja all || exit /b
ninja check || ninja check || ninja check || exit /b
ninja check-clang || ninja check-clang || ninja check-clang ||  exit /b
cd..

mkdir build64
cd build64
set CC=..\build64_stage0\bin\clang-cl
set CXX=..\build64_stage0\bin\clang-cl
cmake -GNinja %cmake_flags% -DPYTHON_HOME=%python64_dir% ..\llvm || exit /b
ninja all || ninja all || ninja all || exit /b
ninja check || ninja check || ninja check || exit /b
ninja check-clang || ninja check-clang || ninja check-clang ||  exit /b
ninja package || exit /b
cd ..

Include lldb in Win snapshots again (PR37307)

git-svn-id: 0ff597fd157e6f4fc38580e8d64ab130330d2411@351309 91177308-0d34-0410-b5e6-96231b3b80d8


cd ./src/AspNet.Mvc.Formatters.Protobuf
dnu restore
dnu build
dnu pack
dnu publish
cd ..
cd ..

Move directory back

Move directory back


call "%ProgramFiles(x86)%\Microsoft Visual Studio 14.0\Common7\Tools\VsMSBuildCmd.bat"
git checkout .
git status

Add git status

Add git status


@echo off
:: ############################
:: # Install the dotfiles on Windows systems.
:: ############################

NET SESSION >nul 2>&1
if %ERRORLEVEL% neq 0 (
    echo Not an admin, exiting.
    exit /B 1
)

setlocal EnableDelayedExpansion

if exist "%HOME%" (
	set homeDir=%HOME%
) else (
	if exist "%HOMEDRIVE%%HOMEPATH%" (
		set homeDir=%HOMEDRIVE%%HOMEPATH%
	) else (
		set homeDir=%USERPROFILE%
	)
)

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

set dotfilesDir=%~dp0
set backupDir=%homeDir%\dotfiles_backup
set dotfiles=bashrc bash_profile config minttyrc zshenv puppet-lint.rc

:: add registry key for init.bat
if exist "%CLINK_DIR%" (
    reg add "HKCU\Software\Microsoft\Command Processor" /v AutoRun /t REG_EXPAND_SZ /d "%dotfilesDir%init.bat&\"%%CLINK_DIR%%\clink\" inject --profile ~\clink" /f
) else (
    reg add "HKCU\Software\Microsoft\Command Processor" /v AutoRun /t REG_SZ /d "%dotfilesDir%init.bat" /f
)

for %%A in (%dotfiles%) DO (
    call:createSymLink "%dotfilesDir%%%A" "%homeDir%\.%%A" "%backupDir%" true
)

call:createSymLink "%dotfilesDir%config\readline\inputrc" "%homeDir%\.inputrc" "%backupDir%" true

set sublimeDir=%APPDATA%\Sublime Text 3\Packages
set backupDir=%homeDir%\dotfiles_backup\sublime

if exist "%sublimeDir%" (
    call:createSymLink "%dotfilesDir%sublime\User" "%sublimeDir%\User" "%backupDir%" false
    call:createSymLink "%dotfilesDir%sublime\User (OS Settings)" "%sublimeDir%\User (OS Settings)" "%backupDir%" false
)

set vsCodeDir=%APPDATA%\Code
set backupDir=%homeDir%\dotfiles_backup\code

if exist "%vsCodeDir%" (
    call:createSymLink "%dotfilesDir%vscode\User" "%vsCodeDir%\User" "%backupDir%" false
)

set backupDir=%homeDir%\dotfiles_backup\atom
set atomfiles=config.cson init.coffee keymap.cson snippets.cson styles.less

for %%A in (%atomfiles%) DO (
    call:createSymLink "%dotfilesDir%\atom\%%A" "%homeDir%\.atom\%%A" "%backupDir%" false
)

set backupDir=%homeDir%\dotfiles_backup\bin
set binfiles=create-eclipse-shortcuts.cmd create-eclipse-shortcuts.ps1 stree.cmd update-everything.cmd

for %%A in (%binfiles%) DO (
    call:createSymLink "%dotfilesDir%\bin\%%A" "%homeDir%\bin\%%A" "%backupDir%" false
)

PowerShell.exe -Command  "& Set-ExecutionPolicy RemoteSigned -Force"
PowerShell.exe -ExecutionPolicy RemoteSigned -File install-win.ps1 %dotfilesDir%Microsoft.PowerShell_profile.ps1

goto:EOF

::function
:createSymLink - target linkName backupDirectory hideLink
    set linkExists="0"
    if exist "%~2" (
        set Z=&& for %%A in ("%~2") do set Z=%%~aA
        if "!Z:~8,1!" == "l" (
            set linkExists="1"
        ) else (
            if not exist "%~3" (
                mkdir "%~3"
            )
            echo Moving existing %2 to %3
            move "%~2" "%~3"
        )
    )

    if !linkExists! == "0" (
        if exist "%~1\" (
            mklink /d "%~2" "%~1"
        ) else (
            mklink "%~2" "%~1"
        )
        if %4 == "true" (
        	attrib /L "%~2" +h
        )
    ) else (
        echo Not replacing existing link %2
    )

goto:EOF

@echo off
:: ############################
:: # Install the dotfiles on Windows systems.
:: ############################

NET SESSION >nul 2>&1
if %ERRORLEVEL% neq 0 (
    echo Not an admin, exiting.
    exit /B 1
)

setlocal EnableDelayedExpansion

if exist "%HOME%" (
	set homeDir=%HOME%
) else (
	if exist "%HOMEDRIVE%%HOMEPATH%" (
		set homeDir=%HOMEDRIVE%%HOMEPATH%
	) else (
		set homeDir=%USERPROFILE%
	)
)

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

set dotfilesDir=%~dp0
set backupDir=%homeDir%\dotfiles_backup
set dotfiles=bashrc bash_profile config minttyrc zshenv puppet-lint.rc

:: add registry key for init.bat
if exist "%CLINK_DIR%" (
    reg add "HKCU\Software\Microsoft\Command Processor" /v AutoRun /t REG_EXPAND_SZ /d "%dotfilesDir%init.bat&\"%%CLINK_DIR%%\clink\" inject --profile ~\clink" /f
) else (
    reg add "HKCU\Software\Microsoft\Command Processor" /v AutoRun /t REG_SZ /d "%dotfilesDir%init.bat" /f
)

for %%A in (%dotfiles%) DO (
    call:createSymLink "%dotfilesDir%%%A" "%homeDir%\.%%A" "%backupDir%" true
)

call:createSymLink "%dotfilesDir%config\readline\inputrc" "%homeDir%\.inputrc" "%backupDir%" true

set sublimeDir=%APPDATA%\Sublime Text 3\Packages
set backupDir=%homeDir%\dotfiles_backup\sublime

if exist "%sublimeDir%" (
    call:createSymLink "%dotfilesDir%sublime\User" "%sublimeDir%\User" "%backupDir%" false
    call:createSymLink "%dotfilesDir%sublime\User (OS Settings)" "%sublimeDir%\User (OS Settings)" "%backupDir%" false
)

set vsCodeDir=%APPDATA%\Code
set backupDir=%homeDir%\dotfiles_backup\code

if exist "%vsCodeDir%" (
    call:createSymLink "%dotfilesDir%vscode\User" "%vsCodeDir%\User" "%backupDir%" false
)

set backupDir=%homeDir%\dotfiles_backup\atom
set atomfiles=config.cson init.coffee keymap.cson snippets.cson styles.less

if not exist "%homeDir%\.atom" (
    mkdir "%homeDir%\.atom"
)

for %%A in (%atomfiles%) DO (
    call:createSymLink "%dotfilesDir%\atom\%%A" "%homeDir%\.atom\%%A" "%backupDir%" false
)

set backupDir=%homeDir%\dotfiles_backup\bin
set binfiles=create-eclipse-shortcuts.cmd create-eclipse-shortcuts.ps1 stree.cmd update-everything.cmd

for %%A in (%binfiles%) DO (
    call:createSymLink "%dotfilesDir%\bin\%%A" "%homeDir%\bin\%%A" "%backupDir%" false
)

PowerShell.exe -Command  "& Set-ExecutionPolicy RemoteSigned -Force"
PowerShell.exe -ExecutionPolicy RemoteSigned -File install-win.ps1 %dotfilesDir%Microsoft.PowerShell_profile.ps1

goto:EOF

::function
:createSymLink - target linkName backupDirectory hideLink
    set linkExists="0"
    if exist "%~2" (
        set Z=&& for %%A in ("%~2") do set Z=%%~aA
        if "!Z:~8,1!" == "l" (
            set linkExists="1"
        ) else (
            if not exist "%~3" (
                mkdir "%~3"
            )
            echo Moving existing %2 to %3
            move "%~2" "%~3"
        )
    )

    if !linkExists! == "0" (
        if exist "%~1\" (
            mklink /d "%~2" "%~1"
        ) else (
            mklink "%~2" "%~1"
        )
        if %4 == "true" (
        	attrib /L "%~2" +h
        )
    ) else (
        echo Not replacing existing link %2
    )

goto:EOF

Create ~/.atom if necessary

Create ~/.atom if necessary


@ECHO OFF
SETLOCAL
rem SET "PERL_PATH=G:\Installation Programs\Programs\Compiling Stuff\Other\ActivePerl-5.12.2.1202-MSWin32-x86-293621"

rem Check the building environment
rem IF NOT EXIST "%PERL_PATH%" CALL :SUBMSG "INFO" "The Perl direcotry wasn't found; the addon won't be built"
IF NOT DEFINED VS100COMNTOOLS CALL :SUBMSG "INFO" "Visual Studio 2010 wasn't found; the installer won't be built"

CD /D %~dp0

CALL build.cmd
IF %ERRORLEVEL% NEQ 0 CALL :SUBMSG "ERROR" "Compilation failed!"

CALL :SubVersion

CALL :SubZipFiles Release x86-32
CALL :SubZipFiles Release_x64 x86-64

IF DEFINED VS100COMNTOOLS (
  CALL :SubInstaller x86
  CALL :SubInstaller x64
)

rem Calulate md5/sha1 hashes
PUSHD packages
rem "..\..\distrib\tools\md5sum.exe" *.7z *.zip *.exe >md5hashes
rem "..\..\distrib\tools\sha1sum.exe" *.7z *.zip *.exe >sha1hashes

rem Compress everything into a single ZIP file
DEL Notepad2-mod.zip >NUL 2>&1
START "" /B /WAIT "..\..\distrib\tools\7za.exe" a -tzip -mx=9 Notepad2-mod.zip * -x!md5hashes -x!sha1hashes >NUL
IF %ERRORLEVEL% NEQ 0 CALL :SUBMSG "ERROR" "Compilation failed!"

CALL :SUBMSG "INFO" "Notepad2-mod.zip created successfully!"

POPD

:END
TITLE Finished!
ECHO.
ENDLOCAL
PAUSE
EXIT /B

:SubZipFiles
TITLE Creating the %2 ZIP file...
CALL :SUBMSG "INFO" "Creating the %2 ZIP file..."

MD "temp_zip" "packages" >NUL 2>&1
COPY /Y /V "..\License.txt" "temp_zip\"
COPY /Y /V "..\%1\Notepad2.exe" "temp_zip\"
COPY /Y /V "..\distrib\res\cabinet\notepad2.ini" "temp_zip\Notepad2.ini"
COPY /Y /V "..\Notepad2.txt" "temp_zip\"
COPY /Y /V "..\Readme.txt" "temp_zip\"
COPY /Y /V "..\Readme-mod.txt" "temp_zip\"

PUSHD "temp_zip"
START "" /B /WAIT "..\..\distrib\tools\7za.exe" a -tzip -mx=9^
 "Notepad2-mod.%NP2_VER%_r%VerRev%_%2.zip" "License.txt" "Notepad2.exe"^
 "Notepad2.ini" "Notepad2.txt" "Readme.txt" "Readme-mod.txt" >NUL
IF %ERRORLEVEL% NEQ 0 CALL :SUBMSG "ERROR" "Compilation failed!"

CALL :SUBMSG "INFO" "Notepad2-mod.%NP2_VER%_r%VerRev%_%2.zip created successfully!"

MOVE /Y "Notepad2-mod.%NP2_VER%_r%VerRev%_%2.zip" "..\packages" >NUL 2>&1
POPD
RD /S /Q "temp_zip" >NUL 2>&1
GOTO :EOF

:SubInstaller
IF /I "%1"=="x86" (
  SET ARCH=Win32
  SET BINDIR=x86-32
  SET OUTDIR=Release
)
IF /I "%1"=="x64" (
  SET ARCH=x64
  SET BINDIR=x86-64
  SET OUTDIR=Release_x64
)

TITLE Building %BINDIR% installer...
CALL :SUBMSG "INFO" "Building %BINDIR% installer..."

PUSHD ..\distrib
MD temp\%BINDIR% >NUL 2>&1

COPY /B /V /Y ..\%OUTDIR%\Notepad2.exe temp\%BINDIR%\notepad2.exe
COPY /B /V /Y ..\License.txt temp\%BINDIR%\license.txt
COPY /B /V /Y res\cabinet\notepad2.inf temp\%BINDIR%\notepad2.inf
COPY /B /V /Y res\cabinet\notepad2.ini temp\%BINDIR%\notepad2.ini
COPY /B /V /Y res\cabinet\notepad2.redir.ini temp\%BINDIR%\notepad2.redir.ini
COPY /B /V /Y ..\Notepad2.txt temp\%BINDIR%\notepad2.txt
COPY /B /V /Y ..\Readme.txt temp\%BINDIR%\readme.txt
COPY /B /V /Y ..\Readme-mod.txt temp\%BINDIR%\readme-mod.txt

rem Set the version for the DisplayVersion registry value
CALL tools\BatchSubstitute.bat "0.0.0.0" "%NP2_VER%.%VerRev%" temp\%BINDIR%\notepad2.inf >notepad2.inf.tmp
COPY /Y temp\%BINDIR%\notepad2.inf notepad2.inf.orig >NUL
MOVE /Y notepad2.inf.tmp temp\%BINDIR%\notepad2.inf >NUL

rem get the size and put it in the inf file
PUSHD temp\%BINDIR%
FOR /F "tokens=*" %%a IN ('"DIR /-C | FIND "bytes" | FIND /V "free""') DO SET summaryout=%%a
FOR /F "tokens=1,2 delims=)" %%a IN ("%summaryout%") DO SET filesout=%%a&set sizeout=%%b
SET /A sizeout=%sizeout:bytes=%/1024
POPD

CALL tools\BatchSubstitute.bat "1111" "%sizeout%" temp\%BINDIR%\notepad2.inf >notepad2.inf.tmp
COPY /Y temp\%BINDIR%\notepad2.inf notepad2.inf.orig >NUL
MOVE /Y notepad2.inf.tmp temp\%BINDIR%\notepad2.inf >NUL

tools\cabutcd.exe temp\%BINDIR% res\cabinet.%BINDIR%.cab
DEL notepad2.inf.orig >NUL 2>&1
RD /Q /S temp\%BINDIR% >NUL 2>&1

CALL "%VS100COMNTOOLS%vsvars32.bat" >NUL
devenv setup.sln /Rebuild "Full|%ARCH%"
IF %ERRORLEVEL% NEQ 0 CALL :SUBMSG "ERROR" "Compilation failed!"
rem devenv setup.sln /Rebuild "Lite|%ARCH%"
rem IF %ERRORLEVEL% NEQ 0 CALL :SUBMSG "ERROR" "Compilation failed!"

rem IF EXIST "%PERL_PATH%" (
rem   "%PERL_PATH%\perl\bin\perl.exe" addon_build.pl
rem )

MD ..\wdkbuild\packages >NUL 2>&1
rem IF EXIST "%PERL_PATH%" (
rem   MOVE setup.%BINDIR%\addon.7z    ..\wdkbuild\packages\Notepad2-mod_Addon.%BINDIR%.7z >NUL
rem )
MOVE setup.%BINDIR%\setupfull.exe ..\wdkbuild\packages\Notepad2-mod_Setup.%BINDIR%.exe >NUL
rem MOVE setup.%BINDIR%\setuplite.exe ..\wdkbuild\packages\Notepad2-mod_Setup_Silent.%BINDIR%.exe >NUL

rem Cleanup
RD /Q setup.%BINDIR% temp >NUL 2>&1
RD /Q /S addon obj >NUL 2>&1

POPD
GOTO :EOF

:SubVersion
rem Get the version
FOR /f "tokens=3,4 delims= " %%K IN (
  'FINDSTR /I /L /C:"define VERSION_MAJOR" "..\src\Version.h"') DO (
  SET "VerMajor=%%K"&Call :SubVerMajor %%VerMajor:*Z=%%)
FOR /f "tokens=3,4 delims= " %%L IN (
  'FINDSTR /I /L /C:"define VERSION_MINOR" "..\src\Version.h"') DO (
  SET "VerMinor=%%L"&Call :SubVerMinor %%VerMinor:*Z=%%)
FOR /f "tokens=3,4 delims= " %%M IN (
  'FINDSTR /I /L /C:"define VERSION_BUILD" "..\src\Version.h"') DO (
  SET "VerBuild=%%M"&Call :SubVerBuild %%VerBuild:*Z=%%)
FOR /f "tokens=3,4 delims= " %%N IN (
  'FINDSTR /I /L /C:"define VERSION_REV" "..\src\Version_rev.h"') DO (
  SET "VerRev=%%N"&Call :SubVerRev %%VerRev:*Z=%%)

SET NP2_VER=%VerMajor%.%VerMinor%.%VerBuild%
GOTO :EOF

:SubVerMajor
SET VerMajor=%*
GOTO :EOF
:SubVerMinor
SET VerMinor=%*
GOTO :EOF
:SubVerBuild
SET VerBuild=%*
GOTO :EOF
:SubVerRev
SET VerRev=%*
GOTO :EOF

:SUBMSG
ECHO.&&ECHO:______________________________
ECHO:[%~1] %~2
ECHO:______________________________&&ECHO.
IF /I "%~1"=="ERROR" (
  PAUSE
  EXIT
) ELSE (
  EXIT /B
)

@ECHO OFF
SETLOCAL
rem SET "PERL_PATH=G:\Installation Programs\Programs\Compiling Stuff\Other\ActivePerl-5.12.2.1202-MSWin32-x86-293621"

rem Check the building environment
rem IF NOT EXIST "%PERL_PATH%" CALL :SUBMSG "INFO" "The Perl direcotry wasn't found; the addon won't be built"
IF NOT DEFINED VS100COMNTOOLS CALL :SUBMSG "INFO" "Visual Studio 2010 wasn't found; the installer won't be built"

CD /D %~dp0

CALL build.cmd
IF %ERRORLEVEL% NEQ 0 CALL :SUBMSG "ERROR" "Compilation failed!"

CALL :SubVersion

CALL :SubZipFiles Release x86-32
CALL :SubZipFiles Release_x64 x86-64

IF DEFINED VS100COMNTOOLS (
  CALL :SubInstaller x86
  CALL :SubInstaller x64
)

rem Calulate md5/sha1 hashes
PUSHD packages
rem "..\..\distrib\tools\md5sum.exe" *.7z *.zip *.exe >md5hashes
rem "..\..\distrib\tools\sha1sum.exe" *.7z *.zip *.exe >sha1hashes

rem Compress everything into a single ZIP file
DEL Notepad2-mod.zip >NUL 2>&1
START "" /B /WAIT "..\..\distrib\tools\7za.exe" a -tzip -mx=9 Notepad2-mod.zip * -x!md5hashes -x!sha1hashes >NUL
IF %ERRORLEVEL% NEQ 0 CALL :SUBMSG "ERROR" "Compilation failed!"

CALL :SUBMSG "INFO" "Notepad2-mod.zip created successfully!"

POPD

:END
TITLE Finished!
ECHO.
ENDLOCAL
PAUSE
EXIT /B

:SubZipFiles
TITLE Creating the %2 ZIP file...
CALL :SUBMSG "INFO" "Creating the %2 ZIP file..."

MD "temp_zip" "packages" >NUL 2>&1
COPY /Y /V "..\License.txt" "temp_zip\"
COPY /Y /V "..\%1\Notepad2.exe" "temp_zip\"
COPY /Y /V "..\distrib\res\cabinet\notepad2.ini" "temp_zip\Notepad2.ini"
COPY /Y /V "..\Notepad2.txt" "temp_zip\"
COPY /Y /V "..\Readme.txt" "temp_zip\"
COPY /Y /V "..\Readme-mod.txt" "temp_zip\"

PUSHD "temp_zip"
START "" /B /WAIT "..\..\distrib\tools\7za.exe" a -tzip -mx=9^
 "Notepad2-mod.%NP2_VER%_r%VerRev%_%2.zip" "License.txt" "Notepad2.exe"^
 "Notepad2.ini" "Notepad2.txt" "Readme.txt" "Readme-mod.txt" >NUL
IF %ERRORLEVEL% NEQ 0 CALL :SUBMSG "ERROR" "Compilation failed!"

CALL :SUBMSG "INFO" "Notepad2-mod.%NP2_VER%_r%VerRev%_%2.zip created successfully!"

MOVE /Y "Notepad2-mod.%NP2_VER%_r%VerRev%_%2.zip" "..\packages" >NUL 2>&1
POPD
RD /S /Q "temp_zip" >NUL 2>&1
GOTO :EOF

:SubInstaller
IF /I "%1"=="x86" (
  SET ARCH=Win32
  SET BINDIR=x86-32
  SET OUTDIR=Release
)
IF /I "%1"=="x64" (
  SET ARCH=x64
  SET BINDIR=x86-64
  SET OUTDIR=Release_x64
)

TITLE Building %BINDIR% installer...
CALL :SUBMSG "INFO" "Building %BINDIR% installer..."

PUSHD ..\distrib
MD temp\%BINDIR% >NUL 2>&1

COPY /B /V /Y ..\%OUTDIR%\Notepad2.exe temp\%BINDIR%\notepad2.exe
COPY /B /V /Y ..\License.txt temp\%BINDIR%\license.txt
COPY /B /V /Y res\cabinet\notepad2.inf temp\%BINDIR%\notepad2.inf
COPY /B /V /Y res\cabinet\notepad2.ini temp\%BINDIR%\notepad2.ini
COPY /B /V /Y res\cabinet\notepad2.redir.ini temp\%BINDIR%\notepad2.redir.ini
COPY /B /V /Y ..\Notepad2.txt temp\%BINDIR%\notepad2.txt
COPY /B /V /Y ..\Readme.txt temp\%BINDIR%\readme.txt
COPY /B /V /Y ..\Readme-mod.txt temp\%BINDIR%\readme-mod.txt

rem Set the version for the DisplayVersion registry value
CALL tools\BatchSubstitute.bat "0.0.0.0" "%NP2_VER%.%VerRev%" temp\%BINDIR%\notepad2.inf >notepad2.inf.tmp
COPY /Y temp\%BINDIR%\notepad2.inf notepad2.inf.orig >NUL
MOVE /Y notepad2.inf.tmp temp\%BINDIR%\notepad2.inf >NUL

rem get the size and put it in the inf file
PUSHD temp\%BINDIR%
FOR /F "tokens=*" %%a IN ('"DIR /-C | FIND "bytes" | FIND /V "free""') DO SET summaryout=%%a
FOR /F "tokens=1,2 delims=)" %%a IN ("%summaryout%") DO SET filesout=%%a&set sizeout=%%b
SET /A sizeout=%sizeout:bytes=%/1024
POPD

CALL tools\BatchSubstitute.bat "1111" "%sizeout%" temp\%BINDIR%\notepad2.inf >notepad2.inf.tmp
COPY /Y temp\%BINDIR%\notepad2.inf notepad2.inf.orig >NUL
MOVE /Y notepad2.inf.tmp temp\%BINDIR%\notepad2.inf >NUL

tools\cabutcd.exe temp\%BINDIR% res\cabinet.%BINDIR%.cab
DEL notepad2.inf.orig >NUL 2>&1
RD /Q /S temp\%BINDIR% >NUL 2>&1

CALL "%VS100COMNTOOLS%vsvars32.bat" >NUL
devenv setup.sln /Rebuild "Full|%ARCH%"
IF %ERRORLEVEL% NEQ 0 CALL :SUBMSG "ERROR" "Compilation failed!"
rem devenv setup.sln /Rebuild "Lite|%ARCH%"
rem IF %ERRORLEVEL% NEQ 0 CALL :SUBMSG "ERROR" "Compilation failed!"

rem IF EXIST "%PERL_PATH%" (
rem   "%PERL_PATH%\perl\bin\perl.exe" addon_build.pl
rem )

MD ..\wdkbuild\packages >NUL 2>&1
rem IF EXIST "%PERL_PATH%" (
rem   MOVE setup.%BINDIR%\addon.7z    ..\wdkbuild\packages\Notepad2-mod_Addon.%BINDIR%.7z >NUL
rem )
MOVE setup.%BINDIR%\setupfull.exe ..\wdkbuild\packages\Notepad2-mod.%NP2_VER%_r%VerRev%_%BINDIR%_Setup.exe >NUL
rem MOVE setup.%BINDIR%\setuplite.exe ..\wdkbuild\packages\Notepad2-mod.%NP2_VER%_r%VerRev%_%BINDIR%_Setup_Silent.exe >NUL

rem Cleanup
RD /Q setup.%BINDIR% temp >NUL 2>&1
RD /Q /S addon obj >NUL 2>&1

POPD
GOTO :EOF

:SubVersion
rem Get the version
FOR /f "tokens=3,4 delims= " %%K IN (
  'FINDSTR /I /L /C:"define VERSION_MAJOR" "..\src\Version.h"') DO (
  SET "VerMajor=%%K"&Call :SubVerMajor %%VerMajor:*Z=%%)
FOR /f "tokens=3,4 delims= " %%L IN (
  'FINDSTR /I /L /C:"define VERSION_MINOR" "..\src\Version.h"') DO (
  SET "VerMinor=%%L"&Call :SubVerMinor %%VerMinor:*Z=%%)
FOR /f "tokens=3,4 delims= " %%M IN (
  'FINDSTR /I /L /C:"define VERSION_BUILD" "..\src\Version.h"') DO (
  SET "VerBuild=%%M"&Call :SubVerBuild %%VerBuild:*Z=%%)
FOR /f "tokens=3,4 delims= " %%N IN (
  'FINDSTR /I /L /C:"define VERSION_REV" "..\src\Version_rev.h"') DO (
  SET "VerRev=%%N"&Call :SubVerRev %%VerRev:*Z=%%)

SET NP2_VER=%VerMajor%.%VerMinor%.%VerBuild%
GOTO :EOF

:SubVerMajor
SET VerMajor=%*
GOTO :EOF
:SubVerMinor
SET VerMinor=%*
GOTO :EOF
:SubVerBuild
SET VerBuild=%*
GOTO :EOF
:SubVerRev
SET VerRev=%*
GOTO :EOF

:SUBMSG
ECHO.&&ECHO:______________________________
ECHO:[%~1] %~2
ECHO:______________________________&&ECHO.
IF /I "%~1"=="ERROR" (
  PAUSE
  EXIT
) ELSE (
  EXIT /B
)

change the packages name

change the packages name

git-svn-id: 756506b3b0ea8c31733a8f0a5bb416c7e269da3d@254 28bd50df-7adb-d945-0439-6e466c6a13cc


@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

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

:SelectNodeVersion

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

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

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

  IF NOT DEFINED NODE_EXE (
    SET NODE_EXE=node
  )

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

goto :EOF

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

:Deployment
echo Handling node.js deployment.

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

:: 2. Select node version
call :SelectNodeVersion

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

:: 4. Restore Gulp packages and run Gulp tasks
IF /I "gulpfile.js" NEQ "" (
  echo Installing Gulp dependencies: Starting %TIME%
  call npm install gulp
  echo Installing Gulp dependencies: Finished %TIME%
  IF !ERRORLEVEL! NEQ 0 goto error
  echo Running Gulp deployment: Starting %TIME%
  call :ExecuteCmd "%DEPLOYMENT_TARGET%\node_modules\.bin\gulp"
  echo Running Gulp deployment: Finished %TIME%
  IF !ERRORLEVEL! NEQ 0 goto error
)

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

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

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

:exitSetErrorLevel
exit /b 1

:exitFromFunction
()

:end
endlocal
echo Finished successfully.

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

:: ----------------------
:: KUDU Deployment Script
:: Version: 1.0.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

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

:SelectNodeVersion

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

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

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

  IF NOT DEFINED NODE_EXE (
    SET NODE_EXE=node
  )

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

goto :EOF

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

:Deployment
echo Handling node.js deployment.

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

:: 2. Select node version
call :SelectNodeVersion

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

:: 4. Restore Gulp packages and run Gulp tasks
IF /I "gulpfile.js" NEQ "" (
  echo Installing Gulp dependencies: Starting %TIME%
  echo Installing Gulp dependencies: Finished %TIME%
  IF !ERRORLEVEL! NEQ 0 goto error
  echo Running Gulp deployment: Starting %TIME%
  call :ExecuteCmd "%DEPLOYMENT_TARGET%\node_modules\.bin\gulp"
  echo Running Gulp deployment: Finished %TIME%
  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.

change source of gulp file again

change source of gulp file again


@ECHO OFF

:: setup my variables
set OLDDIR=%CD%
SET "dir="D:\Archive\arccasperdeploy""
SET url=git@github.com:kaveh096/ArcCASPER.git

:: clean enviroment
IF NOT EXIST %dir% ( git clone %url% %dir% )
cd %dir%

:: call build function
echo Going to build a nightly version
call:buildFunc dev nightly
echo
echo Going to build an stable version
call:buildFunc master stable

goto :exit

:: ------------------------------------- build and post function
:buildFunc

:: switch to branch
git checkout %1
git pull

:: get hash of head
for /f %%i in ('git describe') do set revi=%%i
set "out=ArcCASPER-%revi%-%2%.zip"

:: TODO create changle.log from 'git shortlog --no-merges %1 --not v10.1'

:: check if there is new commit to be built
for /f %%i in ('d:\cygwin64\bin\bash.exe -c "/home/kshahabi/dropbox_uploader.sh list | grep %revi% | wc -l"') do set iscommit=%%i
if %iscommit%==1 (
  echo No new code is commited to %1% branch
  goto :eof
)

:: build clean
set NOREG=1
del /Q Package\EvcSolver32.*
del /Q Package\EvcSolver64.*
msbuild.exe /m /target:rebuild /p:Configuration=Release /p:Platform=Win32 ArcCASPER.sln
msbuild.exe /m /target:rebuild /p:Configuration=Release /p:Platform=x64   ArcCASPER.sln

:: Generate readme file
"c:\Program Files (x86)\GnuWin32\bin\sed.exe" -e "s/REV/%revi%/g" README.md > Package\README.md

:: post to dropbox
cd Package
"c:\Program Files\7-Zip\7z.exe" a %out% -i@file.list
if %errorlevel%==0 (
  d:\cygwin64\bin\bash.exe -c '/home/kshahabi/dropbox_uploader.sh upload `cygpath -u "%CD%\%out%"` %out%'
) else (
  echo Some of the files are not present
)
goto :eof
:: ------------------------------------- end of build function

:: restore current directory and then exit
:exit
chdir /d %OLDDIR%

@ECHO OFF

:: setup my variables
set OLDDIR=%CD%
SET dir=d:\Archive\arccasperdeploy
SET cydir=d:/Archive/arccasperdeploy
SET url=git@github.com:kaveh096/ArcCASPER.git

:: clean enviroment
IF NOT EXIST %dir% ( git clone %url% %cydir% )
cd %dir%

:: call build function
echo Going to build a nightly version
call:buildFunc dev nightly
echo
echo Going to build an stable version
call:buildFunc master stable

goto :exit

:: ------------------------------------- build and post function
:buildFunc

:: switch to branch
git checkout %1
git pull

:: get hash of head
for /f %%i in ('git describe') do set revi=%%i
set "out=ArcCASPER-%revi%-%2%.zip"

:: TODO create changle.log from 'git shortlog --no-merges %1 --not v10.1'

:: check if there is new commit to be built
for /f %%i in ('d:\cygwin64\bin\bash.exe -c "/home/kshahabi/dropbox_uploader.sh list | grep %revi% | wc -l"') do set iscommit=%%i
if %iscommit%==1 (
  echo No new code is commited to %1% branch
  goto :eof
)

:: build clean
set NOREG=1
del /Q Package\EvcSolver32.*
del /Q Package\EvcSolver64.*
msbuild.exe /m /target:rebuild /p:Configuration=Release /p:Platform=Win32 ArcCASPER.sln
msbuild.exe /m /target:rebuild /p:Configuration=Release /p:Platform=x64   ArcCASPER.sln

:: Generate readme file
"c:\Program Files (x86)\GnuWin32\bin\sed.exe" -e "s/REV/%revi%/g" README.md > Package\README.md

:: post to dropbox
cd Package
"c:\Program Files\7-Zip\7z.exe" a %out% -i@file.list
if %errorlevel%==0 (
  d:\cygwin64\bin\bash.exe -c '/home/kshahabi/dropbox_uploader.sh upload `cygpath -u "%CD%\%out%"` %out%'
) else (
  echo Some of the files are not present
)
goto :eof
:: ------------------------------------- end of build function

:: restore current directory and then exit
:exit
chdir /d %OLDDIR%

clone directory fixed according to cygwin path


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

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

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

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

:: Setup
:: -----

setlocal enabledelayedexpansion

SET ARTIFACTS=%~dp0%..\artifacts

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

IF NOT DEFINED DEPLOYMENT_DIST (
    SET DEPLOYMENT_DIST = %DEPLOYMENT_SOURCE\dist
)

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
)

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

::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: Pre-Deployment
:: ----------

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

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

echo Handling function App deployment.

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

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

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

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

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

:exitSetErrorLevel
exit /b 1

:exitFromFunction
()

:end
endlocal
echo Finished successfully.

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

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

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

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

:: Setup
:: -----

setlocal enabledelayedexpansion

SET ARTIFACTS=%~dp0%..\artifacts

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

IF NOT DEFINED DEPLOYMENT_DIST (
    SET DEPLOYMENT_DIST = %DEPLOYMENT_SOURCE%\dist
)

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
)

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

::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: Pre-Deployment
:: ----------

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

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

echo Handling function App deployment.

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

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

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

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

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

:exitSetErrorLevel
exit /b 1

:exitFromFunction
()

:end
endlocal
echo Finished successfully.

Build Master:2017-02-28T00:20:08.079Z

Build Master:2017-02-28T00:20:08.079Z


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

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

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

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

:: Setup
:: -----

setlocal enabledelayedexpansion

SET ARTIFACTS=%~dp0%..\artifacts

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

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

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

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

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

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

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

IF NOT DEFINED ANGUALR_CLI (
  :: Install angular-cli
  echo Installing angular-cli
  call npm install -g angular-cli

  IF !ERRORLEVEL! NEQ 0 goto error

  SET ANGUALR_CLI=true
)

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 Print variables
echo dp0=%~dp0%
echo ARTIFACTS=%ARTIFACTS%
echo DEPLOYMENT_SOURCE=%DEPLOYMENT_SOURCE%
echo DEPLOYMENT_TARGET=%DEPLOYMENT_TARGET%
echo DEPLOYMENT_TARGET_ANGULAR=%DEPLOYMENT_TARGET_ANGULAR%
echo NEXT_MANIFEST_PATH=%NEXT_MANIFEST_PATH%
echo PREVIOUS_MANIFEST_PATH=%PREVIOUS_MANIFEST_PATH%
echo DEPLOYMENT_TEMP=%DEPLOYMENT_TEMP%
echo IN_PLACE_DEPLOYMENT=%IN_PLACE_DEPLOYMENT%

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

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

echo Handling frontend Angular2 project.
:: 2. Bundle frontend angular2 app to the temporary path
IF EXIST "%DEPLOYMENT_SOURCE%\AzureFunctions.AngularClient\package.json" (
	pushd "%DEPLOYMENT_SOURCE%\AzureFunctions.AngularClient"
	echo Restore npm packages
	call :ExecuteCmd npm install
	IF !ERRORLEVEL! NEQ 0 (
		call :ExecuteCmd npm install
		IF !ERRORLEVEL! NEQ 0 goto error
	)
	echo Bundle angular2 app
	call :ExecuteCmd ng build --environment=prod --output-path="%DEPLOYMENT_SOURCE%\AzureFunctions.AngularClient\dist"
	IF !ERRORLEVEL! NEQ 0 (
		call :ExecuteCmd ng build --environment=prod --output-path="%DEPLOYMENT_SOURCE%\AzureFunctions.AngularClient\dist"
		IF !ERRORLEVEL! NEQ 0 goto error
	)

	each Copy angular output to the temporary path
	IF /I "%IN_PLACE_DEPLOYMENT%" NEQ "1" (
	echo ROBOCOPY "%DEPLOYMENT_SOURCE%\AzureFunctions.AngularClient\dist" "%DEPLOYMENT_TEMP%" /E /IS
		call :ExecuteCmd ROBOCOPY "%DEPLOYMENT_SOURCE%\AzureFunctions.AngularClient\dist" "%DEPLOYMENT_TEMP%" /E /IS
		:: http://ss64.com/nt/robocopy-exit.html
		IF %ERRORLEVEL% EQU 16 echo ***FATAL ERROR*** & goto error
		IF %ERRORLEVEL% EQU 15 echo OKCOPY + FAIL + MISMATCHES + XTRA & goto error
		IF %ERRORLEVEL% EQU 14 echo FAIL + MISMATCHES + XTRA & goto error
		IF %ERRORLEVEL% EQU 13 echo OKCOPY + FAIL + MISMATCHES & goto error
		IF %ERRORLEVEL% EQU 12 echo FAIL + MISMATCHES& goto error
		IF %ERRORLEVEL% EQU 11 echo OKCOPY + FAIL + XTRA & goto error
		IF %ERRORLEVEL% EQU 10 echo FAIL + XTRA & goto error
		IF %ERRORLEVEL% EQU 9 echo OKCOPY + FAIL & goto error
		IF %ERRORLEVEL% EQU 8 echo FAIL & goto error
		IF %ERRORLEVEL% EQU 7 echo OKCOPY + MISMATCHES + XTRA & goto error
		IF %ERRORLEVEL% EQU 6 echo MISMATCHES + XTRA & goto error
		IF %ERRORLEVEL% EQU 5 echo OKCOPY + MISMATCHES & goto error
		IF %ERRORLEVEL% EQU 4 echo MISMATCHES & goto error
		IF %ERRORLEVEL% EQU 3 echo OKCOPY + XTRA
		IF %ERRORLEVEL% EQU 2 echo XTRA
		IF %ERRORLEVEL% EQU 1 echo OKCOPY
		IF %ERRORLEVEL% EQU 0 echo No Change
	)
)

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

IF !ERRORLEVEL! NEQ 0 goto error

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

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

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

:: 5. update build.txt
call :ExecuteCmd echo %SCM_COMMIT_ID% > %DEPLOYMENT_TARGET%\build.txt
IF !ERRORLEVEL! NEQ 0 (
  call :ExecuteCmd echo %SCM_COMMIT_ID% > %DEPLOYMENT_TARGET%\build.txt
  IF !ERRORLEVEL! NEQ 0 goto error
)

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

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

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

:exitSetErrorLevel
exit /b 1

:exitFromFunction
()

:end
endlocal
echo Finished successfully.

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

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

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

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

:: Setup
:: -----

echo Print variables
echo dp0=%~dp0%
echo ARTIFACTS=%ARTIFACTS%
echo DEPLOYMENT_SOURCE=%DEPLOYMENT_SOURCE%
echo DEPLOYMENT_TARGET=%DEPLOYMENT_TARGET%
echo DEPLOYMENT_TARGET_ANGULAR=%DEPLOYMENT_TARGET_ANGULAR%
echo NEXT_MANIFEST_PATH=%NEXT_MANIFEST_PATH%
echo PREVIOUS_MANIFEST_PATH=%PREVIOUS_MANIFEST_PATH%
echo DEPLOYMENT_TEMP=%DEPLOYMENT_TEMP%
echo IN_PLACE_DEPLOYMENT=%IN_PLACE_DEPLOYMENT%
echo ANGUALR_CLI=%ANGUALR_CLI%

setlocal enabledelayedexpansion

SET ARTIFACTS=%~dp0%..\artifacts

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

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

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

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

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

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

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

IF NOT DEFINED ANGUALR_CLI (
  :: Install angular-cli
  echo Installing angular-cli
  call npm install -g angular-cli

  IF !ERRORLEVEL! NEQ 0 goto error

  SET ANGUALR_CLI=true
)

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 Print variables
echo dp0=%~dp0%
echo ARTIFACTS=%ARTIFACTS%
echo DEPLOYMENT_SOURCE=%DEPLOYMENT_SOURCE%
echo DEPLOYMENT_TARGET=%DEPLOYMENT_TARGET%
echo DEPLOYMENT_TARGET_ANGULAR=%DEPLOYMENT_TARGET_ANGULAR%
echo NEXT_MANIFEST_PATH=%NEXT_MANIFEST_PATH%
echo PREVIOUS_MANIFEST_PATH=%PREVIOUS_MANIFEST_PATH%
echo DEPLOYMENT_TEMP=%DEPLOYMENT_TEMP%
echo IN_PLACE_DEPLOYMENT=%IN_PLACE_DEPLOYMENT%
echo ANGUALR_CLI=%ANGUALR_CLI%

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

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

echo Handling frontend Angular2 project.
:: 2. Bundle frontend angular2 app to the temporary path
IF EXIST "%DEPLOYMENT_SOURCE%\AzureFunctions.AngularClient\package.json" (
	pushd "%DEPLOYMENT_SOURCE%\AzureFunctions.AngularClient"
	echo Restore npm packages
	call :ExecuteCmd npm install
	IF !ERRORLEVEL! NEQ 0 (
		call :ExecuteCmd npm install
		IF !ERRORLEVEL! NEQ 0 goto error
	)
	echo Bundle angular2 app
	call :ExecuteCmd ng build --environment=prod --output-path="%DEPLOYMENT_SOURCE%\AzureFunctions.AngularClient\dist"
	IF !ERRORLEVEL! NEQ 0 (
		call :ExecuteCmd ng build --environment=prod --output-path="%DEPLOYMENT_SOURCE%\AzureFunctions.AngularClient\dist"
		IF !ERRORLEVEL! NEQ 0 goto error
	)

	each Copy angular output to the temporary path
	IF /I "%IN_PLACE_DEPLOYMENT%" NEQ "1" (
	echo ROBOCOPY "%DEPLOYMENT_SOURCE%\AzureFunctions.AngularClient\dist" "%DEPLOYMENT_TEMP%" /E /IS
		call :ExecuteCmd ROBOCOPY "%DEPLOYMENT_SOURCE%\AzureFunctions.AngularClient\dist" "%DEPLOYMENT_TEMP%" /E /IS
		:: http://ss64.com/nt/robocopy-exit.html
		IF %ERRORLEVEL% EQU 16 echo ***FATAL ERROR*** & goto error
		IF %ERRORLEVEL% EQU 15 echo OKCOPY + FAIL + MISMATCHES + XTRA & goto error
		IF %ERRORLEVEL% EQU 14 echo FAIL + MISMATCHES + XTRA & goto error
		IF %ERRORLEVEL% EQU 13 echo OKCOPY + FAIL + MISMATCHES & goto error
		IF %ERRORLEVEL% EQU 12 echo FAIL + MISMATCHES& goto error
		IF %ERRORLEVEL% EQU 11 echo OKCOPY + FAIL + XTRA & goto error
		IF %ERRORLEVEL% EQU 10 echo FAIL + XTRA & goto error
		IF %ERRORLEVEL% EQU 9 echo OKCOPY + FAIL & goto error
		IF %ERRORLEVEL% EQU 8 echo FAIL & goto error
		IF %ERRORLEVEL% EQU 7 echo OKCOPY + MISMATCHES + XTRA & goto error
		IF %ERRORLEVEL% EQU 6 echo MISMATCHES + XTRA & goto error
		IF %ERRORLEVEL% EQU 5 echo OKCOPY + MISMATCHES & goto error
		IF %ERRORLEVEL% EQU 4 echo MISMATCHES & goto error
		IF %ERRORLEVEL% EQU 3 echo OKCOPY + XTRA
		IF %ERRORLEVEL% EQU 2 echo XTRA
		IF %ERRORLEVEL% EQU 1 echo OKCOPY
		IF %ERRORLEVEL% EQU 0 echo No Change
	)
)

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

IF !ERRORLEVEL! NEQ 0 goto error

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

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

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

:: 5. update build.txt
call :ExecuteCmd echo %SCM_COMMIT_ID% > %DEPLOYMENT_TARGET%\build.txt
IF !ERRORLEVEL! NEQ 0 (
  call :ExecuteCmd echo %SCM_COMMIT_ID% > %DEPLOYMENT_TARGET%\build.txt
  IF !ERRORLEVEL! NEQ 0 goto error
)

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

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

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

:exitSetErrorLevel
exit /b 1

:exitFromFunction
()

:end
endlocal
echo Finished successfully.

Print variables

Print variables


@echo off

::
:: The Batchography book by Elias Bachaalany
::

:: Auto interpret Python scripts
::

:main
    setlocal

    if "%1"=="" goto :help
    if not exist "%1" (
        echo Input file '%1' not found
        goto :eof
    )

    set FN=%1
    set last_fdate=x

    title Batchography - Python auto re-interpreting '%FN%'

    :repeat
        :: Get the file date/time, size and attributes
        for %%a in (%FN%) do set fdate=%%~ta.%%~za.%%~aa

        :: Different attributes found?
        if not "%last_fdate%"=="%fdate%" (
            cls
            :: Re-interpret
            call python "%FN%"
        )

        :: Remember the new date/time
        set last_fdate=%fdate%

        :: Wait for a second before checking for the file modification again
        CHOICE /T 1 /C "yq" /D y > nul

        :: User pressed Q? just quit
        if "%errorlevel%" neq "1" goto :eof

        :: Repeat until user quits or Ctrl-C
        goto repeat

:help
    echo Auto Python reinterpreter takes the input file name to autocompile as an argument
    goto :eof

@echo off

::
:: The Batchography book by Elias Bachaalany
::

:: Auto interpret Python scripts
::

:main
    setlocal

    if "%1"=="" goto :help
    if not exist "%1" (
        echo Input file '%1' not found
        goto :eof
    )

    set FN=%1
    set last_fdate=x

    title Batchography - Python auto re-interpreting '%FN%'

    :repeat
        :: Get the file date/time (incl. seconds)
        for /f "delims=" %%i in ('"forfiles /m %FN% /c "cmd /c echo @ftime" "') do set fdate=%%i

        :: Different attributes found?
        if not "%last_fdate%"=="%fdate%" (
            cls
            :: Re-interpret
            call python "%FN%"
        )

        :: Remember the new date/time
        set last_fdate=%fdate%

        :: Wait for a second before checking for the file modification again
        CHOICE /T 1 /C "yq" /D y > nul

        :: User pressed Q? just quit
        if "%errorlevel%" neq "1" goto :eof

        :: Repeat until user quits or Ctrl-C
        goto repeat

:help
    echo Auto Python reinterpreter takes the input file name to autocompile as an argument
    goto :eof

Update autopy.bat

Update autopy.bat

Use 'forfiles' to gather full modification time including seconds


"%sdkver%" -q -version:v7.0
call setenv /x64
python setup.py test || exit 1

remove the exit

remove the exit