|
View:
New views
4 Messages
—
Rating Filter:
Alert me
|
|
|
Progessbar on the console?From googling, I know that Ant cannot display a progress bar on the
console. I know about the <splash> task, but that's not the same. What I have in mind is something like Term::ProgressBar in Perl, which is nice, here's a (slightly edited) screenshot: C:\ :: \dev\Perl\progressbar.pl 76% [================================================ ] http://search.cpan.org/dist/Term-ProgressBar/lib/Term/ProgressBar.pm That's cool for running stuff on the server and knowing that it'll be done in five minutes. Of course, you don't always know how long a task will take, but there are scenarios where it is absolutely possible to give a reasonable estimate. Batch processing 34567 XML files, for example. I know how many I've done, I know how many are left. My task would notify the embedded <progressbar/>, which has been initialized with @count = 34567, and update it each time around. Whenever the update makes a difference on the screen, the screen is also updated. Would that be very complicated to do in Ant? Michael Ludwig --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscribe@... For additional commands, e-mail: user-help@... |
|
|
Re: Progessbar on the console?On Thu, Jun 18, 2009 at 6:35 PM, Michael Ludwig<milu71@...> wrote:
> From googling, I know that Ant cannot display a progress bar on the console. > [snip] > C:\ :: \dev\Perl\progressbar.pl > 76% [================================================ ] > [snip] > Would that be very complicated to do in Ant? As you may have read, Ant redirects java.System.out to intercept all println calls to send them to a Logger and zero or more listeners. But it also does line buffering on this stream, which prevents Junit-like dot-dot-dot output to the console. There are existing contributed Loggers which for example take advantage of some *nix terminal codes to color the output, and provided you have a terminal that properly handles some BACKSPACE code, you could imagine a Logger that prints out a bunch of backspaces to erase the current line to print the new updated one. You have very little control (to not say not at all) over the tty in Java to do something like what you describe in a portable manner, but I could be wrong. As you can see, my knowledge of the topic is quite limited, but hopefully this might help a little nonetheless. --DD --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscribe@... For additional commands, e-mail: user-help@... |
|
|
Re: Progessbar on the console?Dominique Devienne schrieb am 18.06.2009 um 19:42:12 (-0500):
> As you may have read, Ant redirects java.System.out to intercept all > println calls to send them to a Logger and zero or more listeners. But > it also does line buffering on this stream, which prevents Junit-like > dot-dot-dot output to the console. Yes, that would have to change, I guess. Difficult? > You have very little control (to not say not at all) over the tty in > Java to do something like what you describe in a portable manner, but > I could be wrong. Ah, so not only Ant makes it complicated, but also Java. Google found me something: http://luka.tnode.com/blog/2007/07/java-console-progress-bar http://www.repher.at/static/coding/java/progress/api/at/repher/console/Progress.html Haven't looked more closely, but progress bars don't seem impossible in Java. So only Ant would have to accomodate this. > As you can see, my knowledge of the topic is quite limited, but > hopefully this might help a little nonetheless. --DD Less limited than mine - good input, thanks! Michael Ludwig --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscribe@... For additional commands, e-mail: user-help@... |
|
|
Re: Progessbar on the console?On Thu, Jun 18, 2009 at 8:22 PM, Michael Ludwig<milu71@...> wrote:
> Dominique Devienne schrieb am 18.06.2009 um 19:42:12 (-0500): >> As you may have read, Ant redirects java.System.out to intercept all >> println calls to send them to a Logger and zero or more listeners. But >> it also does line buffering on this stream, which prevents Junit-like >> dot-dot-dot output to the console. > > Yes, that would have to change, I guess. Difficult? Well, if it's not line-buffered, what does it do, send every character individually? Look at DemuxOutputStream. Looks like explicit calls to flush will actually flush the buffer to the logger+listeners, so maybe there's nothing to do. >> You have very little control (to not say not at all) over the tty in >> Java to do something like what you describe in a portable manner, but >> I could be wrong. > > Ah, so not only Ant makes it complicated, but also Java. Google found me > something: > > http://luka.tnode.com/blog/2007/07/java-console-progress-bar > http://www.repher.at/static/coding/java/progress/api/at/repher/console/Progress.html This just shows that I'm no longer actively writing Java code... This is a class new to 1.6 that I've never used. > Haven't looked more closely, but progress bars don't seem impossible in > Java. So only Ant would have to accomodate this. I guess that line-buffered or not is not really the issue here. If you try to replicate exactly what the Perl code does, you need to rewrite the same tty line over and over, which java.io.Console might allow easily, provided you chop the trailing \n before writing it on screen, unless Console provides even more control over the tty. >> As you can see, my knowledge of the topic is quite limited, but >> hopefully this might help a little nonetheless. --DD > > Less limited than mine - good input, thanks! Not for long it seems, and I learned about Console that way :) --DD --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscribe@... For additional commands, e-mail: user-help@... |
| Free embeddable forum powered by Nabble | Forum Help |