@@ -121,7 +121,7 @@ native-assets:
121
121
'--output-dill' ,
122
122
'$build /program.dill' ,
123
123
'--depfile' ,
124
- '$build /kernel_snapshot .d' ,
124
+ '$build /kernel_snapshot_program .d' ,
125
125
'--verbosity=error' ,
126
126
'file:///lib/main.dart' ,
127
127
], exitCode: 1 ),
@@ -161,7 +161,7 @@ native-assets:
161
161
'--output-dill' ,
162
162
'$build /program.dill' ,
163
163
'--depfile' ,
164
- '$build /kernel_snapshot .d' ,
164
+ '$build /kernel_snapshot_program .d' ,
165
165
'--verbosity=error' ,
166
166
'file:///lib/main.dart' ,
167
167
], stdout: 'result $kBoundaryKey \n $kBoundaryKey \n $kBoundaryKey $build /program.dill 0\n ' ),
@@ -202,7 +202,7 @@ native-assets:
202
202
'--output-dill' ,
203
203
'$build /program.dill' ,
204
204
'--depfile' ,
205
- '$build /kernel_snapshot .d' ,
205
+ '$build /kernel_snapshot_program .d' ,
206
206
'--verbosity=error' ,
207
207
'file:///lib/main.dart' ,
208
208
], stdout: 'result $kBoundaryKey \n $kBoundaryKey \n $kBoundaryKey $build /program.dill 0\n ' ),
@@ -244,7 +244,7 @@ native-assets:
244
244
'--output-dill' ,
245
245
'$build /program.dill' ,
246
246
'--depfile' ,
247
- '$build /kernel_snapshot .d' ,
247
+ '$build /kernel_snapshot_program .d' ,
248
248
'--verbosity=error' ,
249
249
'file:///lib/main.dart' ,
250
250
], stdout: 'result $kBoundaryKey \n $kBoundaryKey \n $kBoundaryKey $build /program.dill 0\n ' ),
@@ -286,7 +286,7 @@ native-assets:
286
286
'--output-dill' ,
287
287
'$build /program.dill' ,
288
288
'--depfile' ,
289
- '$build /kernel_snapshot .d' ,
289
+ '$build /kernel_snapshot_program .d' ,
290
290
'--verbosity=error' ,
291
291
'foo' ,
292
292
'bar' ,
@@ -327,7 +327,7 @@ native-assets:
327
327
'--output-dill' ,
328
328
'$build /program.dill' ,
329
329
'--depfile' ,
330
- '$build /kernel_snapshot .d' ,
330
+ '$build /kernel_snapshot_program .d' ,
331
331
'--incremental' ,
332
332
'--initialize-from-dill' ,
333
333
'$build /program.dill' ,
@@ -368,7 +368,7 @@ native-assets:
368
368
'--output-dill' ,
369
369
'$build /program.dill' ,
370
370
'--depfile' ,
371
- '$build /kernel_snapshot .d' ,
371
+ '$build /kernel_snapshot_program .d' ,
372
372
'--incremental' ,
373
373
'--initialize-from-dill' ,
374
374
'$build /program.dill' ,
@@ -424,7 +424,7 @@ native-assets:
424
424
'--output-dill' ,
425
425
'$build /program.dill' ,
426
426
'--depfile' ,
427
- '$build /kernel_snapshot .d' ,
427
+ '$build /kernel_snapshot_program .d' ,
428
428
'--incremental' ,
429
429
'--initialize-from-dill' ,
430
430
'$build /program.dill' ,
@@ -488,6 +488,27 @@ native-assets:
488
488
}
489
489
}
490
490
491
+ for (final bool empty in < bool > [true , false ]) {
492
+ final String testName = empty ? 'empty' : 'non empty' ;
493
+ testWithoutContext ('KernelSnapshot native assets $testName ' , () async {
494
+ const List <int > programDillBytes = < int > [1 , 2 , 3 , 4 ];
495
+ androidEnvironment.buildDir.childFile ('program.dill' )
496
+ ..createSync (recursive: true )
497
+ ..writeAsBytesSync (programDillBytes);
498
+ final List <int > nativeAssetsDillBytes = empty ? < int > [] : < int > [5 , 6 , 7 , 8 ];
499
+ androidEnvironment.buildDir.childFile ('native_assets.dill' )
500
+ ..createSync (recursive: true )
501
+ ..writeAsBytesSync (nativeAssetsDillBytes);
502
+
503
+ await const KernelSnapshot ().build (androidEnvironment);
504
+
505
+ expect (
506
+ androidEnvironment.buildDir.childFile ('app.dill' ).readAsBytesSync (),
507
+ equals (< int > [...programDillBytes, ...nativeAssetsDillBytes]),
508
+ );
509
+ });
510
+ }
511
+
491
512
testUsingContext ('AotElfProfile Produces correct output directory' , () async {
492
513
final String build = androidEnvironment.buildDir.path;
493
514
processManager.addCommands (< FakeCommand > [
0 commit comments