@@ -121,7 +121,7 @@ native-assets:
121121 '--output-dill' ,
122122 '$build /program.dill' ,
123123 '--depfile' ,
124- '$build /kernel_snapshot .d' ,
124+ '$build /kernel_snapshot_program .d' ,
125125 '--verbosity=error' ,
126126 'file:///lib/main.dart' ,
127127 ], exitCode: 1 ),
@@ -161,7 +161,7 @@ native-assets:
161161 '--output-dill' ,
162162 '$build /program.dill' ,
163163 '--depfile' ,
164- '$build /kernel_snapshot .d' ,
164+ '$build /kernel_snapshot_program .d' ,
165165 '--verbosity=error' ,
166166 'file:///lib/main.dart' ,
167167 ], stdout: 'result $kBoundaryKey \n $kBoundaryKey \n $kBoundaryKey $build /program.dill 0\n ' ),
@@ -202,7 +202,7 @@ native-assets:
202202 '--output-dill' ,
203203 '$build /program.dill' ,
204204 '--depfile' ,
205- '$build /kernel_snapshot .d' ,
205+ '$build /kernel_snapshot_program .d' ,
206206 '--verbosity=error' ,
207207 'file:///lib/main.dart' ,
208208 ], stdout: 'result $kBoundaryKey \n $kBoundaryKey \n $kBoundaryKey $build /program.dill 0\n ' ),
@@ -244,7 +244,7 @@ native-assets:
244244 '--output-dill' ,
245245 '$build /program.dill' ,
246246 '--depfile' ,
247- '$build /kernel_snapshot .d' ,
247+ '$build /kernel_snapshot_program .d' ,
248248 '--verbosity=error' ,
249249 'file:///lib/main.dart' ,
250250 ], stdout: 'result $kBoundaryKey \n $kBoundaryKey \n $kBoundaryKey $build /program.dill 0\n ' ),
@@ -286,7 +286,7 @@ native-assets:
286286 '--output-dill' ,
287287 '$build /program.dill' ,
288288 '--depfile' ,
289- '$build /kernel_snapshot .d' ,
289+ '$build /kernel_snapshot_program .d' ,
290290 '--verbosity=error' ,
291291 'foo' ,
292292 'bar' ,
@@ -327,7 +327,7 @@ native-assets:
327327 '--output-dill' ,
328328 '$build /program.dill' ,
329329 '--depfile' ,
330- '$build /kernel_snapshot .d' ,
330+ '$build /kernel_snapshot_program .d' ,
331331 '--incremental' ,
332332 '--initialize-from-dill' ,
333333 '$build /program.dill' ,
@@ -368,7 +368,7 @@ native-assets:
368368 '--output-dill' ,
369369 '$build /program.dill' ,
370370 '--depfile' ,
371- '$build /kernel_snapshot .d' ,
371+ '$build /kernel_snapshot_program .d' ,
372372 '--incremental' ,
373373 '--initialize-from-dill' ,
374374 '$build /program.dill' ,
@@ -424,7 +424,7 @@ native-assets:
424424 '--output-dill' ,
425425 '$build /program.dill' ,
426426 '--depfile' ,
427- '$build /kernel_snapshot .d' ,
427+ '$build /kernel_snapshot_program .d' ,
428428 '--incremental' ,
429429 '--initialize-from-dill' ,
430430 '$build /program.dill' ,
@@ -488,6 +488,27 @@ native-assets:
488488 }
489489 }
490490
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+
491512 testUsingContext ('AotElfProfile Produces correct output directory' , () async {
492513 final String build = androidEnvironment.buildDir.path;
493514 processManager.addCommands (< FakeCommand > [
0 commit comments