ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Wolfgang Häfelinger" <>
Subject puzzled with installing my own PropertyHelper
Date Tue, 24 May 2005 17:40:43 GMT
Hi Antees,

I wonder whether someone got his own PropertyHelper installed and what needs
exactly to be done?

What I'm doing is basically this:
1. I'm deriving my PropertyHandler from `'
2. I wrote a `Init' task to install my propery handler. The execute method looks

   public void execute() throws 
     PropertyHelper PH = new PropertyHelper(); /* that's my own here */
     Project P = getProject();

I can see that my methods are called, especially the method "replaceProperties()"
of my helper. However, having done this I'm not longer able to resolve ${basedir}
and neither Java system properties 

My build.xml looks basically like:

<project name="ant-test" default="test" basedir=".">
  <taskdef name="my-init" classname="my.Init" />
  <!-- install my property handler -->
 <property name="X" value="Y" />
 <my-init />
 <target name="test">
  <echo> basedir=${basedir} </echo>
  <echo> X=${X}</echo>

This would echo then print
 instead which is a bit unexpected to me.

Note that I can reproduce this with a very basic PropertyHelper:

 public class PropertyHelper extends {
  protected PropertyHelper() {

Any help available??

Side issue: 
Installing  your  own PropertyHelper is not enough in general. It appears that
task `Property' is not consistently using the PropertyHelper interface. In order
to have  my  fancy  property  handling  installed I also had to subclass class
Property and make a couple of adjustments.

Finally - what is it all about?
I'm investigating build scripts written in our organisation. Lot's of times I found
things like

  classname = "x.y.z"
  filename    = "x/y/z.class

in I want to avoid that users need to write things more than 
once if not really required. So what I want to have is this:

  filename = ${subst \\., /, ${classname}}.class   # evaluates to: x/y/z.class

Everythings works fine so far except that my expression evaluator fails to 
resolve ${basedir}  :-(((

Thanks for any help,
Verschicken Sie romantische, coole und witzige Bilder per SMS!
Jetzt bei WEB.DE FreeMail:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message