Merge "Keep dependency files out of the apk file."

This commit is contained in:
Treehugger Robot
2022-04-05 05:53:22 +00:00
committed by Gerrit Code Review
2 changed files with 18 additions and 6 deletions

View File

@@ -586,10 +586,16 @@ func (a *AndroidApp) generateAndroidBuildActions(ctx android.ModuleContext) {
}
a.onDeviceDir = android.InstallPathToOnDevicePath(ctx, a.installDir)
noticeFile := android.PathForModuleOut(ctx, "NOTICE", "NOTICE.html.gz")
android.BuildNoticeHtmlOutputFromLicenseMetadata(ctx, noticeFile)
if Bool(a.appProperties.Embed_notices) || ctx.Config().IsEnvTrue("ALWAYS_EMBED_NOTICES") {
a.aapt.noticeFile = android.OptionalPathForPath(noticeFile)
noticeFile := android.PathForModuleOut(ctx, "NOTICE.html.gz")
android.BuildNoticeHtmlOutputFromLicenseMetadata(ctx, noticeFile)
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)
}
a.classLoaderContexts = a.usesLibrary.classLoaderContextForUsesLibDeps(ctx)