@@ -70,6 +70,14 @@ def init(self, options, workingdir):
70
70
self ._compressed_js_path = os .path .join (self ._dst_dir , options .compressed_filename )
71
71
self ._compressed_jsc_path = os .path .join (self ._dst_dir , options .compressed_filename + "c" )
72
72
73
+ if (cocos .os_is_linux ()):
74
+ if (platform .architecture ()[0 ] == "32bit" ):
75
+ self .jsbcc_exe_path = os .path .join (self ._workingdir , "bin" , "linux" , "jsbcc_x86" )
76
+ else :
77
+ self .jsbcc_exe_path = os .path .join (self ._workingdir , "bin" , "linux" , "jsbcc_x64" )
78
+ else :
79
+ self .jsbcc_exe_path = os .path .join (self ._workingdir , "bin" , "jsbcc" )
80
+
73
81
def normalize_path_in_list (self , list ):
74
82
for i in list :
75
83
tmp = os .path .normpath (i )
@@ -118,16 +126,7 @@ def compile_js(self, jsfile, output_file):
118
126
"""
119
127
cocos .Logging .debug (MultiLanguage .get_string ('JSCOMPILE_DEBUG_COMPILE_FILE_FMT' , jsfile ))
120
128
121
- jsbcc_exe_path = ""
122
- if (cocos .os_is_linux ()):
123
- if (platform .architecture ()[0 ] == "32bit" ):
124
- jsbcc_exe_path = os .path .join (self ._workingdir , "bin" , "linux" , "jsbcc_x86" )
125
- else :
126
- jsbcc_exe_path = os .path .join (self ._workingdir , "bin" , "linux" , "jsbcc_x64" )
127
- else :
128
- jsbcc_exe_path = os .path .join (self ._workingdir , "bin" , "jsbcc" )
129
-
130
- cmd_str = "\" %s\" \" %s\" \" %s\" " % (jsbcc_exe_path , jsfile , output_file )
129
+ cmd_str = "\" %s\" \" %s\" \" %s\" " % (self .jsbcc_exe_path , jsfile , output_file )
131
130
self ._run_cmd (cmd_str )
132
131
133
132
def compress_js (self ):
@@ -252,8 +251,7 @@ def run(self, argv, dependencies):
252
251
cocos .CCPluginError .ERROR_PATH_NOT_FOUND )
253
252
254
253
# download the bin folder
255
- jsbcc_exe_path = os .path .join (self ._workingdir , "bin" , "jsbcc" )
256
- if not os .path .exists (jsbcc_exe_path ):
254
+ if not os .path .exists (self .jsbcc_exe_path ):
257
255
download_cmd_path = os .path .join (self ._workingdir , os .pardir , os .pardir )
258
256
subprocess .call ("python %s -f -r no" % (os .path .join (download_cmd_path , "download-bin.py" )), shell = True , cwd = download_cmd_path )
259
257
0 commit comments