添加 打包脚本控制

hmxc
张萌 4 years ago
parent 1bc4cf982f
commit 41192d6a96

@ -28,7 +28,8 @@ void main() async {
// await AmapCore.init(''); // await AmapCore.init('');
// await AmapLocation.instance.init(iosKey: ''); // await AmapLocation.instance.init(iosKey: '');
JPush jpush = new JPush(); JPush jpush = new JPush();
DevUtil.setDev(true); const isProduct = const bool.fromEnvironment('ISPRODUCT');
DevUtil.setDev(!isProduct);
jpush.addEventHandler( jpush.addEventHandler(
// //
onReceiveNotification: (Map<String, dynamic> message) async { onReceiveNotification: (Map<String, dynamic> message) async {

@ -13,3 +13,20 @@ build() {
@Task() @Task()
clean() => defaultClean(); clean() => defaultClean();
@Task()
buildApk() async {
await runAsync('flutter', arguments: [
'build',
'apk',
'--target-platform=android-arm64',
'--dart-define',
'ISPRODUCT=true'
]);
}
@Task()
buildIos() async {
await runAsync('flutter',
arguments: ['build', 'ios', '--dart-define', 'BUILD_TYPE=PRODUCT']);
}

Loading…
Cancel
Save