Browse Source

ci: use cmd to call gclient (#21523)

John Kleinschmidt 5 years ago
parent
commit
48688f9124
1 changed files with 13 additions and 7 deletions
  1. 13 7
      appveyor.yml

+ 13 - 7
appveyor.yml

@@ -78,7 +78,7 @@ build_script:
       "https://github.com/electron/electron"
   - ps: >-
       if ($env:GN_CONFIG -eq 'release') {
-        gclient sync --with_branch_heads --with_tags --ignore_locks --break_repo_locks
+        $env:RUN_GCLIENT_SYNC="true"
       } else {
         cd src\electron
         node script\generate-deps-hash.js
@@ -92,16 +92,22 @@ build_script:
           python src/electron/script/update-external-binaries.py
         } else {    
           # file does not exist, gclient sync, then zip
-          gclient sync --with_branch_heads --with_tags --ignore_locks --break_repo_locks
+          $env:RUN_GCLIENT_SYNC="true"
           if ($env:TARGET_ARCH -ne 'ia32') {
-            # archive current source for future use 
-            # only run on x64/woa to avoid contention saving
-            if ($(7z a $zipfile src -xr!android_webview -xr!electron -xr'!*\.git' -xr!third_party\WebKit\LayoutTests! -xr!third_party\blink\web_tests -xr!third_party\blink\perf_tests -slp -t7z -mmt=30;$LASTEXITCODE -ne 0)) {
-              Write-warning "Could not save source to shared drive; continuing anyway"
-            }
+            # only save on x64/woa to avoid contention saving
+            $env:SAVE_GCLIENT_SRC="true"
           }
         }
       }
+  - if "%RUN_GCLIENT_SYNC%"=="true" ( gclient sync --with_branch_heads --with_tags --ignore_locks)
+  - ps: >-
+      if ($env:SAVE_GCLIENT_SRC -eq 'true') {
+        # archive current source for future use 
+        # only run on x64/woa to avoid contention saving
+        if ($(7z a $zipfile src -xr!android_webview -xr!electron -xr'!*\.git' -xr!third_party\WebKit\LayoutTests! -xr!third_party\blink\web_tests -xr!third_party\blink\perf_tests -slp -t7z -mmt=30;$LASTEXITCODE -ne 0)) {
+          Write-warning "Could not save source to shared drive; continuing anyway"
+        }
+      }
   - cd src
   - ps: $env:BUILD_CONFIG_PATH="//electron/build/args/%GN_CONFIG%.gn"
   - gn gen out/Default "--args=import(\"%BUILD_CONFIG_PATH%\") %GN_EXTRA_ARGS% cc_wrapper=\"%SCCACHE_PATH%\""