diff options
Diffstat (limited to 'java/droidstubs.go')
| -rw-r--r-- | java/droidstubs.go | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/java/droidstubs.go b/java/droidstubs.go index cf3e21925..e955949af 100644 --- a/java/droidstubs.go +++ b/java/droidstubs.go @@ -769,15 +769,6 @@ func addMetalavaConfigFilesToCmd(cmd *android.RuleBuilderCommand, configFiles an // property is defined, apply transformations and only revert the flagged apis that are not // enabled via release configurations and are not specified in aconfig_declarations func generateRevertAnnotationArgs(ctx android.ModuleContext, cmd *android.RuleBuilderCommand, stubsType StubsType, aconfigFlagsPaths android.Paths) { - - if len(aconfigFlagsPaths) == 0 { - cmd.Flag("--revert-annotation android.annotation.FlaggedApi") - return - } - - releasedFlaggedApisFile := android.PathForModuleOut(ctx, fmt.Sprintf("released-flagged-apis-%s.txt", stubsType.String())) - revertAnnotationsFile := android.PathForModuleOut(ctx, fmt.Sprintf("revert-annotations-%s.txt", stubsType.String())) - var filterArgs string switch stubsType { // No flagged apis specific flags need to be passed to metalava when generating @@ -799,6 +790,15 @@ func generateRevertAnnotationArgs(ctx android.ModuleContext, cmd *android.RuleBu } } + if len(aconfigFlagsPaths) == 0 { + // This argument should not be added for "everything" stubs + cmd.Flag("--revert-annotation android.annotation.FlaggedApi") + return + } + + releasedFlaggedApisFile := android.PathForModuleOut(ctx, fmt.Sprintf("released-flagged-apis-%s.txt", stubsType.String())) + revertAnnotationsFile := android.PathForModuleOut(ctx, fmt.Sprintf("revert-annotations-%s.txt", stubsType.String())) + ctx.Build(pctx, android.BuildParams{ Rule: gatherReleasedFlaggedApisRule, Inputs: aconfigFlagsPaths, @@ -1011,7 +1011,7 @@ func (d *Droidstubs) everythingOptionalCmd(ctx android.ModuleContext, cmd *andro cmd.FlagWithOutput("--update-baseline:api-lint ", updatedBaselineOutput) msg += fmt.Sprintf(``+ - `3. FOR LSC ONLY: You can update the baseline by executing\n` + + `3. FOR LSC ONLY: You can update the baseline by executing\n`+ ` the following command:\n`+ ` (cd $ANDROID_BUILD_TOP && cp \\\n`+ ` "%s" \\\n`+ @@ -1374,7 +1374,7 @@ func (d *Droidstubs) setOutputFiles(ctx android.ModuleContext) { for _, stubType := range android.SortedKeys(stubsTypeToPrefix) { tagWithPrefix := stubsTypeToPrefix[stubType] + tag outputFile, err := tagToOutputFileFunc[tag](stubType) - if err == nil { + if err == nil && outputFile != nil { ctx.SetOutputFiles(android.Paths{outputFile}, tagWithPrefix) } } |