Mark unresolved classes in jdeps as Kind.INCOMPLETE.
Currently, all classes from the symbol table are added to jdeps,
even if some of them haven't been resolved and as such aren't
actually used. This causes siblings from other jars (such as
R.java) to be added to jdeps, even though they are not actually
referenced. Mark these with Kind.UNRESOLVED to allow code to
discard these.
All non-test code that references Kind.IMPLICIT has been
modified to also check for Kind.INCOMPLETE to keep
the current behavior unchanged.
Eg:
jar liba.jar:
package a;
class A {
void test() {
// Use R.id
}
}
jar liba_resources.jar:
package a;
class R {
}
package b;
import a;
class MyClass {
A a = new A();
}
---> jdeps will contain both liba.jar, liba_resources.jar
the latter will now have Kind.INCOMPLETE.
--
MOS_MIGRATED_REVID=133791687
diff --git a/src/main/protobuf/deps.proto b/src/main/protobuf/deps.proto
index af35bea..8c688a7 100644
--- a/src/main/protobuf/deps.proto
+++ b/src/main/protobuf/deps.proto
@@ -36,6 +36,8 @@
IMPLICIT = 1;
// Unused dependency.
UNUSED = 2;
+ // Implicit dependency considered by the compiler but not completed.
+ INCOMPLETE = 3;
}
// Path to the artifact representing this dependency.