Merge "Support blueprint_go_binary in PathForModuleSrc" am: 57892ceafb
am: c24869d391
am: 81866c119c
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1694192 Change-Id: I99b7d53ac449a040aa76e2c331e66b8751ea2f2d
This commit is contained in:
commit
d472940919
|
@ -24,6 +24,7 @@ import (
|
|||
"strings"
|
||||
|
||||
"github.com/google/blueprint"
|
||||
"github.com/google/blueprint/bootstrap"
|
||||
"github.com/google/blueprint/pathtools"
|
||||
)
|
||||
|
||||
|
@ -449,6 +450,12 @@ func getPathsFromModuleDep(ctx ModuleWithDepsPathContext, path, moduleName, tag
|
|||
return outputFiles, nil
|
||||
} else if tag != "" {
|
||||
return nil, fmt.Errorf("path dependency %q is not an output file producing module", path)
|
||||
} else if goBinary, ok := module.(bootstrap.GoBinaryTool); ok {
|
||||
if rel, err := filepath.Rel(PathForOutput(ctx).String(), goBinary.InstallPath()); err == nil {
|
||||
return Paths{PathForOutput(ctx, rel).WithoutRel()}, nil
|
||||
} else {
|
||||
return nil, fmt.Errorf("cannot find output path for %q: %w", goBinary.InstallPath(), err)
|
||||
}
|
||||
} else if srcProducer, ok := module.(SourceFileProducer); ok {
|
||||
return srcProducer.Srcs(), nil
|
||||
} else {
|
||||
|
|
|
@ -444,11 +444,10 @@ func (p *Module) GenerateAndroidBuildActions(ctx android.ModuleContext) {
|
|||
var sharedLibs []string
|
||||
// if embedded launcher is enabled, we need to collect the shared library depenendencies of the
|
||||
// launcher
|
||||
ctx.VisitDirectDeps(func(dep android.Module) {
|
||||
if ctx.OtherModuleDependencyTag(dep) == launcherSharedLibTag {
|
||||
sharedLibs = append(sharedLibs, ctx.OtherModuleName(dep))
|
||||
}
|
||||
})
|
||||
for _, dep := range ctx.GetDirectDepsWithTag(launcherSharedLibTag) {
|
||||
sharedLibs = append(sharedLibs, ctx.OtherModuleName(dep))
|
||||
}
|
||||
|
||||
p.installer.setAndroidMkSharedLibs(sharedLibs)
|
||||
|
||||
// Install the par file from installSource
|
||||
|
|
Loading…
Reference in New Issue