contants.py 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  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. OUT_PUT_DIR = "/opt/new_packing_tool/output"
  9. SP_OUT_PUT_DIR = "/Users/kaiweicai/Documents/Project/PackKit/YYXXPackKit/sp_output"
  10. # 打包日志输出目录,正式打包机需改为"/opt/package_log"
  11. SDK_LOG = "/opt/package_log"
  12. IS_USE_AAPT2 = True
  13. IS_USE_APK_V2_SIGN = False
  14. # 本地java目录,正式打包机需改为对应绝对路径
  15. KEY_TOOL_PATH = "/usr/java/jdk-12.0.1/bin/keytool"
  16. JAR_SIGNER_TOOL_PATH = "/usr/java/jdk-12.0.1/bin/jarsigner"
  17. JAVAC_PATH = "/usr/java/jdk-12.0.1/bin/javac"
  18. ZIPALIGN_PATH = "/opt/mixsdk/tool/Android/Sdk/build-tools/28.0.3/zipalign"
  19. SDK_CHANNEL_PATH = "/opt/mixsdk/script2.0/V2/channel"
  20. SDK_BASE_ABS_PATH = "/opt/mixsdk/script2.0"
  21. def get_notify_url():
  22. if isTestEnvironment:
  23. return SDK_NOTIFY_TEST_URL
  24. else:
  25. return SDK_NOTIFY_URL
  26. def get_sp_notify_url():
  27. if isTestEnvironment:
  28. return SDK_SP_NOTIFY_TEST_URL
  29. else:
  30. return SDK_SP_NOTIFY_URL
  31. def get_out_put_dir():
  32. return OUT_PUT_DIR
  33. def get_local_ip():
  34. ip = os.popen("/sbin/ifconfig | grep 'inet addr' | awk '{print $2}'").read()
  35. ip = ip[ip.find(':') + 1:ip.find('\n')]
  36. return ip
  37. def isTestEnvironment():
  38. if get_local_ip() == "10.255.3.8":
  39. return True
  40. else:
  41. return False