diff --git a/dev/devicelab/bin/tasks/build_ios_framework_module_test.dart b/dev/devicelab/bin/tasks/build_ios_framework_module_test.dart index d4ffdb24bd..ba76ec386a 100644 --- a/dev/devicelab/bin/tasks/build_ios_framework_module_test.dart +++ b/dev/devicelab/bin/tasks/build_ios_framework_module_test.dart @@ -138,7 +138,7 @@ Future _testBuildIosFramework(Directory projectDir, { bool isModule = fals outputPath, 'Debug', 'App.xcframework', - 'ios-arm64_armv7', + 'ios-arm64', 'App.framework', 'App', ); @@ -148,7 +148,7 @@ Future _testBuildIosFramework(Directory projectDir, { bool isModule = fals outputPath, 'Debug', 'App.xcframework', - 'ios-arm64_armv7', + 'ios-arm64', 'App.framework', 'Info.plist', )); @@ -173,12 +173,6 @@ Future _testBuildIosFramework(Directory projectDir, { bool isModule = fals 'app.ios-arm64.symbols', )); - checkFileExists(path.join( - projectDir.path, - 'symbols', - 'app.ios-armv7.symbols', - )); - section('Check debug build has no Dart AOT'); final String aotSymbols = await _dylibSymbols(debugAppFrameworkPath); @@ -195,7 +189,7 @@ Future _testBuildIosFramework(Directory projectDir, { bool isModule = fals outputPath, mode, 'App.xcframework', - 'ios-arm64_armv7', + 'ios-arm64', 'App.framework', 'App', ); @@ -212,7 +206,7 @@ Future _testBuildIosFramework(Directory projectDir, { bool isModule = fals outputPath, mode, 'App.xcframework', - 'ios-arm64_armv7', + 'ios-arm64', 'App.framework', 'flutter_assets', 'vm_snapshot_data', @@ -294,7 +288,7 @@ Future _testBuildIosFramework(Directory projectDir, { bool isModule = fals outputPath, mode, 'connectivity.xcframework', - 'ios-arm64_armv7', + 'ios-arm64', 'connectivity.framework', 'connectivity', ); @@ -319,7 +313,7 @@ Future _testBuildIosFramework(Directory projectDir, { bool isModule = fals outputPath, mode, 'connectivity.xcframework', - 'ios-arm64_armv7', + 'ios-arm64', 'connectivity.framework', 'Headers', 'FLTConnectivityPlugin.h', @@ -330,7 +324,7 @@ Future _testBuildIosFramework(Directory projectDir, { bool isModule = fals outputPath, mode, 'connectivity.xcframework', - 'ios-arm64_armv7', + 'ios-arm64', 'dSYMs', 'connectivity.framework.dSYM', )); @@ -363,7 +357,7 @@ Future _testBuildIosFramework(Directory projectDir, { bool isModule = fals outputPath, 'Release', 'connectivity.xcframework', - 'ios-arm64_armv7', + 'ios-arm64', 'BCSymbolMaps', )); @@ -377,7 +371,7 @@ Future _testBuildIosFramework(Directory projectDir, { bool isModule = fals outputPath, mode, 'FlutterPluginRegistrant.xcframework', - 'ios-arm64_armv7', + 'ios-arm64', 'FlutterPluginRegistrant.framework', 'FlutterPluginRegistrant', ); @@ -387,7 +381,7 @@ Future _testBuildIosFramework(Directory projectDir, { bool isModule = fals outputPath, mode, 'FlutterPluginRegistrant.xcframework', - 'ios-arm64_armv7', + 'ios-arm64', 'FlutterPluginRegistrant.framework', 'Headers', 'GeneratedPluginRegistrant.h', diff --git a/packages/flutter_tools/bin/podhelper.rb b/packages/flutter_tools/bin/podhelper.rb index 3c41e887a4..b0892ab03e 100644 --- a/packages/flutter_tools/bin/podhelper.rb +++ b/packages/flutter_tools/bin/podhelper.rb @@ -81,6 +81,7 @@ def flutter_additional_ios_build_settings(target) # Override legacy Xcode 11 style VALID_ARCHS[sdk=iphonesimulator*]=x86_64 and prefer Xcode 12 EXCLUDED_ARCHS. build_configuration.build_settings['VALID_ARCHS[sdk=iphonesimulator*]'] = '$(ARCHS_STANDARD)' build_configuration.build_settings['EXCLUDED_ARCHS[sdk=iphonesimulator*]'] = '$(inherited) i386' + build_configuration.build_settings['EXCLUDED_ARCHS[sdk=iphoneos*]'] = '$(inherited) armv7' end end diff --git a/packages/flutter_tools/lib/src/base/build.dart b/packages/flutter_tools/lib/src/base/build.dart index 674bf4eb93..b16384a5d3 100644 --- a/packages/flutter_tools/lib/src/base/build.dart +++ b/packages/flutter_tools/lib/src/base/build.dart @@ -57,6 +57,7 @@ class GenSnapshot { DarwinArch? darwinArch, Iterable additionalArgs = const [], }) { + assert(darwinArch != DarwinArch.armv7); assert(snapshotType.platform != TargetPlatform.ios || darwinArch != null); final List args = [ ...additionalArgs, @@ -171,9 +172,8 @@ class AOTSnapshotter { genSnapshotArgs.add('--strip'); } - if (platform == TargetPlatform.android_arm || darwinArch == DarwinArch.armv7) { + if (platform == TargetPlatform.android_arm) { // Use softfp for Android armv7 devices. - // This is the default for armv7 iOS builds, but harmless to set. // TODO(cbracken): eliminate this when we fix https://github.com/flutter/flutter/issues/17489 genSnapshotArgs.add('--no-sim-use-hardfp'); diff --git a/packages/flutter_tools/lib/src/build_info.dart b/packages/flutter_tools/lib/src/build_info.dart index e77caf2875..c12e7c201f 100644 --- a/packages/flutter_tools/lib/src/build_info.dart +++ b/packages/flutter_tools/lib/src/build_info.dart @@ -546,7 +546,7 @@ enum TargetPlatform { // // TODO(cbracken): split TargetPlatform.ios into ios_armv7, ios_arm64. enum DarwinArch { - armv7, + armv7, // Deprecated. Used to display 32-bit unsupported devices. arm64, x86_64, } @@ -569,7 +569,6 @@ List defaultIOSArchsForEnvironment( ]; } return [ - DarwinArch.armv7, DarwinArch.arm64, ]; } @@ -922,8 +921,6 @@ const String kFileSystemRoots = 'FileSystemRoots'; /// /// This is expected to be a space-delimited list of architectures. If not /// provided, defaults to arm64. -/// -/// The other supported value is armv7, the 32-bit iOS architecture. const String kIosArchs = 'IosArchs'; /// The define to control what macOS architectures are built for. diff --git a/packages/flutter_tools/lib/src/ios/xcode_build_settings.dart b/packages/flutter_tools/lib/src/ios/xcode_build_settings.dart index 08a6d0fc6b..3b703dd439 100644 --- a/packages/flutter_tools/lib/src/ios/xcode_build_settings.dart +++ b/packages/flutter_tools/lib/src/ios/xcode_build_settings.dart @@ -3,6 +3,7 @@ // found in the LICENSE file. import '../artifacts.dart'; +import '../base/common.dart'; import '../base/file_system.dart'; import '../build_info.dart'; import '../cache.dart'; @@ -194,7 +195,7 @@ Future> _xcodeBuildSettingsLines({ } } else { if (localEngineName.endsWith('_arm')) { - arch = 'armv7'; + throwToolExit('32-bit iOS local engine binaries are not supported.'); } else if (localEngineName.contains('_arm64')) { arch = 'arm64'; } else if (localEngineName.contains('_sim')) { @@ -215,6 +216,7 @@ Future> _xcodeBuildSettingsLines({ excludedSimulatorArchs += ' arm64'; } xcodeBuildSettings.add('EXCLUDED_ARCHS[sdk=iphonesimulator*]=$excludedSimulatorArchs'); + xcodeBuildSettings.add('EXCLUDED_ARCHS[sdk=iphoneos*]=armv7'); } for (final MapEntry config in buildInfo.toEnvironmentConfig().entries) { diff --git a/packages/flutter_tools/test/commands.shard/permeable/create_test.dart b/packages/flutter_tools/test/commands.shard/permeable/create_test.dart index b8cc1ce501..16ecc75d46 100755 --- a/packages/flutter_tools/test/commands.shard/permeable/create_test.dart +++ b/packages/flutter_tools/test/commands.shard/permeable/create_test.dart @@ -1177,6 +1177,7 @@ void main() { expect(xcodeConfig, contains('FLUTTER_APPLICATION_PATH=')); expect(xcodeConfig, contains('FLUTTER_TARGET=')); expect(xcodeConfig, contains('COCOAPODS_PARALLEL_CODE_SIGN=true')); + expect(xcodeConfig, contains('EXCLUDED_ARCHS[sdk=iphoneos*]=armv7')); // Avoid legacy build locations to support Swift Package Manager. expect(xcodeConfig, isNot(contains('SYMROOT'))); @@ -1279,6 +1280,7 @@ void main() { expect(xcodeConfig, contains('FLUTTER_ROOT=')); expect(xcodeConfig, contains('FLUTTER_APPLICATION_PATH=')); expect(xcodeConfig, contains('COCOAPODS_PARALLEL_CODE_SIGN=true')); + expect(xcodeConfig, contains('EXCLUDED_ARCHS[sdk=iphoneos*]=armv7')); // Xcode project final String xcodeProjectPath = globals.fs.path.join('ios', 'Runner.xcodeproj', 'project.pbxproj'); expectExists(xcodeProjectPath); diff --git a/packages/flutter_tools/test/general.shard/base/build_test.dart b/packages/flutter_tools/test/general.shard/base/build_test.dart index 149d0cb3cc..cb4059a66a 100644 --- a/packages/flutter_tools/test/general.shard/base/build_test.dart +++ b/packages/flutter_tools/test/general.shard/base/build_test.dart @@ -88,24 +88,6 @@ void main() { expect(result, 0); }); - testWithoutContext('iOS armv7', () async { - processManager.addCommand( - FakeCommand( - command: [ - '${artifacts.getArtifactPath(Artifact.genSnapshot, platform: TargetPlatform.ios, mode: BuildMode.release)}_armv7', - '--additional_arg' - ], - ), - ); - - final int result = await genSnapshot.run( - snapshotType: SnapshotType(TargetPlatform.ios, BuildMode.release), - darwinArch: DarwinArch.armv7, - additionalArgs: ['--additional_arg'], - ); - expect(result, 0); - }); - testWithoutContext('iOS arm64', () async { final String genSnapshotPath = artifacts.getArtifactPath( Artifact.genSnapshot, @@ -224,13 +206,11 @@ void main() { ); processManager.addCommands([ FakeCommand(command: [ - '${genSnapshotPath}_armv7', + '${genSnapshotPath}_arm64', '--deterministic', '--snapshot_kind=app-aot-assembly', '--assembly=$assembly', '--strip', - '--no-sim-use-hardfp', - '--no-use-integer-division', 'main.dill', ]), kWhichSysctlCommand, @@ -239,7 +219,7 @@ void main() { 'xcrun', 'cc', '-arch', - 'armv7', + 'arm64', '-miphoneos-version-min=9.0', '-isysroot', 'path/to/sdk', @@ -253,7 +233,7 @@ void main() { 'xcrun', 'clang', '-arch', - 'armv7', + 'arm64', '-miphoneos-version-min=9.0', '-isysroot', 'path/to/sdk', @@ -280,7 +260,7 @@ void main() { buildMode: BuildMode.profile, mainPath: 'main.dill', outputPath: outputPath, - darwinArch: DarwinArch.armv7, + darwinArch: DarwinArch.arm64, sdkRoot: 'path/to/sdk', bitcode: true, dartObfuscation: false, @@ -290,10 +270,10 @@ void main() { expect(processManager, hasNoRemainingExpectations); }); - testWithoutContext('builds iOS armv7 snapshot with dwarStackTraces', () async { + testWithoutContext('builds iOS snapshot with dwarfStackTraces', () async { final String outputPath = fileSystem.path.join('build', 'foo'); final String assembly = fileSystem.path.join(outputPath, 'snapshot_assembly.S'); - final String debugPath = fileSystem.path.join('foo', 'app.ios-armv7.symbols'); + final String debugPath = fileSystem.path.join('foo', 'app.ios-arm64.symbols'); final String genSnapshotPath = artifacts.getArtifactPath( Artifact.genSnapshot, platform: TargetPlatform.ios, @@ -301,13 +281,11 @@ void main() { ); processManager.addCommands([ FakeCommand(command: [ - '${genSnapshotPath}_armv7', + '${genSnapshotPath}_arm64', '--deterministic', '--snapshot_kind=app-aot-assembly', '--assembly=$assembly', '--strip', - '--no-sim-use-hardfp', - '--no-use-integer-division', '--dwarf-stack-traces', '--save-debugging-info=$debugPath', 'main.dill', @@ -318,7 +296,7 @@ void main() { 'xcrun', 'cc', '-arch', - 'armv7', + 'arm64', '-miphoneos-version-min=9.0', '-isysroot', 'path/to/sdk', @@ -331,7 +309,7 @@ void main() { 'xcrun', 'clang', '-arch', - 'armv7', + 'arm64', ...kDefaultClang, ]), ]); @@ -341,7 +319,7 @@ void main() { buildMode: BuildMode.profile, mainPath: 'main.dill', outputPath: outputPath, - darwinArch: DarwinArch.armv7, + darwinArch: DarwinArch.arm64, sdkRoot: 'path/to/sdk', bitcode: false, splitDebugInfo: 'foo', @@ -352,7 +330,7 @@ void main() { expect(processManager, hasNoRemainingExpectations); }); - testWithoutContext('builds iOS armv7 snapshot with obfuscate', () async { + testWithoutContext('builds iOS snapshot with obfuscate', () async { final String outputPath = fileSystem.path.join('build', 'foo'); final String assembly = fileSystem.path.join(outputPath, 'snapshot_assembly.S'); final String genSnapshotPath = artifacts.getArtifactPath( @@ -362,13 +340,11 @@ void main() { ); processManager.addCommands([ FakeCommand(command: [ - '${genSnapshotPath}_armv7', + '${genSnapshotPath}_arm64', '--deterministic', '--snapshot_kind=app-aot-assembly', '--assembly=$assembly', '--strip', - '--no-sim-use-hardfp', - '--no-use-integer-division', '--obfuscate', 'main.dill', ]), @@ -378,7 +354,7 @@ void main() { 'xcrun', 'cc', '-arch', - 'armv7', + 'arm64', '-miphoneos-version-min=9.0', '-isysroot', 'path/to/sdk', @@ -391,7 +367,7 @@ void main() { 'xcrun', 'clang', '-arch', - 'armv7', + 'arm64', ...kDefaultClang, ]), ]); @@ -401,7 +377,7 @@ void main() { buildMode: BuildMode.profile, mainPath: 'main.dill', outputPath: outputPath, - darwinArch: DarwinArch.armv7, + darwinArch: DarwinArch.arm64, sdkRoot: 'path/to/sdk', bitcode: false, dartObfuscation: true, @@ -411,64 +387,7 @@ void main() { expect(processManager, hasNoRemainingExpectations); }); - testWithoutContext('builds iOS armv7 snapshot', () async { - final String outputPath = fileSystem.path.join('build', 'foo'); - final String genSnapshotPath = artifacts.getArtifactPath( - Artifact.genSnapshot, - platform: TargetPlatform.ios, - mode: BuildMode.release, - ); - processManager.addCommands([ - FakeCommand(command: [ - '${genSnapshotPath}_armv7', - '--deterministic', - '--snapshot_kind=app-aot-assembly', - '--assembly=${fileSystem.path.join(outputPath, 'snapshot_assembly.S')}', - '--strip', - '--no-sim-use-hardfp', - '--no-use-integer-division', - 'main.dill', - ]), - kWhichSysctlCommand, - kARMCheckCommand, - const FakeCommand(command: [ - 'xcrun', - 'cc', - '-arch', - 'armv7', - '-miphoneos-version-min=9.0', - '-isysroot', - 'path/to/sdk', - '-c', - 'build/foo/snapshot_assembly.S', - '-o', - 'build/foo/snapshot_assembly.o', - ]), - const FakeCommand(command: [ - 'xcrun', - 'clang', - '-arch', - 'armv7', - ...kDefaultClang, - ]), - ]); - - final int genSnapshotExitCode = await snapshotter.build( - platform: TargetPlatform.ios, - buildMode: BuildMode.release, - mainPath: 'main.dill', - outputPath: outputPath, - darwinArch: DarwinArch.armv7, - sdkRoot: 'path/to/sdk', - bitcode: false, - dartObfuscation: false, - ); - - expect(genSnapshotExitCode, 0); - expect(processManager, hasNoRemainingExpectations); - }); - - testWithoutContext('builds iOS arm64 snapshot', () async { + testWithoutContext('builds iOS snapshot', () async { final String outputPath = fileSystem.path.join('build', 'foo'); final String genSnapshotPath = artifacts.getArtifactPath( Artifact.genSnapshot, diff --git a/packages/flutter_tools/test/general.shard/build_system/targets/common_test.dart b/packages/flutter_tools/test/general.shard/build_system/targets/common_test.dart index 31258f16f8..b4a34bd023 100644 --- a/packages/flutter_tools/test/general.shard/build_system/targets/common_test.dart +++ b/packages/flutter_tools/test/general.shard/build_system/targets/common_test.dart @@ -451,123 +451,7 @@ void main() { ProcessManager: () => processManager, }); - testUsingContext('AotAssemblyProfile generates multiple arches and lipos together', () async { - final String build = iosEnvironment.buildDir.path; - processManager.addCommands([ - FakeCommand(command: [ - // This path is not known by the cache due to the iOS gen_snapshot split. - 'Artifact.genSnapshot.TargetPlatform.ios.profile_armv7', - '--deterministic', - kAssemblyAot, - '--assembly=$build/armv7/snapshot_assembly.S', - '--strip', - '--no-sim-use-hardfp', - '--no-use-integer-division', - '$build/app.dill', - ]), - FakeCommand(command: [ - // This path is not known by the cache due to the iOS gen_snapshot split. - 'Artifact.genSnapshot.TargetPlatform.ios.profile_arm64', - '--deterministic', - kAssemblyAot, - '--assembly=$build/arm64/snapshot_assembly.S', - '--strip', - '$build/app.dill', - ]), - FakeCommand(command: [ - 'xcrun', - 'cc', - '-arch', - 'armv7', - '-miphoneos-version-min=9.0', - '-isysroot', - 'path/to/iPhoneOS.sdk', - '-c', - '$build/armv7/snapshot_assembly.S', - '-o', - '$build/armv7/snapshot_assembly.o', - ]), - FakeCommand(command: [ - 'xcrun', - 'cc', - '-arch', - 'arm64', - '-miphoneos-version-min=9.0', - '-isysroot', - 'path/to/iPhoneOS.sdk', - '-c', - '$build/arm64/snapshot_assembly.S', - '-o', - '$build/arm64/snapshot_assembly.o', - ]), - FakeCommand(command: [ - 'xcrun', - 'clang', - '-arch', - 'armv7', - '-miphoneos-version-min=9.0', - '-isysroot', - 'path/to/iPhoneOS.sdk', - '-dynamiclib', - '-Xlinker', - '-rpath', - '-Xlinker', - '@executable_path/Frameworks', - '-Xlinker', - '-rpath', - '-Xlinker', - '@loader_path/Frameworks', - '-install_name', - '@rpath/App.framework/App', - '-o', - '$build/armv7/App.framework/App', - '$build/armv7/snapshot_assembly.o', - ]), - FakeCommand(command: [ - 'xcrun', - 'clang', - '-arch', - 'arm64', - '-miphoneos-version-min=9.0', - '-isysroot', - 'path/to/iPhoneOS.sdk', - '-dynamiclib', - '-Xlinker', - '-rpath', - '-Xlinker', - '@executable_path/Frameworks', - '-Xlinker', - '-rpath', - '-Xlinker', - '@loader_path/Frameworks', - '-install_name', - '@rpath/App.framework/App', - '-o', - '$build/arm64/App.framework/App', - '$build/arm64/snapshot_assembly.o', - ]), - FakeCommand(command: [ - 'lipo', - '$build/armv7/App.framework/App', - '$build/arm64/App.framework/App', - '-create', - '-output', - '$build/App.framework/App', - ]), - ]); - iosEnvironment.defines[kIosArchs] ='armv7 arm64'; - iosEnvironment.defines[kSdkRoot] = 'path/to/iPhoneOS.sdk'; - - await const AotAssemblyProfile().build(iosEnvironment); - - expect(processManager, hasNoRemainingExpectations); - }, overrides: { - Platform: () => macPlatform, - FileSystem: () => fileSystem, - ProcessManager: () => processManager, - }); - - testUsingContext('AotAssemblyProfile with bitcode sends correct argument to snapshotter (one arch)', () async { + testUsingContext('AotAssemblyProfile with bitcode sends correct argument to snapshotter', () async { iosEnvironment.defines[kIosArchs] = 'arm64'; iosEnvironment.defines[kBitcodeFlag] = 'true'; iosEnvironment.defines[kSdkRoot] = 'path/to/iPhoneOS.sdk'; diff --git a/packages/flutter_tools/test/general.shard/ios/xcodeproj_test.dart b/packages/flutter_tools/test/general.shard/ios/xcodeproj_test.dart index c1579812d9..0eacb84f69 100644 --- a/packages/flutter_tools/test/general.shard/ios/xcodeproj_test.dart +++ b/packages/flutter_tools/test/general.shard/ios/xcodeproj_test.dart @@ -683,7 +683,7 @@ Information about project "Runner": setUp(() { fs = MemoryFileSystem.test(); - localIosArtifacts = Artifacts.test(localEngine: 'out/ios_profile_arm'); + localIosArtifacts = Artifacts.test(localEngine: 'out/ios_profile_arm64'); macOS = FakePlatform(operatingSystem: 'macos'); fs.file(xcodebuild).createSync(recursive: true); }); @@ -744,6 +744,7 @@ Build settings for action build and target plugin2: final File config = fs.file('path/to/project/ios/Flutter/Generated.xcconfig'); expect(config.readAsStringSync(), contains('EXCLUDED_ARCHS[sdk=iphonesimulator*]=i386\n')); + expect(config.readAsStringSync(), contains('EXCLUDED_ARCHS[sdk=iphoneos*]=armv7\n')); expect(fakeProcessManager, hasNoRemainingExpectations); }, overrides: { Artifacts: () => localIosArtifacts, @@ -788,6 +789,7 @@ Build settings for action build and target plugin2: final File config = fs.file('path/to/project/ios/Flutter/Generated.xcconfig'); expect(config.readAsStringSync(), contains('EXCLUDED_ARCHS[sdk=iphonesimulator*]=i386 arm64\n')); + expect(config.readAsStringSync(), contains('EXCLUDED_ARCHS[sdk=iphoneos*]=armv7\n')); expect(fakeProcessManager, hasNoRemainingExpectations); }, overrides: { Artifacts: () => localIosArtifacts, @@ -844,6 +846,7 @@ Build settings for action build and target plugin2: final File config = fs.file('path/to/project/ios/Flutter/Generated.xcconfig'); expect(config.readAsStringSync(), contains('EXCLUDED_ARCHS[sdk=iphonesimulator*]=i386 arm64\n')); + expect(config.readAsStringSync(), contains('EXCLUDED_ARCHS[sdk=iphoneos*]=armv7\n')); expect(fakeProcessManager, hasNoRemainingExpectations); }, overrides: { Artifacts: () => localIosArtifacts, @@ -863,27 +866,17 @@ Build settings for action build and target plugin2: }); } - testUsingOsxContext('sets ARCHS=armv7 when armv7 local iOS engine is set', () async { + testUsingOsxContext('exits when armv7 local engine is set', () async { + localIosArtifacts = Artifacts.test(localEngine: 'out/ios_profile_arm'); const BuildInfo buildInfo = BuildInfo.debug; final FlutterProject project = FlutterProject.fromDirectoryTest(fs.directory('path/to/project')); - await updateGeneratedXcodeProperties( - project: project, - buildInfo: buildInfo, + await expectLater(() => + updateGeneratedXcodeProperties( + project: project, + buildInfo: buildInfo, + ), + throwsToolExit(message: '32-bit iOS local engine binaries are not supported.'), ); - - final File config = fs.file('path/to/project/ios/Flutter/Generated.xcconfig'); - expect(config.existsSync(), isTrue); - - final String contents = config.readAsStringSync(); - expect(contents.contains('ARCHS=armv7'), isTrue); - expect(contents.contains('EXCLUDED_ARCHS[sdk=iphonesimulator*]=i386'), isTrue); - - final File buildPhaseScript = fs.file('path/to/project/ios/Flutter/flutter_export_environment.sh'); - expect(buildPhaseScript.existsSync(), isTrue); - - final String buildPhaseScriptContents = buildPhaseScript.readAsStringSync(); - expect(buildPhaseScriptContents.contains('ARCHS=armv7'), isTrue); - expect(buildPhaseScriptContents.contains('EXCLUDED_ARCHS'), isFalse); }); testUsingContext('sets ARCHS=arm64 when arm64 local host engine is set', () async { @@ -950,6 +943,7 @@ Build settings for action build and target plugin2: final File config = fs.file('path/to/project/ios/Flutter/Generated.xcconfig'); expect(config.readAsStringSync(), contains('EXCLUDED_ARCHS[sdk=iphonesimulator*]=i386\n')); + expect(config.readAsStringSync(), contains('EXCLUDED_ARCHS[sdk=iphoneos*]=armv7\n')); final File buildPhaseScript = fs.file('path/to/project/ios/Flutter/flutter_export_environment.sh'); expect(buildPhaseScript.readAsStringSync(), isNot(contains('EXCLUDED_ARCHS'))); @@ -1051,35 +1045,6 @@ Build settings for action build and target plugin2: }); }); - group('armv7 local engine', () { - Artifacts localArtifacts; - - setUp(() { - localArtifacts = Artifacts.test(localEngine: 'out/ios_profile'); - }); - - testUsingContext('sets ARCHS=armv7 when armv7 local engine is set', () async { - const BuildInfo buildInfo = BuildInfo.debug; - - final FlutterProject project = FlutterProject.fromDirectoryTest(fs.directory('path/to/project')); - await updateGeneratedXcodeProperties( - project: project, - buildInfo: buildInfo, - ); - - final File config = fs.file('path/to/project/ios/Flutter/Generated.xcconfig'); - expect(config.existsSync(), isTrue); - - final String contents = config.readAsStringSync(); - expect(contents.contains('ARCHS=arm64'), isTrue); - }, overrides: { - Artifacts: () => localArtifacts, - Platform: () => macOS, - FileSystem: () => fs, - ProcessManager: () => FakeProcessManager.any(), - }); - }); - String propertyFor(String key, File file) { final List properties = file .readAsLinesSync() diff --git a/packages/flutter_tools/test/general.shard/xcode_backend_test.dart b/packages/flutter_tools/test/general.shard/xcode_backend_test.dart index 23c7529eb5..f6b1a27d3d 100644 --- a/packages/flutter_tools/test/general.shard/xcode_backend_test.dart +++ b/packages/flutter_tools/test/general.shard/xcode_backend_test.dart @@ -130,7 +130,7 @@ void main() { ..createSync(recursive: true); final Directory flutterRoot = fileSystem.directory('/path/to/flutter') ..createSync(recursive: true); - const String archs = 'arm64 armv7'; + const String archs = 'arm64'; const String buildMode = 'Release'; const String dartObfuscation = 'false'; const String dartDefines = 'flutter.inspector.structuredErrors%3Dtrue';