- def package(self, source, cert=None, pkg_type=None, conf=None):
- """SDK CLI package command"""
-
- if cert is None: cert = 'ABS'
- if pkg_type is None: pkg_type = 'tpk'
- if conf is None: conf = 'Debug'
-
- final_app = ''
- main_args = ['-t', pkg_type, '-s', cert]
- out = '' #logfile
-
- if conf == 'Release' :
- main_args.extend(['--strip', 'on'])
-
- for i, x in enumerate(source.project_list):
- if x['type'] == 'app':
- out = '%s\n%s' % (out, \
- self._run('package', main_args + ['--',os.path.join(x['path'],conf)]))
- try:
- final_app = list_files(os.path.join(x['path'], conf), ext='tpk')[0]
- except:
- raise LocalError('TPK file not generated for %s.' % x['APPNAME'])
- x['out_package'] = final_app
- elif x['type'] == 'sharedLib':
- self._package_sharedlib(x['path'], conf, x['APPNAME'])
- x['out_package'] = list_files(os.path.join(x['path'], conf), ext='zip')[0]
- else:
- raise LocalError('Not supported project type %s' % x['type'])
-
- if source.b_multi == True:
- extra_args=[]
- print 'THIS IS MULTI PROJECT'
- for i, x in enumerate(source.project_list):
- if x['out_package'] != final_app and x['type'] == 'app':
- extra_args.extend(['-r', x['out_package']])
- elif x['type'] == 'sharedLib':
- extra_args.extend(['-r', x['out_package']])
-
- extra_args.extend(['--', final_app])
- out = self._run('package', main_args + extra_args)
-
- #TODO: signature validation check failed : Invalid file reference. An unsigned file was found.
- print 'Packaging final step again!'
- out = self._run('package', main_args + ['--', final_app])
-
- #Copy tpk to output directory
- shutil.copy(final_app, source.output_dir)
-
- def package_new(self, source, cert=None, pkg_type=None, conf=None, manual_strip=False):