1 @if "%_echo%" neq "on" echo off
2 setlocal EnableDelayedExpansion
5 echo Running Sync.cmd %* > %synclog%
7 set options=/nologo /v:minimal /clp:Summary /flp:v=detailed;Append;LogFile=%synclog%
11 set unprocessedBuildArgs=
24 if [%1]==[] goto Begin
26 if /I [%1] == [/?] goto Usage
27 if /I [%1] == [/help] goto Usage
31 set processedArgs=!processedArgs! %1
37 set processedArgs=!processedArgs! %1
43 set processedArgs=!processedArgs! %1
47 if [!processedArgs!]==[] (
48 call set unprocessedBuildArgs=!__args!
50 call set unprocessedBuildArgs=%%__args:*!processedArgs!=%%
58 echo Running init-tools.cmd
59 call %~dp0init-tools.cmd
61 if [%src%] == [true] (
62 echo Fetching git database from remote repos ...
63 call git fetch --all -p -v >> %synclog% 2>&1
64 if NOT [!ERRORLEVEL!]==[0] (
65 echo ERROR: An error occurred while fetching remote source code, see %synclog% for more details.
70 if [%azureBlobs%] == [true] (
71 echo Connecting and downloading packages from Azure BLOB ...
72 echo msbuild.exe %~dp0src\syncAzure.proj !options! !unprocessedBuildArgs! >> %synclog%
73 call msbuild.exe %~dp0src\syncAzure.proj !options! !unprocessedBuildArgs!
74 if NOT [!ERRORLEVEL!]==[0] (
75 echo ERROR: An error occurred while downloading packages from Azure BLOB, see %synclog% for more details. There may have been networking problems so please try again in a few minutes.
80 set targets=RestoreNETCorePlatforms
82 if [%packages%] == [true] (
83 set options=!options! /t:!targets! /p:RestoreDuringBuild=true
84 echo msbuild.exe %~dp0build.proj !options! !unprocessedBuildArgs! >> %synclog%
85 call msbuild.exe %~dp0build.proj !options! !unprocessedBuildArgs!
86 if NOT [!ERRORLEVEL!]==[0] (
87 echo ERROR: An error occurred while syncing packages, see %synclog% for more details. There may have been networking problems so please try again in a few minutes.
99 echo Repository syncing script.
102 echo /s - Fetches source history from all configured remotes
103 echo (git fetch --all -p -v)
104 echo /p - Restores all nuget packages for repository
105 echo /ab - Downloads the latests product packages from Azure.
106 echo The following properties are required:
107 echo /p:CloudDropAccountName="Account name"
108 echo /p:CloudDropAccessToken="Access token"
109 echo To download a specific group of product packages, specify:
110 echo /p:BuildNumberMajor
111 echo /p:BuildNumberMinor
114 echo If no option is specified then sync.cmd /s /p is implied.