"Minutes to next build" field

Steve Magoun <[email protected]> Thu, 30 Jan 2003 14:53:15 -0500
Newsgroups gmane.comp.java.anthill.devel
Message-ID <[email protected]>
Since I'm impatient, knowing the number of minutes until the next build  
isn't enough - I want to know the number of seconds, too. I've patched  
AnthillSchedule.java and main.jsp to tell me the # of minutes + seconds  
until the next build; the diffs follow for anyone interested.

The new method in AnthillSchedule isn't terribly robust (it doesn't  
support days/hours/etc), but it works pretty well (our build cycles are  
<1hr). If anyone writes a more robust version, please let me know!


Steve



AnthillSchedule.java:

188a189,203
 >
 >      
/ 
/----------------------------------------------------------------------- 
---
 >     public String getTimeToNextBuild() {
 >         long mins = getMinutesToNextBuild();
 >         long millis = getMillisToNextBuild();
 >         long seconds = (millis / 1000) - (60 * mins);
 >         String ret = mins + ":";
 >         if (seconds <= 9) {
 >             ret += "0" + seconds;
 >         } else {
 >             ret += seconds;
 >         }
 >         return ret;
 >     }
 >


main.jsp:

141c141
<     <td align="center"><%= schedule.getMinutesToNextBuild()  
%></a></td>
---
 >     <td align="center"><%= schedule.getTimeToNextBuild() %></a></td>