提交 cf3891dd 编写于 作者: K Kohsuke Kawaguchi

minor doc changes

上级 6fcbc164
......@@ -36,6 +36,9 @@ import hudson.Launcher;
import java.io.IOException;
import java.util.Collection;
import java.util.Collections;
import hudson.model.Run;
import hudson.model.TaskListener;
import jenkins.tasks.SimpleBuildStep;
/**
......@@ -63,6 +66,7 @@ public abstract class BuildStepCompatibilityLayer implements BuildStep {
*/
public boolean perform(AbstractBuild<?,?> build, Launcher launcher, BuildListener listener) throws InterruptedException, IOException {
if (this instanceof SimpleBuildStep) {
// delegate to the overloaded version defined in SimpleBuildStep
FilePath workspace = build.getWorkspace();
if (workspace == null) {
throw new AbortException("no workspace for " + build);
......@@ -70,6 +74,7 @@ public abstract class BuildStepCompatibilityLayer implements BuildStep {
((SimpleBuildStep) this).perform(build, workspace, launcher, listener);
return true;
} else if (build instanceof Build) {
// delegate to the legacy signature deprecated in 1.312
return perform((Build)build,launcher,listener);
} else {
return true;
......
......@@ -57,8 +57,10 @@ import org.kohsuke.accmod.restrictions.DoNotUse;
* <p>Such a build step would typically be written according to some guidelines that ensure it makes few assumptions about how it is being used:
* <ul>
* <li>Do not implement {@link BuildStep#prebuild}, since this presupposes a particular execution order.
* <li>Do not implement {@link BuildStep#getProjectActions}, since this might never be called if the step is not part of the static configuration of a project; instead, add a {@link LastBuildAction} to a build when run.
* <li>Implement {@link BuildStep#getRequiredMonitorService} to be {@link BuildStepMonitor#NONE}, since this facility only makes sense for a step called exactly once per build.
* <li>Do not implement {@link BuildStep#getProjectActions}, since this might never be called
* if the step is not part of the static configuration of a project; instead, add a {@link LastBuildAction} to a build when run.
* <li>Implement {@link BuildStep#getRequiredMonitorService} to be {@link BuildStepMonitor#NONE}, since this facility
* only makes sense for a step called exactly once per build.
* <li>Do not implement {@link DependencyDeclarer} since this would be limited to use in {@link AbstractProject}.
* <li>Return true unconditionally from {@link BuildStepDescriptor#isApplicable} (there is currently no filtering for other {@link Job} types).
* </ul>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册