Merge "Simple refactoring of prefix related functions." am: 36b6aec26a
am: 9bc4a38707
am: 7f2487d5cc
Change-Id: Ia383f411632524fa2fb3fb238f754900564172c7
This commit is contained in:
13
java/aar.go
13
java/aar.go
@@ -134,15 +134,8 @@ func (a *aapt) aapt2Flags(ctx android.ModuleContext, sdkContext sdkContext,
|
||||
manifestPath android.Path) (compileFlags, linkFlags []string, linkDeps android.Paths,
|
||||
resDirs, overlayDirs []globbedResourceDir, rroDirs []rroDir, resZips android.Paths) {
|
||||
|
||||
hasVersionCode := false
|
||||
hasVersionName := false
|
||||
for _, f := range a.aaptProperties.Aaptflags {
|
||||
if strings.HasPrefix(f, "--version-code") {
|
||||
hasVersionCode = true
|
||||
} else if strings.HasPrefix(f, "--version-name") {
|
||||
hasVersionName = true
|
||||
}
|
||||
}
|
||||
hasVersionCode := android.PrefixInList(a.aaptProperties.Aaptflags, "--version-code")
|
||||
hasVersionName := android.PrefixInList(a.aaptProperties.Aaptflags, "--version-name")
|
||||
|
||||
// Flags specified in Android.bp
|
||||
linkFlags = append(linkFlags, a.aaptProperties.Aaptflags...)
|
||||
@@ -337,7 +330,7 @@ func (a *aapt) buildActions(ctx android.ModuleContext, sdkContext sdkContext, ex
|
||||
|
||||
// Extract assets from the resource package output so that they can be used later in aapt2link
|
||||
// for modules that depend on this one.
|
||||
if android.PrefixedStringInList(linkFlags, "-A ") || len(assetPackages) > 0 {
|
||||
if android.PrefixInList(linkFlags, "-A ") || len(assetPackages) > 0 {
|
||||
assets := android.PathForModuleOut(ctx, "assets.zip")
|
||||
ctx.Build(pctx, android.BuildParams{
|
||||
Rule: extractAssetsRule,
|
||||
|
@@ -273,13 +273,7 @@ func (a *AndroidApp) aaptBuildActions(ctx android.ModuleContext) {
|
||||
aaptLinkFlags := []string{}
|
||||
|
||||
// Add TARGET_AAPT_CHARACTERISTICS values to AAPT link flags if they exist and --product flags were not provided.
|
||||
hasProduct := false
|
||||
for _, f := range a.aaptProperties.Aaptflags {
|
||||
if strings.HasPrefix(f, "--product") {
|
||||
hasProduct = true
|
||||
break
|
||||
}
|
||||
}
|
||||
hasProduct := android.PrefixInList(a.aaptProperties.Aaptflags, "--product")
|
||||
if !hasProduct && len(ctx.Config().ProductAAPTCharacteristics()) > 0 {
|
||||
aaptLinkFlags = append(aaptLinkFlags, "--product", ctx.Config().ProductAAPTCharacteristics())
|
||||
}
|
||||
|
@@ -605,11 +605,8 @@ func (j *Javadoc) collectDeps(ctx android.ModuleContext) deps {
|
||||
continue
|
||||
}
|
||||
packageName := strings.ReplaceAll(filepath.Dir(src.Rel()), "/", ".")
|
||||
for _, pkg := range filterPackages {
|
||||
if strings.HasPrefix(packageName, pkg) {
|
||||
filtered = append(filtered, src)
|
||||
break
|
||||
}
|
||||
if android.HasAnyPrefix(packageName, filterPackages) {
|
||||
filtered = append(filtered, src)
|
||||
}
|
||||
}
|
||||
return filtered
|
||||
|
Reference in New Issue
Block a user