aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLuca Stefani <luca.stefani.ge1@gmail.com>2019-09-01 21:49:45 +0200
committerLuca Stefani <luca.stefani.ge1@gmail.com>2019-09-04 15:14:54 +0200
commit8fa17df6a02ff77e881c24f098210624b0a31672 (patch)
tree36a9eb2cd6430e873bf79b6801b1e891843b665a
parent131f7d9d575ebde366d326f0322de45ca3190e87 (diff)
downloadbuild_soong-8fa17df6a02ff77e881c24f098210624b0a31672.tar.gz
build_soong-8fa17df6a02ff77e881c24f098210624b0a31672.tar.bz2
build_soong-8fa17df6a02ff77e881c24f098210624b0a31672.zip
Bring back env flag to skip checkapi
* This was removed while moving to soong Change-Id: Ibb41838b891a8a7ede48e687e8da16f87ad0a57b
-rw-r--r--java/droiddoc.go30
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")