Skip to content

Commit

Permalink
Merging from dart3a
Browse files Browse the repository at this point in the history
  • Loading branch information
alextekartik committed Feb 1, 2024
2 parents a7daef5 + 2ee50a4 commit f6aa98d
Show file tree
Hide file tree
Showing 2 changed files with 72 additions and 32 deletions.
10 changes: 8 additions & 2 deletions packages/build_flutter/lib/src/app_builder.dart
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,10 @@ class FlutterAppFlavorBuilder {
await build('appbundle');
}

Future<void> buildIosIpa() async {
await build('ipa');
}

Future<void> buildAndroidAndCopy() async {
await buildAndroidApk();
await buildAndroidAab();
Expand Down Expand Up @@ -244,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');
}
94 changes: 64 additions & 30 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 @@ -38,39 +40,50 @@ void menuFlutterAppFlavorContent(
item('clean', () async {
await flavorBuilder.clean();
});
item('build aab', () async {
await androidReady;
await flavorBuilder.buildAndroidAab();
});
item('build apk', () async {
await androidReady;
await flavorBuilder.buildAndroidApk();
});
item('sha1', () async {
await androidReady;
await printApkSha1();
menu('ios', () {
item('build ipa', () async {
await flavorBuilder.buildIosIpa();
});
item('clean, build ipa', () async {
await flavorBuilder.clean();
await flavorBuilder.buildIosIpa();
});
});
item('apkinfo', () async {
await androidReady;
menu('android', () {
item('build aab', () async {
await androidReady;
await flavorBuilder.buildAndroidAab();
});
item('build apk', () async {
await androidReady;
await flavorBuilder.buildAndroidApk();
});
item('sha1', () async {
await androidReady;
await printApkSha1();
});
item('apkinfo', () async {
await androidReady;

write('apkinfo: ${await flavorBuilder.getApkInfo()}');
write(
'apkinfo: ${jsonEncode((await flavorBuilder.getApkInfo()).toMap())}');
});
item('build aab & apk and copy', () async {
await androidReady;
await flavorBuilder.buildAndroidAndCopy();
});
item('clean, build aab & apk and copy', () async {
await androidReady;
await flavorBuilder.clean();
await flavorBuilder.buildAndroidAndCopy();
});
write('apkinfo: ${await flavorBuilder.getApkInfo()}');
write(
'apkinfo: ${jsonEncode((await flavorBuilder.getApkInfo()).toMap())}');
});
item('build aab & apk and copy', () async {
await androidReady;
await flavorBuilder.buildAndroidAndCopy();
});
item('clean, build aab & apk and copy', () async {
await androidReady;
await flavorBuilder.clean();
await flavorBuilder.buildAndroidAndCopy();
});

item('copy aab & apk', () async {
await androidReady;
await flavorBuilder.copyAndroid();
await printApkSha1();
item('copy aab & apk', () async {
await androidReady;
await flavorBuilder.copyAndroid();
await printApkSha1();
});
});
});
}
Expand Down Expand Up @@ -140,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 f6aa98d

Please sign in to comment.