The way to solve this is to put your <taskdef> declaration inside the <target> that builds yor <task> and then make the targets that use it to be dependant on that target.
I am doing that right now and it works just great. Jose Alberto > -----Original Message----- > From: Mads Andersen [mailto:[EMAIL PROTECTED] > Sent: Tuesday, September 19, 2000 11:34 AM > To: [EMAIL PROTECTED] > Subject: Lazy evaluation of custom taskdefs > > > Now that Ant can finally find my custom tag, I have a minor > suggestion. > > My build.xml has a custom task in the beginning of the file > as follows: > > <taskdef name="transform" > classname="com.madsie.util.xsl.XSLTransformTask"/> > > Now, XSLTransformTask is a part of the project, so after an > "ant clean" the > XSLTransformTask.class is no longer accessible. No matter > which target you > try with Ant, it will fail because the Class of > XSLTransformTask is resolved > before any targets get executed. > > What I would like is to make my targets using taskdef > transform ensure that > XSLTransformTask.java is compiled. This would be possible if > custom taskdefs > were evaluated in a lazy fasion, that is when the custom > tasdef is first > needed. > > Best regards, Madsie >
