Add a trace_references_from dex optimization property

Introduce a new property `trace_references_from` in the optimize block.
This field allows specifying a set of downstream targets from which to
trace references when optimizing the current target.

In practice, this requires explicit breaking of any cycles that might
occur. A follow-up effort will explore doing this dynamically and
implicitly for `libs` references onto an optimized target that
enables this feature.

Bug: 212737576
Test: m nothing
Test: go test ./java
Flag: EXEMPT bugfix
Change-Id: I088bd8bf89403661a084a43b2822a6efbbc0294d
diff --git a/java/java.go b/java/java.go
index 215fbbd..372e043 100644
--- a/java/java.go
+++ b/java/java.go
@@ -578,6 +578,7 @@
 	extraLintCheckTag       = dependencyTag{name: "extra-lint-check", toolchain: true}
 	jniLibTag               = dependencyTag{name: "jnilib", runtimeLinked: true}
 	r8LibraryJarTag         = dependencyTag{name: "r8-libraryjar", runtimeLinked: true}
+	traceReferencesTag      = dependencyTag{name: "trace-references"}
 	syspropPublicStubDepTag = dependencyTag{name: "sysprop public stub"}
 	javaApiContributionTag  = dependencyTag{name: "java-api-contribution"}
 	aconfigDeclarationTag   = dependencyTag{name: "aconfig-declaration"}
@@ -608,6 +609,7 @@
 		kotlinPluginTag,
 		syspropPublicStubDepTag,
 		instrumentationForTag,
+		traceReferencesTag,
 	}
 )