aboutsummaryrefslogtreecommitdiffstats
path: root/python
diff options
context:
space:
mode:
authorColin Cross <ccross@android.com>2019-03-04 22:35:41 -0800
committerColin Cross <ccross@android.com>2019-03-07 18:36:35 +0000
commit27b922f53e938896c0a693a1d9f50e6c9e686ad7 (patch)
treed3383cbdebb9fb78d8d96fa3a3023764620d483e /python
parent1b48842a4b83ba6234d26ff4c77a0884f5008f62 (diff)
downloadbuild_soong-27b922f53e938896c0a693a1d9f50e6c9e686ad7.tar.gz
build_soong-27b922f53e938896c0a693a1d9f50e6c9e686ad7.tar.bz2
build_soong-27b922f53e938896c0a693a1d9f50e6c9e686ad7.zip
Annotate paths and deprecate ExtractSource(s)Deps
Add `android:"path"` to all properties that take paths to source files, and remove the calls to ExtractSource(s)Deps, the pathsDepsMutator will add the necessary SourceDepTag dependency. Test: All soong tests Change-Id: I488ba1a5d680aaa50b04fc38acf693e23c6d4d6d
Diffstat (limited to 'python')
-rw-r--r--python/python.go24
1 files changed, 5 insertions, 19 deletions
diff --git a/python/python.go b/python/python.go
index 4445f404..6d160201 100644
--- a/python/python.go
+++ b/python/python.go
@@ -43,11 +43,11 @@ type VersionProperties struct {
// non-empty list of .py files under this strict Python version.
// srcs may reference the outputs of other modules that produce source files like genrule
// or filegroup using the syntax ":module".
- Srcs []string `android:"arch_variant"`
+ Srcs []string `android:"path,arch_variant"`
// list of source files that should not be used to build the Python module.
// This is most useful in the arch/multilib variants to remove non-common files
- Exclude_srcs []string `android:"arch_variant"`
+ Exclude_srcs []string `android:"path,arch_variant"`
// list of the Python libraries under this Python version.
Libs []string `android:"arch_variant"`
@@ -74,15 +74,15 @@ type BaseProperties struct {
// srcs may reference the outputs of other modules that produce source files like genrule
// or filegroup using the syntax ":module".
// Srcs has to be non-empty.
- Srcs []string `android:"arch_variant"`
+ Srcs []string `android:"path,arch_variant"`
// list of source files that should not be used to build the C/C++ module.
// This is most useful in the arch/multilib variants to remove non-common files
- Exclude_srcs []string `android:"arch_variant"`
+ Exclude_srcs []string `android:"path,arch_variant"`
// list of files or filegroup modules that provide data that should be installed alongside
// the test. the file extension can be arbitrary except for (.py).
- Data []string `android:"arch_variant"`
+ Data []string `android:"path,arch_variant"`
// list of the Python libraries compatible both with Python2 and Python3.
Libs []string `android:"arch_variant"`
@@ -288,21 +288,11 @@ func (p *Module) hasSrcExt(ctx android.BottomUpMutatorContext, ext string) bool
}
func (p *Module) DepsMutator(ctx android.BottomUpMutatorContext) {
- // deps from "data".
- android.ExtractSourcesDeps(ctx, p.properties.Data)
- // deps from "srcs".
- android.ExtractSourcesDeps(ctx, p.properties.Srcs)
- android.ExtractSourcesDeps(ctx, p.properties.Exclude_srcs)
-
if p.hasSrcExt(ctx, protoExt) && p.Name() != "libprotobuf-python" {
ctx.AddVariationDependencies(nil, pythonLibTag, "libprotobuf-python")
}
switch p.properties.Actual_version {
case pyVersion2:
- // deps from "version.py2.srcs" property.
- android.ExtractSourcesDeps(ctx, p.properties.Version.Py2.Srcs)
- android.ExtractSourcesDeps(ctx, p.properties.Version.Py2.Exclude_srcs)
-
ctx.AddVariationDependencies(nil, pythonLibTag,
uniqueLibs(ctx, p.properties.Libs, "version.py2.libs",
p.properties.Version.Py2.Libs)...)
@@ -334,10 +324,6 @@ func (p *Module) DepsMutator(ctx android.BottomUpMutatorContext) {
}
case pyVersion3:
- // deps from "version.py3.srcs" property.
- android.ExtractSourcesDeps(ctx, p.properties.Version.Py3.Srcs)
- android.ExtractSourcesDeps(ctx, p.properties.Version.Py3.Exclude_srcs)
-
ctx.AddVariationDependencies(nil, pythonLibTag,
uniqueLibs(ctx, p.properties.Libs, "version.py3.libs",
p.properties.Version.Py3.Libs)...)