contants.py 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. import os
  2. SDK_NOTIFY_URL = "gamesdk.yyxxgame.com:9001/api/update_gcp_resource_msg/run"
  3. SDK_SP_NOTIFY_URL = "gamesdk.yyxxgame.com:9001/api/update_sp_resource_msg/run"
  4. SDK_NOTIFY_TEST_URL = "testgamesdk.yyxxgame.com/api/update_gcp_resource_msg/run"
  5. SDK_SP_NOTIFY_TEST_URL = "testgamesdk.yyxxgame.com/api/update_sp_resource_msg/run"
  6. # 本地输出目录,正式打包机需改为"/opt/new_packing_tool/output"
  7. OUT_PUT_DIR = "/Users/kaiweicai/Documents/Project/PackKit/YYXXPackKit/output"
  8. SP_OUT_PUT_DIR = "/Users/kaiweicai/Documents/Project/PackKit/YYXXPackKit/sp_output"
  9. # 打包日志输出目录,正式打包机需改为"/opt/package_log"
  10. SDK_LOG = "/Users/kaiweicai/Documents/Project/PackKit/YYXXPackKit/package_log"
  11. IS_USE_AAPT2 = True
  12. IS_USE_APK_V2_SIGN = False
  13. # 本地java目录,正式打包机需改为对应绝对路径
  14. KEY_TOOL_PATH = "/Library/Java/JavaVirtualMachines/jdk-14.0.2.jdk/Contents/Home/bin/keytool"
  15. JAR_SIGNER_TOOL_PATH = "/Library/Java/JavaVirtualMachines/jdk-14.0.2.jdk/Contents/Home/bin/jarsigner"
  16. def get_notify_url():
  17. if isTestEnvironment:
  18. return SDK_NOTIFY_TEST_URL
  19. else:
  20. return SDK_NOTIFY_URL
  21. def get_sp_notify_url():
  22. if isTestEnvironment:
  23. return SDK_SP_NOTIFY_TEST_URL
  24. else:
  25. return SDK_SP_NOTIFY_URL
  26. def get_out_put_dir():
  27. return OUT_PUT_DIR
  28. def get_local_ip():
  29. ip = os.popen("/sbin/ifconfig | grep 'inet addr' | awk '{print $2}'").read()
  30. ip = ip[ip.find(':') + 1:ip.find('\n')]
  31. return ip
  32. def isTestEnvironment():
  33. '''
  34. if get_local_ip() == "10.255.3.8":
  35. return True
  36. else:
  37. return False
  38. '''
  39. return True