Ant output?

Is there any way to have the output of ant within idea of similar
fidelity to ant via the command line. Specifically, I only want to see
the targets, not each individual task. By this I mean I don't see the
400+ property sets and stuff like that.

I've tried playing with the verbose setting and the various view
settings, but can't seem to get a the target-only view.

8 comments
Comment actions Permalink

Have you tried using the BuildListener interface ?

http://ant.apache.org/manual/develop.html#buildevents

-Dash.

"Barry Kaplan" <bkaplan@integratedtrading.com> wrote in message
news:bf1c48$k32$1@is.intellij.net...

Is there any way to have the output of ant within idea of similar
fidelity to ant via the command line. Specifically, I only want to see
the targets, not each individual task. By this I mean I don't see the
400+ property sets and stuff like that.

>

I've tried playing with the verbose setting and the various view
settings, but can't seem to get a the target-only view.

>


0
Comment actions Permalink


Debabrata Dash wrote:

Have you tried using the BuildListener interface ?

http://ant.apache.org/manual/develop.html#buildevents


Well, I'm sure that idea is using that as part of its ant integration.
But that is an internal idea thing. I think idea is spewing to much of
the events receives from ant.

0
Comment actions Permalink

Has anyone come up with a good way of fixing this? Specifically, I'd like to only see the actual target names (and any output, obviously) rather than the individual tasks, which are very fine grained. I'm working on a large project, and I'd rather not have to wrap all the init stuff in an "init" target just to avoid seeing all the property and taskdef tasks.

0
Comment actions Permalink

I am using IDEA 5.0 and this still seems to be that case.

I really am quite un-interested in seeing debug messages about the individual tasks that are being set.

I searched the issue tracker for any related issues but I couldn't find any.
Are there any plans afoot to allow us to filter out these pointless messages?

0
Comment actions Permalink

Anyone figure this out yet? I've tried using the '-logger ]]>' option and that doesn't do anything - it just seems to skip the build altogether and printed a 'done' one-line message. Done in 1 second, what should take 15 seconds.

Weird. Might have to go code-diving to figure out which particular logger Idea is using...

I'm using 5.0.2 on WinXP...

0
Comment actions Permalink

just searched the Idea Help docs (included with Idea) and found this:

===============================
Ant command line
-


In the command line you can introduce parameters to launch the Ant with except for -logger. Parameters should be introduced with a dash and the delimiter is a space symbol.
===============================

So, that explains the trouble I was having with '-logger' option. Hmmm....

0
Comment actions Permalink

Have you tried to press the buttons on the left side of the ant run window? it might help...

0
Comment actions Permalink

Just started playing around with BeanShell inside Ant/Idea and came up with this script that allows you to turn down the logging level of the default logger - problem being, that doesn't really help me much - I can get the same thing by passing a '-q' on the command line.

Here it is, in case anyone wants to continue the effort:

List listeners = project.getBuildListeners(); for ( untypedElement : listeners ) { String expectedLoggerClassName = "com.intellij.rt.ant.execution.IdeaAntLogger2"; if ( untypedElement.getClass().getName().equals( expectedLoggerClassName ) ) { //print( untypedElement.getClass().getName() ); untypedElement.setMessageOutputLevel( 1 ); } } ]]>

I figured out the name of the default logger/listener they're using ('com.intellij.rt.ant.execution.IdeaAntLogger2') - I'm guessing this is what's being used, anyways - by printing all the listeners returned from the 'project.getBuildListeners()' method. There are 50 or more of them, but only one seemed to say anything about 'log' or 'ant' in the name.

Having built a custom listener in the past I figured this class either extended an existing class or implemented one of the 'logging' interfaces - BuildLogger or BuildListener, so I took a chance and called "untypedElement.setMessageOutputLevel( 1 )" on it. I tried to use 'PROJECT.MSG_WARN' instead of 1, but it didn't take, then I found this page in the Javadoc saying what the numeric values were (apache-ant-1.6.5/docs/manual/api/constant-values.html#org.apache.tools.ant.Project.MSG_WARN).

The 'project' class lets you add new listeners, but not take existing ones away. I guess you could set the logging level of the default logger to something even lower than MSG_ERR (0) - so, make it -1, that would effectively turn off the existing default logger. Then, create a new logger and add it to the project with 'project.addBuildListener()'. I'm guessing you can do that in BeanShell - seems you can do a whole lot of other stuff.

Problem remains, where to call this beanshell task from? I called it from my lowest-level task, that everything else is dependent upon, and I still get a whole bunch of crap on my screen b/c a lot of the property init stuff takes place even before the first task runs. Not sure what to do about that yet.

But, my guess is that Idea probably has a configurable way to set up your own logger w/o having ot resort to these hacks.

0

Please sign in to leave a comment.