internal_package_name = prop.get('sdk_package')
if app_type == 'wgt':
- internal_package_name = prop.get('sdk_web_name')
+ internal_package_name = '%s' % data.get('obs_package')
for fn in os.listdir(tizen_studio.builddir):
if app_type == 'tpk':
found_archs.extend(l)
break
elif app_type == 'wgt':
- full_arch = []
- for l in archs_lookup:
- full_arch.extend(l)
- mtch = re.search(r'(.*)-(%s)(?<!-debug).wgt' % '|'.join(full_arch), fn)
- if mtch and mtch.groups() and len(mtch.groups()) == 2:
+ if True:
+ mtch = re.search(r'(.*).wgt', fn)
+ if mtch:
+ _app_version = prop.get('sdk_version')
+ os.rename(os.path.join(tizen_studio.builddir, fn), \
+ os.path.join(tizen_studio.builddir, "%s-%s.wgt" % (internal_package_name, _app_version)))
+ else:
+ full_arch = []
for l in archs_lookup:
- _a = mtch.groups()[1]
- if _a in l:
- found_archs.extend(l)
- _app_name = prop.get('sdk_web_name')
- _app_arch = _a
- _app_version = prop.get('sdk_version')
- #Append version info in filename
- os.rename(os.path.join(tizen_studio.builddir, fn), \
- os.path.join(tizen_studio.builddir, "%s-%s-%s.wgt" % (_app_name, _app_version, _app_arch)))
- #fn.replace(_a, '%s-%s' % (prop.get('sdk_version'), _a))))
- break
+ full_arch.extend(l)
+ mtch = re.search(r'(.*)-(%s)(?<!-debug).wgt' % '|'.join(full_arch), fn)
+ if mtch and mtch.groups() and len(mtch.groups()) == 2:
+ for l in archs_lookup:
+ _a = mtch.groups()[1]
+ if _a in l:
+ found_archs.extend(l)
+ _app_name = prop.get('sdk_web_name')
+ _app_arch = _a
+ _app_version = prop.get('sdk_version')
+ #Append version info in filename
+ os.rename(os.path.join(tizen_studio.builddir, fn), \
+ os.path.join(tizen_studio.builddir, "%s-%s-%s.wgt" % (_app_name, _app_version, _app_arch)))
+ #fn.replace(_a, '%s-%s' % (prop.get('sdk_version'), _a))))
+ break
found_archs = list(set(found_archs))
print 'found_archs=%s' % found_archs
rpm_build_mode = '%{nil}'
- spec_template = tizen_studio.get_template('spec')
+ if app_type == 'wgt':
+ spec_template = tizen_studio.get_template('spec-wgt')
+ else:
+ spec_template = tizen_studio.get_template('spec')
spec_template = spec_template.replace( \
'__OBS_PACKAGE_NAME__', data.get('obs_package')).replace( \
'__VCS__', vcs).replace( \
mailer.add_receiver(data.get('email'))
mailer.add_message('Package: %s' % data.get('project'))
mailing_list = os.getenv('ABS_MAILINGLIST').split(',')
- mailing_list.extend(ast.literal_eval(os.getenv('ABS_MAILINGLIST_2')).get(data.get('obs_project')).split(','))
+ try:
+ mailing_list.extend(ast.literal_eval(os.getenv('ABS_MAILINGLIST_2')).get(data.get('obs_project')).split(','))
+ except Exception as err:
+ pass
mailer.add_receiver(filter(None, mailing_list))
non_exist_prjs = [ prj for prj in set([data.get('obs_project')]) if not build.exists(prj) ]
print 'Set obs_package to sdk [%s]' % data['obs_package']
#FIXME:
- if project_properties.get('sdk_profile') == "" or project_properties.get('sdk_profile') is None:
- if "mobile" in data.get('project'):
- project_properties['sdk_profile'] = "mobile"
- elif "wearable" in data.get('project'):
- project_properties['sdk_profile'] = "wearable"
+ if project_properties.get('sdk_profile') == "" or project_properties.get('sdk_profile') is None \
+ or project_properties.get('app_type') == 'wgt':
+ profile_search = re.search(r'profile/(.*)/apps/native|web/.*', data.get('project'))
+ if profile_search and profile_search.groups():
+ project_properties['sdk_profile'] = profile_search.groups()[0]
else:
project_properties['sdk_profile'] = "mobile"
print project_properties.get('sdk_profile')
gitpath=data.get('project'), \
build_mode=os.getenv('BUILD_MODE'), \
parallel_jobs=parallel_jobs, \
- build_type=data.get('type', 'default'))
+ build_type=data.get('type', 'default'), \
+ app_type=branch_postfix)
print '[ TizenStudio END ] %s' % (str(datetime.now()))
print ret
'tizen_studio_version': tizen_studio_version, \
'tizen_studio_distribution': tizen_studio_distribution}
- def build_app_source(self, package, profile=None, gitpath=None, build_mode='Release', parallel_jobs='', build_type='default'):
+ def build_app_source(self, package, profile=None, gitpath=None, build_mode='Release', \
+ parallel_jobs='', build_type='default', app_type='tpk'):
PROFILE = profile
- build_cmd = self.get_template('build')
+ if app_type == 'wgt':
+ build_cmd = self.get_template('build-wgt')
+ else:
+ build_cmd = self.get_template('build')
build_cmd = build_cmd.replace( \
'__SDK_PATH__', self.sdk_path).replace( \
'__SHARE_ROOT__', self.share_root).replace( \