hudson.tasks
Class CommandInterpreter
java.lang.Object
hudson.tasks.BuildStepCompatibilityLayer
hudson.tasks.Builder
hudson.tasks.CommandInterpreter
- All Implemented Interfaces:
- ExtensionPoint, Describable<Builder>, BuildStep
- Direct Known Subclasses:
- BatchFile, Shell
public abstract class CommandInterpreter
- extends Builder
Common part between Shell
and BatchFile
.
- Author:
- Kohsuke Kawaguchi
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
command
protected final String command
- Command to execute. The format depends on the actual
CommandInterpreter
implementation.
CommandInterpreter
public CommandInterpreter(String command)
getCommand
public final String getCommand()
perform
public boolean perform(AbstractBuild<?,?> build,
Launcher launcher,
BuildListener listener)
throws InterruptedException
- Description copied from interface:
BuildStep
- Runs the step over the given build and reports the progress to the listener.
A plugin can contribute the action object to Actionable.getActions()
so that a 'report' becomes a part of the persisted data of Build
.
This is how JUnit plugin attaches the test report to a build page, for example.
- Specified by:
perform
in interface BuildStep
- Overrides:
perform
in class BuildStepCompatibilityLayer
- Returns:
- true if the build can continue, false if there was an error
and the build needs to be aborted.
Using the return value to indicate success/failure should
be considered deprecated, and implementations are encouraged
to throw AbortException
to indicate a failure.
- Throws:
InterruptedException
- If the build is interrupted by the user (in an attempt to abort the build.)
Normally the BuildStep
implementations may simply forward the exception
it got from its lower-level functions.
perform
public boolean perform(AbstractBuild<?,?> build,
Launcher launcher,
TaskListener listener)
throws InterruptedException
- Throws:
InterruptedException
createScriptFile
public FilePath createScriptFile(@Nonnull
FilePath dir)
throws IOException,
InterruptedException
- Creates a script file in a temporary name in the specified directory.
- Throws:
IOException
InterruptedException
buildCommandLine
public abstract String[] buildCommandLine(FilePath script)
getContents
protected abstract String getContents()
getFileExtension
protected abstract String getFileExtension()
Copyright © 2004-2013. All Rights Reserved.