Skip to content

Commit e3ad3b5

Browse files
derekxu16Commit Queue
authored andcommitted
[package:dartdev] Make dartdev's Sdk class correctly return paths to PRODUCT snapshots when necessary
This makes the class return paths to PRODUCT snapshots if and only if it is under the conditions that would make it return the path to a PRODUCT dartaotruntime. TEST=manual testing, CI Change-Id: I2544c7bc58625d85d34ff3506c10821484e75f1e Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/396500 Reviewed-by: Ben Konyi <[email protected]> Commit-Queue: Derek Xu <[email protected]>
1 parent a65067f commit e3ad3b5

File tree

1 file changed

+21
-9
lines changed

1 file changed

+21
-9
lines changed

pkg/dartdev/lib/src/sdk.dart

Lines changed: 21 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -71,17 +71,25 @@ class Sdk {
7171
'dartdevc.dart.snapshot',
7272
);
7373

74-
String get ddcAotSnapshot => _snapshotPathFor(
75-
'dartdevc_aot.dart.snapshot',
76-
);
74+
String get ddcAotSnapshot => _runFromBuildRoot
75+
? _snapshotPathFor(
76+
'dartdevc_aot_product.dart.snapshot',
77+
)
78+
: _snapshotPathFor(
79+
'dartdevc_aot.dart.snapshot',
80+
);
7781

7882
String get dart2jsSnapshot => _snapshotPathFor(
7983
'dart2js.dart.snapshot',
8084
);
8185

82-
String get dart2jsAotSnapshot => _snapshotPathFor(
83-
'dart2js_aot.dart.snapshot',
84-
);
86+
String get dart2jsAotSnapshot => _runFromBuildRoot
87+
? _snapshotPathFor(
88+
'dart2js_aot_product.dart.snapshot',
89+
)
90+
: _snapshotPathFor(
91+
'dart2js_aot.dart.snapshot',
92+
);
8593

8694
String get dart2wasmSnapshot => _snapshotPathFor(
8795
'dart2wasm_product.snapshot',
@@ -99,9 +107,13 @@ class Sdk {
99107
'frontend_server.dart.snapshot',
100108
);
101109

102-
String get frontendServerAotSnapshot => _snapshotPathFor(
103-
'frontend_server_aot.dart.snapshot',
104-
);
110+
String get frontendServerAotSnapshot => _runFromBuildRoot
111+
? _snapshotPathFor(
112+
'frontend_server_aot_product.dart.snapshot',
113+
)
114+
: _snapshotPathFor(
115+
'frontend_server_aot.dart.snapshot',
116+
);
105117

106118
String get dtdSnapshot => _snapshotPathFor(
107119
'dart_tooling_daemon.dart.snapshot',

0 commit comments

Comments
 (0)