Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit b82aff3

Browse files
committed
Merge pull request #341 from abarth/fix_setup_dart_analyzer
Teach setup_dart_analyzer about workbench
2 parents d81858f + bfe37ce commit b82aff3

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

sky/tools/setup_dart_analyzer

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,11 @@ import yaml
1212

1313
SKY_TOOLS_DIR = os.path.dirname(os.path.abspath(__file__))
1414
SRC_ROOT = os.path.dirname(os.path.dirname(SKY_TOOLS_DIR))
15-
SKY_SDK_DIR = os.path.join(SRC_ROOT, 'sky', 'sdk')
16-
SKY_PUBSPEC = os.path.join(SKY_SDK_DIR, 'pubspec.yaml')
17-
SKY_PUBSPEC_LOCK = os.path.join(SKY_SDK_DIR, 'pubspec.lock')
15+
SKY_PACKAGE_DIR = os.path.join(SRC_ROOT, 'sky', 'packages', 'sky')
16+
SKY_PUBSPEC = os.path.join(SKY_PACKAGE_DIR, 'pubspec.yaml')
17+
SKY_PUBSPEC_LOCK = os.path.join(SKY_PACKAGE_DIR, 'pubspec.lock')
18+
19+
WORKBENCH = os.path.join(SRC_ROOT, 'sky', 'packages', 'workbench')
1820

1921
def version_for_pubspec(pubspec_path):
2022
with open(pubspec_path, 'r') as stream:
@@ -25,12 +27,15 @@ def version_for_pubspec(pubspec_path):
2527
def entry_for_dependency(dart_pkg_dir, dependency):
2628
dependency_path = os.path.join(dart_pkg_dir, dependency)
2729
pubspec_path = os.path.join(dependency_path, 'pubspec.yaml')
30+
if not os.path.exists(pubspec_path):
31+
dependency_path = os.path.dirname(os.path.realpath(os.path.join(WORKBENCH, 'packages', dependency)))
32+
pubspec_path = os.path.join(dependency_path, 'pubspec.yaml')
2833
if not os.path.exists(pubspec_path):
2934
return
3035
version = version_for_pubspec(pubspec_path)
3136
return {
3237
'description': {
33-
'path': os.path.relpath(dependency_path, SKY_SDK_DIR),
38+
'path': os.path.relpath(dependency_path, SKY_PACKAGE_DIR),
3439
'relative': True,
3540
},
3641
'source': 'path',
@@ -47,7 +52,7 @@ def main():
4752

4853
if not os.path.exists(dart_pkg_dir):
4954
print 'Cannot find Dart pacakges at "%s".' % dart_pkg_dir
50-
print 'Did you run `ninja -C %s sky` ?' % os.path.relpath(args.build_dir, os.getcwd())
55+
print 'Did you run `ninja -C %s` ?' % os.path.relpath(args.build_dir, os.getcwd())
5156
return 1
5257

5358
packages = {}

0 commit comments

Comments
 (0)