From ee11328709ae33b5e1a904c75c2120e5c4f846a5 Mon Sep 17 00:00:00 2001 From: Jihoon Kang Date: Tue, 23 Jan 2024 00:16:41 +0000 Subject: 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 --- java/androidmk.go | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'java/androidmk.go') diff --git a/java/androidmk.go b/java/androidmk.go index cc0efe9b8..c86dcf4be 100644 --- a/java/androidmk.go +++ b/java/androidmk.go @@ -587,7 +587,7 @@ func (dstubs *Droidstubs) AndroidMkEntries() []android.AndroidMkEntries { 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 @@ func (dstubs *Droidstubs) AndroidMkEntries() []android.AndroidMkEntries { 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) } }, }, -- cgit v1.2.3-59-g8ed1b