@@ -501,4 +501,59 @@ void main() {
501501
502502 expect (depfile.outputs[2 ].path, '/out/abi1/app.so-4.part.so' );
503503 });
504+
505+ testUsingContext ('DebugAndroidApplication with impeller and shader compilation' , () async {
506+ // Create impellerc to work around fallback detection logic.
507+ fileSystem.file (artifacts.getHostArtifact (HostArtifact .impellerc)).createSync (recursive: true );
508+
509+ final Environment environment = Environment .test (
510+ fileSystem.currentDirectory,
511+ outputDir: fileSystem.directory ('out' )..createSync (),
512+ defines: < String , String > {
513+ kBuildMode: 'debug' ,
514+ },
515+ processManager: processManager,
516+ artifacts: artifacts,
517+ fileSystem: fileSystem,
518+ logger: logger,
519+ );
520+ environment.buildDir.createSync (recursive: true );
521+
522+ // create pre-requisites.
523+ environment.buildDir.childFile ('app.dill' )
524+ .writeAsStringSync ('abcd' );
525+ fileSystem
526+ .file (artifacts.getArtifactPath (Artifact .vmSnapshotData, mode: BuildMode .debug))
527+ .createSync (recursive: true );
528+ fileSystem
529+ .file (artifacts.getArtifactPath (Artifact .isolateSnapshotData, mode: BuildMode .debug))
530+ .createSync (recursive: true );
531+ fileSystem.file ('pubspec.yaml' ).writeAsStringSync ('name: hello\n flutter:\n shaders:\n - shader.glsl' );
532+ fileSystem.file ('.packages' ).writeAsStringSync ('\n ' );
533+ fileSystem.file ('shader.glsl' ).writeAsStringSync ('test' );
534+
535+ processManager.addCommands (< FakeCommand > [
536+ const FakeCommand (command: < String > [
537+ 'HostArtifact.impellerc' ,
538+ '--runtime-stage-gles' ,
539+ '--iplr' ,
540+ '--sl=out/flutter_assets/shader.glsl' ,
541+ '--spirv=out/flutter_assets/shader.glsl.spirv' ,
542+ '--input=/shader.glsl' ,
543+ '--input-type=frag' ,
544+ '--include=/' ,
545+ '--include=/./shader_lib' ,
546+ ]),
547+ ]);
548+
549+ await const DebugAndroidApplication ().build (environment);
550+ expect (processManager, hasNoRemainingExpectations);
551+
552+ expect (fileSystem.file (fileSystem.path.join ('out' , 'flutter_assets' , 'isolate_snapshot_data' )).existsSync (), true );
553+ expect (fileSystem.file (fileSystem.path.join ('out' , 'flutter_assets' , 'vm_snapshot_data' )).existsSync (), true );
554+ expect (fileSystem.file (fileSystem.path.join ('out' , 'flutter_assets' , 'kernel_blob.bin' )).existsSync (), true );
555+ }, overrides: < Type , Generator > {
556+ FileSystem : () => fileSystem,
557+ ProcessManager : () => processManager,
558+ });
504559}
0 commit comments