build.py 929 B

12345678910111213141516171819202122232425262728293031323334
  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. exit()
  15. if args[1] == "splash":
  16. gen_splash()
  17. exit()
  18. elif args[1] == "help":
  19. print("用法:\n\
  20. gen\t\t-- 生成 json models\n\
  21. splash\t\t-- 生成 splash files\n\
  22. help\t\t-- 显示帮助文档\n\
  23. ")
  24. exit()
  25. else:
  26. print("参数错误 请使用 help 检查可用的参数列表")
  27. else:
  28. print("参数错误 请使用 help 检查可用的参数列表")