build_flowy.dart 1.1 KB

123456789101112131415161718192021222324252627282930313233
  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. String? arch;
  23. if (args.length > 2) arch = args[2];
  24. await _BuildTool(
  25. repositoryRoot: repositoryRoot.path,
  26. appVersion: appVersion,
  27. arch: arch,
  28. ).run();
  29. }