Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1244)

Unified Diff: build/toolchain/mac/compile_xcassets.py

Issue 2236973004: Pass the bundle product_type to the actool invocation. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@product_type
Patch Set: Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « build/toolchain/mac/BUILD.gn ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/toolchain/mac/compile_xcassets.py
diff --git a/build/toolchain/mac/compile_xcassets.py b/build/toolchain/mac/compile_xcassets.py
index 2e8c00e8fba7789f606a950ef9c356147959bb9f..ac0742eb56f7800656b3f229681b14ae0baaa531 100644
--- a/build/toolchain/mac/compile_xcassets.py
+++ b/build/toolchain/mac/compile_xcassets.py
@@ -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:
@@ -67,6 +80,9 @@ def Main():
'--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')
args = parser.parse_args()
@@ -80,6 +96,7 @@ def Main():
CompileXCAssets(
args.output,
args.platform,
+ args.product_type,
args.minimum_deployment_target,
args.inputs)
« no previous file with comments | « build/toolchain/mac/BUILD.gn ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698