Add iOS build -destination flag (#90915)

This commit is contained in:
Jenn Magder
2021-10-04 10:18:03 -07:00
committed by GitHub
parent 905ac63e34
commit 61e2e86611
8 changed files with 70 additions and 21 deletions

View File

@@ -112,10 +112,15 @@ void main() {
'-scheme', 'Runner',
'BUILD_DIR=/build/ios',
'-sdk',
if (simulator)
'iphonesimulator'
else
if (simulator) ...<String>[
'iphonesimulator',
'-destination',
'generic/platform=iOS Simulator',
] else ...<String>[
'iphoneos',
'-destination',
'generic/platform=iOS',
],
'FLUTTER_SUPPRESS_ANALYTICS=true',
'COMPILER_INDEX_STORE_ENABLE=NO',
],

View File

@@ -96,6 +96,8 @@ void main() {
'-workspace', 'Runner.xcworkspace',
'-scheme', 'Runner',
'-sdk', 'iphoneos',
'-destination',
'generic/platform=iOS',
'FLUTTER_SUPPRESS_ANALYTICS=true',
'COMPILER_INDEX_STORE_ENABLE=NO',
'-archivePath', '/build/ios/archive/Runner',

View File

@@ -54,6 +54,8 @@ const List<String> kRunReleaseArgs = <String>[
'BUILD_DIR=/build/ios',
'-sdk',
'iphoneos',
'-destination',
'id=123',
'ONLY_ACTIVE_ARCH=YES',
'ARCHS=arm64',
'FLUTTER_SUPPRESS_ANALYTICS=true',

View File

@@ -278,6 +278,8 @@ void main() {
'/',
'-scheme',
'Free',
'-destination',
'id=123',
'-showBuildSettings',
'BUILD_DIR=${fileSystem.path.absolute('build', 'ios')}',
],
@@ -286,7 +288,7 @@ void main() {
]);
expect(
await xcodeProjectInterpreter.getBuildSettings('', buildContext: const XcodeProjectBuildContext(scheme: 'Free')),
await xcodeProjectInterpreter.getBuildSettings('', buildContext: const XcodeProjectBuildContext(deviceId: '123', scheme: 'Free')),
const <String, String>{});
expect(fakeProcessManager, hasNoRemainingExpectations);
}, overrides: <Type, Generator>{
@@ -308,6 +310,8 @@ void main() {
'/',
'-sdk',
'iphonesimulator',
'-destination',
'generic/platform=iOS Simulator',
'-showBuildSettings',
'BUILD_DIR=${fileSystem.path.absolute('build', 'ios')}',
],
@@ -340,6 +344,8 @@ void main() {
'xcodebuild',
'-project',
'/',
'-destination',
'generic/platform=iOS',
'-showBuildSettings',
'BUILD_DIR=${fileSystem.path.absolute('build', 'ios')}',
],
@@ -371,6 +377,8 @@ void main() {
fileSystem.path.separator,
'-scheme',
'Free',
'-destination',
'generic/platform=iOS',
'-showBuildSettings',
'BUILD_DIR=${fileSystem.path.absolute('build', 'ios')}',
'CODE_SIGN_STYLE=Manual',

View File

@@ -628,7 +628,7 @@ apply plugin: 'kotlin-android'
testUsingContext('cannot find bundle identifier', () async {
final FlutterProject project = await someProject();
expect(await project.ios.containsWatchCompanion(<String>['WatchTarget'], null), isFalse);
expect(await project.ios.containsWatchCompanion(<String>['WatchTarget'], null, '123'), isFalse);
}, overrides: <Type, Generator>{
FileSystem: () => fs,
ProcessManager: () => FakeProcessManager.any(),
@@ -647,7 +647,7 @@ apply plugin: 'kotlin-android'
testUsingContext('no Info.plist in target', () async {
final FlutterProject project = await someProject();
expect(await project.ios.containsWatchCompanion(<String>['WatchTarget'], null), isFalse);
expect(await project.ios.containsWatchCompanion(<String>['WatchTarget'], null, '123'), isFalse);
}, overrides: <Type, Generator>{
FileSystem: () => fs,
ProcessManager: () => FakeProcessManager.any(),
@@ -660,7 +660,7 @@ apply plugin: 'kotlin-android'
final FlutterProject project = await someProject();
project.ios.hostAppRoot.childDirectory('WatchTarget').childFile('Info.plist').createSync(recursive: true);
expect(await project.ios.containsWatchCompanion(<String>['WatchTarget'], null), isFalse);
expect(await project.ios.containsWatchCompanion(<String>['WatchTarget'], null, '123'), isFalse);
}, overrides: <Type, Generator>{
FileSystem: () => fs,
ProcessManager: () => FakeProcessManager.any(),
@@ -674,7 +674,7 @@ apply plugin: 'kotlin-android'
project.ios.hostAppRoot.childDirectory('WatchTarget').childFile('Info.plist').createSync(recursive: true);
testPlistParser.setProperty('WKCompanionAppBundleIdentifier', 'io.flutter.someOTHERproject');
expect(await project.ios.containsWatchCompanion(<String>['WatchTarget'], null), isFalse);
expect(await project.ios.containsWatchCompanion(<String>['WatchTarget'], null, '123'), isFalse);
}, overrides: <Type, Generator>{
FileSystem: () => fs,
ProcessManager: () => FakeProcessManager.any(),
@@ -689,7 +689,7 @@ apply plugin: 'kotlin-android'
project.ios.hostAppRoot.childDirectory('WatchTarget').childFile('Info.plist').createSync(recursive: true);
testPlistParser.setProperty('WKCompanionAppBundleIdentifier', 'io.flutter.someProject');
expect(await project.ios.containsWatchCompanion(<String>['WatchTarget'], null), isTrue);
expect(await project.ios.containsWatchCompanion(<String>['WatchTarget'], null, '123'), isTrue);
}, overrides: <Type, Generator>{
FileSystem: () => fs,
ProcessManager: () => FakeProcessManager.any(),
@@ -707,7 +707,7 @@ apply plugin: 'kotlin-android'
project.ios.hostAppRoot.childDirectory('WatchTarget').childFile('Info.plist').createSync(recursive: true);
testPlistParser.setProperty('WKCompanionAppBundleIdentifier', r'$(PRODUCT_BUNDLE_IDENTIFIER)');
expect(await project.ios.containsWatchCompanion(<String>['WatchTarget'], null), isTrue);
expect(await project.ios.containsWatchCompanion(<String>['WatchTarget'], null, '123'), isTrue);
}, overrides: <Type, Generator>{
FileSystem: () => fs,
ProcessManager: () => FakeProcessManager.any(),