package org.jenkinsci.plugins.p4.console; import hudson.model.TaskListener; import org.jenkinsci.plugins.p4.client.ConnectionHelper; import com.perforce.p4java.server.callback.IProgressCallback; public class P4Progress implements IProgressCallback { private final TaskListener listener; private final ConnectionHelper p4; public P4Progress(TaskListener listener, ConnectionHelper p4) { this.listener = listener; this.p4 = p4; } public void start(int key) { } public boolean tick(int key, String msg) { if (msg != null && !msg.isEmpty()) { StringBuffer sb = new StringBuffer(); for (String line : msg.split("(?<=\\n)")) { sb.append("... " + line); } log(msg); } if (Thread.interrupted()) { log("(p4):stop:exception\n"); log("P4: ABORT called!"); p4.abort(); return false; } return true; } public void stop(int key) { log("(p4):stop:" + key); } private void log(String msg) { if (listener == null) { return; } listener.getLogger().println(msg); } }
# | Change | User | Description | Committed | |
---|---|---|---|---|---|
#1 | 20641 | Paul Allen | Copy main -> dev (jenkinsci/p4-plugin) | ||
//guest/perforce_software/p4jenkins/main/src/main/java/org/jenkinsci/plugins/p4/console/P4Progress.java | |||||
#2 | 15430 | Paul Allen |
Trap User Abort and stop Perforce. Uses the ‘tick’ function on Progress to check if the Thread has been interrupted. If a user aborts the build then the Perforce connection is dropped at the next tick. JENKINS-26650 |
||
#1 | 12976 | Paul Allen | Improved logging to include 'actual' Perforce command. | ||
//guest/perforce_software/p4jenkins/main/src/main/java/org/jenkinsci/plugins/p4/console/P4Callback.java | |||||
#1 | 12953 | Paul Allen |
Update logging to support expand/collapse divs. - Additional Publish logging |
||
//guest/perforce_software/p4jenkins/main/src/main/java/org/jenkinsci/plugins/p4/client/ClientProgress.java | |||||
#2 | 12417 | Paul Allen |
Extend Jenkins support back to 1.568 - remove @Override annotations - remove jenkins.security.Roles |
||
#1 | 12296 | Paul Allen | Monitor P4Java progress, reporting to console log. |