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

Unified Diff: services/service_manager/public/tools/manifest/manifest_collator.py

Issue 2475543003: Introduce the image_decoder service (Closed)
Patch Set: . Created 4 years, 1 month 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 | « services/service_manager/public/service_manifest.gni ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: services/service_manager/public/tools/manifest/manifest_collator.py
diff --git a/services/service_manager/public/tools/manifest/manifest_collator.py b/services/service_manager/public/tools/manifest/manifest_collator.py
index 1d2d76e7a8abab0fa0c20e54558fe52bf519c63d..3944d2f4b0fb664b1a158cd9720e97b7f5d58d98 100755
--- a/services/service_manager/public/tools/manifest/manifest_collator.py
+++ b/services/service_manager/public/tools/manifest/manifest_collator.py
@@ -72,8 +72,11 @@ def main():
parser.add_argument("--parent")
parser.add_argument("--output")
parser.add_argument("--name")
+ parser.add_argument("--pretty", action="store_true")
parser.add_argument("--overlays", nargs="+", dest="overlays", default=[])
- args, children = parser.parse_known_args()
+ parser.add_argument("--packaged-services", nargs="+",
+ dest="packaged_services", default=[])
+ args, _ = parser.parse_known_args()
parent = ParseJSONFile(args.parent)
@@ -82,23 +85,26 @@ def main():
raise ValueError("Service name path component '%s' must not start " \
"with //" % service_path)
- if args.name != service_path:
+ if args.name and args.name != service_path:
raise ValueError("Service name '%s' specified in build file does not " \
"match name '%s' specified in manifest." %
(args.name, service_path))
- services = []
- for child in children:
- services.append(ParseJSONFile(child))
+ packaged_services = []
+ for child_manifest in args.packaged_services:
+ packaged_services.append(ParseJSONFile(child_manifest))
- if len(services) > 0:
- parent['services'] = services
+ if len(packaged_services) > 0:
+ if 'services' not in parent:
+ parent['services'] = packaged_services
+ else:
+ parent['services'].extend(packaged_services)
for overlay_path in args.overlays:
MergeManifestOverlay(parent, ParseJSONFile(overlay_path))
with open(args.output, 'w') as output_file:
- json.dump(parent, output_file)
+ json.dump(parent, output_file, indent=2 if args.pretty else -1)
return 0
« no previous file with comments | « services/service_manager/public/service_manifest.gni ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698