diff options
Diffstat (limited to 'python/binary.go')
-rw-r--r-- | python/binary.go | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/python/binary.go b/python/binary.go index 5f60761be..a3acb347d 100644 --- a/python/binary.go +++ b/python/binary.go @@ -22,8 +22,14 @@ import ( "strings" "android/soong/android" + "android/soong/cc" + "github.com/google/blueprint" ) +type PythonBinaryInfo struct{} + +var PythonBinaryInfoProvider = blueprint.NewProvider[PythonBinaryInfo]() + func init() { registerPythonBinaryComponents(android.InitRegistrationContext) } @@ -103,6 +109,9 @@ func (p *PythonBinaryModule) GenerateAndroidBuildActions(ctx android.ModuleConte p.buildBinary(ctx) p.installedDest = ctx.InstallFile(installDir(ctx, "bin", "", ""), p.installSource.Base(), p.installSource) + + android.SetProvider(ctx, PythonBinaryInfoProvider, PythonBinaryInfo{}) + ctx.SetOutputFiles(android.Paths{p.installSource}, "") } @@ -116,13 +125,13 @@ func (p *PythonBinaryModule) buildBinary(ctx android.ModuleContext) { var launcherPath android.OptionalPath if embeddedLauncher { - ctx.VisitDirectDepsWithTag(launcherTag, func(m android.Module) { - if provider, ok := m.(IntermPathProvider); ok { + ctx.VisitDirectDepsProxyWithTag(launcherTag, func(m android.ModuleProxy) { + if provider, ok := android.OtherModuleProvider(ctx, m, cc.LinkableInfoProvider); ok { if launcherPath.Valid() { panic(fmt.Errorf("launcher path was found before: %q", launcherPath)) } - launcherPath = provider.IntermPathForModuleOut() + launcherPath = provider.OutputFile } }) } @@ -140,7 +149,7 @@ func (p *PythonBinaryModule) buildBinary(ctx android.ModuleContext) { var sharedLibs []string // if embedded launcher is enabled, we need to collect the shared library dependencies of the // launcher - for _, dep := range ctx.GetDirectDepsWithTag(launcherSharedLibTag) { + for _, dep := range ctx.GetDirectDepsProxyWithTag(launcherSharedLibTag) { sharedLibs = append(sharedLibs, ctx.OtherModuleName(dep)) } p.androidMkSharedLibs = sharedLibs |