build_flowy.dart 1.0 KB

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