apex_manifest in protobuf binary format

For Q compatibility, .json files are also bundled.

Three different apex_manifest files are built from input.
- apex_manifest.json: Q-readable .json file
- apex_manifest_full.json: input + dependency
- apex_manifest.pb: apex: converted from apex_manifest_full.json

apexer will handle these files.

Bug: 143654022
Test: m
Change-Id: I9697094057f0c0543282b1b46b7535cf21431176
diff --git a/apex/apex_test.go b/apex/apex_test.go
index 77c1fb0..8b49e99 100644
--- a/apex/apex_test.go
+++ b/apex/apex_test.go
@@ -517,6 +517,26 @@
 	ensureListContains(t, noticeInputs, "custom_notice")
 }
 
+func TestApexManifest(t *testing.T) {
+	ctx, _ := testApex(t, `
+		apex {
+			name: "myapex",
+			key: "myapex.key",
+		}
+
+		apex_key {
+			name: "myapex.key",
+			public_key: "testkey.avbpubkey",
+			private_key: "testkey.pem",
+		}
+	`)
+
+	module := ctx.ModuleForTests("myapex", "android_common_myapex_image")
+	module.Output("apex_manifest.pb")
+	module.Output("apex_manifest.json")
+	module.Output("apex_manifest_full.json")
+}
+
 func TestBasicZipApex(t *testing.T) {
 	ctx, _ := testApex(t, `
 		apex {