Reland "m <apex_name>-deps-info prints the internal/external deps of the APEX""
This reverts commit 4513f703f9
.
Bug: 1190898
Test: m
Test: EMMA_INSTRUMENT=true EMMA_INSTRUMENT_FRAMEWORK=true NATIVE_COVERAGE=true m dist
Change-Id: I50fdccabb43e4751694db83ee451d388657257e0
This commit is contained in:
31
apex/apex.go
31
apex/apex.go
@@ -341,6 +341,8 @@ type apexBundleProperties struct {
|
||||
// Whether this APEX should support Android10. Default is false. If this is set true, then apex_manifest.json is bundled as well
|
||||
// because Android10 requires legacy apex_manifest.json instead of apex_manifest.pb
|
||||
Legacy_android10_support *bool
|
||||
|
||||
IsCoverageVariant bool `blueprint:"mutated"`
|
||||
}
|
||||
|
||||
type apexTargetBundleProperties struct {
|
||||
@@ -520,8 +522,13 @@ type apexBundle struct {
|
||||
// list of files to be included in this apex
|
||||
filesInfo []apexFile
|
||||
|
||||
// list of module names that this APEX is depending on
|
||||
// list of module names that should be installed along with this APEX
|
||||
requiredDeps []string
|
||||
|
||||
// list of module names that this APEX is depending on (to be shown via *-deps-info target)
|
||||
externalDeps []string
|
||||
// list of module names that this APEX is including (to be shown via *-deps-info target)
|
||||
internalDeps []string
|
||||
|
||||
testApex bool
|
||||
vndkApex bool
|
||||
@@ -817,6 +824,10 @@ func (a *apexBundle) HideFromMake() {
|
||||
a.properties.HideFromMake = true
|
||||
}
|
||||
|
||||
func (a *apexBundle) MarkAsCoverageVariant(coverage bool) {
|
||||
a.properties.IsCoverageVariant = coverage
|
||||
}
|
||||
|
||||
// TODO(jiyong) move apexFileFor* close to the apexFile type definition
|
||||
func apexFileForNativeLibrary(ctx android.BaseModuleContext, ccMod *cc.Module, handleSpecialLibs bool) apexFile {
|
||||
// Decide the APEX-local directory by the multilib of the library
|
||||
@@ -945,7 +956,7 @@ func (a *apexBundle) GenerateAndroidBuildActions(ctx android.ModuleContext) {
|
||||
a.primaryApexType = true
|
||||
|
||||
if ctx.Config().InstallExtraFlattenedApexes() {
|
||||
a.externalDeps = append(a.externalDeps, a.Name()+flattenedSuffix)
|
||||
a.requiredDeps = append(a.requiredDeps, a.Name()+flattenedSuffix)
|
||||
}
|
||||
}
|
||||
case zipApex:
|
||||
@@ -1004,6 +1015,9 @@ func (a *apexBundle) GenerateAndroidBuildActions(ctx android.ModuleContext) {
|
||||
depTag := ctx.OtherModuleDependencyTag(child)
|
||||
depName := ctx.OtherModuleName(child)
|
||||
if _, isDirectDep := parent.(*apexBundle); isDirectDep {
|
||||
if depTag != keyTag && depTag != certificateTag {
|
||||
a.internalDeps = append(a.internalDeps, depName)
|
||||
}
|
||||
switch depTag {
|
||||
case sharedLibTag:
|
||||
if cc, ok := child.(*cc.Module); ok {
|
||||
@@ -1134,9 +1148,10 @@ func (a *apexBundle) GenerateAndroidBuildActions(ctx android.ModuleContext) {
|
||||
//
|
||||
// Always include if we are a host-apex however since those won't have any
|
||||
// system libraries.
|
||||
if !android.DirectlyInAnyApex(ctx, cc.Name()) && !android.InList(cc.Name(), a.externalDeps) {
|
||||
a.externalDeps = append(a.externalDeps, cc.Name())
|
||||
if !android.DirectlyInAnyApex(ctx, cc.Name()) && !android.InList(cc.Name(), a.requiredDeps) {
|
||||
a.requiredDeps = append(a.requiredDeps, cc.Name())
|
||||
}
|
||||
a.externalDeps = append(a.externalDeps, depName)
|
||||
requireNativeLibs = append(requireNativeLibs, cc.OutputFile().Path().Base())
|
||||
// Don't track further
|
||||
return false
|
||||
@@ -1144,6 +1159,8 @@ func (a *apexBundle) GenerateAndroidBuildActions(ctx android.ModuleContext) {
|
||||
af := apexFileForNativeLibrary(ctx, cc, handleSpecialLibs)
|
||||
af.transitiveDep = true
|
||||
filesInfo = append(filesInfo, af)
|
||||
a.internalDeps = append(a.internalDeps, depName)
|
||||
a.internalDeps = append(a.internalDeps, cc.AllStaticDeps()...)
|
||||
return true // track transitive dependencies
|
||||
}
|
||||
} else if cc.IsTestPerSrcDepTag(depTag) {
|
||||
@@ -1159,8 +1176,10 @@ func (a *apexBundle) GenerateAndroidBuildActions(ctx android.ModuleContext) {
|
||||
return true // track transitive dependencies
|
||||
}
|
||||
} else if java.IsJniDepTag(depTag) {
|
||||
// Do nothing for JNI dep. JNI libraries are always embedded in APK-in-APEX.
|
||||
a.externalDeps = append(a.externalDeps, depName)
|
||||
return true
|
||||
} else if java.IsStaticLibDepTag(depTag) {
|
||||
a.internalDeps = append(a.internalDeps, depName)
|
||||
} else if am.CanHaveApexVariants() && am.IsInstallableToApex() {
|
||||
ctx.ModuleErrorf("unexpected tag %q for indirect dependency %q", depTag, depName)
|
||||
}
|
||||
@@ -1257,6 +1276,8 @@ func (a *apexBundle) GenerateAndroidBuildActions(ctx android.ModuleContext) {
|
||||
}
|
||||
|
||||
a.compatSymlinks = makeCompatSymlinks(a.BaseModuleName(), ctx)
|
||||
|
||||
a.buildApexDependencyInfo(ctx)
|
||||
}
|
||||
|
||||
func newApexBundle() *apexBundle {
|
||||
|
Reference in New Issue
Block a user