Introduce library property is_stubs_module
is_stubs_module property signifies whether the module compiles stubs or
not. The information is propagated to the reverse dependencies of the
java_library/java_sdk_library modules via JavaInfoProvider as
StubsLinkType, a ternary state that provides information about whether
the provided jars are compilation of stubs or implementation, or
unknown.
When java_sdk_library sets StubsLinkType, its state is Unknown as the
decision of providing stubs vs implementation jar differs by the reverse
dependency.
Note that this CL does NOT propagate the property up to its reverse
dependencies. This will be done in follow up CLs.
Test: m nothing
Bug: 310504781
Merged-In: Ic81488dbd1c9af1b5d31a33e5e9441d9f1416dbe
Change-Id: Ic81488dbd1c9af1b5d31a33e5e9441d9f1416dbe
diff --git a/java/aar.go b/java/aar.go
index f61fc83..92c1adf 100644
--- a/java/aar.go
+++ b/java/aar.go
@@ -23,6 +23,7 @@
"android/soong/android"
"android/soong/dexpreopt"
+
"github.com/google/blueprint"
"github.com/google/blueprint/proptools"
)
@@ -1250,6 +1251,7 @@
TransitiveStaticLibsHeaderJars: a.transitiveStaticLibsHeaderJars,
ImplementationAndResourcesJars: android.PathsIfNonNil(a.classpathFile),
ImplementationJars: android.PathsIfNonNil(a.classpathFile),
+ StubsLinkType: Implementation,
// TransitiveAconfigFiles: // TODO(b/289117800): LOCAL_ACONFIG_FILES for prebuilts
})