@@ -28,11 +28,10 @@ dependencies:
28
28
path: ^1.0.0
29
29
30
30
environment:
31
- sdk: '>=2.12.0-0 <3.0.0'
31
+ sdk: '>=2.12.0 <3.0.0'
32
32
''' ),
33
33
d.dir ('bin' , [
34
34
d.file ('main.dart' , '''
35
- // @dart = 2.8
36
35
import 'package:path/path.dart' as p;
37
36
38
37
void main() async {
@@ -64,9 +63,6 @@ String get message => p.join('hello', 'world');
64
63
client = await FrontendServerClient .start (
65
64
entrypoint, p.join (packageRoot, 'out.dill' ), vmPlatformDill);
66
65
var result = await client.compile ();
67
- if (result == null ) {
68
- fail ('Expected compilation to be non-null' );
69
- }
70
66
client.accept ();
71
67
expect (result.compilerOutputLines, isEmpty);
72
68
expect (result.errorCount, 0 );
@@ -77,12 +73,13 @@ String get message => p.join('hello', 'world');
77
73
packageConfig.resolve (Uri .parse ('package:path/path.dart' )),
78
74
]));
79
75
expect (result.removedSources, isEmpty);
80
- expect (File (result.dillOutput).existsSync (), true );
76
+ expect (result.dillOutput, isNotNull);
77
+ expect (File (result.dillOutput! ).existsSync (), true );
81
78
var process = await Process .start (Platform .resolvedExecutable, [
82
79
'--observe' ,
83
80
'--no-pause-isolates-on-exit' ,
84
81
'--pause-isolates-on-start' ,
85
- result.dillOutput
82
+ result.dillOutput!
86
83
]);
87
84
addTearDown (process.kill);
88
85
var stdoutLines = StreamQueue (
@@ -102,9 +99,6 @@ String get message => p.join('hello', 'world');
102
99
await appFile.writeAsString (newContent);
103
100
104
101
result = await client.compile ([File (entrypoint).uri]);
105
- if (result == null ) {
106
- fail ('Expected compilation to be non-null' );
107
- }
108
102
109
103
client.accept ();
110
104
expect (result.newSources, isEmpty);
@@ -130,9 +124,6 @@ String get message => p.join('hello', 'world');
130
124
client = await FrontendServerClient .start (
131
125
entrypoint, p.join (packageRoot, 'out.dill' ), vmPlatformDill);
132
126
var result = await client.compile ();
133
- if (result == null ) {
134
- fail ('Expected compilation to be non-null' );
135
- }
136
127
137
128
client.accept ();
138
129
expect (result.errorCount, 2 );
@@ -145,13 +136,14 @@ String get message => p.join('hello', 'world');
145
136
packageConfig.resolve (Uri .parse ('package:path/path.dart' )),
146
137
]));
147
138
expect (result.removedSources, isEmpty);
148
- expect (File (result.dillOutput).existsSync (), true );
139
+ expect (result.dillOutput, isNotNull);
140
+ expect (File (result.dillOutput! ).existsSync (), true );
149
141
150
142
var process = await Process .start (Platform .resolvedExecutable, [
151
143
'--observe' ,
152
144
'--no-pause-isolates-on-exit' ,
153
145
'--pause-isolates-on-start' ,
154
- result.dillOutput
146
+ result.dillOutput!
155
147
]);
156
148
addTearDown (process.kill);
157
149
var stdoutLines = StreamQueue (
@@ -170,15 +162,13 @@ String get message => p.join('hello', 'world');
170
162
await entrypointFile
171
163
.writeAsString (originalContent.replaceFirst ('hello' , 'goodbye' ));
172
164
result = await client.compile ([entrypointFile.uri]);
173
- if (result == null ) {
174
- fail ('Expected compilation to be non-null' );
175
- }
176
165
client.accept ();
177
166
expect (result.errorCount, 0 );
178
167
expect (result.compilerOutputLines, isEmpty);
179
168
expect (result.newSources, isEmpty);
180
169
expect (result.removedSources, isEmpty);
181
- expect (File (result.dillOutput).existsSync (), true );
170
+ expect (result.dillOutput, isNotNull);
171
+ expect (File (result.dillOutput! ).existsSync (), true );
182
172
183
173
await vmService.reloadSources (isolate.id! , rootLibUri: result.dillOutput);
184
174
@@ -190,11 +180,12 @@ String get message => p.join('hello', 'world');
190
180
var entrypoint =
191
181
p.toUri (p.join (packageRoot, 'bin' , 'main.dart' )).toString ();
192
182
var dartDevcClient = client = await DartDevcFrontendServerClient .start (
193
- entrypoint, p.join (packageRoot, 'out.dill' ));
183
+ entrypoint, p.join (packageRoot, 'out.dill' ),
184
+ platformKernel: p
185
+ .toUri (
186
+ p.join (sdkDir, 'lib' , '_internal' , 'ddc_platform_sound.dill' ))
187
+ .toString ());
194
188
var result = await client.compile ();
195
- if (result == null ) {
196
- fail ('Expected compilation to be non-null' );
197
- }
198
189
client.accept ();
199
190
200
191
expect (result.compilerOutputLines, isEmpty);
@@ -207,9 +198,10 @@ String get message => p.join('hello', 'world');
207
198
]));
208
199
expect (result.removedSources, isEmpty);
209
200
210
- expect (File (result.jsManifestOutput).existsSync (), true );
211
- expect (File (result.jsSourcesOutput).existsSync (), true );
212
- expect (File (result.jsSourceMapsOutput).existsSync (), true );
201
+ expect (result.dillOutput, isNotNull);
202
+ expect (File (result.jsManifestOutput! ).existsSync (), true );
203
+ expect (File (result.jsSourcesOutput! ).existsSync (), true );
204
+ expect (File (result.jsSourceMapsOutput! ).existsSync (), true );
213
205
214
206
var entrypointUri = Uri .parse (entrypoint);
215
207
expect (
@@ -222,9 +214,6 @@ String get message => p.join('hello', 'world');
222
214
await appFile.writeAsString (newContent);
223
215
224
216
result = await client.compile ([entrypointUri]);
225
- if (result == null ) {
226
- fail ('Expected compilation to be non-null' );
227
- }
228
217
client.accept ();
229
218
expect (result.newSources, isEmpty);
230
219
expect (result.removedSources, isEmpty);
@@ -257,9 +246,6 @@ void main() {
257
246
entrypoint, p.join (packageRoot, 'out.dill' ), vmPlatformDill,
258
247
enabledExperiments: ['non-nullable' ]);
259
248
var result = await client.compile ();
260
- if (result == null ) {
261
- fail ('Expected compilation to be non-null' );
262
- }
263
249
client.accept ();
264
250
expect (result.errorCount, 1 );
265
251
expect (result.compilerOutputLines, contains (contains ('int x;' )));
@@ -280,9 +266,6 @@ void main() {
280
266
client = await FrontendServerClient .start (entrypoint,
281
267
p.join (packageRoot, 'out with spaces.dill' ), vmPlatformDill);
282
268
var result = await client.compile ();
283
- if (result == null ) {
284
- fail ('Expected compilation to be non-null' );
285
- }
286
269
client.accept ();
287
270
expect (result.compilerOutputLines, isEmpty);
288
271
expect (result.errorCount, 0 );
@@ -292,9 +275,10 @@ void main() {
292
275
File (entrypoint).uri,
293
276
]));
294
277
expect (result.removedSources, isEmpty);
295
- expect (File (result.dillOutput).existsSync (), true );
278
+ expect (result.dillOutput, isNotNull);
279
+ expect (File (result.dillOutput! ).existsSync (), true );
296
280
var processResult =
297
- await Process .run (Platform .resolvedExecutable, [result.dillOutput]);
281
+ await Process .run (Platform .resolvedExecutable, [result.dillOutput! ]);
298
282
299
283
expect (processResult.stdout, startsWith ('hello world' ));
300
284
expect (processResult.exitCode, 0 );
@@ -304,16 +288,13 @@ void main() {
304
288
var newContent = originalContent.replaceFirst ('hello' , 'goodbye' );
305
289
await appFile.writeAsString (newContent);
306
290
result = await client.compile ([appFile.uri]);
307
- if (result == null ) {
308
- fail ('Expected compilation to be non-null' );
309
- }
310
291
expect (result.compilerOutputLines, isEmpty);
311
292
expect (result.errorCount, 0 );
312
293
expect (result.newSources, isEmpty);
313
294
expect (result.removedSources, isEmpty);
314
295
315
296
processResult =
316
- await Process .run (Platform .resolvedExecutable, [result.dillOutput]);
297
+ await Process .run (Platform .resolvedExecutable, [result.dillOutput! ]);
317
298
expect (processResult.stdout, startsWith ('goodbye world' ));
318
299
expect (processResult.exitCode, 0 );
319
300
});
0 commit comments