diff options
-rw-r--r-- | java/droiddoc.go | 30 |
1 files changed, 16 insertions, 14 deletions
diff --git a/java/droiddoc.go b/java/droiddoc.go index fd7e2a48..9d4790c4 100644 --- a/java/droiddoc.go +++ b/java/droiddoc.go @@ -424,8 +424,10 @@ func InitDroiddocModule(module android.DefaultableModule, hod android.HostOrDevi android.InitDefaultableModule(module) } -func apiCheckEnabled(apiToCheck ApiToCheck, apiVersionTag string) bool { - if String(apiToCheck.Api_file) != "" && String(apiToCheck.Removed_api_file) != "" { +func apiCheckEnabled(ctx android.ModuleContext, apiToCheck ApiToCheck, apiVersionTag string) bool { + if ctx.Config().IsEnvTrue("WITHOUT_CHECK_API") { + return false + } else if String(apiToCheck.Api_file) != "" && String(apiToCheck.Removed_api_file) != "" { return true } else if String(apiToCheck.Api_file) != "" { panic("for " + apiVersionTag + " removed_api_file has to be non-empty!") @@ -988,8 +990,8 @@ func (d *Droiddoc) collectDoclavaDocsFlags(ctx android.ModuleContext, implicits func (d *Droiddoc) collectStubsFlags(ctx android.ModuleContext, implicitOutputs *android.WritablePaths) string { var doclavaFlags string - if apiCheckEnabled(d.properties.Check_api.Current, "current") || - apiCheckEnabled(d.properties.Check_api.Last_released, "last_released") || + if apiCheckEnabled(ctx, d.properties.Check_api.Current, "current") || + apiCheckEnabled(ctx, d.properties.Check_api.Last_released, "last_released") || String(d.properties.Api_filename) != "" { d.apiFile = android.PathForModuleOut(ctx, ctx.ModuleName()+"_api.txt") doclavaFlags += " -api " + d.apiFile.String() @@ -997,8 +999,8 @@ func (d *Droiddoc) collectStubsFlags(ctx android.ModuleContext, d.apiFilePath = d.apiFile } - if apiCheckEnabled(d.properties.Check_api.Current, "current") || - apiCheckEnabled(d.properties.Check_api.Last_released, "last_released") || + if apiCheckEnabled(ctx, d.properties.Check_api.Current, "current") || + apiCheckEnabled(ctx, d.properties.Check_api.Last_released, "last_released") || String(d.properties.Removed_api_filename) != "" { d.removedApiFile = android.PathForModuleOut(ctx, ctx.ModuleName()+"_removed.txt") doclavaFlags += " -removedApi " + d.removedApiFile.String() @@ -1178,7 +1180,7 @@ func (d *Droiddoc) GenerateAndroidBuildActions(ctx android.ModuleContext) { flags.postDoclavaCmds) } - if apiCheckEnabled(d.properties.Check_api.Current, "current") && + if apiCheckEnabled(ctx, d.properties.Check_api.Current, "current") && !ctx.Config().IsPdkBuild() { apiFile := ctx.ExpandSource(String(d.properties.Check_api.Current.Api_file), "check_api.current.api_file") @@ -1204,7 +1206,7 @@ func (d *Droiddoc) GenerateAndroidBuildActions(ctx android.ModuleContext) { d.updateCurrentApiTimestamp) } - if apiCheckEnabled(d.properties.Check_api.Last_released, "last_released") && + if apiCheckEnabled(ctx, d.properties.Check_api.Last_released, "last_released") && !ctx.Config().IsPdkBuild() { apiFile := ctx.ExpandSource(String(d.properties.Check_api.Last_released.Api_file), "check_api.last_released.api_file") @@ -1328,8 +1330,8 @@ func (d *Droidstubs) initBuilderFlags(ctx android.ModuleContext, implicits *andr func (d *Droidstubs) collectStubsFlags(ctx android.ModuleContext, implicitOutputs *android.WritablePaths) string { var metalavaFlags string - if apiCheckEnabled(d.properties.Check_api.Current, "current") || - apiCheckEnabled(d.properties.Check_api.Last_released, "last_released") || + if apiCheckEnabled(ctx, d.properties.Check_api.Current, "current") || + apiCheckEnabled(ctx, d.properties.Check_api.Last_released, "last_released") || String(d.properties.Api_filename) != "" { d.apiFile = android.PathForModuleOut(ctx, ctx.ModuleName()+"_api.txt") metalavaFlags = metalavaFlags + " --api " + d.apiFile.String() @@ -1337,8 +1339,8 @@ func (d *Droidstubs) collectStubsFlags(ctx android.ModuleContext, d.apiFilePath = d.apiFile } - if apiCheckEnabled(d.properties.Check_api.Current, "current") || - apiCheckEnabled(d.properties.Check_api.Last_released, "last_released") || + if apiCheckEnabled(ctx, d.properties.Check_api.Current, "current") || + apiCheckEnabled(ctx, d.properties.Check_api.Last_released, "last_released") || String(d.properties.Removed_api_filename) != "" { d.removedApiFile = android.PathForModuleOut(ctx, ctx.ModuleName()+"_removed.txt") metalavaFlags = metalavaFlags + " --removed-api " + d.removedApiFile.String() @@ -1649,7 +1651,7 @@ func (d *Droidstubs) GenerateAndroidBuildActions(ctx android.ModuleContext) { flags.metalavaStubsFlags+flags.metalavaAnnotationsFlags+flags.metalavaInclusionAnnotationsFlags+ flags.metalavaApiLevelsAnnotationsFlags+flags.metalavaApiToXmlFlags+" "+d.Javadoc.args) - if apiCheckEnabled(d.properties.Check_api.Current, "current") && + if apiCheckEnabled(ctx, d.properties.Check_api.Current, "current") && !ctx.Config().IsPdkBuild() { apiFile := ctx.ExpandSource(String(d.properties.Check_api.Current.Api_file), "check_api.current.api_file") @@ -1680,7 +1682,7 @@ func (d *Droidstubs) GenerateAndroidBuildActions(ctx android.ModuleContext) { d.updateCurrentApiTimestamp) } - if apiCheckEnabled(d.properties.Check_api.Last_released, "last_released") && + if apiCheckEnabled(ctx, d.properties.Check_api.Last_released, "last_released") && !ctx.Config().IsPdkBuild() { apiFile := ctx.ExpandSource(String(d.properties.Check_api.Last_released.Api_file), "check_api.last_released.api_file") |