Merge "Do not include assets in autogenerated RROs" into main am: 2c38ba575c
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3390844 Change-Id: If6f571b8c60a7fad16f06ca00cab55ae35ad8820 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
commit
4a8bac7e5a
1 changed files with 9 additions and 3 deletions
12
java/aar.go
12
java/aar.go
|
|
@ -257,7 +257,7 @@ func (a *aapt) IsRROEnforced(ctx android.BaseModuleContext) bool {
|
|||
}
|
||||
|
||||
func (a *aapt) aapt2Flags(ctx android.ModuleContext, sdkContext android.SdkContext,
|
||||
manifestPath android.Path) (compileFlags, linkFlags []string, linkDeps android.Paths,
|
||||
manifestPath android.Path, doNotIncludeAssetDirImplicitly bool) (compileFlags, linkFlags []string, linkDeps android.Paths,
|
||||
resDirs, overlayDirs []globbedResourceDir, rroDirs []rroDir, resZips android.Paths) {
|
||||
|
||||
hasVersionCode := android.PrefixInList(a.aaptProperties.Aaptflags, "--version-code")
|
||||
|
|
@ -274,7 +274,12 @@ func (a *aapt) aapt2Flags(ctx android.ModuleContext, sdkContext android.SdkConte
|
|||
Paths: a.aaptProperties.Assets,
|
||||
IncludeDirs: false,
|
||||
})
|
||||
assetDirs := android.PathsWithOptionalDefaultForModuleSrc(ctx, a.aaptProperties.Asset_dirs, "assets")
|
||||
var assetDirs android.Paths
|
||||
if doNotIncludeAssetDirImplicitly {
|
||||
assetDirs = android.PathsForModuleSrc(ctx, a.aaptProperties.Asset_dirs)
|
||||
} else {
|
||||
assetDirs = android.PathsWithOptionalDefaultForModuleSrc(ctx, a.aaptProperties.Asset_dirs, "assets")
|
||||
}
|
||||
resourceDirs := android.PathsWithOptionalDefaultForModuleSrc(ctx, a.aaptProperties.Resource_dirs.GetOrDefault(ctx, nil), "res")
|
||||
resourceZips := android.PathsForModuleSrc(ctx, a.aaptProperties.Resource_zips)
|
||||
|
||||
|
|
@ -494,7 +499,8 @@ func (a *aapt) buildActions(ctx android.ModuleContext, opts aaptBuildActionOptio
|
|||
a.mergedManifestFile = manifestPath
|
||||
}
|
||||
|
||||
compileFlags, linkFlags, linkDeps, resDirs, overlayDirs, rroDirs, resZips := a.aapt2Flags(ctx, opts.sdkContext, manifestPath)
|
||||
// do not include assets in autogenerated RRO.
|
||||
compileFlags, linkFlags, linkDeps, resDirs, overlayDirs, rroDirs, resZips := a.aapt2Flags(ctx, opts.sdkContext, manifestPath, opts.rroDirs != nil)
|
||||
|
||||
a.rroDirsDepSet = depset.NewBuilder[rroDir](depset.TOPOLOGICAL).
|
||||
Direct(rroDirs...).
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue