diff --git a/packages/flutter_tools/lib/src/build_system/targets/assets.dart b/packages/flutter_tools/lib/src/build_system/targets/assets.dart index d719a1c3fdf..4d7ff2a1b9b 100644 --- a/packages/flutter_tools/lib/src/build_system/targets/assets.dart +++ b/packages/flutter_tools/lib/src/build_system/targets/assets.dart @@ -32,6 +32,7 @@ Future copyAssets( required TargetPlatform targetPlatform, BuildMode? buildMode, required ShaderTarget shaderTarget, + List additionalInputs = const [], }) async { // Check for an SkSL bundle. final String? shaderBundlePath = environment.defines[kBundleSkSLPath] ?? environment.inputs[kBundleSkSLPath]; @@ -65,6 +66,7 @@ Future copyAssets( // An asset manifest with no assets would have zero inputs if not // for this pubspec file. pubspecFile, + ...additionalInputs, ]; final List outputs = []; diff --git a/packages/flutter_tools/lib/src/build_system/targets/ios.dart b/packages/flutter_tools/lib/src/build_system/targets/ios.dart index 644d48aff06..9d54b55d127 100644 --- a/packages/flutter_tools/lib/src/build_system/targets/ios.dart +++ b/packages/flutter_tools/lib/src/build_system/targets/ios.dart @@ -10,7 +10,7 @@ import '../../base/common.dart'; import '../../base/file_system.dart'; import '../../base/io.dart'; import '../../build_info.dart'; -import '../../globals.dart' as globals show xcode; +import '../../globals.dart' as globals; import '../../macos/xcode.dart'; import '../../project.dart'; import '../../reporting/reporting.dart'; @@ -509,12 +509,28 @@ abstract class IosAssetBundle extends Target { .copySync(dsymOutputBinary.path); } + final FlutterProject flutterProject = FlutterProject.fromDirectory(environment.projectDir); + + bool isImpellerEnabled() { + if (!flutterProject.ios.infoPlist.existsSync()) { + return false; + } + final Map info = globals.plistParser.parseFile(flutterProject.ios.infoPlist.path); + + final Object? enableImpeller = info['FLTEnableImpeller']; + return enableImpeller is bool && enableImpeller; + } + // Copy the assets. final Depfile assetDepfile = await copyAssets( environment, assetDirectory, targetPlatform: TargetPlatform.ios, - shaderTarget: ShaderTarget.sksl, + shaderTarget: isImpellerEnabled() ? ShaderTarget.impelleriOS : ShaderTarget.sksl, + additionalInputs: [ + flutterProject.ios.infoPlist, + flutterProject.ios.appFrameworkInfoPlist, + ], ); final DepfileService depfileService = DepfileService( fileSystem: environment.fileSystem, @@ -526,8 +542,6 @@ abstract class IosAssetBundle extends Target { ); // Copy the plist from either the project or module. - // TODO(zanderso): add plist to inputs - final FlutterProject flutterProject = FlutterProject.fromDirectory(environment.projectDir); flutterProject.ios.appFrameworkInfoPlist .copySync(environment.outputDir .childDirectory('App.framework') diff --git a/packages/flutter_tools/lib/src/build_system/targets/shader_compiler.dart b/packages/flutter_tools/lib/src/build_system/targets/shader_compiler.dart index 194d2f2bfbb..b63307f737f 100644 --- a/packages/flutter_tools/lib/src/build_system/targets/shader_compiler.dart +++ b/packages/flutter_tools/lib/src/build_system/targets/shader_compiler.dart @@ -21,8 +21,8 @@ import '../build_system.dart'; /// The output shader format that should be used by the [ShaderCompiler]. enum ShaderTarget { - impellerAndroid('--opengl-es'), - impelleriOS('--metal-ios'), + impellerAndroid('--runtime-stage-gles'), + impelleriOS('--runtime-stage-metal'), sksl('--sksl'); const ShaderTarget(this.target); diff --git a/packages/flutter_tools/lib/src/xcode_project.dart b/packages/flutter_tools/lib/src/xcode_project.dart index 77d1d7b81ae..1b0e328b9b6 100644 --- a/packages/flutter_tools/lib/src/xcode_project.dart +++ b/packages/flutter_tools/lib/src/xcode_project.dart @@ -131,6 +131,8 @@ class IosProject extends XcodeBasedProject { File get appFrameworkInfoPlist => _flutterLibRoot.childDirectory('Flutter').childFile('AppFrameworkInfo.plist'); + File get infoPlist => _editableDirectory.childDirectory('Runner').childFile('Info.plist'); + Directory get symlinks => _flutterLibRoot.childDirectory('.symlinks'); /// True, if the app project is using swift. diff --git a/packages/flutter_tools/test/general.shard/build_system/targets/shader_compiler_test.dart b/packages/flutter_tools/test/general.shard/build_system/targets/shader_compiler_test.dart index 39ff52598f9..7fca2959858 100644 --- a/packages/flutter_tools/test/general.shard/build_system/targets/shader_compiler_test.dart +++ b/packages/flutter_tools/test/general.shard/build_system/targets/shader_compiler_test.dart @@ -81,7 +81,7 @@ void main() { FakeCommand( command: [ impellerc, - '--metal-ios', + '--runtime-stage-metal', '--iplr', '--sl=$outputPath', '--spirv=$outputPath.spirv', @@ -117,7 +117,7 @@ void main() { FakeCommand( command: [ impellerc, - '--opengl-es', + '--runtime-stage-gles', '--iplr', '--sl=$outputPath', '--spirv=$outputPath.spirv', @@ -275,7 +275,7 @@ void main() { FakeCommand( command: [ impellerc, - '--opengl-es', + '--runtime-stage-gles', '--iplr', '--sl=/.tmp_rand0/0.8255140718871702.temp', '--spirv=/.tmp_rand0/0.8255140718871702.temp.spirv',