Skip to content

Commit 633e3d5

Browse files
committed
Merge pull request nwjs#1976 from libm/nw10
[Win] Move nw.exp nw.lib out of the package
2 parents 7015ce3 + 63d9e20 commit 633e3d5

File tree

1 file changed

+23
-4
lines changed

1 file changed

+23
-4
lines changed

tools/package_binaries.py

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
import tarfile
1111
import zipfile
1212

13-
steps = ['nw', 'chromedriver', 'symbol']
13+
steps = ['nw', 'chromedriver', 'symbol', 'others']
1414
################################
1515
# Parse command line args
1616
parser = argparse.ArgumentParser(description='Package nw binaries.')
@@ -180,6 +180,16 @@ def generate_target_symbols(platform_name, arch, version):
180180
target['folder'] = True
181181
return target
182182

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+
183193

184194
################################
185195
# Make packages
@@ -219,7 +229,6 @@ def compress(from_dir, to_dir, fname, compress):
219229

220230

221231
def make_packages(targets):
222-
223232
# check file existance
224233
for t in targets:
225234
for f in t['input']:
@@ -239,8 +248,16 @@ def make_packages(targets):
239248
# now let's do it
240249
os.mkdir(dist_dir)
241250
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'] + '"'
244261
# copy files into a folder then pack
245262
folder = os.path.join(dist_dir, t['output'])
246263
os.mkdir(folder)
@@ -256,13 +273,15 @@ def make_packages(targets):
256273
shutil.rmtree(folder)
257274
else:
258275
# single file
276+
print 'Making "' + t['output'] + '.' + t['compress'] + '"'
259277
compress(binaries_location, dist_dir, t['input'][0], t['compress'])
260278

261279
# must be aligned with steps
262280
generators = {}
263281
generators['nw'] = generate_target_nw
264282
generators['chromedriver'] = generate_target_chromedriver
265283
generators['symbol'] = generate_target_symbols
284+
generators['others'] = generate_target_others
266285
################################
267286
# Process targets
268287
targets = []

0 commit comments

Comments
 (0)