diff options
| author | 2024-04-18 22:59:54 +0000 | |
|---|---|---|
| committer | 2024-04-18 22:59:54 +0000 | |
| commit | 587c40f2165dc69830f46a07b6baf5d833a53dca (patch) | |
| tree | 989c181d90e908b798c96ccc7b93aa7062594749 /python/python.go | |
| parent | 7694cdd6bae5a25993154b3c2869e23ac18735c3 (diff) | |
| parent | c4cd7a11a1410d6c9d9a8765194460822d0b51ff (diff) | |
Merge "Implement test-only for python_ rules" into main
Diffstat (limited to 'python/python.go')
| -rw-r--r-- | python/python.go | 9 |
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) |