Pass the bundle product_type to the actool invocation.

With Xcode 8, the invocation of actool need to contain the type of
the bundle containing the asset catalog, pass the information from
the create_bundle target to the actool command.

BUG=634373

Review-Url: https://codereview.chromium.org/2236973004
Cr-Original-Commit-Position: refs/heads/master@{#411865}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: bf8b26608b67a274cf7b5ca99446043e9e197394
This commit is contained in:
sdefresne 2016-08-12 19:44:33 -07:00 коммит произвёл Commit bot
Родитель c4e089f755
Коммит 45574dce74
2 изменённых файлов: 19 добавлений и 2 удалений

Просмотреть файл

@ -403,7 +403,7 @@ template("mac_toolchain") {
command = "rm -f {{output}} && " +
"TOOL_VERSION=${tool_versions.compile_xcassets} " +
"python $_tool -p $_sdk_name -t $_min_deployment_target " +
"-o {{output}} {{inputs}}"
"-T {{bundle_product_type}} -o {{output}} {{inputs}}"
description = "COMPILE_XCASSETS {{output}}"
pool = ":bundle_pool($default_toolchain)"

Просмотреть файл

@ -8,7 +8,17 @@ import subprocess
import sys
def CompileXCAssets(output, platform, min_deployment_target, inputs):
def CompileXCAssets(
output, platform, product_type, min_deployment_target, inputs):
"""Compile the .xcassets bundles to an asset catalog using actool.
Args:
output: absolute path to the containing bundle
platform: the targetted platform
product_type: the bundle type
min_deployment_target: minimum deployment target
inputs: list of absolute paths to .xcassets bundles
"""
command = [
'xcrun', 'actool', '--output-format=human-readable-text',
'--compress-pngs', '--notices', '--warnings', '--errors',
@ -16,6 +26,9 @@ def CompileXCAssets(output, platform, min_deployment_target, inputs):
min_deployment_target,
]
if product_type != '':
command.extend(['--product-type', product_type])
if platform == 'macosx':
command.extend(['--target-device', 'mac'])
else:
@ -66,6 +79,9 @@ def Main():
parser.add_argument(
'--output', '-o', required=True,
help='path to the compiled assets catalog')
parser.add_argument(
'--product-type', '-T',
help='type of the containing bundle')
parser.add_argument(
'inputs', nargs='+',
help='path to input assets catalog sources')
@ -80,6 +96,7 @@ def Main():
CompileXCAssets(
args.output,
args.platform,
args.product_type,
args.minimum_deployment_target,
args.inputs)