|
15 | 15 | import sys
|
16 | 16 |
|
17 | 17 | DART_SCRIPT_DIR = os.path.dirname(sys.argv[0])
|
18 |
| -DART_ROOT = os.path.realpath(os.path.join(DART_SCRIPT_DIR, '../../third_party/dart')) |
19 |
| -FLUTTER_ROOT = os.path.realpath(os.path.join(DART_SCRIPT_DIR, '../../flutter')) |
| 18 | +OLD_DART_DEPS = os.path.realpath(os.path.join(DART_SCRIPT_DIR, '../../third_party/dart/DEPS')) |
| 19 | +DART_DEPS = os.path.realpath(os.path.join(DART_SCRIPT_DIR, '../../flutter/third_party/dart/DEPS')) |
| 20 | +FLUTTER_DEPS = os.path.realpath(os.path.join(DART_SCRIPT_DIR, '../../flutter/DEPS')) |
20 | 21 |
|
21 | 22 | class VarImpl(object):
|
22 | 23 | def __init__(self, local_scope):
|
@@ -56,15 +57,17 @@ def ParseArgs(args):
|
56 | 57 | parser.add_argument('--dart_deps', '-d',
|
57 | 58 | type=str,
|
58 | 59 | help='Dart DEPS file.',
|
59 |
| - default=os.path.join(DART_ROOT, 'DEPS')) |
| 60 | + default=DART_DEPS) |
60 | 61 | parser.add_argument('--flutter_deps', '-f',
|
61 | 62 | type=str,
|
62 | 63 | help='Flutter DEPS file.',
|
63 |
| - default=os.path.join(FLUTTER_ROOT, 'DEPS')) |
| 64 | + default=FLUTTER_DEPS) |
64 | 65 | return parser.parse_args(args)
|
65 | 66 |
|
66 | 67 | def Main(argv):
|
67 | 68 | args = ParseArgs(argv)
|
| 69 | + if args.dart_deps == DART_DEPS and not os.path.isfile(DART_DEPS): |
| 70 | + args.dart_deps = OLD_DART_DEPS |
68 | 71 | (new_vars, new_deps) = ParseDepsFile(args.dart_deps)
|
69 | 72 | (old_vars, old_deps) = ParseDepsFile(args.flutter_deps)
|
70 | 73 |
|
@@ -104,7 +107,8 @@ def Main(argv):
|
104 | 107 | while i < len(lines) and (lines[i].startswith(" # WARNING: end of dart dependencies") == 0):
|
105 | 108 | i = i + 1
|
106 | 109 | for (k, v) in sorted(old_deps.items()):
|
107 |
| - if (k.startswith('src/third_party/dart/')): |
| 110 | + if (k.startswith('src/flutter/third_party/dart/') or |
| 111 | + k.startswith('src/third_party/dart/')): |
108 | 112 | for (dart_k, dart_v) in (list(new_deps.items())):
|
109 | 113 | dart_k_suffix = dart_k[len('sdk/') if dart_k.startswith('sdk/') else 0:]
|
110 | 114 | if (k.endswith(dart_k_suffix)):
|
|
0 commit comments