Reland^2 "m <apex_name>-deps-info prints the internal/external deps of the APEX"
This reverts commit 7cb4d378e79ffdd46d9a675aeb9780cd6c5ee022.
Test: m
Test: ALLOW_MISSING_DEPENDENCIES=true DIST_DIR=out/dist ./art/tools/dist_linux_bionic.sh -j80 com.android.art.host
(in the master-art-host branch)
Change-Id: I9beca73aafdf42f03bfa19cf1634b2641dac417b
diff --git a/cc/cc.go b/cc/cc.go
index 04f0351..d1b97b4 100644
--- a/cc/cc.go
+++ b/cc/cc.go
@@ -398,6 +398,13 @@
return ok && ccDepTag.Shared
}
+func IsStaticDepTag(depTag blueprint.DependencyTag) bool {
+ ccDepTag, ok := depTag.(DependencyTag)
+ return ok && (ccDepTag == staticExportDepTag ||
+ ccDepTag == lateStaticDepTag ||
+ ccDepTag == wholeStaticDepTag)
+}
+
func IsRuntimeDepTag(depTag blueprint.DependencyTag) bool {
ccDepTag, ok := depTag.(DependencyTag)
return ok && ccDepTag == runtimeDepTag
@@ -463,6 +470,9 @@
makeLinkType string
// Kythe (source file indexer) paths for this compilation module
kytheFiles android.Paths
+
+ // name of the modules that are direct or indirect static deps of this module
+ allStaticDeps []string
}
func (c *Module) Toc() android.OptionalPath {
@@ -1258,6 +1268,15 @@
return results
}
+func gatherTransitiveStaticDeps(staticDeps []LinkableInterface) []string {
+ var ret []string
+ for _, dep := range staticDeps {
+ ret = append(ret, dep.Module().Name())
+ ret = append(ret, dep.AllStaticDeps()...)
+ }
+ return android.FirstUniqueStrings(ret)
+}
+
func (c *Module) IsTestPerSrcAllTestsVariation() bool {
test, ok := c.linker.(testPerSrc)
return ok && test.isAllTestsVariation()
@@ -2328,6 +2347,8 @@
c.sabi.Properties.ReexportedIncludes = android.FirstUniqueStrings(c.sabi.Properties.ReexportedIncludes)
}
+ c.allStaticDeps = gatherTransitiveStaticDeps(directStaticDeps)
+
return depPaths
}
@@ -2481,6 +2502,10 @@
return false
}
+func (c *Module) AllStaticDeps() []string {
+ return c.allStaticDeps
+}
+
func (c *Module) AndroidMkWriteAdditionalDependenciesForSourceAbiDiff(w io.Writer) {
if c.linker != nil {
if library, ok := c.linker.(*libraryDecorator); ok {