aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2023-12-07 11:52:50 +0000
committerAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2023-12-07 11:52:50 +0000
commite7f33349dec36eb08f41898f981fb71f1d41d1c5 (patch)
tree81e95e4af1e7bad7f94aac6c4e4ee6c00641e589
parent46c86b2853cecc931e7d6d2a350b08c876bf6b01 (diff)
parent640380699f0eab0c445a59a757bb670954d8f1ed (diff)
downloadsoong-e7f33349dec36eb08f41898f981fb71f1d41d1c5.tar.gz
Snap for 11190379 from 640380699f0eab0c445a59a757bb670954d8f1ed to mainline-conscrypt-releaseaml_con_341410300android14-mainline-conscrypt-release
Change-Id: Ifa59d7983d43e888d16aedb18c40b9c859387cbc
-rw-r--r--java/sdk_library.go20
1 files changed, 19 insertions, 1 deletions
diff --git a/java/sdk_library.go b/java/sdk_library.go
index 76f050b73..853792d20 100644
--- a/java/sdk_library.go
+++ b/java/sdk_library.go
@@ -1682,6 +1682,24 @@ func (module *SdkLibrary) createStubsSourcesAndApi(mctx android.DefaultableHookC
}
droidstubsArgs = append(droidstubsArgs, android.JoinWithPrefix(disabledWarnings, "--hide "))
+ droidstubsFiles := append([]string{}, module.sdkLibraryProperties.Droiddoc_option_files...)
+
+ // If requested hide the flagged APIs from the output of metalava. This
+ // should be implemented in the module SDK snapshot code by depending on
+ // special metalava rules that hide the flagged APIs but that will take
+ // lots of work. In the meantime, this is a temporary workaround that
+ // can and will only be used when building module SDK snapshots. This
+ // delegates the decision as to what options are passed to metalava to
+ // the "sdkext-released-flagged-apis" module by using metalava's support
+ // for expanding an argument of the form "@<file>" to the list of
+ // arguments found in <file>.
+ if mctx.Config().GetenvWithDefault("SOONG_SDK_SNAPSHOT_HIDE_FLAGGED_APIS", "false") == "true" {
+ metalavaHideFlaggedApisSource := ":sdkext-released-flagged-apis"
+ droidstubsArgs = append(droidstubsArgs,
+ fmt.Sprintf("@$(location %s)", metalavaHideFlaggedApisSource))
+ droidstubsFiles = append(droidstubsFiles, metalavaHideFlaggedApisSource)
+ }
+
// Output Javadoc comments for public scope.
if apiScope == apiScopePublic {
props.Output_javadoc_comments = proptools.BoolPtr(true)
@@ -1689,7 +1707,7 @@ func (module *SdkLibrary) createStubsSourcesAndApi(mctx android.DefaultableHookC
// Add in scope specific arguments.
droidstubsArgs = append(droidstubsArgs, scopeSpecificDroidstubsArgs...)
- props.Arg_files = module.sdkLibraryProperties.Droiddoc_option_files
+ props.Arg_files = droidstubsFiles
props.Args = proptools.StringPtr(strings.Join(droidstubsArgs, " "))
// List of APIs identified from the provided source files are created. They are later