Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a3348295 authored by Bob Badour's avatar Bob Badour Committed by Gerrit Code Review
Browse files

Merge "Allow cross-cutting dependencies like licenses."

parents c59c512e 07065cd3
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -2374,6 +2374,16 @@ func (b *baseModuleContext) FinalModule() Module {
	return b.bp.FinalModule().(Module)
}

// IsMetaDependencyTag returns true for cross-cutting metadata dependencies.
func IsMetaDependencyTag(tag blueprint.DependencyTag) bool {
	if tag == licenseKindTag {
		return true
	} else if tag == licensesTag {
		return true
	}
	return false
}

// A regexp for removing boilerplate from BaseDependencyTag from the string representation of
// a dependency tag.
var tagCleaner = regexp.MustCompile(`\QBaseDependencyTag:{}\E(, )?`)
+4 −0
Original line number Diff line number Diff line
@@ -90,6 +90,10 @@ func (b *BootImageModule) DepIsInSameApex(ctx android.BaseModuleContext, dep and
		// The dex2oat tool is only needed for building and is not required in the apex.
		return false
	}
	if android.IsMetaDependencyTag(tag) {
		// Cross-cutting metadata dependencies are metadata.
		return false
	}
	panic(fmt.Errorf("boot_image module %q should not have a dependency on %q via tag %s", b, dep, android.PrettyPrintTag(tag)))
}