提交 bfdfe527 编写于 作者: N Nicolas De loof

Merge pull request #327 from recampbell/master

Expose a new beforeUse callback on WorkspaceListener for performing actions on a workspace before it's used by a build.
......@@ -452,7 +452,10 @@ public abstract class AbstractBuild<P extends AbstractProject<P,R>,R extends Abs
try {
workspace = lease.path.getRemote();
node.getFileSystemProvisioner().prepareWorkspace(AbstractBuild.this,lease.path,listener);
for (WorkspaceListener wl : WorkspaceListener.all()) {
wl.beforeUse(AbstractBuild.this, lease.path, listener);
}
preCheckout(launcher,listener);
checkout(listener);
......
......@@ -2,6 +2,7 @@ package hudson.model;
import hudson.ExtensionList;
import hudson.ExtensionPoint;
import hudson.FilePath;
public abstract class WorkspaceListener implements ExtensionPoint {
......@@ -11,6 +12,16 @@ public abstract class WorkspaceListener implements ExtensionPoint {
*/
public void afterDelete(AbstractProject project) {
}
/**
* Called before a build uses a workspace. IE, before any SCM checkout.
* @param r
* @param workspace
* @param listener
*/
public void beforeUse(AbstractBuild b, FilePath workspace, BuildListener listener) {
}
/**
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册