Skip to content

Commit

Permalink
Change pub_get_offline hook to find engine src relative to script (fl…
Browse files Browse the repository at this point in the history
…utter#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: dart-lang/sdk#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: dart-lang/sdk#49163

* Fix merge errors, run ci/bin/format.dart
  • Loading branch information
whesse authored Jun 9, 2022
1 parent 64c743b commit ab9932e
Showing 1 changed file with 24 additions and 21 deletions.
45 changes: 24 additions & 21 deletions tools/pub_get_offline.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,23 +14,28 @@
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"),
]


Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit ab9932e

Please sign in to comment.