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
diff --git a/android/paths.go b/android/paths.go
index 74d9f13..93103c9 100644
--- a/android/paths.go
+++ b/android/paths.go
@@ -1474,41 +1474,6 @@
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
// output directory.
func PathForModuleOut(ctx ModuleOutPathContext, paths ...string) ModuleOutPath {
diff --git a/cc/library.go b/cc/library.go
index c8ce6a5..7f5b019 100644
--- a/cc/library.go
+++ b/cc/library.go
@@ -1600,13 +1600,48 @@
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 {
// The logic must be consistent with classifySourceAbiDump.
isNdk := ctx.isNdk(ctx.Config())
isVndk := ctx.useVndk() && ctx.isVndk()
- refAbiDumpTextFile := android.PathForVndkRefAbiDump(ctx, vndkVersion, fileName, isNdk, isVndk, false)
- refAbiDumpGzipFile := android.PathForVndkRefAbiDump(ctx, vndkVersion, fileName, isNdk, isVndk, true)
+ refAbiDumpTextFile := pathForVndkRefAbiDump(ctx, vndkVersion, fileName, isNdk, isVndk, false)
+ refAbiDumpGzipFile := pathForVndkRefAbiDump(ctx, vndkVersion, fileName, isNdk, isVndk, true)
if refAbiDumpTextFile.Valid() {
if refAbiDumpGzipFile.Valid() {