@@ -15,6 +15,9 @@ import 'common/repository_package.dart';
15
15
16
16
const String _outputDirectoryFlag = 'output-dir' ;
17
17
18
+ const int _exitUpdateMacosPodfileFailed = 3 ;
19
+ const int _exitUpdateMacosPbxprojFailed = 4 ;
20
+
18
21
/// A command to create an application that builds all in a single application.
19
22
class CreateAllPluginsAppCommand extends PackageCommand {
20
23
/// Creates an instance of the builder command.
@@ -270,12 +273,6 @@ dev_dependencies:${_pubspecMapString(pubspec.devDependencies)}
270
273
}
271
274
272
275
Future <int > _genNativeBuildFiles () async {
273
- // Only run on macOS.
274
- // Other platforms don't need generation of additional files.
275
- if (! io.Platform .isMacOS) {
276
- return 0 ;
277
- }
278
-
279
276
final io.ProcessResult result = io.Process .runSync (
280
277
flutterCommand,
281
278
< String > [
@@ -291,15 +288,10 @@ dev_dependencies:${_pubspecMapString(pubspec.devDependencies)}
291
288
}
292
289
293
290
Future <void > _updateMacosPodfile () async {
294
- // Only change the macOS deployment target if the host platform is macOS.
295
- if (! io.Platform .isMacOS) {
296
- return ;
297
- }
298
-
299
291
final File podfileFile =
300
292
app.platformDirectory (FlutterPlatform .macos).childFile ('Podfile' );
301
293
if (! podfileFile.existsSync ()) {
302
- throw ToolExit (64 );
294
+ throw ToolExit (_exitUpdateMacosPodfileFailed );
303
295
}
304
296
305
297
final StringBuffer newPodfile = StringBuffer ();
@@ -315,17 +307,12 @@ dev_dependencies:${_pubspecMapString(pubspec.devDependencies)}
315
307
}
316
308
317
309
Future <void > _updateMacosPbxproj () async {
318
- // Only change the macOS deployment target if the host platform is macOS.
319
- if (! io.Platform .isMacOS) {
320
- return ;
321
- }
322
-
323
310
final File pbxprojFile = app
324
311
.platformDirectory (FlutterPlatform .macos)
325
312
.childDirectory ('Runner.xcodeproj' )
326
313
.childFile ('project.pbxproj' );
327
314
if (! pbxprojFile.existsSync ()) {
328
- throw ToolExit (64 );
315
+ throw ToolExit (_exitUpdateMacosPbxprojFailed );
329
316
}
330
317
331
318
final StringBuffer newPbxproj = StringBuffer ();
0 commit comments