diff options
author | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | 2022-06-23 23:00:55 +0000 |
---|---|---|
committer | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | 2022-06-23 23:00:55 +0000 |
commit | b953dcc88c303b3b1657f4dcc74167eabf7dd81d (patch) | |
tree | 6ae1ed404983672f2b4b33a7f0d2af87c3adc72d | |
parent | 809a1f0551ee0e5895a324cd066d8b3a7099c690 (diff) | |
parent | 8378feda12bf7153757888bf44ddadc0925c9369 (diff) | |
download | soong-b953dcc88c303b3b1657f4dcc74167eabf7dd81d.tar.gz |
Snap for 8762204 from 8378feda12bf7153757888bf44ddadc0925c9369 to tm-releaseandroid-vts-13.0_r8android-vts-13.0_r7android-vts-13.0_r6android-vts-13.0_r5android-vts-13.0_r4android-vts-13.0_r3android-vts-13.0_r2android-vts-13.0_r1android-security-13.0.0_r3android-security-13.0.0_r2android-security-13.0.0_r1android-platform-13.0.0_r2android-platform-13.0.0_r1android-cts-13.0_r8android-cts-13.0_r7android-cts-13.0_r6android-cts-13.0_r5android-cts-13.0_r4android-cts-13.0_r3android-cts-13.0_r2android-cts-13.0_r1android-13.0.0_r8android-13.0.0_r7android-13.0.0_r6android-13.0.0_r5android-13.0.0_r4android-13.0.0_r31android-13.0.0_r3android-13.0.0_r2android-13.0.0_r12android-13.0.0_r1android13-tests-releaseandroid13-s3-releaseandroid13-s2-releaseandroid13-s1-releaseandroid13-release
Change-Id: I05868136eaa9382feab85bb076ce20e36866d760
-rwxr-xr-x | java/app.go | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/java/app.go b/java/app.go index 94e6fb950..41419ba78 100755 --- a/java/app.go +++ b/java/app.go @@ -589,6 +589,16 @@ func (a *AndroidApp) generateAndroidBuildActions(ctx android.ModuleContext) { a.classLoaderContexts = a.usesLibrary.classLoaderContextForUsesLibDeps(ctx) + var noticeAssetPath android.WritablePath + if Bool(a.appProperties.Embed_notices) || ctx.Config().IsEnvTrue("ALWAYS_EMBED_NOTICES") { + // The rule to create the notice file can't be generated yet, as the final output path + // for the apk isn't known yet. Add the path where the notice file will be generated to the + // aapt rules now before calling aaptBuildActions, the rule to create the notice file will + // be generated later. + noticeAssetPath = android.PathForModuleOut(ctx, "NOTICE", "NOTICE.html.gz") + a.aapt.noticeFile = android.OptionalPathForPath(noticeAssetPath) + } + // Process all building blocks, from AAPT to certificates. a.aaptBuildActions(ctx) @@ -663,7 +673,8 @@ func (a *AndroidApp) generateAndroidBuildActions(ctx android.ModuleContext) { a.extraOutputFiles = append(a.extraOutputFiles, v4SignatureFile) } - if Bool(a.appProperties.Embed_notices) || ctx.Config().IsEnvTrue("ALWAYS_EMBED_NOTICES") { + if a.aapt.noticeFile.Valid() { + // Generating the notice file rule has to be here after a.outputFile is known. noticeFile := android.PathForModuleOut(ctx, "NOTICE.html.gz") android.BuildNoticeHtmlOutputFromLicenseMetadata( ctx, noticeFile, "", "", @@ -672,13 +683,11 @@ func (a *AndroidApp) generateAndroidBuildActions(ctx android.ModuleContext) { android.PathForModuleInstall(ctx).String() + "/", a.outputFile.String(), }) - noticeAssetPath := android.PathForModuleOut(ctx, "NOTICE", "NOTICE.html.gz") builder := android.NewRuleBuilder(pctx, ctx) builder.Command().Text("cp"). Input(noticeFile). Output(noticeAssetPath) builder.Build("notice_dir", "Building notice dir") - a.aapt.noticeFile = android.OptionalPathForPath(noticeAssetPath) } for _, split := range a.aapt.splits { |