Skip to content

Commit ab9932e

Browse files
authored
Change pub_get_offline hook to find engine src relative to script (flutter#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
1 parent 64c743b commit ab9932e

File tree

1 file changed

+24
-21
lines changed

1 file changed

+24
-21
lines changed

tools/pub_get_offline.py

Lines changed: 24 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -14,23 +14,28 @@
1414
import subprocess
1515
import sys
1616

17+
SRC_ROOT = os.path.dirname(
18+
os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
19+
)
20+
ENGINE_DIR = os.path.join(SRC_ROOT, 'flutter')
21+
1722
ALL_PACKAGES = [
18-
os.path.join("src", "flutter", "ci"),
19-
os.path.join("src", "flutter", "flutter_frontend_server"),
20-
os.path.join("src", "flutter", "shell", "vmservice"),
21-
os.path.join("src", "flutter", "testing", "benchmark"),
22-
os.path.join("src", "flutter", "testing", "dart"),
23-
os.path.join("src", "flutter", "testing", "litetest"),
24-
os.path.join("src", "flutter", "testing", "android_background_image"),
25-
os.path.join("src", "flutter", "testing", "scenario_app"),
26-
os.path.join("src", "flutter", "testing", "smoke_test_failure"),
27-
os.path.join("src", "flutter", "testing", "symbols"),
28-
os.path.join("src", "flutter", "tools", "api_check"),
29-
os.path.join("src", "flutter", "tools", "android_lint"),
30-
os.path.join("src", "flutter", "tools", "clang_tidy"),
31-
os.path.join("src", "flutter", "tools", "const_finder"),
32-
os.path.join("src", "flutter", "tools", "githooks"),
33-
os.path.join("src", "flutter", "tools", "licenses"),
23+
os.path.join(ENGINE_DIR, "ci"),
24+
os.path.join(ENGINE_DIR, "flutter_frontend_server"),
25+
os.path.join(ENGINE_DIR, "shell", "vmservice"),
26+
os.path.join(ENGINE_DIR, "testing", "benchmark"),
27+
os.path.join(ENGINE_DIR, "testing", "dart"),
28+
os.path.join(ENGINE_DIR, "testing", "litetest"),
29+
os.path.join(ENGINE_DIR, "testing", "android_background_image"),
30+
os.path.join(ENGINE_DIR, "testing", "scenario_app"),
31+
os.path.join(ENGINE_DIR, "testing", "smoke_test_failure"),
32+
os.path.join(ENGINE_DIR, "testing", "symbols"),
33+
os.path.join(ENGINE_DIR, "tools", "api_check"),
34+
os.path.join(ENGINE_DIR, "tools", "android_lint"),
35+
os.path.join(ENGINE_DIR, "tools", "clang_tidy"),
36+
os.path.join(ENGINE_DIR, "tools", "const_finder"),
37+
os.path.join(ENGINE_DIR, "tools", "githooks"),
38+
os.path.join(ENGINE_DIR, "tools", "licenses"),
3439
]
3540

3641

@@ -71,15 +76,13 @@ def CheckPackage(package):
7176

7277

7378
def Main():
74-
leading = os.path.join(
75-
"src", "third_party", "dart", "tools", "sdks", "dart-sdk", "bin"
79+
dart_sdk_bin = os.path.join(
80+
SRC_ROOT, "third_party", "dart", "tools", "sdks", "dart-sdk", "bin"
7681
)
7782
dart = "dart"
7883
if os.name == "nt":
7984
dart = "dart.exe"
80-
pubcmd = [
81-
os.path.abspath(os.path.join(leading, dart)), "pub", "get", "--offline"
82-
]
85+
pubcmd = [os.path.join(dart_sdk_bin, dart), "pub", "get", "--offline"]
8386

8487
pub_count = 0
8588
for package in ALL_PACKAGES:

0 commit comments

Comments
 (0)