Merge pull request #11054 from wtgodbe/spacing
[platform/upstream/coreclr.git] / sync.cmd
index 70bde8c..f633155 100644 (file)
--- a/sync.cmd
+++ b/sync.cmd
@@ -1,84 +1,38 @@
-@if "%_echo%" neq "on" echo off
+@if not defined _echo @echo off
 setlocal EnableDelayedExpansion
 
-set synclog=sync.log
-echo Running Sync.cmd %* > %synclog%
+if /I [%1] == [-?] goto Usage
+if /I [%1] == [-help] goto Usage
 
-set options=/nologo /v:minimal /clp:Summary /flp:v=detailed;Append;LogFile=%synclog%
-set unprocessedBuildArgs=
-set allargs=%*
-set thisArgs=
+@if [%1]==[] set __args=-p
 
-set src=false
-set packages=false
-
-if [%1]==[] (
-  set src=true
-  set packages=true
-  goto Begin
-)
-
-:Loop
-if [%1]==[] goto Begin
-
-if /I [%1] == [/?] goto Usage
-if /I [%1] == [/help] goto Usage
-
-if /I [%1] == [/p] (
-    set packages=true
-    set thisArgs=!thisArgs!%1
-    goto Next
-)
-
-if /I [%1] == [/s] (
-    set src=true
-    set thisArgs=!thisArgs!%1
-    goto Next
-)
-
-set unprocessedBuildArgs=!unprocessedBuildArgs! %1
-
-:Next
-shift /1
-goto Loop
-
-:Begin
-echo Running init-tools.cmd
-call %~dp0init-tools.cmd
-
-if [%src%] == [true] (
-  echo Fetching git database from remote repos ...
-  call git fetch --all -p -v >> %synclog% 2>&1
-  if NOT [!ERRORLEVEL!]==[0] (
-    echo ERROR: An error occurred while fetching remote source code, see %synclog% for more details.
-    exit /b 1
-  )
-)
-
-set targets=RestoreNETCorePlatforms
-
-if [%packages%] == [true] (
-  set options=!options! /t:!targets! /p:RestoreDuringBuild=true
-  echo msbuild.exe %~dp0build.proj !options! !unprocessedBuildArgs! >> %synclog%
-  call msbuild.exe %~dp0build.proj !options! !unprocessedBuildArgs!
-  if NOT [!ERRORLEVEL!]==[0] (
-    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.
-    exit /b 1
-  )
-)
-
-echo Done Syncing.
-exit /b 0
-
-goto :EOF
+ @call %~dp0run.cmd sync %__args% %*
+@exit /b %ERRORLEVEL%
 
 :Usage
 echo.
 echo Repository syncing script.
 echo.
 echo Options:
-echo     /s     - Fetches source history from all configured remotes
-echo              (git fetch --all -p -v)
-echo     /p     - Restores all nuget packages for repository
+echo     -?     - Prints Usage
+echo     -help  - Prints Usage
+echo     -p     - Restores all nuget packages for repository
+echo     -ab    - Downloads the latests product packages from Azure.
+echo              The following properties are required:
+echo                 -AzureAccount="Account name"
+echo                 -AzureToken="Access token"
+echo              To download a specific group of product packages, specify:
+echo                 -BuildMajor
+echo                 -BuildMinor
+echo              To download from a specific container, specify:
+echo                 -Container="container name"
+echo     -n     - Downloads test native binaries from the specified container
+echo              The following properties are required:
+echo                 -AzureAccount="Account name"
+echo                 -AzureToken="Access token"
+echo                 -Container="Container name"
+echo                 -RuntimeId="RID" (Needs to match what's in the container)
+echo.
+echo.
 echo.
-echo If no option is specified then sync.cmd /s /p is implied.
\ No newline at end of file
+echo If no option is specified then sync.cmd -p is implied.
\ No newline at end of file