本文整理汇总了Python中builder.Builder.get_aapt方法的典型用法代码示例。如果您正苦于以下问题:Python Builder.get_aapt方法的具体用法?Python Builder.get_aapt怎么用?Python Builder.get_aapt使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类builder.Builder
的用法示例。
在下文中一共展示了Builder.get_aapt方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from builder import Builder [as 别名]
# 或者: from builder.Builder import get_aapt [as 别名]
def __init__(self, name, path, config, changed_files, module_info, is_art=False,
is_other_modules_has_src_changed=False):
self._name = name
self._module_path = path
self._config = config
self._changed_files = changed_files
self._module_info = module_info
self._is_art = is_art
self._is_other_modules_has_src_changed = is_other_modules_has_src_changed
self._aapt = Builder.get_aapt()
self._javac = Builder.get_javac(config=config)
if self._javac is None:
raise FreelineException('Please declares your JAVA_HOME to system env!', 'JAVA_HOME not found in env.')
self._dx = Builder.get_dx(self._config)
self._cache_dir = self._config['build_cache_dir']
self._finder = None
self._res_dependencies = []
self._is_ids_changed = False
self._public_xml_path = None
self._ids_xml_path = None
self._new_res_list = []
self._merged_xml_cache = {}
self._origin_res_list = list(self._changed_files['res'])
self._classpaths = []
self._is_r_file_changed = False
self._is_need_javac = True
self._extra_javac_args = []
self.before_execute()
示例2: run_aapt
# 需要导入模块: from builder import Builder [as 别名]
# 或者: from builder.Builder import get_aapt [as 别名]
def run_aapt(self):
aapt_args = [Builder.get_aapt(), 'package', '-f', '-I',
os.path.join(self._config['compile_sdk_directory'], 'android.jar'),
'-M', fix_package_name(self._config, self._finder.get_dst_manifest_path())]
for rdir in self._config['project_source_sets'][self._main_module_name]['main_res_directory']:
if os.path.exists(rdir):
aapt_args.append('-S')
aapt_args.append(rdir)
for rdir in self._module_info['local_dep_res_path']:
if os.path.exists(rdir):
aapt_args.append('-S')
aapt_args.append(rdir)
if 'extra_dep_res_paths' in self._config and self._config['extra_dep_res_paths'] is not None:
arr = self._config['extra_dep_res_paths']
for path in arr:
path = path.strip()
if os.path.isdir(path):
aapt_args.append('-S')
aapt_args.append(path)
for resdir in self._module_info['dep_res_path']:
if os.path.exists(resdir):
aapt_args.append('-S')
aapt_args.append(resdir)
aapt_args.extend(['-S', self._finder.get_backup_res_dir()])
freeline_assets_dir = os.path.join(self._config['build_cache_dir'], 'freeline-assets')
aapt_args.append('-A')
aapt_args.append(freeline_assets_dir)
for adir in self._config['project_source_sets'][self._main_module_name]['main_assets_directory']:
if os.path.exists(adir):
aapt_args.append('-A')
aapt_args.append(adir)
for m in self._module_info['local_module_dep']:
if m in self._config['project_source_sets']:
for adir in self._config['project_source_sets'][m]['main_assets_directory']:
if os.path.exists(adir):
aapt_args.append('-A')
aapt_args.append(adir)
base_resource_path = get_base_resource_path(self._config['build_cache_dir'])
aapt_args.append('-m')
aapt_args.append('-J')
aapt_args.append(self._finder.get_backup_dir())
aapt_args.append('--auto-add-overlay')
aapt_args.append('-F')
aapt_args.append(base_resource_path)
aapt_args.append('--debug-mode')
aapt_args.append('--no-version-vectors')
aapt_args.append('--resoucres-md5-cache-path')
aapt_args.append(os.path.join(self._config['build_cache_dir'], "arsc_cache.dat"))
aapt_args.append('--ignore-assets')
aapt_args.append('public_id.xml:public.xml:*.bak:.*')
self.debug('aapt exec: ' + ' '.join(aapt_args))
output, err, code = cexec(aapt_args, callback=None)
if code != 0:
raise FreelineException('build base resources failed with: {}'.format(' '.join(aapt_args)),
'{}\n{}'.format(output, err))
self.debug('generate base resource success: {}'.format(base_resource_path))