| Index: services/catalog/public/tools/catalog.gni
|
| diff --git a/services/catalog/public/tools/catalog.gni b/services/catalog/public/tools/catalog.gni
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..7683907c45f252f80ae2cf076240d6d96b3d47e4
|
| --- /dev/null
|
| +++ b/services/catalog/public/tools/catalog.gni
|
| @@ -0,0 +1,94 @@
|
| +# 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")
|
| +import("//services/service_manager/public/constants.gni")
|
| +
|
| +# Generates a static catalog manifest to be loaded at runtime. This manifest
|
| +# contains the union of all individual service manifests specified by the
|
| +# template parameters.
|
| +#
|
| +# The output of a catalog rule is always a file named:
|
| +#
|
| +# ${target_gen_dir}/${target_name}.json
|
| +#
|
| +# A Service Manager embedder uses a catalog manifest as its singular source of
|
| +# truth regarding available services in the system.
|
| +#
|
| +# Parameters:
|
| +#
|
| +# embedded_services (optional)
|
| +# A list of names of services which must be embedded by the Service
|
| +# Manager embedder's binary in order to function. Services listed here
|
| +# should have a corresponding service_manifest rule entry in deps.
|
| +#
|
| +# standalone_services (optional)
|
| +# A list of names of services which must be available to the Service
|
| +# Manager at runtime, in a Packages/ directory relative to the Service
|
| +# Manager embedder's binary.
|
| +#
|
| +# executable_overrides (optional)
|
| +# A list of overrides to apply in catalog metadata for individual
|
| +# services. An override string must be of the form
|
| +#
|
| +# "<service_name>:<executable_path>"
|
| +#
|
| +# The special token @EXE_DIR may be used in |executable_path| to denote
|
| +# a path relative to the Service Manager embedder's binary, substituted
|
| +# at runtime. For example:
|
| +#
|
| +# "content_browser:@EXE_DIR/chrome"
|
| +#
|
| +# would indicate to the Service Manager embedder that the
|
| +# "content_browser" service can be started by running the "chrome"
|
| +# executable in the embedder's own directory.
|
| +#
|
| +# included_catalogs (optional)
|
| +# A list of other catalog files to be included within this catalog.
|
| +#
|
| +template("catalog") {
|
| + output_filename = "$target_gen_dir/${target_name}.json"
|
| + action(target_name) {
|
| + testonly = defined(invoker.testonly) && invoker.testonly
|
| +
|
| + script = "//services/catalog/public/tools/generate_manifest.py"
|
| +
|
| + outputs = [
|
| + output_filename,
|
| + ]
|
| +
|
| + args = [
|
| + "--output=" + rebase_path(output_filename),
|
| + "--packages-dir=" + rebase_path("$root_out_dir/$packages_directory"),
|
| + ]
|
| +
|
| + if (is_debug || dcheck_always_on) {
|
| + args += [ "--pretty" ]
|
| + }
|
| +
|
| + if (defined(invoker.embedded_services)) {
|
| + args += [ "--embedded-services" ] + invoker.embedder_services
|
| + }
|
| +
|
| + if (defined(invoker.standalone_services)) {
|
| + args += [ "--standalone-services" ] + invoker.standalone_services
|
| + }
|
| +
|
| + if (defined(invoker.executable_overrides)) {
|
| + args +=
|
| + [ "--override-service-executables" ] + invoker.executable_overrides
|
| + }
|
| +
|
| + if (defined(invoker.included_catalogs)) {
|
| + args += [ "--include-catalogs" ]
|
| + foreach(catalog_filename, invoker.included_catalogs) {
|
| + args += [ rebase_path(catalog_filename) ]
|
| + }
|
| + }
|
| +
|
| + if (defined(invoker.deps)) {
|
| + deps = invoker.deps
|
| + }
|
| + }
|
| +}
|
|
|