Skip to content

Commit da9a26e

Browse files
authored
Merge pull request #463 from PatriceJiang/fix-lua-.keystore
[android] cocos run locate gradle.properties file
2 parents e08ae5a + 42c1cce commit da9a26e

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

bin/strings.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,7 @@
221221
"COMPILE_INFO_NOT_A_FILE" : "The string inputed is not a file!",
222222
"COMPILE_INFO_ANDROID_PROJPATH_FMT" : "Using %s project : %s",
223223
"COMPILE_TIP_INPUT_KEYSTORE" : "Please input the absolute/relative path of '.keystore' file:",
224+
"COMPILE_GRADLE_PROPERTIES_NOT_FOUND" : "gradle.properties not found!",
224225
"COMPILE_TIP_INPUT_ALIAS" : "Please input the alias:",
225226
"COMPILE_TIP_INPUT_KEY_PASS" : "Please input the password of key store:",
226227
"COMPILE_TIP_INPUT_ALIAS_PASS" : "Please input the password of alias:",
@@ -567,6 +568,7 @@
567568
"COMPILE_INFO_NOT_A_FILE" : "输入的路径不是一个有效的文件。",
568569
"COMPILE_INFO_ANDROID_PROJPATH_FMT" : "使用 %s 工程:%s",
569570
"COMPILE_TIP_INPUT_KEYSTORE" : "请输入 '.keystore' 文件的绝对路径(相对路径):",
571+
"COMPILE_GRADLE_PROPERTIES_NOT_FOUND" : "gradle.properties 未找到!",
570572
"COMPILE_TIP_INPUT_ALIAS" : "请输入签名文件的别名:",
571573
"COMPILE_TIP_INPUT_KEY_PASS" : "请输入签名文件的密码:",
572574
"COMPILE_TIP_INPUT_ALIAS_PASS" : "请输入别名的密码:",
@@ -912,6 +914,7 @@
912914
"COMPILE_INFO_NOT_A_FILE" : "輸入的路徑不是一個有效的檔案。",
913915
"COMPILE_INFO_ANDROID_PROJPATH_FMT" : "使用 %s 工程:%s",
914916
"COMPILE_TIP_INPUT_KEYSTORE" : "請輸入 '.keystore' 檔案的絕對路徑(相對路徑):",
917+
"COMPILE_GRADLE_PROPERTIES_NOT_FOUND" : "gradle.properties 未找到!",
915918
"COMPILE_TIP_INPUT_ALIAS" : "請輸入簽名檔案的別名:",
916919
"COMPILE_TIP_INPUT_KEY_PASS" : "請輸入簽名檔案的密碼:",
917920
"COMPILE_TIP_INPUT_ALIAS_PASS" : "請輸入別名的密碼:",

plugins/plugin_compile/build_android.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,13 @@ def __init__(self, verbose, app_android_root, no_res, proj_obj, mode, build_type
5454
# check environment variable
5555
self.sdk_root = cocos.check_environment_variable('ANDROID_SDK_ROOT')
5656
self.ant_root = None
57-
self.sign_prop_file = os.path.join(self.app_android_root, 'app', "gradle.properties")
58-
57+
if os.path.exists(os.path.join(self.app_android_root, "gradle.properties")):
58+
self.sign_prop_file = os.path.join(self.app_android_root, "gradle.properties")
59+
elif os.path.exists(os.path.join(self.app_android_root, 'app', "gradle.properties")):
60+
self.sign_prop_file = os.path.join(self.app_android_root, 'app', "gradle.properties")
61+
else:
62+
raise cocos.CCPluginError(MultiLanguage.get_string('COMPILE_GRADLE_PROPERTIES_NOT_FOUND'),
63+
cocos.CCPluginError.ERROR_PATH_NOT_FOUND)
5964
self._parse_cfg()
6065

6166
def _run_cmd(self, command, cwd=None):

0 commit comments

Comments
 (0)