ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From <ext-simon.stei...@nokia.com>
Subject RE: Find a properties location
Date Wed, 26 Nov 2008 10:05:02 GMT
Hi,

Also how can I get a list of all ant files?

We use this but this only includes files with targets not ones with only properties.

Map targets = project.getTargets();
Iterator targetsIter = targets.values().iterator();
while (targetsIter.hasNext())
{
Target target = (Target) targetsIter.next();
String projectPath = target.getLocation().getFileName();

Thanks

> -----Original Message-----
> From: ext Jan.Materne@rzf.fin-nrw.de [mailto:Jan.Materne@rzf.fin-nrw.de]
> Sent: 13 November 2008 06:48
> To: user@ant.apache.org
> Subject: AW: Find a properties location
> 
> While I think that could be implemented this is not at the moment.
> You have to introduce a new type for propertyvalues, containing the value
> and the location.
> You would change the api from
> 
> Hashtable/*<String,String>*/ properties;
> 
> to
> 
> Hashtable<String,Property> properties;
> class Property {
>     String value;
>     Location location;
> }
> 
> and change
> 
> Project.setProperty(String name, String value)
> to
> Project.setProperty(String name, String value, Task settingTask)
> 
> The last change is needed because somewhere the location has to be set.
> 
> 
> Jan
> 
> >-----Urspr√ľngliche Nachricht-----
> >Von: ext-simon.steiner@nokia.com [mailto:ext-simon.steiner@nokia.com]
> >Gesendet: Mittwoch, 12. November 2008 16:22
> >An: user@ant.apache.org
> >Betreff: RE: Find a properties location
> >
> >Hi,
> >
> >I not looking for the value of the property but where in the
> >configuration it is defined.
> >
> >The org.apache.tools.ant.Target class has a method:
> >getLocation(), can I get the same sort of thing for properties.
> >
> >Thanks
> >
> >> -----Original Message-----
> >> From: ext Jan.Materne@rzf.fin-nrw.de
> >[mailto:Jan.Materne@rzf.fin-nrw.de]
> >> Sent: 12 November 2008 15:11
> >> To: user@ant.apache.org
> >> Subject: AW: Find a properties location
> >>
> >> Properties are a String-String-Mapping.
> >> Quasi a
> >>   Hashtable<String,String> properties = ...
> >> The name works as key.
> >> The value is set by
> >>   <property .. value=""/> : to the string value
> >>   <property .. location=""/> : to the absolute path (again
> >as String) of
> >> that location.
> >>
> >>
> >> Jan
> >>
> >> >-----Urspr√ľngliche Nachricht-----
> >> >Von: ext-simon.steiner@nokia.com
> >[mailto:ext-simon.steiner@nokia.com]
> >> >Gesendet: Mittwoch, 12. November 2008 15:32
> >> >An: user@ant.apache.org
> >> >Betreff: Find a properties location
> >> >
> >> >Hi,
> >> >
> >> >How can I find out where a property is defined, which ant file?
> >> >
> >> >I would like:
> >> >project.getProperty("helium.dir").file()
> >> >
> >> >or:
> >> >project.getProperty("helium.dir").location()
> >> >
> >> >Thanks
> >> >
> >> >
> >> >
> >>
> >>---------------------------------------------------------------------
> >> >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