diff options
author | Ulf Adams <ulfjack@google.com> | 2016-04-22 09:00:13 +0000 |
---|---|---|
committer | Damien Martin-Guillerez <dmarting@google.com> | 2016-04-22 11:50:36 +0000 |
commit | 8ed31f05e664e925ad628ab47feeaaab30c26283 (patch) | |
tree | c1cf9feb9e2d36ed7f14b4a412d85daecd8dbfce /src/main/java/com/google/devtools/build/lib/rules/python/PyCommon.java | |
parent | e345ba54feda0c630679d18e3d039fd1ee8843bd (diff) |
Remove all internal calls to FileProvider.getLabel.
The method will be removed in a subsequent change to facilitate reverting the
change in case it goes bad.
--
MOS_MIGRATED_REVID=120526894
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/rules/python/PyCommon.java')
-rw-r--r-- | src/main/java/com/google/devtools/build/lib/rules/python/PyCommon.java | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/rules/python/PyCommon.java b/src/main/java/com/google/devtools/build/lib/rules/python/PyCommon.java index 50aebce23b..045c06ca4e 100644 --- a/src/main/java/com/google/devtools/build/lib/rules/python/PyCommon.java +++ b/src/main/java/com/google/devtools/build/lib/rules/python/PyCommon.java @@ -180,15 +180,16 @@ public final class PyCommon { List<Artifact> sourceFiles = new ArrayList<>(); // TODO(bazel-team): Need to get the transitive deps closure, not just the // sources of the rule. - for (FileProvider src : ruleContext - .getPrerequisites("srcs", Mode.TARGET, FileProvider.class)) { + for (TransitiveInfoCollection src : ruleContext + .getPrerequisitesIf("srcs", Mode.TARGET, FileProvider.class)) { // Make sure that none of the sources contain hyphens. if (Util.containsHyphen(src.getLabel().getPackageFragment())) { ruleContext.attributeError("srcs", src.getLabel() + ": paths to Python packages may not contain '-'"); } - Iterable<Artifact> pySrcs = FileType.filter(src.getFilesToBuild(), - PyRuleClasses.PYTHON_SOURCE); + Iterable<Artifact> pySrcs = + FileType.filter( + src.getProvider(FileProvider.class).getFilesToBuild(), PyRuleClasses.PYTHON_SOURCE); Iterables.addAll(sourceFiles, pySrcs); if (Iterables.isEmpty(pySrcs)) { ruleContext.attributeWarning("srcs", |