From: hyokeun Date: Wed, 22 Jun 2016 10:27:28 +0000 (+0900) Subject: Support Build Configuration, Strip mode on Release X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d9946cfe881ad749f8644e37b4f0dfc256ef4007;p=scm%2Fmeta%2Fabs.git Support Build Configuration, Strip mode on Release Change-Id: I22c891732be9d513a50d5753937cf818b2422158 --- diff --git a/README b/README index d3aaaab..0bc374b 100644 --- a/README +++ b/README @@ -4,7 +4,7 @@ ==== build command ==== usage: abs build [-h] [-w WORKSPACE] [-r ROOTSTRAP] [-a ARCH] [-t TYPE] - [-s SIGN] [--sdkpath SDKPATH] + [-s CERT] [-c CONF] [--sdkpath SDKPATH] optional arguments: -h, --help show this help message and exit @@ -14,7 +14,8 @@ optional arguments: (ex, mobile-3.0-device.core) rootstrap name -a ARCH, --arch ARCH (x86|arm) Architecture to build -t TYPE, --type TYPE (tpk|wgt) Packaging type - -s SIGN, --sign SIGN (ex, ABS) Signing profile name + -s CERT, --cert CERT (ex, ABS) Signing profile name + -c CONF, --conf CONF (Debug|Release) Build configuration --sdkpath SDKPATH Specify Tizen SDK installation root (one time init). ex) /home/yours/tizen-sdk/ diff --git a/abs b/abs index 48d3be6..a0d43be 100644 --- a/abs +++ b/abs @@ -337,7 +337,7 @@ class Sdk(object): 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) @@ -357,7 +357,7 @@ class Sdk(object): 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): @@ -370,21 +370,24 @@ class Sdk(object): 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: @@ -397,6 +400,7 @@ class Sdk(object): 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': @@ -405,11 +409,11 @@ class Sdk(object): 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) @@ -494,6 +498,8 @@ def argument_parsing(argv): 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/') @@ -506,8 +512,8 @@ def build_main(args): 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."""