Merge changes from topic "apex_available"

* changes:
  shared_lib dependency from a static lib crosses the APEX boundary
  apex_available tracks static dependencies
This commit is contained in:
TreeHugger Robot
2020-02-06 05:37:37 +00:00
committed by Android (Google) Code Review
8 changed files with 870 additions and 69 deletions

View File

@@ -583,6 +583,13 @@ func (a *AndroidApp) getCertString(ctx android.BaseModuleContext) string {
return String(a.overridableAppProperties.Certificate)
}
func (a *AndroidApp) DepIsInSameApex(ctx android.BaseModuleContext, dep android.Module) bool {
if IsJniDepTag(ctx.OtherModuleDependencyTag(dep)) {
return true
}
return a.Library.DepIsInSameApex(ctx, dep)
}
// For OutputFileProducer interface
func (a *AndroidApp) OutputFiles(tag string) (android.Paths, error) {
switch tag {

View File

@@ -1717,8 +1717,10 @@ func (j *Module) hasCode(ctx android.ModuleContext) bool {
func (j *Module) DepIsInSameApex(ctx android.BaseModuleContext, dep android.Module) bool {
depTag := ctx.OtherModuleDependencyTag(dep)
// dependencies other than the static linkage are all considered crossing APEX boundary
return depTag == staticLibTag
// Dependencies other than the static linkage are all considered crossing APEX boundary
// Also, a dependency to an sdk member is also considered as such. This is required because
// sdk members should be mutated into APEXes. Refer to sdk.sdkDepsReplaceMutator.
return depTag == staticLibTag || j.IsInAnySdk()
}
func (j *Module) Stem() string {
@@ -2406,6 +2408,14 @@ func (j *Import) SrcJarArgs() ([]string, android.Paths) {
return nil, nil
}
func (j *Import) DepIsInSameApex(ctx android.BaseModuleContext, dep android.Module) bool {
depTag := ctx.OtherModuleDependencyTag(dep)
// dependencies other than the static linkage are all considered crossing APEX boundary
// Also, a dependency to an sdk member is also considered as such. This is required because
// sdk members should be mutated into APEXes. Refer to sdk.sdkDepsReplaceMutator.
return depTag == staticLibTag || j.IsInAnySdk()
}
// Add compile time check for interface implementation
var _ android.IDEInfo = (*Import)(nil)
var _ android.IDECustomizedModuleName = (*Import)(nil)