Interface ScriptInterpreter

All Superinterfaces:
AutoCloseable, Closeable

public interface ScriptInterpreter extends Closeable
Defines a simple abstraction used to plug-in several script interpreters for the pre-/post-build-hooks. Each interpreter implementation should be stateless and support reuse.
Benjamin Bentmann
  • Method Details

    • setClassPath

      void setClassPath(List<String> classPath)
      Set class path used by interpreted.
      classPath - The additional class path for the script interpreter, may be null or empty if only the plugin realm should be used for the script evaluation. If specified, this class path will precede the artifacts from the plugin class path.
    • evaluateScript

      Object evaluateScript(String script, Map<String,?> globalVariables, PrintStream scriptOutput) throws ScriptEvaluationException
      Evaluates the specified script.
      script - The script contents to evaluate, must not be null.
      globalVariables - The global variables (as a mapping from variable name to value) to define for the script, may be null if not used.
      scriptOutput - A print stream to redirect any output from the script to, may be null to use stdout/stderr.
      The return value from the script, can be null
      ScriptEvaluationException - If the script evaluation produced an error.