aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools/build/lib/analysis/stringtemplate/TemplateContext.java
diff options
context:
space:
mode:
authorGravatar ulfjack <ulfjack@google.com>2017-10-10 10:45:56 +0200
committerGravatar Marcel Hlopko <hlopko@google.com>2017-10-10 11:25:05 +0200
commit312d719a99e7c1b4508a92f84936e7f041ff86c3 (patch)
tree62a7329887cc80cd4531368236b1cb215bf2228d /src/main/java/com/google/devtools/build/lib/analysis/stringtemplate/TemplateContext.java
parent16ee62a05483124601945a5fbeb9db013590b9a5 (diff)
Move the MakeVariableExpander to a new package
Rename it to TemplateExpander and start rewriting the documentation to refer to template variables. PiperOrigin-RevId: 171648255
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/analysis/stringtemplate/TemplateContext.java')
-rw-r--r--src/main/java/com/google/devtools/build/lib/analysis/stringtemplate/TemplateContext.java31
1 files changed, 31 insertions, 0 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/analysis/stringtemplate/TemplateContext.java b/src/main/java/com/google/devtools/build/lib/analysis/stringtemplate/TemplateContext.java
new file mode 100644
index 0000000000..d4aa40dcf0
--- /dev/null
+++ b/src/main/java/com/google/devtools/build/lib/analysis/stringtemplate/TemplateContext.java
@@ -0,0 +1,31 @@
+// Copyright 2017 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.analysis.stringtemplate;
+
+/**
+ * Interface to be implemented by callers of MakeVariableExpander which defines the expansion of
+ * each "Make" variable.
+ */
+public interface TemplateContext {
+
+ /**
+ * Returns the expansion of the specified "Make" variable.
+ *
+ * @param name the variable to expand.
+ * @return the expansion of the variable.
+ * @throws ExpansionException if the variable "var" was not defined or
+ * there was any other error while expanding "var".
+ */
+ String lookupVariable(String name) throws ExpansionException;
+} \ No newline at end of file