Skip to content
Permalink
Browse files

Fix endless loop when used with Ant builder

[FIXES JENKINS-46051]
  • Loading branch information
wolfs committed Sep 26, 2017
1 parent 13140a0 commit 319f42a30a616dd2def1337776eec40a4c0d10df
@@ -25,12 +25,12 @@ THE SOFTWARE.
<?jelly escape-by-default='true'?>
<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:d="jelly:define" xmlns:l="/lib/layout" xmlns:t="/lib/hudson" xmlns:f="/lib/form" xmlns:i="jelly:fmt" xmlns:p="/lib/hudson/project">
<l:ajax>
<table class='pane' id='console-outline'>
<table class='pane' id='gradle-console-outline'>
<tr>
<td class='pane-header'>${%Executed Gradle Tasks}</td>
</tr>
<tr>
<td id='console-outline-body'>
<td id='gradle-console-outline-body'>
<ul></ul>
</td>
</tr>
@@ -1,24 +1,26 @@
(function() {
(function () {
// created on demand
var outline = null;
var loading = false;

var queue = []; // gradle tasks are queued up until we load outline.

function loadOutline() {
if (outline != null) return false; // already loaded
if (outline != null) return false; // already loaded

if (!loading) {
loading = true;
var u = new Ajax.Updater(document.getElementById("side-panel"),
rootURL + "/descriptor/hudson.plugins.gradle.GradleTaskNote/outline",
{insertion: Insertion.Bottom, onComplete: function() {
if (!u.success()) return; // we can't us onSuccess because that kicks in before onComplete
outline = document.getElementById("console-outline-body")
.getElementsByTagName('ul')[0];
loading = false;
queue.each(handle);
}});
rootURL + "/descriptor/hudson.plugins.gradle.GradleTaskNote/outline",
{
insertion: Insertion.Bottom, onComplete: function () {
if (!u.success()) return; // we can't us onSuccess because that kicks in before onComplete
outline = document.getElementById("gradle-console-outline-body")
.getElementsByTagName('ul')[0];
loading = false;
queue.each(handle);
}
});
}
return true;
}
@@ -42,7 +44,7 @@

Behaviour.register({
// insert <a name="..."> for each Gradle task and put it into the outline
"b.gradle-task" : function(e) {
"b.gradle-task": function (e) {
handle(e);
}
});
@@ -1,8 +1,8 @@
#console-outline-body ul {
#gradle-console-outline-body ul {
padding-left:5%;
word-wrap:break-word;
}

#console-outline-body ul li a {
#gradle-console-outline-body ul li a {
word-break:break-all;
}

0 comments on commit 319f42a

Please sign in to comment.
You can’t perform that action at this time.