[go: nahoru, domu]

[SM] Generate C++ sources for all manifest targets

Reland of r618718, unchanged. Was reverted so that an unrelated
dependency CL could be reverted.

Changes the service_manifest target to emit C++ sources for that
specific Manifest definition. Previously we only generated sources
for catalog_cpp_source targets, which aggregated JSON data from
multiple service_manifest targets.

Every service_manifest GN template thus now emits two artifacts:
the same collated JSON as before (including packaged services and
overlays), since embedders use this to generate runtime
manifest resources; and a new source_set target which expresses the
same manifest in terms of C++ sources, with proper dependencies
on each dependency manifest's source_set.

The point of this is to make it possible for incremental migration away
from generated code and over to code that lives in the source tree.
For example, many implementations of ContentBrowserClient override
GetServiceManifestOverlay() and use parsed JSON resources at runtime
to construct a Manifest object. After this change, any of those
cases can be individually converted to use the generated source_set
instead of the generated JSON, and the JSON resource can be deleted.

Once this lands, catalog targets can also be eliminated and replaced by
helpers in the tree which return the same lists of manifests that the
catalog-generated code returns now. Finally, after all that, remaining
service manifests can be (mostly) independently pulled out of generated
code. The end result will be: no more JSON manifests anywhere, no more
catalog() or catalog_cpp_source() GN targets, and no more
service_manifest() GN targets.

TBR=dpranke@chromium.org
TBR=oksamyt@chromium.org
TBR=sky@chromium.org

Bug: 895616
Change-Id: I67a4fd11d6ebb2585dd7897c777458d5b31b1961
Reviewed-on: https://chromium-review.googlesource.com/c/1390768
Commit-Queue: Ken Rockot <rockot@google.com>
Reviewed-by: Ken Rockot <rockot@google.com>
Cr-Commit-Position: refs/heads/master@{#618909}
18 files changed