diff options
author | cparsons <cparsons@google.com> | 2018-03-06 16:15:11 -0800 |
---|---|---|
committer | Copybara-Service <copybara-piper@google.com> | 2018-03-06 16:18:46 -0800 |
commit | e2d200f32a7242898a5c976837bd3b8e6dfed62c (patch) | |
tree | 98a6fb3b0bbe3d8438aff9206d5ff77cf19870c3 /src/main/java/com/google/devtools/build/lib/rules/python | |
parent | a854d6c0d3d222bbd4ff2a532d48ddd91718908c (diff) |
Expose an actions provider on RuleConfiguredTarget instances.
Given a target (for example from a skylark aspect), one will be able to access a list of actions that the target generated using "target.actions". This is without additional memory footprint.
Actions themselves are not fully exposed to skylark (and thus there isn't much meaning to gather from them in skylark yet). Access methods will follow soon.
RELNOTES: None.
PiperOrigin-RevId: 188098079
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/rules/python')
3 files changed, 7 insertions, 4 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 b2ef88db97..8415d171b9 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 @@ -14,6 +14,7 @@ package com.google.devtools.build.lib.rules.python; import com.google.devtools.build.lib.actions.Artifact; +import com.google.devtools.build.lib.actions.MutableActionGraph.ActionConflictException; import com.google.devtools.build.lib.analysis.ConfiguredTarget; import com.google.devtools.build.lib.analysis.RuleConfiguredTargetBuilder; import com.google.devtools.build.lib.analysis.RuleConfiguredTargetFactory; @@ -44,7 +45,7 @@ public abstract class PyBinary implements RuleConfiguredTargetFactory { @Override public ConfiguredTarget create(RuleContext ruleContext) - throws InterruptedException, RuleErrorException { + throws InterruptedException, RuleErrorException, ActionConflictException { PyCommon common = new PyCommon(ruleContext); common.initCommon(common.getDefaultPythonVersion()); diff --git a/src/main/java/com/google/devtools/build/lib/rules/python/PyLibrary.java b/src/main/java/com/google/devtools/build/lib/rules/python/PyLibrary.java index f41d99baca..43f33f7eb5 100644 --- a/src/main/java/com/google/devtools/build/lib/rules/python/PyLibrary.java +++ b/src/main/java/com/google/devtools/build/lib/rules/python/PyLibrary.java @@ -14,6 +14,7 @@ package com.google.devtools.build.lib.rules.python; import com.google.devtools.build.lib.actions.Artifact; +import com.google.devtools.build.lib.actions.MutableActionGraph.ActionConflictException; import com.google.devtools.build.lib.analysis.ConfiguredTarget; import com.google.devtools.build.lib.analysis.RuleConfiguredTargetBuilder; import com.google.devtools.build.lib.analysis.RuleConfiguredTargetFactory; @@ -43,7 +44,8 @@ public abstract class PyLibrary implements RuleConfiguredTargetFactory { protected abstract PythonSemantics createSemantics(); @Override - public ConfiguredTarget create(final RuleContext ruleContext) throws RuleErrorException { + public ConfiguredTarget create(final RuleContext ruleContext) + throws InterruptedException, RuleErrorException, ActionConflictException { PythonSemantics semantics = createSemantics(); PyCommon common = new PyCommon(ruleContext); common.initCommon(common.getDefaultPythonVersion()); diff --git a/src/main/java/com/google/devtools/build/lib/rules/python/PyTest.java b/src/main/java/com/google/devtools/build/lib/rules/python/PyTest.java index f0711086e9..b60b5a221e 100644 --- a/src/main/java/com/google/devtools/build/lib/rules/python/PyTest.java +++ b/src/main/java/com/google/devtools/build/lib/rules/python/PyTest.java @@ -13,11 +13,11 @@ // limitations under the License. package com.google.devtools.build.lib.rules.python; +import com.google.devtools.build.lib.actions.MutableActionGraph.ActionConflictException; import com.google.devtools.build.lib.analysis.ConfiguredTarget; import com.google.devtools.build.lib.analysis.RuleConfiguredTargetBuilder; import com.google.devtools.build.lib.analysis.RuleConfiguredTargetFactory; import com.google.devtools.build.lib.analysis.RuleContext; -import com.google.devtools.build.lib.packages.RuleClass.ConfiguredTargetFactory.RuleErrorException; import com.google.devtools.build.lib.syntax.Type; /** @@ -32,7 +32,7 @@ public abstract class PyTest implements RuleConfiguredTargetFactory { @Override public ConfiguredTarget create(RuleContext ruleContext) - throws InterruptedException, RuleErrorException { + throws InterruptedException, RuleErrorException, ActionConflictException { PythonSemantics semantics = createSemantics(); PyCommon common = new PyCommon(ruleContext); common.initCommon(getDefaultPythonVersion(ruleContext)); |