Prepare to generate "runtime" stubs in droidstubs
In order to prepare generating "runtime" stubs in droidstubs, this
change performs some cleanups, which are:
- Modify droidstubs providers methods to take a StubsType enum as an
input, in order to remove exportable-specific providers. The methods
are also modifed to return an error when the artifact is not provided
for the input StubsType.
- Wrap droidstubs artifact to a struct. This removes artifacts common to
all stubs types from being written out as a individual module property
(e.g. exportableAnnotationsZip -> exportableArtifacts.annotationsZip)
Test: m nothing --no-skip-soong-tests
Bug: 319162970
Change-Id: I6d6c57c5417ca71eab5ddda7981b71fd84fa6ee1
diff --git a/java/androidmk.go b/java/androidmk.go
index cc0efe9..c86dcf4 100644
--- a/java/androidmk.go
+++ b/java/androidmk.go
@@ -587,7 +587,7 @@
outputFile = android.OptionalPathForPath(dstubs.apiFile)
}
if !outputFile.Valid() {
- outputFile = android.OptionalPathForPath(dstubs.apiVersionsXml)
+ outputFile = android.OptionalPathForPath(dstubs.everythingArtifacts.apiVersionsXml)
}
return []android.AndroidMkEntries{android.AndroidMkEntries{
Class: "JAVA_LIBRARIES",
@@ -598,14 +598,14 @@
if dstubs.Javadoc.stubsSrcJar != nil {
entries.SetPath("LOCAL_DROIDDOC_STUBS_SRCJAR", dstubs.Javadoc.stubsSrcJar)
}
- if dstubs.apiVersionsXml != nil {
- entries.SetPath("LOCAL_DROIDDOC_API_VERSIONS_XML", dstubs.apiVersionsXml)
+ if dstubs.everythingArtifacts.apiVersionsXml != nil {
+ entries.SetPath("LOCAL_DROIDDOC_API_VERSIONS_XML", dstubs.everythingArtifacts.apiVersionsXml)
}
- if dstubs.annotationsZip != nil {
- entries.SetPath("LOCAL_DROIDDOC_ANNOTATIONS_ZIP", dstubs.annotationsZip)
+ if dstubs.everythingArtifacts.annotationsZip != nil {
+ entries.SetPath("LOCAL_DROIDDOC_ANNOTATIONS_ZIP", dstubs.everythingArtifacts.annotationsZip)
}
- if dstubs.metadataZip != nil {
- entries.SetPath("LOCAL_DROIDDOC_METADATA_ZIP", dstubs.metadataZip)
+ if dstubs.everythingArtifacts.metadataZip != nil {
+ entries.SetPath("LOCAL_DROIDDOC_METADATA_ZIP", dstubs.everythingArtifacts.metadataZip)
}
},
},