ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Tim Gordon" <tim.gor...@allustra.com>
Subject How do I get at the project base dir inside a subclass of BaseExtendSelector?
Date Mon, 31 Mar 2003 17:40:16 GMT
Hi

I'm passing <param name="somedir" value="${some.relative.directory}">
parameter into a custom selector, which is a subclass of BaseExtendSelector.
${some.relative.directory} is defined relative to the project ${basedir}, so
inside my code I'll get a string value for the "somedir" parameter which is
basically useless to me unless I can do

new File(project.getBasedir(), somedir);

However, setProject() never seems to get called on my custom selector, even
though it's a ProjectComponent. Is this a bug in ANT BaseExtendSelector or
AbstractFileSet, not setting the project on the component?

I can acheive the effect I'm after by passing in <param name="somedir"
value="${basedir}/${some.relative.directory}"> - do I have to live with
that? I'd rather pass in paths defined relative to the project basedir,
which is consistent with passing around directories in the rest of ANT.

Tim Gordon

Allustra Limited
1 Royal Exchange Avenue
London
EC3V 3LT
Tel 020 7464 4190
Tel 020 7464 4194
http://www.allustra.com/


Mime
View raw message