public abstract class AbstractBuild.AbstractBuildExecution extends Run.Runner
Modifier and Type | Field and Description |
---|---|
protected Launcher |
launcher
Since configuration can be changed while a build is in progress,
create a launcher once and stick to it for the entire build duration.
|
protected BuildListener |
listener
Output/progress of this build goes here.
|
Constructor and Description |
---|
AbstractBuildExecution() |
Modifier and Type | Method and Description |
---|---|
void |
cleanUp(BuildListener listener)
Performs final clean up action.
|
protected Launcher |
createLauncher(BuildListener listener)
Creates a
Launcher that this build will use. |
protected WorkspaceList.Lease |
decideWorkspace(Node n,
WorkspaceList wsl)
Allocates the workspace from
WorkspaceList . |
void |
defaultCheckout() |
protected abstract Result |
doRun(BuildListener listener)
The portion of a build that is specific to a subclass of
AbstractBuild
goes here. |
protected Node |
getCurrentNode()
Returns the current
Node on which we are building. |
Launcher |
getLauncher() |
BuildListener |
getListener() |
protected boolean |
perform(BuildStep bs,
BuildListener listener)
Calls a build step.
|
protected void |
performAllBuildStep(BuildListener listener,
Iterable<? extends BuildStep> buildSteps,
boolean phase)
Deprecated.
as of 1.356
Use
performAllBuildSteps(BuildListener, Iterable, boolean) |
protected void |
performAllBuildStep(BuildListener listener,
Map<?,? extends BuildStep> buildSteps,
boolean phase)
Deprecated.
as of 1.356
Use
performAllBuildSteps(BuildListener, Map, boolean) |
protected boolean |
performAllBuildSteps(BuildListener listener,
Iterable<? extends BuildStep> buildSteps,
boolean phase)
Runs all the given build steps, even if one of them fail.
|
protected boolean |
performAllBuildSteps(BuildListener listener,
Map<?,? extends BuildStep> buildSteps,
boolean phase) |
void |
post(BuildListener listener)
Performs the post-build action.
|
protected abstract void |
post2(BuildListener listener) |
protected boolean |
preBuild(BuildListener listener,
Collection<? extends BuildStep> steps) |
protected boolean |
preBuild(BuildListener listener,
Iterable<? extends BuildStep> steps) |
protected boolean |
preBuild(BuildListener listener,
Map<?,? extends BuildStep> steps) |
Result |
run(BuildListener listener)
Performs the main build and returns the status code.
|
getAttributes, getBuild, getProject
protected Launcher launcher
protected BuildListener listener
@NonNull protected final Node getCurrentNode() throws IllegalStateException
Node
on which we are building.Node
IllegalStateException
- if that cannot be determinedpublic Launcher getLauncher()
public BuildListener getListener()
protected WorkspaceList.Lease decideWorkspace(@NonNull Node n, WorkspaceList wsl) throws InterruptedException, IOException
WorkspaceList
.n
- Passed in for the convenience. The node where the build is running.wsl
- Passed in for the convenience. The returned path must be registered to this object.InterruptedException
IOException
@NonNull public Result run(@NonNull BuildListener listener) throws Exception
Run.RunExecution
run
in class Run.RunExecution
Exception
- exception will be recorded and the build will be considered a failure.@NonNull protected Launcher createLauncher(@NonNull BuildListener listener) throws IOException, InterruptedException
Launcher
that this build will use. This can be overridden by derived types
to decorate the resulting Launcher
.listener
- Always non-null. Connected to the main build output.IOException
InterruptedException
public void defaultCheckout() throws IOException, InterruptedException
IOException
InterruptedException
protected abstract Result doRun(BuildListener listener) throws Exception
AbstractBuild
goes here.Exception
protected abstract void post2(BuildListener listener) throws Exception
Exception
post(BuildListener)
public final void post(@NonNull BuildListener listener) throws Exception
Run.RunExecution
This method is called after the main portion of the build is completed.
This is a good opportunity to do notifications based on the result
of the build. When this method is called, the build is not really
finalized yet, and the build is still considered in progress --- for example,
even if the build is successful, this build still won't be picked up
by Job.getLastSuccessfulBuild()
.
post
in class Run.RunExecution
Exception
public void cleanUp(@NonNull BuildListener listener) throws Exception
Run.RunExecution
This method is called after Run.RunExecution.post(BuildListener)
,
after the build result is fully finalized. This is the point
where the build is already considered completed.
Among other things, this is often a necessary pre-condition before invoking other builds that depend on this build.
cleanUp
in class Run.RunExecution
Exception
@Deprecated protected final void performAllBuildStep(BuildListener listener, Map<?,? extends BuildStep> buildSteps, boolean phase) throws InterruptedException, IOException
performAllBuildSteps(BuildListener, Map, boolean)
InterruptedException
IOException
protected final boolean performAllBuildSteps(BuildListener listener, Map<?,? extends BuildStep> buildSteps, boolean phase) throws InterruptedException, IOException
InterruptedException
IOException
@Deprecated protected final void performAllBuildStep(BuildListener listener, Iterable<? extends BuildStep> buildSteps, boolean phase) throws InterruptedException, IOException
performAllBuildSteps(BuildListener, Iterable, boolean)
InterruptedException
IOException
protected final boolean performAllBuildSteps(BuildListener listener, Iterable<? extends BuildStep> buildSteps, boolean phase) throws InterruptedException, IOException
phase
- true for the post build processing, and false for the final "run after finished" execution.InterruptedException
IOException
protected final boolean perform(BuildStep bs, BuildListener listener) throws InterruptedException, IOException
InterruptedException
IOException
protected final boolean preBuild(BuildListener listener, Map<?,? extends BuildStep> steps)
protected final boolean preBuild(BuildListener listener, Collection<? extends BuildStep> steps)
protected final boolean preBuild(BuildListener listener, Iterable<? extends BuildStep> steps)
Copyright © 2004–2022. All rights reserved.