aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools/build/lib/rules/python/PythonSemantics.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/PythonSemantics.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/PythonSemantics.java')
-rw-r--r--src/main/java/com/google/devtools/build/lib/rules/python/PythonSemantics.java11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/rules/python/PythonSemantics.java b/src/main/java/com/google/devtools/build/lib/rules/python/PythonSemantics.java
index 863c3ee76d..357020029b 100644
--- a/src/main/java/com/google/devtools/build/lib/rules/python/PythonSemantics.java
+++ b/src/main/java/com/google/devtools/build/lib/rules/python/PythonSemantics.java
@@ -13,12 +13,15 @@
// limitations under the License.
package com.google.devtools.build.lib.rules.python;
+import com.google.devtools.build.lib.actions.Artifact;
import com.google.devtools.build.lib.analysis.RuleContext;
import com.google.devtools.build.lib.analysis.Runfiles;
import com.google.devtools.build.lib.analysis.RunfilesSupport;
import com.google.devtools.build.lib.rules.cpp.CcLinkParamsStore;
import com.google.devtools.build.lib.rules.test.InstrumentedFilesCollector.InstrumentationSpec;
+import java.util.Collection;
+
/**
* Pluggable semantics for Python rules.
*
@@ -47,6 +50,12 @@ public interface PythonSemantics {
InstrumentationSpec getCoverageInstrumentationSpec();
/**
+ * Utility function to compile multiple .py files to .pyc files, if required.
+ */
+ Collection<Artifact> precompiledPythonFiles(
+ RuleContext ruleContext, Collection<Artifact> sources, PyCommon common);
+
+ /**
* Create the actual executable artifact.
*
* <p>This should create a generating action for {@code common.getExecutable()}.
@@ -59,4 +68,4 @@ public interface PythonSemantics {
*/
void postInitBinary(RuleContext ruleContext, RunfilesSupport runfilesSupport,
PyCommon common);
-} \ No newline at end of file
+}