aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools/build/lib/rules/python/PyBinary.java
diff options
context:
space:
mode:
authorGravatar Googler <noreply@google.com>2015-07-27 09:16:53 +0000
committerGravatar Damien Martin-Guillerez <dmarting@google.com>2015-07-27 12:58:40 +0000
commit20b15fbf1cd36a99c306c6d0324e4aeb328df36e (patch)
treeccd5a66e332b64efbb1ebba7470de4d4e6b2aefc /src/main/java/com/google/devtools/build/lib/rules/python/PyBinary.java
parent31143247f9c2ab78aee92c07dd7e664904e8b4f2 (diff)
Enable simple compilation of Python artifacts for py_binary and py_library.
-- MOS_MIGRATED_REVID=99163140
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/rules/python/PyBinary.java')
-rw-r--r--src/main/java/com/google/devtools/build/lib/rules/python/PyBinary.java9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/rules/python/PyBinary.java b/src/main/java/com/google/devtools/build/lib/rules/python/PyBinary.java
index 337d63b1a5..b732cae2ed 100644
--- a/src/main/java/com/google/devtools/build/lib/rules/python/PyBinary.java
+++ b/src/main/java/com/google/devtools/build/lib/rules/python/PyBinary.java
@@ -27,6 +27,7 @@ import com.google.devtools.build.lib.rules.cpp.CcLinkParams;
import com.google.devtools.build.lib.rules.cpp.CcLinkParamsProvider;
import com.google.devtools.build.lib.rules.cpp.CcLinkParamsStore;
+import java.util.ArrayList;
import java.util.List;
/**
@@ -53,10 +54,13 @@ public abstract class PyBinary implements RuleConfiguredTargetFactory {
static RuleConfiguredTargetBuilder init(
RuleContext ruleContext, PythonSemantics semantics, PyCommon common) {
- List<Artifact> srcs = common.validateSrcs();
CcLinkParamsStore ccLinkParamsStore = initializeCcLinkParamStore(ruleContext);
- common.initBinary(srcs);
+ List<Artifact> srcs = common.validateSrcs();
+ List<Artifact> allOutputs = new ArrayList<>(srcs);
+ allOutputs.addAll(semantics.precompiledPythonFiles(ruleContext, srcs, common));
+
+ common.initBinary(allOutputs);
semantics.validate(ruleContext, common);
if (ruleContext.hasErrors()) {
return null;
@@ -127,4 +131,3 @@ public abstract class PyBinary implements RuleConfiguredTargetFactory {
};
}
}
-