OLD | NEW |
(Empty) | |
| 1 # Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. |
| 4 |
| 5 import("//build/config/dcheck_always_on.gni") |
| 6 import("//services/service_manager/public/constants.gni") |
| 7 |
| 8 # Generates a static catalog manifest to be loaded at runtime. This manifest |
| 9 # contains the union of all individual service manifests specified by the |
| 10 # template parameters. |
| 11 # |
| 12 # The output of a catalog rule is always a file named: |
| 13 # |
| 14 # ${target_gen_dir}/${target_name}.json |
| 15 # |
| 16 # A Service Manager embedder uses a catalog manifest as its singular source of |
| 17 # truth regarding available services in the system. |
| 18 # |
| 19 # Parameters: |
| 20 # |
| 21 # embedded_services (optional) |
| 22 # A list of names of services which must be embedded by the Service |
| 23 # Manager embedder's binary in order to function. Services listed here |
| 24 # should have a corresponding service_manifest rule entry in deps. |
| 25 # |
| 26 # standalone_services (optional) |
| 27 # A list of names of services which must be available to the Service |
| 28 # Manager at runtime, in a Packages/ directory relative to the Service |
| 29 # Manager embedder's binary. |
| 30 # |
| 31 # executable_overrides (optional) |
| 32 # A list of overrides to apply in catalog metadata for individual |
| 33 # services. An override string must be of the form |
| 34 # |
| 35 # "<service_name>:<executable_path>" |
| 36 # |
| 37 # The special token @EXE_DIR may be used in |executable_path| to denote |
| 38 # a path relative to the Service Manager embedder's binary, substituted |
| 39 # at runtime. For example: |
| 40 # |
| 41 # "content_browser:@EXE_DIR/chrome" |
| 42 # |
| 43 # would indicate to the Service Manager embedder that the |
| 44 # "content_browser" service can be started by running the "chrome" |
| 45 # executable in the embedder's own directory. |
| 46 # |
| 47 # included_catalogs (optional) |
| 48 # A list of other catalog files to be included within this catalog. |
| 49 # |
| 50 template("catalog") { |
| 51 output_filename = "$target_gen_dir/${target_name}.json" |
| 52 action(target_name) { |
| 53 testonly = defined(invoker.testonly) && invoker.testonly |
| 54 |
| 55 script = "//services/catalog/public/tools/generate_manifest.py" |
| 56 |
| 57 outputs = [ |
| 58 output_filename, |
| 59 ] |
| 60 |
| 61 args = [ |
| 62 "--output=" + rebase_path(output_filename), |
| 63 "--packages-dir=" + rebase_path("$root_out_dir/$packages_directory"), |
| 64 ] |
| 65 |
| 66 if (is_debug || dcheck_always_on) { |
| 67 args += [ "--pretty" ] |
| 68 } |
| 69 |
| 70 if (defined(invoker.embedded_services)) { |
| 71 args += [ "--embedded-services" ] + invoker.embedder_services |
| 72 } |
| 73 |
| 74 if (defined(invoker.standalone_services)) { |
| 75 args += [ "--standalone-services" ] + invoker.standalone_services |
| 76 } |
| 77 |
| 78 if (defined(invoker.executable_overrides)) { |
| 79 args += |
| 80 [ "--override-service-executables" ] + invoker.executable_overrides |
| 81 } |
| 82 |
| 83 if (defined(invoker.included_catalogs)) { |
| 84 args += [ "--include-catalogs" ] |
| 85 foreach(catalog_filename, invoker.included_catalogs) { |
| 86 args += [ rebase_path(catalog_filename) ] |
| 87 } |
| 88 } |
| 89 |
| 90 if (defined(invoker.deps)) { |
| 91 deps = invoker.deps |
| 92 } |
| 93 } |
| 94 } |
OLD | NEW |