Commit 8b339daf authored by Ken Rockot's avatar Ken Rockot Committed by Commit Bot

Remove build support for JSON manifests

Deletes catalog and service_manifest GN target types and their
dependencies. These things are no longer in use.

Bug: 895616
Change-Id: I4ca5b9d964e29507576fe44a0d2b0804ac5584b1
TBR: sky@chromium.org,skyostil@chromium.org,sdefresne@chromium.org
Reviewed-on: https://chromium-review.googlesource.com/c/1460494
Commit-Queue: Ken Rockot <rockot@google.com>
Reviewed-by: default avatarOksana Zhuravlova <oksamyt@chromium.org>
Cr-Commit-Position: refs/heads/master@{#630644}
parent aad2dfb9
......@@ -10,7 +10,6 @@ import("//components/nacl/features.gni")
import("//device/vr/buildflags/buildflags.gni")
import("//ppapi/buildflags/buildflags.gni")
import("//printing/buildflags/buildflags.gni")
import("//services/service_manager/public/service_manifest.gni")
import("//tools/grit/grit_rule.gni")
import("//tools/ipc_fuzzer/ipc_fuzzer.gni")
......
......@@ -10,7 +10,6 @@ import("//chromeos/assistant/assistant.gni")
import("//device/vr/buildflags/buildflags.gni")
import("//extensions/buildflags/buildflags.gni")
import("//printing/buildflags/buildflags.gni")
import("//services/service_manager/public/service_manifest.gni")
static_library("utility") {
sources = [
......
......@@ -6,7 +6,6 @@ import("//build/buildflag_header.gni")
import("//build/config/ui.gni")
import("//chromecast/chromecast.gni")
import("//media/media_options.gni")
import("//services/service_manager/public/service_manifest.gni")
import("//testing/test.gni")
import("//tools/grit/grit_rule.gni")
......
......@@ -23,7 +23,6 @@
import("//build/config/chrome_build.gni")
import("//build/config/ui.gni")
import("//chromeos/assistant/assistant.gni")
import("//services/service_manager/public/service_manifest.gni")
import("//tools/v8_context_snapshot/v8_context_snapshot.gni")
import("//ui/base/ui_features.gni")
......
......@@ -14,7 +14,6 @@ import("//media/media_options.gni")
import("//mojo/public/tools/bindings/mojom.gni")
import("//net/features.gni")
import("//ppapi/buildflags/buildflags.gni")
import("//services/service_manager/public/service_manifest.gni")
import("//testing/test.gni")
import("//third_party/blink/public/public_features.gni")
import("//tools/v8_context_snapshot/v8_context_snapshot.gni")
......
......@@ -10,7 +10,6 @@ import("//build/util/process_version.gni")
import("//headless/headless.gni")
import("//mojo/public/tools/bindings/mojom.gni")
import("//printing/buildflags/buildflags.gni")
import("//services/service_manager/public/service_manifest.gni")
import("//testing/test.gni")
import("//third_party/closure_compiler/compile_js.gni")
import("//third_party/inspector_protocol/inspector_protocol.gni")
......
......@@ -5,7 +5,6 @@
import("//build/config/ios/rules.gni")
import("//ios/build/config.gni")
import("//mojo/public/tools/bindings/mojom.gni")
import("//services/service_manager/public/service_manifest.gni")
import("//tools/grit/grit_rule.gni")
import("//tools/grit/repack.gni")
......
// Copyright 2017 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// This is a generated file. Please see the "service_manifest" template in
// src/services/service_manager/public/service_manifest.gni for more details.
#include "{{path}}.h"
#include <set>
#include "base/files/file_path.h"
#include "base/no_destructor.h"
#include "build/build_config.h"
#include "services/service_manager/public/cpp/manifest_builder.h"
{%- macro generate_manifest_builder(manifest) -%}
service_manager::ManifestBuilder()
.WithServiceName("{{manifest['name']}}")
{%- if 'display_name' in manifest %}
.WithDisplayName("{{manifest['display_name']}}")
{%- endif %}
.WithOptions(service_manager::ManifestOptionsBuilder()
{%- if 'sandbox_type' in manifest %}
.WithSandboxType("{{manifest['sandbox_type']}}")
{%- endif %}
{%- set options = manifest.get('options', {}) %}
{%- set instance_sharing = options.get('instance_sharing', None) %}
{%- if instance_sharing == 'singleton' %}
.WithInstanceSharingPolicy(
service_manager::Manifest::InstanceSharingPolicy::
kSingleton)
{%- elif instance_sharing == 'shared_instance_across_users' %}
.WithInstanceSharingPolicy(
service_manager::Manifest::InstanceSharingPolicy::
kSharedAcrossGroups)
{%- endif %}
{%- if options.get('can_connect_to_other_services_as_any_user', False) %}
.CanConnectToInstancesInAnyGroup(true)
{%- endif %}
{%- if options.get('can_connect_to_other_services_with_any_instance_name',
False) %}
.CanConnectToInstancesWithAnyId(true)
{%- endif %}
{%- if options.get('can_create_other_service_instances', False) %}
.CanRegisterOtherServiceInstances(true)
{%- endif %}
.Build())
{%- set specs = manifest.get('interface_provider_specs', {}) %}
{%- set main_spec = specs.pop('service_manager:connector', None) %}
{%- if main_spec %}
{%- for name, interfaces in main_spec.get('provides', {}).iteritems() %}
.ExposeCapability(
"{{name}}", std::set<const char*>{
{%- for interface_name in interfaces %}
"{{interface_name}}",
{%- endfor -%}})
{%- endfor %}
{%- for service, caps in main_spec.get('requires', {}).iteritems() %}
{%- if caps == [] %}
.RequireCapability("{{service}}", "")
{%- else %}
{%- for capability in caps %}
.RequireCapability("{{service}}", "{{capability}}")
{%- endfor %}
{%- endif %}
{%- endfor %}
{%- endif %}
{%- for filter_name, filter_spec in specs.iteritems() %}
{%- for name, interfaces in filter_spec.get('provides', {}).iteritems() %}
.ExposeInterfaceFilterCapability_Deprecated(
"{{filter_name}}", "{{name}}", std::set<const char*>{
{%- for interface_name in interfaces %}
"{{interface_name}}" {%- if not loop.last %},{% endif %}
{%- endfor -%}})
{%- endfor %}
{%- for service, caps in filter_spec.get('requires', {}).iteritems() %}
{%- for capability in caps %}
.RequireInterfaceFilterCapability_Deprecated(
"{{service}}", "{{filter_name}}", "{{capability}}")
{%- endfor %}
{%- endfor %}
{%- endfor %}
{%- for key, entries in manifest.get('required_files', {}).iteritems() %}
{%- for entry in entries %}
{%- if entry['platform'] == 'linux' %}
#if defined(OS_LINUX)
{%- elif entry['platform'] == 'android' %}
#if defined(OS_ANDROID)
{%- endif %}
.PreloadFile(
"{{key}}",
base::FilePath(FILE_PATH_LITERAL("{{entry['path']}}")))
#endif
{%- endfor %}
{%- endfor %}
{%- for packaged_service_manifest in manifest.get('services', []) %}
.PackageService(
{{generate_manifest_builder(packaged_service_manifest)|indent(8)}})
{%- endfor %}
.Build()
{%- endmacro %}
{% for namespace in namespaces %}
namespace {{namespace}} {
{%- endfor %}
const service_manager::Manifest& {{function_name}}() {
static base::NoDestructor<service_manager::Manifest> manifest{
{{generate_manifest_builder(root_manifest)|indent(6)}} };
return *manifest;
}
{%- for namespace in namespaces|reverse %}
} // namespace {{namespace}}
{%- endfor %}
# Copyright 2016 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import("//build/config/dcheck_always_on.gni")
# Generates code to produce a list service_manager::Manifest objects given a set
# of service_manager targets to include in the list.
#
# This is a temporary helper to transition away from JSON manifests. The catalog
# target always has a companion catalog_cpp_source target, which yields a
# source_set defining the generated function.
#
# No new uses of these targets should be introduced.
template("catalog") {
group(target_name) {
testonly = defined(invoker.testonly) && invoker.testonly
}
# NOTE: There is no longer a practical difference between embedded and
# standalone services in terms of manifest data. Some targets use one or the
# other or both.
submanifests = []
if (defined(invoker.embedded_services)) {
submanifests += invoker.embedded_services
}
if (defined(invoker.standalone_services)) {
submanifests += invoker.standalone_services
}
write_file("$target_gen_dir/${target_name}.submanifests", submanifests)
}
template("catalog_cpp_source") {
assert(defined(invoker.catalog), "catalog is required")
assert(defined(invoker.generated_function_name),
"generated_function_name is required")
generator_target_name = "${target_name}__generator"
generated_filename_base = "${target_gen_dir}/${target_name}"
catalog_target = invoker.catalog
catalog_target_dir = get_label_info(catalog_target, "target_gen_dir")
catalog_target_name = get_label_info(catalog_target, "name")
submanifests =
read_file("$catalog_target_dir/${catalog_target_name}.submanifests",
"list lines")
action(generator_target_name) {
testonly = defined(invoker.testonly) && invoker.testonly
script = "//services/catalog/public/tools/sourcify_manifest.py"
inputs = [
"$catalog_target_dir/${catalog_target_name}.submanifests",
"//services/catalog/public/tools/catalog.cc.tmpl",
"//services/catalog/public/tools/catalog.h.tmpl",
]
outputs = [
"${generated_filename_base}.cc",
"${generated_filename_base}.h",
]
submanifest_info = []
foreach(submanifest, submanifests) {
manifest_dir = get_label_info(submanifest, "target_gen_dir")
manifest_target_name = get_label_info(submanifest, "name")
manifest_namespace_input =
"$manifest_dir/${manifest_target_name}.namespace"
manifest_namespace_path =
rebase_path(manifest_namespace_input, root_build_dir)
manifest_header_base =
rebase_path(manifest_dir, root_gen_dir) + "/${manifest_target_name}"
submanifest_info +=
[ "packaged@$manifest_namespace_path@$manifest_header_base" ]
}
submanifest_info_file =
"$target_gen_dir/${invoker.target_name}.submanifest_info"
write_file(submanifest_info_file, submanifest_info)
args = [
"--submanifest-info=" +
rebase_path(submanifest_info_file, root_build_dir),
"--output-filename-base=" +
rebase_path(generated_filename_base, root_build_dir),
"--output-function-name=" + invoker.generated_function_name,
"--module-path=" + rebase_path(generated_filename_base, root_gen_dir),
]
}
source_set(target_name) {
testonly = defined(invoker.testonly) && invoker.testonly
sources = get_target_outputs(":$generator_target_name")
deps = [
":$generator_target_name",
"//base",
"//services/service_manager/public/cpp",
] + submanifests
}
}
// Copyright 2017 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// This is a generated file. Please see the "service_manifest" template in
// src/services/service_manager/public/service_manifest.gni for more details.
{%- set header_guard = "%s_H_"|format(path)|upper|replace("/", "_")|
replace(".", "_")|replace("-", "_") %}
#ifndef {{header_guard}}
#define {{header_guard}}
#include <vector>
#include "services/service_manager/public/cpp/manifest.h"
{% for namespace in namespaces %}
namespace {{namespace}} {
{%- endfor %}
{% if root_manifest -%}
const service_manager::Manifest& {{function_name}}();
{% else -%}
const std::vector<service_manager::Manifest>& {{function_name}}();
{%- endif %}
{% for namespace in namespaces|reverse %}
} // namespace {{namespace}}
{%- endfor %}
#endif // {{header_guard}}
#!/usr/bin/env python
# Copyright 2016 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Generates a static catalog manifest to be loaded at runtime. This includes
embedded service manifests for every supported service, as well as information
indicating how to start each service."""
import argparse
import json
import os.path
import sys
sys.path.append(os.path.join(
os.path.dirname(__file__), os.pardir, os.pardir, os.pardir, os.pardir,
"build", "android", "gyp"))
from util import build_utils
eater_relative = "../../../../../tools/json_comment_eater"
eater_relative = os.path.join(os.path.abspath(__file__), eater_relative)
sys.path.insert(0, os.path.normpath(eater_relative))
try:
import json_comment_eater
finally:
sys.path.pop(0)
def ParseJSONFile(filename):
with open(filename) as json_file:
try:
return json.loads(json_comment_eater.Nom(json_file.read()))
except ValueError as e:
print "%s is not a valid JSON document" % filename
raise e
def ParseManifest(filename):
manifest = ParseJSONFile(filename)
if "name" not in manifest:
raise Exception("Manifest %s missing \"name\" key." % filename)
return manifest["name"], manifest
def AddServiceEntryToCatalog(services, name, entry):
if name in services:
raise Exception("Duplicate service entry for %s" % name)
services[name] = entry
def SanityCheckCatalog(catalog):
"""Ensures any given service name appears only once within the catalog."""
known_services = set()
def has_no_dupes(root):
if "name" in root:
name = root["name"]
if name in known_services:
raise ValueError("Duplicate catalog entry found for service: %s" % name)
known_services.add(name)
if "services" not in root:
return True
return all(has_no_dupes(service) for service in root["services"])
return all(has_no_dupes(service["manifest"])
for service in catalog["services"].itervalues())
def main():
parser = argparse.ArgumentParser(
description="Generates a Service Manager catalog manifest.")
parser.add_argument("--output")
parser.add_argument("--pretty", action="store_true")
parser.add_argument("--embedded-services", nargs="+",
dest="embedded_services", default=[])
parser.add_argument("--standalone-services", nargs="+",
dest="standalone_services", default=[])
parser.add_argument("--include-catalogs", nargs="+", dest="included_catalogs",
default=[])
parser.add_argument("--override-service-executables", nargs="+",
dest="executable_override_specs", default=[])
args, _ = parser.parse_known_args()
if args.output is None:
raise Exception("--output required")
services = {}
for subcatalog_path in args.included_catalogs:
subcatalog = ParseJSONFile(subcatalog_path)
for name, entry in subcatalog["services"].iteritems():
AddServiceEntryToCatalog(services, name, entry)
executable_overrides = {}
for override_spec in args.executable_override_specs:
service_name, exe_path = override_spec.split(":", 1)
executable_overrides[service_name] = exe_path
for manifest_path in args.embedded_services:
service_name, manifest = ParseManifest(manifest_path)
entry = { "embedded": True, "manifest": manifest }
AddServiceEntryToCatalog(services, service_name, entry)
for manifest_path in args.standalone_services:
service_name, manifest = ParseManifest(manifest_path)
entry = { "embedded": False, "manifest": manifest }
name = manifest["name"]
if name in executable_overrides:
entry["executable"] = executable_overrides[name]
AddServiceEntryToCatalog(services, service_name, entry)
catalog = { "services": services }
with build_utils.AtomicOutput(args.output) as f:
json.dump(catalog, f, indent=2 if args.pretty else -1)
# NOTE: We do the sanity check and possible failure *after* outputting the
# catalog manifest so it's easier to inspect erroneous output.
SanityCheckCatalog(catalog);
return 0
if __name__ == "__main__":
sys.exit(main())
#!/usr/bin/env python
# Copyright 2017 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Generates C++ source and header files defining function to create an
in-memory representation of a static catalog manifest at runtime."""
import argparse
import imp
import json
import os.path
import sys
sys.path.append(os.path.join(
os.path.dirname(__file__), os.pardir, os.pardir, os.pardir, os.pardir,
"build", "android", "gyp"))
from util import build_utils
_H_FILE_TEMPLATE = "catalog.h.tmpl"
_CC_FILE_TEMPLATE = "catalog.cc.tmpl"
eater_relative = "../../../../../tools/json_comment_eater"
eater_relative = os.path.join(os.path.abspath(__file__), eater_relative)
sys.path.insert(0, os.path.normpath(eater_relative))
try:
import json_comment_eater
finally:
sys.path.pop(0)
# Disable lint check for finding modules:
# pylint: disable=F0401
def _GetDirAbove(dirname):
"""Returns the directory "above" this file containing |dirname| (which must
also be "above" this file)."""
path = os.path.abspath(__file__)
while True:
path, tail = os.path.split(path)
assert tail
if tail == dirname:
return path
try:
imp.find_module("jinja2")
except ImportError:
sys.path.append(os.path.join(_GetDirAbove("services"), "third_party"))
import jinja2
def ApplyTemplate(path_to_template, output_path, global_vars, **kwargs):
with build_utils.AtomicOutput(output_path) as output_file:
jinja_env = jinja2.Environment(
loader=jinja2.FileSystemLoader(os.path.dirname(__file__)),
keep_trailing_newline=True, **kwargs)
jinja_env.globals.update(global_vars)
output_file.write(jinja_env.get_template(path_to_template).render())
def main():
parser = argparse.ArgumentParser(
description="Generates a C++ constant containing a catalog manifest.")
parser.add_argument("--root-manifest")
parser.add_argument("--submanifest-info")
parser.add_argument("--output-filename-base")
parser.add_argument("--output-function-name")
parser.add_argument("--module-path")
args, _ = parser.parse_known_args()
if args.output_filename_base is None:
raise Exception("--output-filename-base is required")
if args.output_function_name is None:
raise Exception("--output-function-name is required")
if args.module_path is None:
args.module_path = args.output_filename_base
if args.root_manifest:
with open(args.root_manifest, "r") as input_file:
root_manifest = json.loads(json_comment_eater.Nom(input_file.read()))
else:
root_manifest = None
qualified_function_name = args.output_function_name.split("::")
namespaces = qualified_function_name[0:-1]
function_name = qualified_function_name[-1]
def raise_error(error, value):
raise Exception(error)
overlays = []
packaged_services = []
global_vars = {
"root_manifest": root_manifest,
"function_name": function_name,
"namespaces": namespaces,
"path": args.module_path,
"raise": raise_error,
}
input_h_filename = _H_FILE_TEMPLATE
output_h_filename = "%s.h" % args.output_filename_base
ApplyTemplate(input_h_filename, output_h_filename, global_vars)
input_cc_filename = _CC_FILE_TEMPLATE
output_cc_filename = "%s.cc" % args.output_filename_base
ApplyTemplate(input_cc_filename, output_cc_filename, global_vars)
return 0
if __name__ == "__main__":
sys.exit(main())
# Copyright 2016 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import("//build/config/dcheck_always_on.gni")
# Generates code to produce a compiled service_manager::Manifest from a JSON
# description at build time.
#
# This is a temporary helper for the transition away from JSON manifests. Do not
# introduce new service_manifest targets.
#
# This template yields a source_set target which defines a symbol named
# "${name}::GetManifest()" where ${name} is the service name given in the
# target.
#
# All service_manifest targets should be replaced with in-tree C++ sources.
template("service_manifest") {
assert(defined(invoker.source),
"\"source\" must be defined for the $target_name target")
generator_target_name = "${target_name}__generator"
generated_sources = [
"$target_gen_dir/${target_name}.cc",
"$target_gen_dir/${target_name}.h",
]
# We prefer to use |name| for the generated function's namespace if a
# |generated_namespace| isn't explicitly defined. It turns out that we also
# have a few targets which don't specify a |name| though; they all have unique
# target names, so we fall back on that if necessary. The important detail is
# that all generated GetManifest() functions should live in their own
# namespace, and with the current (and final) set of service_manifest targets
# in the tree, these rules accomplish that.
if (defined(invoker.generated_namespace)) {
output_namespace = invoker.generated_namespace
} else if (defined(invoker.name)) {
output_namespace = invoker.name
} else {
output_namespace = invoker.target_name
}
write_file("$target_gen_dir/${target_name}.namespace", output_namespace)
source_set(target_name) {
testonly = defined(invoker.testonly) && invoker.testonly
sources = generated_sources
public_deps = [
":$generator_target_name",
]
}
collator_target_name = "${target_name}__collator"
action(generator_target_name) {
testonly = defined(invoker.testonly) && invoker.testonly
script = "//services/catalog/public/tools/sourcify_manifest.py"
inputs = [
"//services/catalog/public/tools/catalog.cc.tmpl",
"//services/catalog/public/tools/catalog.h.tmpl",
invoker.source,
]
outputs = generated_sources
args = [
"--root-manifest=" + rebase_path(invoker.source, root_build_dir),
"--output-function-name=${output_namespace}::GetManifest",
"--output-filename-base=" +
rebase_path("$target_gen_dir/${invoker.target_name}", root_build_dir),
"--module-path=" +
rebase_path("$target_gen_dir/${invoker.target_name}", root_gen_dir),
]
# We inherit a public dependency on the collator because service_manifest
# dependents still expect to use its generated JSON output. We don't
# actually depend on the collated JSON at all here, since packaged services
# and overlays are added in the generated C++ code by referring to other
# generated C++ code.
public_deps = [
":$collator_target_name",
]
}
action(collator_target_name) {
testonly = defined(invoker.testonly) && invoker.testonly
script =
"//services/service_manager/public/tools/manifest/manifest_collator.py"
deps = []
if (defined(invoker.deps)) {
deps += invoker.deps
}
inputs = [
invoker.source,
]
output = "$target_gen_dir/${invoker.target_name}.json"
outputs = [
output,
]
rebase_parent = rebase_path(invoker.source, root_build_dir)
rebase_output = rebase_path(output, root_build_dir)
args = [
"--parent=$rebase_parent",
"--output=$rebase_output",
]
if (defined(invoker.name)) {
args += [
"--name",
invoker.name,
]
}
if (is_debug || dcheck_always_on) {
args += [ "--pretty" ]
}
}
}
#!/usr/bin/env python
# Copyright 2016 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
""" A collator for Service Manifests """
import argparse
import json
import os
import shutil
import sys
import urlparse
sys.path.append(os.path.join(
os.path.dirname(__file__), os.pardir, os.pardir, os.pardir, os.pardir,
os.pardir, "build", "android", "gyp"))
from util import build_utils
# Keys which are completely overridden by manifest overlays
_MANIFEST_OVERLAY_OVERRIDE_KEYS = [
"display_name",
]
# Keys which are merged with content from manifest overlays
_MANIFEST_OVERLAY_MERGE_KEYS = [
"interface_provider_specs",
"required_files",
]
eater_relative = "../../../../../../tools/json_comment_eater"
eater_relative = os.path.join(os.path.abspath(__file__), eater_relative)
sys.path.insert(0, os.path.normpath(eater_relative))
try:
import json_comment_eater
finally:
sys.path.pop(0)
def ParseJSONFile(filename):
with open(filename) as json_file:
try:
return json.loads(json_comment_eater.Nom(json_file.read()))
except ValueError as e:
print "%s is not a valid JSON document" % filename
raise e
def MergeDicts(left, right):
for k, v in right.iteritems():
if k not in left:
left[k] = v
else:
if isinstance(v, dict):
assert isinstance(left[k], dict)
MergeDicts(left[k], v)
elif isinstance(v, list):
assert isinstance(left[k], list)
left[k].extend(v)
else:
raise "Refusing to merge conflicting non-collection values."
return left
def MergeManifestOverlay(manifest, overlay):
for key in _MANIFEST_OVERLAY_MERGE_KEYS:
if key in overlay:
MergeDicts(manifest[key], overlay[key])
if "services" in overlay:
if "services" not in manifest:
manifest["services"] = []
manifest["services"].extend(overlay["services"])
for key in _MANIFEST_OVERLAY_OVERRIDE_KEYS:
if key in overlay:
manifest[key] = overlay[key]
def SanityCheckManifestServices(manifest):
"""Ensures any given service name appears only once within a manifest."""
known_services = set()
def has_no_dupes(root):
if "name" in root:
name = root["name"]
if name in known_services:
raise ValueError(
"Duplicate manifest entry found for service: %s" % name)
known_services.add(name)
if "services" not in root:
return True
return all(has_no_dupes(service) for service in root["services"])
return has_no_dupes(manifest)
def main():
parser = argparse.ArgumentParser(
description="Collate Service Manifests.")
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=[])
parser.add_argument("--packaged-services", nargs="+",
dest="packaged_services", default=[])
args, _ = parser.parse_known_args()
parent = ParseJSONFile(args.parent)
service_name = parent["name"] if "name" in parent else ""
if args.name and args.name != service_name:
raise ValueError("Service name '%s' specified in build file does not " \
"match name '%s' specified in manifest." %
(args.name, service_name))
packaged_services = []
for child_manifest in args.packaged_services:
packaged_services.append(ParseJSONFile(child_manifest))
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 build_utils.AtomicOutput(args.output) as f:
json.dump(parent, f, indent=2 if args.pretty else -1)
# NOTE: We do the sanity check and possible failure *after* outputting the
# aggregate manifest so it's easier to inspect erroneous output.
SanityCheckManifestServices(parent)
return 0
if __name__ == "__main__":
sys.exit(main())
......@@ -3,7 +3,6 @@
# found in the LICENSE file.
import("//build/config/chromecast_build.gni")
import("//services/service_manager/public/service_manifest.gni")
# There should be only one tracing service. It is currently
# in the browser process. So, only //content/browser should link to this target.
......
......@@ -3,7 +3,6 @@
# found in the LICENSE file.
import("//services/service_manager/public/cpp/service_executable.gni")
import("//services/service_manager/public/service_manifest.gni")
import("//testing/test.gni")
service_executable("video_capture") {
......
......@@ -2,7 +2,6 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import("//services/service_manager/public/service_manifest.gni")
import("//testing/test.gni")
source_set("lib") {
......
......@@ -4,7 +4,6 @@
import("//mojo/public/tools/bindings/mojom.gni")
import("//services/service_manager/public/cpp/service_executable.gni")
import("//services/service_manager/public/service_manifest.gni")
service_executable("test_ws") {
testonly = true
......
......@@ -7,7 +7,6 @@ import("//build/config/features.gni")
import("//build/config/jumbo.gni")
import("//build/config/ui.gni")
import("//components/vector_icons/vector_icons.gni")
import("//services/service_manager/public/service_manifest.gni")
import("//testing/test.gni")
import("//ui/base/ui_features.gni")
import("//ui/ozone/ozone.gni")
......
......@@ -5,7 +5,6 @@
import("//build/config/features.gni")
import("//build/config/jumbo.gni")
import("//build/config/ui.gni")
import("//services/service_manager/public/service_manifest.gni")
import("//testing/test.gni")
import("//tools/grit/repack.gni")
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment