ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Rebhan, Gilbert" <Gilbert.Reb...@huk-coburg.de>
Subject RE: How to silence javac task?
Date Mon, 27 Nov 2006 14:45:18 GMT

Hi,


/*
Would that be ok?

<project default="main">

    <scriptdef name="whereAmI" language="javascript"><![CDATA[
        selfAsTarget    = self;
        currentTarget   = selfAsTarget.getOwningTarget();
        currentLocation = selfAsTarget.getLocation();
        project.log(currentLocation + "Target '" + currentTarget + "'");
    ]]></scriptdef>

    <target name="one">
        <whereAmI/>
    </target>

    <target name="two">
        <whereAmI/>
    </target>

    <target name="main" depends="one,two">
        <whereAmI/>
    </target>

</project>


Jan
*/

as posted by Jan Materne =

http://marc.theaimsgroup.com/?l=ant-user&m=110077914931555&w=2

Regards, Gilbert

-----Original Message-----
From: Hans Schwaebli [mailto:hans_schwaebli@yahoo.com] 
Sent: Monday, November 27, 2006 3:40 PM
To: Ant Users List
Subject: Re: How to silence javac task?

I have to reply to a message because if I post my problem as a new
message it is always rejected as spam!
   
  Here is it:
   
  I want to echo the current target name. Is this possible?
   
There is no build-in property ant.target.name. Maybe another way?
   
Why I want to do this? Because if a error occurs, Ant prints the line 
number where the error occured, but not the target name, in which it 
occured. Sometimes I get a error message by mail like "Java returned 
-1".
  I would know more about that failure if I knew in which target it 
happend and not only in which line, because I don't have the Ant script 
all the time to check the line.
   
Best would be a stack trace like in Java. Ant 1.6.5 only contains 
line numbers and script names but not the target names in the error 
message.

  

Dominique Devienne <ddevienne@gmail.com> wrote:
  > So 2. and 3. are _always_ logged irrespective of used loglevel
> it's like using System.out and setloglevel has no impact.

No true ;-) log without an explicit log level uses INFO level, so
setting log level to WARN hides these messages, just like when running
Ant in quiet mode (-q).

The Javac messages are read by the stream pumper threads, and
forwarded to the default logger. You need to replace the default
logger with a custom one that filters out some messages and not
others. Possible, but requires programming... --DD

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org



 
---------------------------------
Check out the all-new Yahoo! Mail beta - Fire up a more powerful email
and get things done faster.

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Mime
View raw message