Merge "TransitivePackagingSpecs should follow "installable" deps" am: 1c534d3c73

Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1775265

Change-Id: I3938d5e21488354f23d119edfa04f33e013614ee
This commit is contained in:
Jooyung Han
2021-07-28 00:51:20 +00:00
committed by Automerger Merge Worker
2 changed files with 35 additions and 2 deletions

View File

@@ -1529,7 +1529,7 @@ func (m *ModuleBase) computeInstallDeps(ctx ModuleContext) ([]*installPathsDepSe
var installDeps []*installPathsDepSet var installDeps []*installPathsDepSet
var packagingSpecs []*packagingSpecsDepSet var packagingSpecs []*packagingSpecsDepSet
ctx.VisitDirectDeps(func(dep Module) { ctx.VisitDirectDeps(func(dep Module) {
if IsInstallDepNeeded(ctx.OtherModuleDependencyTag(dep)) && !dep.IsHideFromMake() { if IsInstallDepNeeded(ctx.OtherModuleDependencyTag(dep)) && !dep.IsHideFromMake() && !dep.IsSkipInstall() {
installDeps = append(installDeps, dep.base().installFilesDepSet) installDeps = append(installDeps, dep.base().installFilesDepSet)
packagingSpecs = append(packagingSpecs, dep.base().packagingSpecsDepSet) packagingSpecs = append(packagingSpecs, dep.base().packagingSpecsDepSet)
} }

View File

@@ -18,13 +18,15 @@ import (
"testing" "testing"
"github.com/google/blueprint" "github.com/google/blueprint"
"github.com/google/blueprint/proptools"
) )
// Module to be packaged // Module to be packaged
type componentTestModule struct { type componentTestModule struct {
ModuleBase ModuleBase
props struct { props struct {
Deps []string Deps []string
Skip_install *bool
} }
} }
@@ -49,6 +51,9 @@ func (m *componentTestModule) GenerateAndroidBuildActions(ctx ModuleContext) {
builtFile := PathForModuleOut(ctx, m.Name()) builtFile := PathForModuleOut(ctx, m.Name())
dir := ctx.Target().Arch.ArchType.Multilib dir := ctx.Target().Arch.ArchType.Multilib
installDir := PathForModuleInstall(ctx, dir) installDir := PathForModuleInstall(ctx, dir)
if proptools.Bool(m.props.Skip_install) {
m.SkipInstall()
}
ctx.InstallFile(installDir, m.Name(), builtFile) ctx.InstallFile(installDir, m.Name(), builtFile)
} }
@@ -365,3 +370,31 @@ func TestPackagingBaseSingleTarget(t *testing.T) {
} }
`, []string{"lib64/foo"}) `, []string{"lib64/foo"})
} }
func TestPackagingWithSkipInstallDeps(t *testing.T) {
// package -[dep]-> foo -[dep]-> bar -[dep]-> baz
// OK SKIPPED
multiTarget := false
runPackagingTest(t, multiTarget,
`
component {
name: "foo",
deps: ["bar"],
}
component {
name: "bar",
deps: ["baz"],
skip_install: true,
}
component {
name: "baz",
}
package_module {
name: "package",
deps: ["foo"],
}
`, []string{"lib64/foo"})
}