Revert "Add SkipToTransitiveDepsTag interface for dependency tags"
This reverts commit 1fb7c3512989311818af83d6aee246f171907a05.
Change-Id: Ib4c5815a06785cd876caa37acc0522adc26bc495
diff --git a/android/deptag.go b/android/deptag.go
index 77b9d61..c7ba4d3 100644
--- a/android/deptag.go
+++ b/android/deptag.go
@@ -44,21 +44,6 @@
return false
}
-// Dependency tags can implement this interface and return true from SkipToTransitiveDeps to
-// annotate that this dependency isn't installed, but its transitive dependencies are. This is
-// useful when a module is built into another module (ex: static linking) but the module still has
-// runtime dependencies.
-type SkipToTransitiveDepsTag interface {
- SkipToTransitiveDeps() bool
-}
-
-func IsSkipToTransitiveDepsTag(tag blueprint.DependencyTag) bool {
- if i, ok := tag.(SkipToTransitiveDepsTag); ok {
- return i.SkipToTransitiveDeps()
- }
- return false
-}
-
type PropagateAconfigValidationDependencyTag interface {
PropagateAconfigValidation() bool
}
diff --git a/android/module.go b/android/module.go
index d7f0537..738f543 100644
--- a/android/module.go
+++ b/android/module.go
@@ -1470,27 +1470,15 @@
var installDeps []*DepSet[InstallPath]
var packagingSpecs []*DepSet[PackagingSpec]
ctx.VisitDirectDeps(func(dep Module) {
- depTag := ctx.OtherModuleDependencyTag(dep)
- // If this is true, the direct outputs from the module is not gathered, but its
- // transitive deps are still gathered.
- skipToTransitive := IsSkipToTransitiveDepsTag(depTag)
- if isInstallDepNeeded(dep, depTag) || skipToTransitive {
+ if isInstallDepNeeded(dep, ctx.OtherModuleDependencyTag(dep)) {
// Installation is still handled by Make, so anything hidden from Make is not
// installable.
if !dep.IsHideFromMake() && !dep.IsSkipInstall() {
- if skipToTransitive {
- installDeps = append(installDeps, dep.base().installFilesDepSet.transitive...)
- } else {
- installDeps = append(installDeps, dep.base().installFilesDepSet)
- }
+ installDeps = append(installDeps, dep.base().installFilesDepSet)
}
// Add packaging deps even when the dependency is not installed so that uninstallable
// modules can still be packaged. Often the package will be installed instead.
- if skipToTransitive {
- packagingSpecs = append(packagingSpecs, dep.base().packagingSpecsDepSet.transitive...)
- } else {
- packagingSpecs = append(packagingSpecs, dep.base().packagingSpecsDepSet)
- }
+ packagingSpecs = append(packagingSpecs, dep.base().packagingSpecsDepSet)
}
})
diff --git a/android/packaging_test.go b/android/packaging_test.go
index 4b72c24..3833437 100644
--- a/android/packaging_test.go
+++ b/android/packaging_test.go
@@ -25,9 +25,8 @@
type componentTestModule struct {
ModuleBase
props struct {
- Deps []string
- Build_only_deps []string
- Skip_install *bool
+ Deps []string
+ Skip_install *bool
}
}
@@ -37,18 +36,6 @@
InstallAlwaysNeededDependencyTag
}
-// dep tag for build_only_deps
-type buildOnlyDepTag struct {
- blueprint.BaseDependencyTag
- InstallAlwaysNeededDependencyTag
-}
-
-var _ SkipToTransitiveDepsTag = (*buildOnlyDepTag)(nil)
-
-func (tag buildOnlyDepTag) SkipToTransitiveDeps() bool {
- return true
-}
-
func componentTestModuleFactory() Module {
m := &componentTestModule{}
m.AddProperties(&m.props)
@@ -58,7 +45,6 @@
func (m *componentTestModule) DepsMutator(ctx BottomUpMutatorContext) {
ctx.AddDependency(ctx.Module(), installDepTag{}, m.props.Deps...)
- ctx.AddDependency(ctx.Module(), buildOnlyDepTag{}, m.props.Build_only_deps...)
}
func (m *componentTestModule) GenerateAndroidBuildActions(ctx ModuleContext) {
@@ -412,30 +398,3 @@
}
`, []string{"lib64/foo", "lib64/bar", "lib64/baz"})
}
-
-func TestPackagingWithSkipToTransitvDeps(t *testing.T) {
- // packag -[deps]-> foo -[build_only_deps]-> bar -[deps]-> baz
- // bar isn't installed, but it brings baz to its parent.
- multiTarget := false
- runPackagingTest(t, multiTarget,
- `
- component {
- name: "foo",
- build_only_deps: ["bar"],
- }
-
- component {
- name: "bar",
- deps: ["baz"],
- }
-
- component {
- name: "baz",
- }
-
- package_module {
- name: "package",
- deps: ["foo"],
- }
- `, []string{"lib64/foo", "lib64/baz"})
-}