aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools/build/lib/skylarkbuildapi/repository/SkylarkExecutionResultApi.java
diff options
context:
space:
mode:
authorGravatar cparsons <cparsons@google.com>2018-05-24 13:16:55 -0700
committerGravatar Copybara-Service <copybara-piper@google.com>2018-05-24 13:18:47 -0700
commitbfacee1b5dd0635e82e78e4221cadeadc49ad56d (patch)
tree38c77e30e865ac4d14e6ab2ab7fc2450fae4d6da /src/main/java/com/google/devtools/build/lib/skylarkbuildapi/repository/SkylarkExecutionResultApi.java
parent2732b176361d04a0aae6f651568a55a119c52afd (diff)
Migrate repository-related modules to skylarkbuildapi
RELNOTES: None. PiperOrigin-RevId: 197941930
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/skylarkbuildapi/repository/SkylarkExecutionResultApi.java')
-rw-r--r--src/main/java/com/google/devtools/build/lib/skylarkbuildapi/repository/SkylarkExecutionResultApi.java56
1 files changed, 56 insertions, 0 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/skylarkbuildapi/repository/SkylarkExecutionResultApi.java b/src/main/java/com/google/devtools/build/lib/skylarkbuildapi/repository/SkylarkExecutionResultApi.java
new file mode 100644
index 0000000000..ff9579b975
--- /dev/null
+++ b/src/main/java/com/google/devtools/build/lib/skylarkbuildapi/repository/SkylarkExecutionResultApi.java
@@ -0,0 +1,56 @@
+// Copyright 2018 The Bazel Authors. 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.skylarkbuildapi.repository;
+
+import com.google.devtools.build.lib.skylarkinterface.SkylarkCallable;
+import com.google.devtools.build.lib.skylarkinterface.SkylarkModule;
+import com.google.devtools.build.lib.skylarkinterface.SkylarkModuleCategory;
+
+/**
+ * A structure callable from Skylark that stores the result of repository_ctx.execute() method. It
+ * contains the standard output stream content, the standard error stream content and the execution
+ * return code.
+ */
+@SkylarkModule(
+ name = "exec_result",
+ category = SkylarkModuleCategory.NONE,
+ doc =
+ "A structure storing result of repository_ctx.execute() method. It contains the standard"
+ + " output stream content, the standard error stream content and the execution return"
+ + " code."
+)
+public interface SkylarkExecutionResultApi {
+ @SkylarkCallable(
+ name = "return_code",
+ structField = true,
+ doc = "The return code returned after the execution of the program. 256 if an error happened"
+ + " while executing the command."
+ )
+ public int getReturnCode();
+
+ @SkylarkCallable(
+ name = "stdout",
+ structField = true,
+ doc = "The content of the standard output returned by the execution."
+ )
+ public String getStdout();
+
+ @SkylarkCallable(
+ name = "stderr",
+ structField = true,
+ doc = "The content of the standard error output returned by the execution."
+ )
+ public String getStderr();
+}