build.py 872 B

12345678910111213141516171819202122232425262728293031
  1. # -*- coding: utf-8 -*-
  2. import os
  3. import sys
  4. import subprocess
  5. def gen_models():
  6. subprocess.call("flutter packages pub run json_model", stderr=subprocess.STDOUT, shell=True)
  7. def gen_splash():
  8. subprocess.call("flutter pub pub run flutter_native_splash:create", stderr=subprocess.STDOUT, shell=True)
  9. if __name__ == "__main__":
  10. args = sys.argv
  11. if len(args) > 1:
  12. if args[1] == "gen":
  13. gen_models()
  14. if args[1] == "splash":
  15. gen_splash()
  16. elif args[1] == "help":
  17. print("用法:\n\
  18. gen\t\t-- 生成 json models\n\
  19. splash\t\t-- 生成 splash files\n\
  20. help\t\t-- 显示帮助文档\n\
  21. ")
  22. else:
  23. print("参数错误 请使用 help 检查可用的参数列表")
  24. else:
  25. print("参数错误 请使用 help 检查可用的参数列表")