mirror of
https://github.com/lollipopkit/flutter_server_box.git
synced 2025-12-18 15:54:35 +01:00
New make.dart
This commit is contained in:
@@ -2,9 +2,9 @@
|
||||
|
||||
class BuildData {
|
||||
static const String name = "ServerBox";
|
||||
static const int build = 112;
|
||||
static const int build = 113;
|
||||
static const String engine =
|
||||
"Flutter 2.10.4 • channel stable • https://github.com/flutter/flutter.git\nFramework • revision c860cba910 (3 weeks ago) • 2022-03-25 00:23:12 -0500\nEngine • revision 57d3bac3dd\nTools • Dart 2.16.2 • DevTools 2.9.2\n";
|
||||
static const String buildAt = "2022-04-15 19:07:21.221650";
|
||||
static const int modifications = 7;
|
||||
static const String buildAt = "2022-04-15 19:46:15.224203";
|
||||
static const int modifications = 2;
|
||||
}
|
||||
|
||||
29
make.dart
29
make.dart
@@ -83,7 +83,6 @@ void flutterRun(String? mode) {
|
||||
}
|
||||
|
||||
Future<void> flutterBuild(String source, String target, bool isAndroid) async {
|
||||
final startTime = DateTime.now();
|
||||
final build = await getGitCommitCount();
|
||||
|
||||
final args = [
|
||||
@@ -112,14 +111,12 @@ Future<void> flutterBuild(String source, String target, bool isAndroid) async {
|
||||
}
|
||||
}
|
||||
|
||||
print('Done.');
|
||||
print('Done.\n');
|
||||
} else {
|
||||
print(buildResult.stderr.toString());
|
||||
print('\nBuild failed with exit code $exitCode');
|
||||
exit(exitCode);
|
||||
}
|
||||
final endTime = DateTime.now();
|
||||
print('Spent time: ${endTime.difference(startTime).toString()}');
|
||||
}
|
||||
|
||||
Future<void> flutterBuildIOS() async {
|
||||
@@ -144,16 +141,28 @@ void main(List<String> args) async {
|
||||
case 'run':
|
||||
return flutterRun(args.length == 2 ? args[1] : null);
|
||||
case 'build':
|
||||
if (args.length > 1) {
|
||||
final stopwatch = Stopwatch()..start();
|
||||
final buildFunc = [flutterBuildIOS, flutterBuildAndroid];
|
||||
await updateBuildData();
|
||||
dartFormat();
|
||||
if (args[1] == 'android' || args[1] == 'harmony') {
|
||||
return flutterBuildAndroid();
|
||||
} else if (args[1] == 'ios') {
|
||||
return flutterBuildIOS();
|
||||
if (args.length > 1) {
|
||||
final platform = args[1];
|
||||
switch (platform) {
|
||||
case 'ios':
|
||||
buildFunc.remove(flutterBuildIOS);
|
||||
break;
|
||||
case 'android':
|
||||
buildFunc.remove(flutterBuildAndroid);
|
||||
break;
|
||||
default:
|
||||
print('Unknown platform: $platform');
|
||||
exit(1);
|
||||
}
|
||||
print('unkonwn build arg: ${args[1]}');
|
||||
}
|
||||
for (final func in buildFunc) {
|
||||
await func();
|
||||
}
|
||||
print('Build finished in ${stopwatch.elapsed}');
|
||||
return;
|
||||
default:
|
||||
print('Unsupported command: $command');
|
||||
|
||||
Reference in New Issue
Block a user