myZipFile.close()
return rsrc_zip
- def build_native(self, source, rootstrap=None, arch=None):
+ def build_native(self, source, rootstrap=None, arch=None, conf='Release'):
"""SDK CLI build command"""
_rootstrap = self.check_rootstrap(rootstrap)
if arch == 'arm': rootstrap = rootstrap.replace('emulator', 'device')
for x in source.project_list:
- out = self._run('build-native', ['-r', rootstrap, '-a', arch, '--' , x['path']], checker=True)
+ out = self._run('build-native', ['-r', rootstrap, '-a', arch, '-C', conf, '--' , x['path']], checker=True)
logpath = os.path.join(source.output_dir, \
'build_%s_%s' % (rootstrap, os.path.basename(x['path'])))
if not os.path.isdir(source.output_dir):
lf.write(out)
raise LocalError(ret)
- def package(self, source, cert=None, type=None, conf=None):
+ def package(self, source, cert=None, pkg_type=None, conf=None):
"""SDK CLI package command"""
if cert is None: cert = 'ABS'
- if type is None: type = 'tpk'
+ if pkg_type is None: pkg_type = 'tpk'
if conf is None: conf = 'Debug'
final_app = ''
- extra_args = ['-t', type, '-s', cert]
+ 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',['-t',type,'-s',cert,'--',os.path.join(x['path'],conf)]))
+ 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('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']])
extra_args.extend(['--', final_app])
- out = self._run('package', extra_args)
+ 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', ['-t', type, '-s', cert, '--', final_app])
+ out = self._run('package', main_args + ['--', final_app])
#Copy tpk to output directory
shutil.copy(final_app, source.output_dir)
help='(tpk|wgt) Packaging type')
build.add_argument('-s', '--cert', action='store', dest='cert', \
help='(ex, ABS) Certificate profile name')
+ build.add_argument('-c', '--conf', action='store',default='Release', dest='conf', \
+ help='(Debug|Release) Build configuration')
build.add_argument('--sdkpath', action='store', dest='sdkpath', \
help='Specify Tizen SDK installation root (one time init).' \
' ex) /home/yours/tizen-sdk/')
my_source = Source(src=args.workspace)
my_sdk = Sdk(sdkpath=args.sdkpath)
my_sdk.clean(my_source)
- my_sdk.build_native(my_source, rootstrap=args.rootstrap, arch=args.arch)
- my_sdk.package(my_source, type=args.type, cert=args.cert)
+ my_sdk.build_native(my_source, rootstrap=args.rootstrap, arch=args.arch, conf=args.conf)
+ my_sdk.package(my_source, pkg_type=args.type, cert=args.cert, conf=args.conf)
def main(argv):
"""Script entry point."""