修改打包命令

hmxc
张萌 3 years ago
parent cf1408c245
commit 63e3e2a72b

@ -1,14 +1,21 @@
// Flutter imports: // Flutter imports:
// Project imports:
import 'package:aku_community_manager/provider/app_provider.dart';
import 'package:aku_community_manager/provider/message_provider.dart'; import 'package:aku_community_manager/provider/message_provider.dart';
import 'package:aku_community_manager/provider/user_provider.dart';
import 'package:aku_community_manager/style/apptheme.dart';
import 'package:aku_community_manager/tools/user_tool.dart'; import 'package:aku_community_manager/tools/user_tool.dart';
import 'package:aku_community_manager/ui/splash/splash_page.dart';
import 'package:aku_community_manager/utils/dev_util.dart';
import 'package:aku_community_manager/utils/jpush_message_parse.dart';
import 'package:aku_community_manager/utils/websocket/fier_dialog.dart'; import 'package:aku_community_manager/utils/websocket/fier_dialog.dart';
import 'package:aku_community_manager/utils/websocket/web_socket_util.dart'; import 'package:aku_community_manager/utils/websocket/web_socket_util.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
// Package imports: // Package imports:
import 'package:bot_toast/bot_toast.dart'; import 'package:bot_toast/bot_toast.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
import 'package:flutter_localizations/flutter_localizations.dart'; import 'package:flutter_localizations/flutter_localizations.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart'; import 'package:get/get.dart';
@ -16,19 +23,11 @@ import 'package:jpush_flutter/jpush_flutter.dart';
import 'package:power_logger/power_logger.dart'; import 'package:power_logger/power_logger.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
// Project imports:
import 'package:aku_community_manager/provider/app_provider.dart';
import 'package:aku_community_manager/provider/user_provider.dart';
import 'package:aku_community_manager/style/apptheme.dart';
import 'package:aku_community_manager/ui/splash/splash_page.dart';
import 'package:aku_community_manager/utils/dev_util.dart';
import 'package:aku_community_manager/utils/jpush_message_parse.dart';
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
void main() async { void main() async {
WidgetsFlutterBinding.ensureInitialized(); WidgetsFlutterBinding.ensureInitialized();
JPush jpush = new JPush(); JPush jpush = new JPush();
const isProduct = const bool.fromEnvironment('ISPRODUCT'); const isProduct =
const bool.fromEnvironment('ISPRODUCT', defaultValue: false);
DevUtil.setDev(!isProduct); DevUtil.setDev(!isProduct);
WebSocketUtil().initWebSocket( WebSocketUtil().initWebSocket(
// heartDuration: Duration(seconds: 5), // heartDuration: Duration(seconds: 5),

@ -61,7 +61,7 @@ dependencies:
#瀑布流 #瀑布流
waterfall_flow: ^3.0.1 waterfall_flow: ^3.0.1
power_logger: ^1.0.1-nullsafety.1 power_logger: ^1.2.1
logger: ^1.0.0 logger: ^1.0.0
hive: ^2.0.4 hive: ^2.0.4

@ -9,6 +9,11 @@ class Config {
static String get buildPath => static String get buildPath =>
'./build/app/outputs/flutter-apk/app-release.apk'; './build/app/outputs/flutter-apk/app-release.apk';
/// ///
static String get buildDir => './build/app/outputs/flutter-apk'; static String get apkDevDir =>
'/users/zhangmeng/team/bee/app/aku_community_manager/dev';
///aku_community_manager
static String get apkDir =>
'/users/zhangmeng/team/bee/app/aku_community_manager/release';
} }

@ -37,9 +37,11 @@ buildApk() async {
]); ]);
String date = DateUtil.formatDate(DateTime.now(), format: 'yy_MM_dd_HH_mm'); String date = DateUtil.formatDate(DateTime.now(), format: 'yy_MM_dd_HH_mm');
String version = await getVersion(); String version = await getVersion();
await runAsync('rm', arguments: ['-rf', Config.apkDir]);
await runAsync('mkdir', arguments: ['-p', Config.apkDir]);
await runAsync('mv', arguments: [ await runAsync('mv', arguments: [
Config.buildPath, Config.buildPath,
'${Config.buildDir}/${Config.packageName}_${version}_release_$date.apk' '${Config.apkDir}/${Config.packageName}_${version}_release_$date.apk'
]); ]);
} }
@ -55,9 +57,11 @@ buildApkDev() async {
]); ]);
String date = DateUtil.formatDate(DateTime.now(), format: 'yy_MM_dd_HH_mm'); String date = DateUtil.formatDate(DateTime.now(), format: 'yy_MM_dd_HH_mm');
String version = await getVersion(); String version = await getVersion();
await runAsync('rm', arguments: ['-rf', Config.apkDevDir]);
await runAsync('mkdir', arguments: ['-p', Config.apkDevDir]);
await runAsync('mv', arguments: [ await runAsync('mv', arguments: [
Config.buildPath, Config.buildPath,
'${Config.buildDir}/${Config.packageName}_${version}_beta_$date.apk' '${Config.apkDevDir}/${Config.packageName}_${version}_beta_$date.apk'
]); ]);
} }

Loading…
Cancel
Save