diff options
author | Paul Duffin <paulduffin@google.com> | 2021-04-29 19:36:33 +0100 |
---|---|---|
committer | Paul Duffin <paulduffin@google.com> | 2021-04-29 19:50:40 +0100 |
commit | c027119e73e9a211b7d2c1cafc978a750f11e920 (patch) | |
tree | d01e0f0fbdb2a9aa4d09897d910b5f202d6bd2b8 /java/platform_bootclasspath.go | |
parent | 86477cfeb210252e477bcf712d8887c6157a57e8 (diff) |
Fix build failure when building unbundled apps
Bug: 186695448
Bug: 185828824
Test: tapas Calendar
m -j60
Change-Id: I1c5365f6d2afb2f2d159e6f6ed004647ec6d2427
Diffstat (limited to 'java/platform_bootclasspath.go')
-rw-r--r-- | java/platform_bootclasspath.go | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/java/platform_bootclasspath.go b/java/platform_bootclasspath.go index d341591d3..b256d76de 100644 --- a/java/platform_bootclasspath.go +++ b/java/platform_bootclasspath.go @@ -209,7 +209,17 @@ func (b *platformBootclasspathModule) generateHiddenAPIBuildActions(ctx android. // Don't run any hiddenapi rules if UNSAFE_DISABLE_HIDDENAPI_FLAGS=true. This is a performance // optimization that can be used to reduce the incremental build time but as its name suggests it // can be unsafe to use, e.g. when the changes affect anything that goes on the bootclasspath. - if ctx.Config().IsEnvTrue("UNSAFE_DISABLE_HIDDENAPI_FLAGS") { + // Instead create some rules to create fake hidden api files. + config := ctx.Config() + fakeHiddenApiRules := config.IsEnvTrue("UNSAFE_DISABLE_HIDDENAPI_FLAGS") + + // Don't run them in an unbundled build either because the chances are that the modules needed + // are not available. + fakeHiddenApiRules = fakeHiddenApiRules || config.UnbundledBuild() + + // Don't run them when always using prebuilts as they won't necessarily have the dex boot jars + // available. + if fakeHiddenApiRules { paths := android.OutputPaths{b.hiddenAPIFlagsCSV, b.hiddenAPIIndexCSV, b.hiddenAPIMetadataCSV} for _, path := range paths { ctx.Build(pctx, android.BuildParams{ |