aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools/build/lib/actions/ActionOwner.java
diff options
context:
space:
mode:
authorGravatar Han-Wen Nienhuys <hanwen@google.com>2015-02-25 16:45:20 +0100
committerGravatar Han-Wen Nienhuys <hanwen@google.com>2015-02-25 16:45:20 +0100
commitd08b27fa9701fecfdb69e1b0d1ac2459efc2129b (patch)
tree5d50963026239ca5aebfb47ea5b8db7e814e57c8 /src/main/java/com/google/devtools/build/lib/actions/ActionOwner.java
Update from Google.
-- MOE_MIGRATED_REVID=85702957
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/actions/ActionOwner.java')
-rw-r--r--src/main/java/com/google/devtools/build/lib/actions/ActionOwner.java71
1 files changed, 71 insertions, 0 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/actions/ActionOwner.java b/src/main/java/com/google/devtools/build/lib/actions/ActionOwner.java
new file mode 100644
index 0000000000..ab59f635bf
--- /dev/null
+++ b/src/main/java/com/google/devtools/build/lib/actions/ActionOwner.java
@@ -0,0 +1,71 @@
+// Copyright 2014 Google Inc. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+package com.google.devtools.build.lib.actions;
+
+import com.google.devtools.build.lib.events.Location;
+import com.google.devtools.build.lib.syntax.Label;
+
+/**
+ * The owner of an action is responsible for reporting conflicts in the action
+ * graph (two actions attempting to generate the same artifact).
+ *
+ * Typically an action's owner is the RuleConfiguredTarget instance responsible
+ * for creating it, but to avoid coupling between the view and actions
+ * packages, the RuleConfiguredTarget is hidden behind this interface, which
+ * exposes only the error reporting functionality.
+ */
+public interface ActionOwner {
+
+ /**
+ * Returns the location of this ActionOwner, if any; null otherwise.
+ */
+ Location getLocation();
+
+ /**
+ * Returns the label for this ActionOwner, if any; null otherwise.
+ */
+ Label getLabel();
+
+ /**
+ * Returns the name of the configuration of the action owner.
+ */
+ String getConfigurationName();
+
+ /**
+ * Returns the configuration's mnemonic.
+ */
+ String getConfigurationMnemonic();
+
+ /**
+ * Returns the short cache key for the configuration of the action owner.
+ *
+ * <p>Special action owners that are not targets can return any string here as long as it is
+ * constant. If the configuration is null, this should return "null".
+ *
+ * <p>These requirements exist so that {@link ActionOwner} instances are consistent with
+ * {@code BuildView.ActionOwnerIdentity(ConfiguredTargetValue)}.
+ */
+ String getConfigurationShortCacheKey();
+
+ /**
+ * Returns the target kind (rule class name) for this ActionOwner, if any; null otherwise.
+ */
+ String getTargetKind();
+
+ /**
+ * Returns additional information that should be displayed in progress messages, or {@code null}
+ * if nothing should be added.
+ */
+ String getAdditionalProgressInfo();
+}