AppFlowy/frontend/scripts/flutter_release_build/build_flowy.dart
2023-05-04 20:05:23 +08:00

34 lines
1.1 KiB
Dart

import 'dart:io';
part 'tool.dart';
const excludeTagBegin = 'BEGIN: EXCLUDE_IN_RELEASE';
const excludeTagEnd = 'END: EXCLUDE_IN_RELEASE';
Future<void> main(List<String> args) async {
const help = '''
A build script that modifies build assets before building the release version of AppFlowy.
args[0]: The directory that contains the AppFlowy git repository. Should be the parent to appflowy_flutter. (absolute path)
args[1]: The appflowy version to be built (github ref_name).
''';
const numArgs = 2;
assert(args.length == numArgs,
'Expected ${numArgs}, got ${args.length}. Read the following for instructions about how to use this script.\n\n$help');
if (args[0] == '-h' || args[0] == '--help') {
stdout.write(help);
stdout.flush();
}
final repositoryRoot = Directory(args[0]);
assert(await repositoryRoot.exists(),
'$repositoryRoot is an invalid directory. Please try again with a valid directory.\n\n$help');
final appVersion = args[1];
String? arch;
if (args.length > 2) arch = args[2];
await _BuildTool(
repositoryRoot: repositoryRoot.path,
appVersion: appVersion,
arch: arch,
).run();
}