Merge "Parameterize scopes with additional droidstubs args" into rvc-dev

This commit is contained in:
TreeHugger Robot 2020-04-23 15:19:36 +00:00 committed by Android (Google) Code Review
commit 1b846d6a08
1 changed files with 7 additions and 6 deletions

View File

@ -86,6 +86,9 @@ type apiScope struct {
// *current. Older stubs library built with a numbered SDK version is created from
// the prebuilt jar.
sdkVersion string
// Extra arguments to pass to droidstubs for this scope.
droidstubsArgs []string
}
// Initialize a scope, creating and adding appropriate dependency tags
@ -131,6 +134,7 @@ var (
moduleSuffix: sdkSystemApiSuffix,
apiFileMakeVariableSuffix: "_SYSTEM",
sdkVersion: "system_current",
droidstubsArgs: []string{"-showAnnotation android.annotation.SystemApi"},
})
apiScopeTest = initApiScope(&apiScope{
name: "test",
@ -138,6 +142,7 @@ var (
moduleSuffix: sdkTestApiSuffix,
apiFileMakeVariableSuffix: "_TEST",
sdkVersion: "test_current",
droidstubsArgs: []string{"-showAnnotation android.annotation.TestApi"},
})
allApiScopes = apiScopes{
apiScopePublic,
@ -528,12 +533,8 @@ func (module *SdkLibrary) createStubsSources(mctx android.LoadHookContext, apiSc
}
droidstubsArgs = append(droidstubsArgs, android.JoinWithPrefix(disabledWarnings, "--hide "))
switch apiScope {
case apiScopeSystem:
droidstubsArgs = append(droidstubsArgs, "-showAnnotation android.annotation.SystemApi")
case apiScopeTest:
droidstubsArgs = append(droidstubsArgs, " -showAnnotation android.annotation.TestApi")
}
// Add in scope specific arguments.
droidstubsArgs = append(droidstubsArgs, apiScope.droidstubsArgs...)
props.Arg_files = module.sdkLibraryProperties.Droiddoc_option_files
props.Args = proptools.StringPtr(strings.Join(droidstubsArgs, " "))