10
10
import tarfile
11
11
import zipfile
12
12
13
- steps = ['nw' , 'chromedriver' , 'symbol' ]
13
+ steps = ['nw' , 'chromedriver' , 'symbol' , 'others' ]
14
14
################################
15
15
# Parse command line args
16
16
parser = argparse .ArgumentParser (description = 'Package nw binaries.' )
@@ -180,6 +180,16 @@ def generate_target_symbols(platform_name, arch, version):
180
180
target ['folder' ] = True
181
181
return target
182
182
183
+ def generate_target_others (platform_name , arch , version ):
184
+ target = {}
185
+ target ['output' ] = ''
186
+ target ['compress' ] = None
187
+ if platform_name == 'win' :
188
+ target ['input' ] = ['nw.exp' , 'nw.lib' ]
189
+ else :
190
+ target ['input' ] = []
191
+ return target
192
+
183
193
184
194
################################
185
195
# Make packages
@@ -219,7 +229,6 @@ def compress(from_dir, to_dir, fname, compress):
219
229
220
230
221
231
def make_packages (targets ):
222
-
223
232
# check file existance
224
233
for t in targets :
225
234
for f in t ['input' ]:
@@ -239,8 +248,16 @@ def make_packages(targets):
239
248
# now let's do it
240
249
os .mkdir (dist_dir )
241
250
for t in targets :
242
- print 'Making "' + t ['output' ] + '.' + t ['compress' ] + '"'
243
- if (t .has_key ('folder' ) and t ['folder' ] == True ) or len (t ['input' ]) > 1 :
251
+ if t ['compress' ] == None :
252
+ if t ['output' ] != '' :
253
+ os .mkdir (dist_dir + t ['output' ])
254
+ for f in t ['input' ]:
255
+ src = os .path .join (binaries_location , f )
256
+ dest = os .path .join (dist_dir + t ['output' ], f )
257
+ print "Copying " + f
258
+ shutil .copy (src , dest )
259
+ elif (t .has_key ('folder' ) and t ['folder' ] == True ) or len (t ['input' ]) > 1 :
260
+ print 'Making "' + t ['output' ] + '.' + t ['compress' ] + '"'
244
261
# copy files into a folder then pack
245
262
folder = os .path .join (dist_dir , t ['output' ])
246
263
os .mkdir (folder )
@@ -256,13 +273,15 @@ def make_packages(targets):
256
273
shutil .rmtree (folder )
257
274
else :
258
275
# single file
276
+ print 'Making "' + t ['output' ] + '.' + t ['compress' ] + '"'
259
277
compress (binaries_location , dist_dir , t ['input' ][0 ], t ['compress' ])
260
278
261
279
# must be aligned with steps
262
280
generators = {}
263
281
generators ['nw' ] = generate_target_nw
264
282
generators ['chromedriver' ] = generate_target_chromedriver
265
283
generators ['symbol' ] = generate_target_symbols
284
+ generators ['others' ] = generate_target_others
266
285
################################
267
286
# Process targets
268
287
targets = []
0 commit comments