Change pub_get_offline hook to find engine src relative to script (flutter/engine#33869)

* Change pub_get_offline hook to find engine src relative to script

If a gclient checkout checks out engine source to a different directory,
the source packages should be found relative to the script location.

Bug: https://github.com/dart-lang/sdk/issues/49163

* Change pub_get_offline hook to find engine src relative to script

If a gclient checkout checks out engine source to a different directory,
the source packages should be found relative to the script location.

Bug: https://github.com/dart-lang/sdk/issues/49163

* Fix merge errors, run ci/bin/format.dart
This commit is contained in:
William Hesse
2022-06-09 03:39:17 +02:00
committed by GitHub
parent af20f79b0e
commit 7cbb6a2dd6

View File

@@ -14,23 +14,28 @@ import os
import subprocess
import sys
SRC_ROOT = os.path.dirname(
os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
)
ENGINE_DIR = os.path.join(SRC_ROOT, 'flutter')
ALL_PACKAGES = [
os.path.join("src", "flutter", "ci"),
os.path.join("src", "flutter", "flutter_frontend_server"),
os.path.join("src", "flutter", "shell", "vmservice"),
os.path.join("src", "flutter", "testing", "benchmark"),
os.path.join("src", "flutter", "testing", "dart"),
os.path.join("src", "flutter", "testing", "litetest"),
os.path.join("src", "flutter", "testing", "android_background_image"),
os.path.join("src", "flutter", "testing", "scenario_app"),
os.path.join("src", "flutter", "testing", "smoke_test_failure"),
os.path.join("src", "flutter", "testing", "symbols"),
os.path.join("src", "flutter", "tools", "api_check"),
os.path.join("src", "flutter", "tools", "android_lint"),
os.path.join("src", "flutter", "tools", "clang_tidy"),
os.path.join("src", "flutter", "tools", "const_finder"),
os.path.join("src", "flutter", "tools", "githooks"),
os.path.join("src", "flutter", "tools", "licenses"),
os.path.join(ENGINE_DIR, "ci"),
os.path.join(ENGINE_DIR, "flutter_frontend_server"),
os.path.join(ENGINE_DIR, "shell", "vmservice"),
os.path.join(ENGINE_DIR, "testing", "benchmark"),
os.path.join(ENGINE_DIR, "testing", "dart"),
os.path.join(ENGINE_DIR, "testing", "litetest"),
os.path.join(ENGINE_DIR, "testing", "android_background_image"),
os.path.join(ENGINE_DIR, "testing", "scenario_app"),
os.path.join(ENGINE_DIR, "testing", "smoke_test_failure"),
os.path.join(ENGINE_DIR, "testing", "symbols"),
os.path.join(ENGINE_DIR, "tools", "api_check"),
os.path.join(ENGINE_DIR, "tools", "android_lint"),
os.path.join(ENGINE_DIR, "tools", "clang_tidy"),
os.path.join(ENGINE_DIR, "tools", "const_finder"),
os.path.join(ENGINE_DIR, "tools", "githooks"),
os.path.join(ENGINE_DIR, "tools", "licenses"),
]
@@ -71,15 +76,13 @@ def CheckPackage(package):
def Main():
leading = os.path.join(
"src", "third_party", "dart", "tools", "sdks", "dart-sdk", "bin"
dart_sdk_bin = os.path.join(
SRC_ROOT, "third_party", "dart", "tools", "sdks", "dart-sdk", "bin"
)
dart = "dart"
if os.name == "nt":
dart = "dart.exe"
pubcmd = [
os.path.abspath(os.path.join(leading, dart)), "pub", "get", "--offline"
]
pubcmd = [os.path.join(dart_sdk_bin, dart), "pub", "get", "--offline"]
pub_count = 0
for package in ALL_PACKAGES: