mirror of
https://github.com/AppFlowy-IO/AppFlowy.git
synced 2024-08-30 18:12:39 +00:00
34 lines
1.1 KiB
Dart
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();
|
|
}
|