Skip to content

Commit

Permalink
feat: add ios pod menu
Browse files Browse the repository at this point in the history
  • Loading branch information
alextekartik committed Feb 1, 2024
1 parent f6730e6 commit 2ee50a4
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 2 deletions.
6 changes: 4 additions & 2 deletions packages/build_flutter/lib/src/app_builder.dart
Original file line number Diff line number Diff line change
Expand Up @@ -248,13 +248,15 @@ class FlutterAppBuilder {
return FlutterAppFlavorBuilder(appBuilder: this, flavor: flavor);
}).toList();
} else {
return [defaultFlavorBuild];
return [defaultFlavorBuilder];
}
}

FlutterAppFlavorBuilder get defaultFlavorBuild =>
FlutterAppFlavorBuilder get defaultFlavorBuilder =>
FlutterAppFlavorBuilder(appBuilder: this, flavor: null);

@Deprecated('Use defaultFlavorBuilder')
FlutterAppFlavorBuilder get defaultFlavorBuild => defaultFlavorBuilder;
String get apkDeployPath => join(deployPath, 'apk');
String get aabDeployPath => join(deployPath, 'aab');
}
23 changes: 23 additions & 0 deletions packages/build_menu_flutter/lib/src/app_build_menu.dart
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import 'dart:io';

import 'package:dev_test/build_support.dart';
import 'package:dev_test/package.dart';
import 'package:path/path.dart';
Expand Down Expand Up @@ -151,6 +153,27 @@ void menuFlutterAppContent({required FlutterAppBuilder builder}) {
}
});
}
if (Platform.isMacOS) {
menu('ios pod', () {
var iosPath = normalize(absolute(join(appPath, 'ios')));
item('Delete podfile.lock && Pods', () async {
await File(join(iosPath, 'Podfile.lock')).delete(recursive: true);
await Directory(join(iosPath, 'Pods')).delete(recursive: true);
});
item('pod install', () async {
var shell = Shell().cd(iosPath);
await shell.run('pod install');
});
item('pod install --repo-update', () async {
var shell = Shell().cd(iosPath);
await shell.run('pod install --repo-update');
});
item('pod repo update', () async {
var shell = Shell().cd(iosPath);
await shell.run('pod repo update');
});
});
}
});
if (builder.context.buildOptions?.flavors?.isNotEmpty ?? false) {
menu('flavors', () {
Expand Down

0 comments on commit 2ee50a4

Please sign in to comment.