contants.py 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  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. def get_notify_url():
  21. if isTestEnvironment:
  22. return SDK_NOTIFY_TEST_URL
  23. else:
  24. return SDK_NOTIFY_URL
  25. def get_sp_notify_url():
  26. if isTestEnvironment:
  27. return SDK_SP_NOTIFY_TEST_URL
  28. else:
  29. return SDK_SP_NOTIFY_URL
  30. def get_out_put_dir():
  31. return OUT_PUT_DIR
  32. def get_local_ip():
  33. ip = os.popen("/sbin/ifconfig | grep 'inet addr' | awk '{print $2}'").read()
  34. ip = ip[ip.find(':') + 1:ip.find('\n')]
  35. return ip
  36. def isTestEnvironment():
  37. if get_local_ip() == "10.255.3.8":
  38. return True
  39. else:
  40. return False