def main(args):
args = build_utils.ExpandFileArgs(args)
options = _ParseArgs(args)
package_command = _ConstructMostAaptArgs(options)
output_paths = [options.apk_path]
if options.create_density_splits:
for _, dst_path in _GenerateDensitySplitPaths(options.apk_path):
output_paths.append(dst_path)
output_paths.extend(
_GenerateLanguageSplitOutputPaths(options.apk_path,
options.language_splits))
input_paths = [options.android_manifest] + options.resource_zips
input_strings = [options.exclude_xxxhdpi] + options.xxxhdpi_whitelist
input_strings.extend(package_command)
if options.png_to_webp:
# This is necessary to ensure conversion if the option is toggled.
input_strings.extend("png_to_webp")
# The md5_check.py doesn't count file path in md5 intentionally,
# in order to repackage resources when assets' name changed, we need
# to put assets into input_strings, as we know the assets path isn't
# changed among each build if there is no asset change.
if options.asset_dir and os.path.exists(options.asset_dir):
asset_paths = []
for root, _, filenames in os.walk(options.asset_dir):
asset_paths.extend(os.path.join(root, f) for f in filenames)
input_paths.extend(asset_paths)
input_strings.extend(sorted(asset_paths))
build_utils.CallAndWriteDepfileIfStale(
lambda: _OnStaleMd5(package_command, options),
options,
input_paths=input_paths,
input_strings=input_strings,
output_paths=output_paths)
评论列表
文章目录