@@ -31,10 +31,6 @@ class BuildIOSCommand extends _BuildIOSSubCommand {
31
31
..addFlag ('simulator' ,
32
32
help: 'Build for the iOS simulator instead of the device. This changes '
33
33
'the default build mode to debug if otherwise unspecified.' ,
34
- )
35
- ..addFlag ('codesign' ,
36
- defaultsTo: true ,
37
- help: 'Codesign the application bundle (only available on device builds).' ,
38
34
);
39
35
}
40
36
@@ -53,9 +49,6 @@ class BuildIOSCommand extends _BuildIOSSubCommand {
53
49
@override
54
50
bool get configOnly => boolArg ('config-only' );
55
51
56
- @override
57
- bool get shouldCodesign => boolArg ('codesign' );
58
-
59
52
@override
60
53
Directory _outputAppDirectory (String xcodeResultOutput) => globals.fs.directory (xcodeResultOutput).parent;
61
54
}
@@ -105,9 +98,6 @@ class BuildIOSArchiveCommand extends _BuildIOSSubCommand {
105
98
@override
106
99
final bool configOnly = false ;
107
100
108
- @override
109
- final bool shouldCodesign = true ;
110
-
111
101
String ? get exportOptionsPlist => stringArg ('export-options-plist' );
112
102
113
103
@override
@@ -141,13 +131,18 @@ class BuildIOSArchiveCommand extends _BuildIOSSubCommand {
141
131
142
132
@override
143
133
Future <FlutterCommandResult > runCommand () async {
144
- final FlutterCommandResult xcarchiveResult = await super .runCommand ();
145
- final BuildInfo buildInfo = await getBuildInfo ();
134
+ final BuildInfo buildInfo = await cachedBuildInfo;
146
135
displayNullSafetyMode (buildInfo);
136
+ final FlutterCommandResult xcarchiveResult = await super .runCommand ();
147
137
148
138
// xcarchive failed or not at expected location.
149
139
if (xcarchiveResult.exitStatus != ExitStatus .success) {
150
- globals.printStatus ('Skipping IPA' );
140
+ globals.printStatus ('Skipping IPA.' );
141
+ return xcarchiveResult;
142
+ }
143
+
144
+ if (! shouldCodesign) {
145
+ globals.printStatus ('Codesigning disabled with --no-codesign, skipping IPA.' );
151
146
return xcarchiveResult;
152
147
}
153
148
@@ -291,6 +286,10 @@ abstract class _BuildIOSSubCommand extends BuildSubCommand {
291
286
addBundleSkSLPathOption (hide: ! verboseHelp);
292
287
addNullSafetyModeOptions (hide: ! verboseHelp);
293
288
usesAnalyzeSizeFlag ();
289
+ argParser.addFlag ('codesign' ,
290
+ defaultsTo: true ,
291
+ help: 'Codesign the application bundle (only available on device builds).' ,
292
+ );
294
293
}
295
294
296
295
@override
@@ -305,7 +304,8 @@ abstract class _BuildIOSSubCommand extends BuildSubCommand {
305
304
XcodeBuildResult ? xcodeBuildResult;
306
305
EnvironmentType get environmentType;
307
306
bool get configOnly;
308
- bool get shouldCodesign;
307
+
308
+ bool get shouldCodesign => boolArg ('codesign' );
309
309
310
310
late final Future <BuildInfo > cachedBuildInfo = getBuildInfo ();
311
311
0 commit comments