diff options
| author | 2024-01-30 02:30:06 +0000 | |
|---|---|---|
| committer | 2024-01-30 02:40:20 +0000 | |
| commit | 4f04df9f504dff89e9a5f5c2728c0579e980ce8a (patch) | |
| tree | 339d90f67967ae89f3d21a055ba250ef06502d07 /java/java.go | |
| parent | 1f4475cee17eca02464def554e5c924b14d18885 (diff) | |
Disable stub validation when `WITHOUT_CHECK_API=true`
Even when building stubs from source, the rules for the
java_api_library modules are generated although they are not
executed. This leads to NPE, as setting `WITHOUT_CHECK_API=true`
prevents `checkCurrentApiTimestamp`, which the java_api_library modules
depend on, from being generated.
To prevent the NPE, this change prevents the `checkCurrentApiTimestamp`
from being registered as the dependency of the java_api_library modules
when `WITHOUT_CHECK_API=true` is set.
Test: BUILD_FROM_SOURCE_STUB=true WITHOUT_CHECK_API=true m nothing
Bug: 320601440
Change-Id: I4f19e30d9cd74bdc20dde0d14884fb03ff223ccb
Diffstat (limited to 'java/java.go')
| -rw-r--r-- | java/java.go | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/java/java.go b/java/java.go index d18d915cc..5dada2e65 100644 --- a/java/java.go +++ b/java/java.go @@ -1837,6 +1837,7 @@ func (al *ApiLibrary) extractApiSrcs(ctx android.ModuleContext, rule *android.Ru func (al *ApiLibrary) DepsMutator(ctx android.BottomUpMutatorContext) { apiContributions := al.properties.Api_contributions addValidations := !ctx.Config().IsEnvTrue("DISABLE_STUB_VALIDATION") && + !ctx.Config().IsEnvTrue("WITHOUT_CHECK_API") && proptools.BoolDefault(al.properties.Enable_validation, true) for _, apiContributionName := range apiContributions { ctx.AddDependency(ctx.Module(), javaApiContributionTag, apiContributionName) |