For abi diffing, factor in arch variant and primary arch.

am: ac066c6b90

Change-Id: Ifb7df61cee156e4578bf8af90b7d9263335c4448
This commit is contained in:
Jayant Chowdhary 2018-03-02 01:50:05 +00:00 committed by android-build-merger
commit 1bb2bac825

View file

@ -776,7 +776,12 @@ 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, isSourceDump bool) OptionalPath {
archName := ctx.Arch().ArchType.Name
arches := ctx.DeviceConfig().Arches()
currentArch := ctx.Arch()
archNameAndVariant := currentArch.ArchType.String()
if currentArch.ArchVariant != "" {
archNameAndVariant += "_" + currentArch.ArchVariant
}
var sourceOrBinaryDir string
var vndkOrNdkDir string
var ext string
@ -792,8 +797,12 @@ func PathForVndkRefAbiDump(ctx ModuleContext, version, fileName string, vndkOrNd
} else {
vndkOrNdkDir = "ndk"
}
refDumpFileStr := "prebuilts/abi-dumps/" + vndkOrNdkDir + "/" + version + "/" +
archName + "/" + sourceOrBinaryDir + "/" + fileName + ext
if len(arches) == 0 {
panic("device build with no primary arch")
}
primary_arch := arches[0].ArchType.String()
refDumpFileStr := "prebuilts/abi-dumps/" + vndkOrNdkDir + "/" + version + "/" + primary_arch + "/" +
archNameAndVariant + "/" + sourceOrBinaryDir + "/" + fileName + ext
return ExistentPathForSource(ctx, refDumpFileStr)
}