Run "ravenizer" on ravenwood jars

Ravenizer is a new tool to preprocess ravenwood tests.

It can optionally be applied to other java targets (for analyzing them,
etc).

The actual tool is being implemented internally, so in AOSP, we just
use a script that copies the jar file as a replacement.

Test: manual -- run `m RavenwoodBivalentTest` and make sure the ravenizer
    log message shows up.
Flag: EXEMPT host test change only
Bug: 360390999
Change-Id: I6d1f81e7c425397b16c37e7c30267957097387fd
diff --git a/java/builder.go b/java/builder.go
index 5d84d0b..02928df 100644
--- a/java/builder.go
+++ b/java/builder.go
@@ -258,6 +258,13 @@
 		},
 	)
 
+	ravenizer = pctx.AndroidStaticRule("ravenizer",
+		blueprint.RuleParams{
+			Command:     "rm -f $out && ${ravenizer} --in-jar $in --out-jar $out",
+			CommandDeps: []string{"${ravenizer}"},
+		},
+	)
+
 	zipalign = pctx.AndroidStaticRule("zipalign",
 		blueprint.RuleParams{
 			Command: "if ! ${config.ZipAlign} -c -p 4 $in > /dev/null; then " +
@@ -307,6 +314,7 @@
 	pctx.Import("android/soong/java/config")
 
 	pctx.HostBinToolVariable("aconfig", "aconfig")
+	pctx.HostBinToolVariable("ravenizer", "ravenizer")
 	pctx.HostBinToolVariable("keep-flagged-apis", "keep-flagged-apis")
 }
 
@@ -746,6 +754,16 @@
 	})
 }
 
+func TransformRavenizer(ctx android.ModuleContext, outputFile android.WritablePath,
+	inputFile android.Path) {
+	ctx.Build(pctx, android.BuildParams{
+		Rule:        ravenizer,
+		Description: "ravenizer",
+		Output:      outputFile,
+		Input:       inputFile,
+	})
+}
+
 func GenerateMainClassManifest(ctx android.ModuleContext, outputFile android.WritablePath, mainClass string) {
 	android.WriteFileRule(ctx, outputFile, "Main-Class: "+mainClass+"\n")
 }