Skip to content

Commit 092e19a

Browse files
authored
Migrate Dart dependency roller to new location of Dart SDK in checkout (#830)
This change will need to be landed when moving the position of the Dart SDK source checkout from [buildroot]/third_party/dart to [flutter_engine]/third_party/dart in a Flutter engine source checkout. It cannot be landed before that point. This script copies changed pinned dependencies from the Dart DEPS to the Flutter engine DEPS, when rolling a new version of Dart into engine. Bug: flutter/flutter#143335
1 parent bce0747 commit 092e19a

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

tools/dart/create_updated_flutter_deps.py

+9-5
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,9 @@
1515
import sys
1616

1717
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'))
2021

2122
class VarImpl(object):
2223
def __init__(self, local_scope):
@@ -56,15 +57,17 @@ def ParseArgs(args):
5657
parser.add_argument('--dart_deps', '-d',
5758
type=str,
5859
help='Dart DEPS file.',
59-
default=os.path.join(DART_ROOT, 'DEPS'))
60+
default=DART_DEPS)
6061
parser.add_argument('--flutter_deps', '-f',
6162
type=str,
6263
help='Flutter DEPS file.',
63-
default=os.path.join(FLUTTER_ROOT, 'DEPS'))
64+
default=FLUTTER_DEPS)
6465
return parser.parse_args(args)
6566

6667
def Main(argv):
6768
args = ParseArgs(argv)
69+
if args.dart_deps == DART_DEPS and not os.path.isfile(DART_DEPS):
70+
args.dart_deps = OLD_DART_DEPS
6871
(new_vars, new_deps) = ParseDepsFile(args.dart_deps)
6972
(old_vars, old_deps) = ParseDepsFile(args.flutter_deps)
7073

@@ -104,7 +107,8 @@ def Main(argv):
104107
while i < len(lines) and (lines[i].startswith(" # WARNING: end of dart dependencies") == 0):
105108
i = i + 1
106109
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/')):
108112
for (dart_k, dart_v) in (list(new_deps.items())):
109113
dart_k_suffix = dart_k[len('sdk/') if dart_k.startswith('sdk/') else 0:]
110114
if (k.endswith(dart_k_suffix)):

0 commit comments

Comments
 (0)