Set compile test iOS app target version to not embed Swift runtime (#140188)

ObjC->Swift plugin migration caused a size regression in the gallery app because the Swift runtime was also pulled in.  

The gallery app minimum target version is iOS 11.0, which predates Swift ABI compatibility.  Pre iOS 12.2 apps embedded the Swift runtime since there wasn't one available to use in the OS.  

Add  `FLUTTER_XCODE_IPHONEOS_DEPLOYMENT_TARGET` to the compile perf test environment, which gets translated by the tool to an Xcode build setting:
```
[2023-12-14 15:52:14.797318] [STDOUT] stdout:                IPHONEOS_DEPLOYMENT_TARGET = 12.2
```

On my machine on main
```
    "release_size_bytes": 43717389,
```
becomes
```
    "release_size_bytes": 40679432,
```

Fixes https://github.com/flutter/flutter/issues/139605
This commit is contained in:
Jenn Magder 2023-12-14 21:04:33 -08:00 committed by GitHub
parent f0051d8b12
commit 0cd2ea960b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1687,7 +1687,17 @@ class CompileTest {
options.add('--tree-shake-icons');
options.add('--split-debug-info=infos/');
watch.start();
await flutter('build', options: options);
await flutter(
'build',
options: options,
environment: <String, String> {
// iOS 12.1 and lower did not have Swift ABI compatibility so Swift apps embedded the Swift runtime.
// https://developer.apple.com/documentation/xcode-release-notes/swift-5-release-notes-for-xcode-10_2#App-Thinning
// The gallery pulls in Swift plugins. Set lowest version to 12.2 to avoid benchmark noise.
// This should be removed when when Flutter's minimum supported version is >12.2.
'FLUTTER_XCODE_IPHONEOS_DEPLOYMENT_TARGET': '12.2',
},
);
watch.stop();
final Directory buildDirectory = dir(path.join(
cwd,