Remove vndkVsNdk()

This commmit removes `vndkVsNdk()`, which is essentially
`!inList(ctx.baseModuleName(), llndkLibraries)`.

Test: lunch aosp_arm64_ab-userdebug && make
Change-Id: I8e2352f302df30057997944678f176f4550d3f75
This commit is contained in:
Logan Chien 2018-07-11 17:15:57 +08:00
parent 83c415f955
commit 5237bed1c4
2 changed files with 10 additions and 14 deletions

View file

@ -828,25 +828,27 @@ func pathForModule(ctx ModuleContext) OutputPath {
// PathForVndkRefDump returns an OptionalPath representing the path of the reference
// abi dump for the given module. This is not guaranteed to be valid.
func PathForVndkRefAbiDump(ctx ModuleContext, version, fileName string, vndkOrNdk bool) OptionalPath {
func PathForVndkRefAbiDump(ctx ModuleContext, version, fileName string, isLlndk bool) OptionalPath {
arches := ctx.DeviceConfig().Arches()
currentArch := ctx.Arch()
archNameAndVariant := currentArch.ArchType.String()
if currentArch.ArchVariant != "" {
archNameAndVariant += "_" + currentArch.ArchVariant
}
var vndkOrNdkDir string
if vndkOrNdk {
vndkOrNdkDir = "vndk"
var dirName string
if isLlndk {
dirName = "ndk"
} else {
vndkOrNdkDir = "ndk"
dirName = "vndk"
}
if len(arches) == 0 {
panic("device build with no primary arch")
}
binderBitness := ctx.DeviceConfig().BinderBitness()
ext := ".lsdump.gz"
refDumpFileStr := "prebuilts/abi-dumps/" + vndkOrNdkDir + "/" + version + "/" + binderBitness + "/" +
refDumpFileStr := "prebuilts/abi-dumps/" + dirName + "/" + version + "/" + binderBitness + "/" +
archNameAndVariant + "/source-based/" + fileName + ext
return ExistentPathForSource(ctx, refDumpFileStr)
}

View file

@ -649,7 +649,8 @@ func (library *libraryDecorator) linkSAbiDumpFiles(ctx ModuleContext, objs Objec
exportedHeaderFlags := strings.Join(SourceAbiFlags, " ")
library.sAbiOutputFile = TransformDumpToLinkedDump(ctx, objs.sAbiDumpFiles, soFile, fileName, exportedHeaderFlags)
refSourceDumpFile := android.PathForVndkRefAbiDump(ctx, vndkVersion, fileName, vndkVsNdk(ctx))
isLlndk := inList(ctx.baseModuleName(), llndkLibraries)
refSourceDumpFile := android.PathForVndkRefAbiDump(ctx, vndkVersion, fileName, isLlndk)
if refSourceDumpFile.Valid() {
unzippedRefDump := UnzipRefDump(ctx, refSourceDumpFile.Path(), fileName)
library.sAbiDiff = SourceAbiDiff(ctx, library.sAbiOutputFile.Path(),
@ -658,13 +659,6 @@ func (library *libraryDecorator) linkSAbiDumpFiles(ctx ModuleContext, objs Objec
}
}
func vndkVsNdk(ctx ModuleContext) bool {
if inList(ctx.baseModuleName(), llndkLibraries) {
return false
}
return true
}
func (library *libraryDecorator) link(ctx ModuleContext,
flags Flags, deps PathDeps, objs Objects) android.Path {