Skip to content

Commit a8a6f43

Browse files
xueeinsteinghostoy
authored andcommitted
update package tool, support upload nw headers file
1 parent 4175cb5 commit a8a6f43

File tree

2 files changed

+26
-2
lines changed

2 files changed

+26
-2
lines changed

tools/make-nw-headers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ def update_uvh(tmp_dir, header_files):
2222
nw_root = os.path.normpath(os.path.join(script_dir, os.pardir))
2323
project_root = os.path.normpath(os.path.join(nw_root, os.pardir, os.pardir))
2424
third_party_dir = os.path.normpath(os.path.join(project_root, 'third_party'))
25-
tmp_dir = tmp_dir = os.path.normpath(os.path.join(nw_root, 'tmp'))
25+
tmp_dir = os.path.normpath(os.path.join(nw_root, 'tmp'))
2626

2727
nw_version = getnwversion.nw_version
2828

tools/package_binaries.py

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
import tarfile
1111
import zipfile
1212

13+
from subprocess import call
14+
1315
steps = ['nw', 'chromedriver', 'symbol', 'others']
1416
################################
1517
# Parse command line args
@@ -31,6 +33,8 @@
3133
nw_ver = None # x.xx
3234
dist_dir = None # .../out/Release/dist
3335

36+
is_headers_ok = False # record whether nw-headers generated
37+
3438
step = args.step
3539
skip = args.skip
3640
binaries_location = args.path
@@ -203,8 +207,20 @@ def generate_target_others(platform_name, arch, version):
203207
target['compress'] = None
204208
if platform_name == 'win':
205209
target['input'] = ['nw.exp', 'nw.lib']
206-
elif platform_name == 'osx' :
210+
elif platform_name == 'linux' :
207211
target['input'] = []
212+
# here , call make-nw-headers.py to generate nw headers
213+
# after generated, move to dist_dir
214+
make_nw_header = os.path.join(os.path.dirname(__file__), \
215+
'make-nw-headers.py')
216+
print make_nw_header
217+
res = call(['python', make_nw_header])
218+
if res == 0:
219+
global is_headers_ok
220+
is_headers_ok = True
221+
print 'nw-headers generated'
222+
else:
223+
print 'nw-headers generate failed'
208224
else:
209225
target['input'] = []
210226
return target
@@ -266,6 +282,14 @@ def make_packages(targets):
266282

267283
# now let's do it
268284
os.mkdir(dist_dir)
285+
# here check whether nw headers generated
286+
# if generated, mv to dist_dir
287+
if is_headers_ok:
288+
nw_headers_name = 'nw-headers-v' + nw_ver + '.tar.gz'
289+
nw_headers_path = os.path.join(os.path.dirname(__file__), \
290+
os.pardir, 'tmp', nw_headers_name)
291+
print 'Moving "' + nw_headers_name + '"'
292+
shutil.move(nw_headers_path, dist_dir)
269293
for t in targets:
270294
if len(t['input']) == 0:
271295
continue

0 commit comments

Comments
 (0)