|
10 | 10 | import tarfile
|
11 | 11 | import zipfile
|
12 | 12 |
|
| 13 | +from subprocess import call |
| 14 | + |
13 | 15 | steps = ['nw', 'chromedriver', 'symbol', 'others']
|
14 | 16 | ################################
|
15 | 17 | # Parse command line args
|
|
31 | 33 | nw_ver = None # x.xx
|
32 | 34 | dist_dir = None # .../out/Release/dist
|
33 | 35 |
|
| 36 | +is_headers_ok = False # record whether nw-headers generated |
| 37 | + |
34 | 38 | step = args.step
|
35 | 39 | skip = args.skip
|
36 | 40 | binaries_location = args.path
|
@@ -203,8 +207,20 @@ def generate_target_others(platform_name, arch, version):
|
203 | 207 | target['compress'] = None
|
204 | 208 | if platform_name == 'win':
|
205 | 209 | target['input'] = ['nw.exp', 'nw.lib']
|
206 |
| - elif platform_name == 'osx' : |
| 210 | + elif platform_name == 'linux' : |
207 | 211 | 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' |
208 | 224 | else:
|
209 | 225 | target['input'] = []
|
210 | 226 | return target
|
@@ -266,6 +282,14 @@ def make_packages(targets):
|
266 | 282 |
|
267 | 283 | # now let's do it
|
268 | 284 | 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) |
269 | 293 | for t in targets:
|
270 | 294 | if len(t['input']) == 0:
|
271 | 295 | continue
|
|
0 commit comments