summaryrefslogtreecommitdiff
path: root/python/python.go
diff options
context:
space:
mode:
Diffstat (limited to 'python/python.go')
-rw-r--r--python/python.go9
1 files changed, 8 insertions, 1 deletions
diff --git a/python/python.go b/python/python.go
index 2b1974eb8..621e429b9 100644
--- a/python/python.go
+++ b/python/python.go
@@ -151,6 +151,8 @@ type PythonLibraryModule struct {
// The zip file containing the current module's source/data files, with the
// source files precompiled.
precompiledSrcsZip android.Path
+
+ sourceProperties android.SourceProperties
}
// newModule generates new Python base module
@@ -203,7 +205,7 @@ func (p *PythonLibraryModule) getBaseProperties() *BaseProperties {
var _ pythonDependency = (*PythonLibraryModule)(nil)
func (p *PythonLibraryModule) init() android.Module {
- p.AddProperties(&p.properties, &p.protoProperties)
+ p.AddProperties(&p.properties, &p.protoProperties, &p.sourceProperties)
android.InitAndroidArchModule(p, p.hod, p.multilib)
android.InitDefaultableModule(p)
return p
@@ -421,6 +423,11 @@ func (p *PythonLibraryModule) AddDepsOnPythonLauncherAndStdlib(ctx android.Botto
func (p *PythonLibraryModule) GenerateAndroidBuildActions(ctx android.ModuleContext) {
expandedSrcs := android.PathsForModuleSrcExcludes(ctx, p.properties.Srcs, p.properties.Exclude_srcs)
android.SetProvider(ctx, blueprint.SrcsFileProviderKey, blueprint.SrcsFileProviderData{SrcPaths: expandedSrcs.Strings()})
+ // Keep before any early returns.
+ android.SetProvider(ctx, android.TestOnlyProviderKey, android.TestModuleInformation{
+ TestOnly: Bool(p.sourceProperties.Test_only),
+ TopLevelTarget: p.sourceProperties.Top_level_test_target,
+ })
// expand data files from "data" property.
expandedData := android.PathsForModuleSrc(ctx, p.properties.Data)