Introduce min_sdk_version to deps info.
Bug: 149622332
Test: m
Change-Id: Ie6568cb8a82d5cca9a3dc91b5a068abf4b0632dc
diff --git a/android/apex.go b/android/apex.go
index 1c2feb9..9056c3d 100644
--- a/android/apex.go
+++ b/android/apex.go
@@ -413,21 +413,29 @@
From []string
// Whether the dependency belongs to the final compiled APEX.
IsExternal bool
+ // min_sdk_version of the ApexModule
+ MinSdkVersion string
}
// A map of a dependency name to its ApexModuleDepInfo
type DepNameToDepInfoMap map[string]ApexModuleDepInfo
type ApexBundleDepsInfo struct {
- flatListPath OutputPath
- fullListPath OutputPath
+ minSdkVersion string
+ flatListPath OutputPath
+ fullListPath OutputPath
}
type ApexDepsInfoIntf interface {
+ MinSdkVersion() string
FlatListPath() Path
FullListPath() Path
}
+func (d *ApexBundleDepsInfo) MinSdkVersion() string {
+ return d.minSdkVersion
+}
+
func (d *ApexBundleDepsInfo) FlatListPath() Path {
return d.flatListPath
}
@@ -441,14 +449,16 @@
// Generate two module out files:
// 1. FullList with transitive deps and their parents in the dep graph
// 2. FlatList with a flat list of transitive deps
-func (d *ApexBundleDepsInfo) BuildDepsInfoLists(ctx ModuleContext, depInfos DepNameToDepInfoMap) {
+func (d *ApexBundleDepsInfo) BuildDepsInfoLists(ctx ModuleContext, minSdkVersion string, depInfos DepNameToDepInfoMap) {
+ d.minSdkVersion = minSdkVersion
+
var fullContent strings.Builder
var flatContent strings.Builder
- fmt.Fprintf(&flatContent, "%s:\\n", ctx.ModuleName())
+ fmt.Fprintf(&flatContent, "%s(minSdkVersion:%s):\\n", ctx.ModuleName(), minSdkVersion)
for _, key := range FirstUniqueStrings(SortedStringKeys(depInfos)) {
info := depInfos[key]
- toName := info.To
+ toName := fmt.Sprintf("%s(minSdkVersion:%s)", info.To, info.MinSdkVersion)
if info.IsExternal {
toName = toName + " (external)"
}