提交 6fcbc164 编写于 作者: K Kohsuke Kawaguchi

If a BuildListener is given, we can just pass through.

上级 af5e06a9
......@@ -214,7 +214,7 @@ public class ArtifactArchiver extends Recorder implements SimpleBuildStep {
Map<String,String> files = ws.act(new ListFiles(artifacts, excludes, defaultExcludes));
if (!files.isEmpty()) {
build.pickArtifactManager().archive(ws, launcher, new BuildListenerAdapter(listener), files);
build.pickArtifactManager().archive(ws, launcher, BuildListenerAdapter.wrap(listener), files);
if (fingerprint) {
new Fingerprinter(artifacts).perform(build, ws, launcher, listener);
}
......
......@@ -84,4 +84,11 @@ public final class BuildListenerAdapter implements BuildListener {
return delegate.fatalError(format, args);
}
public static BuildListener wrap(TaskListener l) {
if (l instanceof BuildListener) {
return (BuildListener) l;
} else {
return new BuildListenerAdapter(l);
}
}
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册