ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From <Jan.Mate...@rzf.fin-nrw.de>
Subject <whereAmI> doesnt run on 1.6.x but on 1.7 (WAS: How to silence javac task?)
Date Tue, 28 Nov 2006 08:27:25 GMT
* <scriptdef> is implemented by oata.taskdefs.optional.script.ScriptDef (according to
oata/taskdefs/default.properties).
* ScriptDef's executeScript(Map,Map,ScriptDefBase) method configures the script runner and
starts the script.
* While configuration it adds some global references: attributes, elements, project and self
* Adding the self-reference was introduced [1] in revision 276682 on 2004-07-07 [2], so between
1.6.1 and 1.6.2.

So "self" should work

* "self" was added with 
      runner.addBean("self", self);
  in 2004. Now (since rev 278277 [4])it is done with
      if (instance != null) {
          runner.addBean("self", instance);
      }
  So, maybe "instance" is null in <=1.6.5 but not in 1.7?
  
  
Jan   
  



[1] http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/script/ScriptDef.java?view=log
[2] Initial commit
    http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/script/ScriptDef.java?r1=276390&r2=276682&diff_format=h
    Fix wrong variable name
    http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/script/ScriptDef.java?r1=276682&r2=276683&diff_format=h
[3] http://ant.apache.org/faq.html#history
[4] http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/script/ScriptDef.java?r1=277184&r2=278277&diff_format=h


>-----Ursprüngliche Nachricht-----
>Von: Jan.Materne@rzf.fin-nrw.de [mailto:Jan.Materne@rzf.fin-nrw.de] 
>Gesendet: Dienstag, 28. November 2006 08:50
>An: user@ant.apache.org
>Betreff: AW: How to silence javac task?
>
>mmm ... I had tested that in the past ...
>I did a retest on Ant 1.5 (failed, ok - no scriptdef ;) 
>1.6.0+1.6.5 (no "self").
>But works on 1.7.0RC1 ... (mmm ... I had posted that in 2004 
>... I should play in a lottery ;) 
>
>I have found the snippet in my local library. With a note
>	Benoetigt Ant >1.6.3 (unbekannt ob 1.6.4 oder 1.6.5 
>funktionieren)
>(translation)
>	needs Ant >1.6.3 (unknown if 1.6.4 or 1.6.5 would work)
>
>2004-07-16 Ant 1.6.2
>2004-11-18 the script
>2005-04-28 Ant 1.6.4
>2005-06-02 Ant 1.6.5
>2006-11-05 Ant 1.7.0RC1
>
>I'll have a look into the svn-history about "self" ...
>
>
>Jan
>
>>-----Ursprüngliche Nachricht-----
>>Von: Rebhan, Gilbert [mailto:Gilbert.Rebhan@huk-coburg.de]
>>Gesendet: Dienstag, 28. November 2006 07:59
>>An: Ant Users List
>>Betreff: RE: How to silence javac task?
>>
>>
>>:-)
>>
>>i just saved it for further use (in November 2004) , i never tried it 
>>until now.
>>
>>yup it doesn't work =
>>
>>ReferenceError: "self" is not defined.
>>
>>Regards, Gilbert
>>
>>-----Original Message-----
>>From: Jan.Materne@rzf.fin-nrw.de [mailto:Jan.Materne@rzf.fin-nrw.de]
>>Sent: Tuesday, November 28, 2006 7:54 AM
>>To: user@ant.apache.org
>>Subject: AW: How to silence javac task?
>>
>>Hihi - I thought I had implemented something .... ;-)
>>
>>Jan
>>
>>>-----Ursprüngliche Nachricht-----
>>>Von: Rebhan, Gilbert [mailto:Gilbert.Rebhan@huk-coburg.de]
>>>Gesendet: Montag, 27. November 2006 15:45
>>>An: Ant Users List
>>>Betreff: RE: How to silence javac task?
>>>
>>>
>>>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
>>>
>>>
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: user-unsubscribe@ant.apache.org For 
>additional 
>>commands, e-mail: user-help@ant.apache.org
>>
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: user-unsubscribe@ant.apache.org For 
>additional 
>>commands, e-mail: user-help@ant.apache.org
>>
>>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: user-unsubscribe@ant.apache.org For 
>additional commands, e-mail: user-help@ant.apache.org
>
>

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


Mime
View raw message