Move function PathForVndkRefAbiDump to Prevent unnecessary exports in paths.go
This CL moves function PathForVndkRefAbiDump from android/paths.go to cc/library.go to prevent unnecessary exports. Test: make libz Bug: 239915696 Change-Id: I1270e8d07edb09d93621c049acab9196757d356b
This commit is contained in:
@@ -1474,41 +1474,6 @@ func pathForModuleOut(ctx ModuleOutPathContext) OutputPath {
|
|||||||
return PathForOutput(ctx, ".intermediates", ctx.ModuleDir(), ctx.ModuleName(), ctx.ModuleSubDir())
|
return PathForOutput(ctx, ".intermediates", ctx.ModuleDir(), ctx.ModuleName(), ctx.ModuleSubDir())
|
||||||
}
|
}
|
||||||
|
|
||||||
// PathForVndkRefAbiDump 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 ModuleInstallPathContext, version, fileName string,
|
|
||||||
isNdk, isVndk, isGzip bool) OptionalPath {
|
|
||||||
|
|
||||||
currentArchType := ctx.Arch().ArchType
|
|
||||||
primaryArchType := ctx.Config().DevicePrimaryArchType()
|
|
||||||
archName := currentArchType.String()
|
|
||||||
if currentArchType != primaryArchType {
|
|
||||||
archName += "_" + primaryArchType.String()
|
|
||||||
}
|
|
||||||
|
|
||||||
var dirName string
|
|
||||||
if isNdk {
|
|
||||||
dirName = "ndk"
|
|
||||||
} else if isVndk {
|
|
||||||
dirName = "vndk"
|
|
||||||
} else {
|
|
||||||
dirName = "platform" // opt-in libs
|
|
||||||
}
|
|
||||||
|
|
||||||
binderBitness := ctx.DeviceConfig().BinderBitness()
|
|
||||||
|
|
||||||
var ext string
|
|
||||||
if isGzip {
|
|
||||||
ext = ".lsdump.gz"
|
|
||||||
} else {
|
|
||||||
ext = ".lsdump"
|
|
||||||
}
|
|
||||||
|
|
||||||
return ExistentPathForSource(ctx, "prebuilts", "abi-dumps", dirName,
|
|
||||||
version, binderBitness, archName, "source-based",
|
|
||||||
fileName+ext)
|
|
||||||
}
|
|
||||||
|
|
||||||
// PathForModuleOut returns a Path representing the paths... under the module's
|
// PathForModuleOut returns a Path representing the paths... under the module's
|
||||||
// output directory.
|
// output directory.
|
||||||
func PathForModuleOut(ctx ModuleOutPathContext, paths ...string) ModuleOutPath {
|
func PathForModuleOut(ctx ModuleOutPathContext, paths ...string) ModuleOutPath {
|
||||||
|
@@ -1600,13 +1600,48 @@ func (library *libraryDecorator) coverageOutputFilePath() android.OptionalPath {
|
|||||||
return library.coverageOutputFile
|
return library.coverageOutputFile
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// pathForVndkRefAbiDump 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 android.ModuleInstallPathContext, version, fileName string,
|
||||||
|
isNdk, isVndk, isGzip bool) android.OptionalPath {
|
||||||
|
|
||||||
|
currentArchType := ctx.Arch().ArchType
|
||||||
|
primaryArchType := ctx.Config().DevicePrimaryArchType()
|
||||||
|
archName := currentArchType.String()
|
||||||
|
if currentArchType != primaryArchType {
|
||||||
|
archName += "_" + primaryArchType.String()
|
||||||
|
}
|
||||||
|
|
||||||
|
var dirName string
|
||||||
|
if isNdk {
|
||||||
|
dirName = "ndk"
|
||||||
|
} else if isVndk {
|
||||||
|
dirName = "vndk"
|
||||||
|
} else {
|
||||||
|
dirName = "platform" // opt-in libs
|
||||||
|
}
|
||||||
|
|
||||||
|
binderBitness := ctx.DeviceConfig().BinderBitness()
|
||||||
|
|
||||||
|
var ext string
|
||||||
|
if isGzip {
|
||||||
|
ext = ".lsdump.gz"
|
||||||
|
} else {
|
||||||
|
ext = ".lsdump"
|
||||||
|
}
|
||||||
|
|
||||||
|
return android.ExistentPathForSource(ctx, "prebuilts", "abi-dumps", dirName,
|
||||||
|
version, binderBitness, archName, "source-based",
|
||||||
|
fileName+ext)
|
||||||
|
}
|
||||||
|
|
||||||
func getRefAbiDumpFile(ctx ModuleContext, vndkVersion, fileName string) android.Path {
|
func getRefAbiDumpFile(ctx ModuleContext, vndkVersion, fileName string) android.Path {
|
||||||
// The logic must be consistent with classifySourceAbiDump.
|
// The logic must be consistent with classifySourceAbiDump.
|
||||||
isNdk := ctx.isNdk(ctx.Config())
|
isNdk := ctx.isNdk(ctx.Config())
|
||||||
isVndk := ctx.useVndk() && ctx.isVndk()
|
isVndk := ctx.useVndk() && ctx.isVndk()
|
||||||
|
|
||||||
refAbiDumpTextFile := android.PathForVndkRefAbiDump(ctx, vndkVersion, fileName, isNdk, isVndk, false)
|
refAbiDumpTextFile := pathForVndkRefAbiDump(ctx, vndkVersion, fileName, isNdk, isVndk, false)
|
||||||
refAbiDumpGzipFile := android.PathForVndkRefAbiDump(ctx, vndkVersion, fileName, isNdk, isVndk, true)
|
refAbiDumpGzipFile := pathForVndkRefAbiDump(ctx, vndkVersion, fileName, isNdk, isVndk, true)
|
||||||
|
|
||||||
if refAbiDumpTextFile.Valid() {
|
if refAbiDumpTextFile.Valid() {
|
||||||
if refAbiDumpGzipFile.Valid() {
|
if refAbiDumpGzipFile.Valid() {
|
||||||
|
Reference in New Issue
Block a user