You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by Jose Alberto Fernandez <JF...@viquity.com> on 2000/09/15 02:49:02 UTC

How to use compileTask

Hi, I have a new task that builds as part of the same project in which it is
defined.
 
So I try to use <compileTask> but had several surprises in the process:
 
1) Must declare <compileTask> in a <target> eventhough it is executed at
parsing time.
    I would have thought that this task would be used just like <taskdef>.
 
2) The destination directory for the task, seem to be required to exists and
there is no way to
    create it during compilation because the <mkdir> will not execute until
compile time.
    Which means that one needs to put the task in some "always existing
place" not clear how.
 
3) So I put it in $ANT_HOME/lib.
 
4) <compileTask> does not seem to declare the task, so I had to add
<taskdef> element,
    but now this taskdef cannot find the class for the task.
 
I would have thougt that one would have declared the <compileTask> in the
same place as <taskdef> and that the task would have declared the new task
(even is up to date) and know which classpath to use to get it, given the
destdir attribute in <compileTask>.
 
Any ideas on how to solve this problem would be appreciated.
 
Jose Alberto
 

 

Re: How to use compileTask

Posted by Stefan Bodewig <bo...@bost.de>.
>>>>> "JAF" == Jose Alberto Fernandez <JF...@viquity.com> writes:

 JAF> Hi, I have a new task that builds as part of the same project in
 JAF> which it is defined.
 
Talking about my personal TODO list. One of the very first priorities
is to make <compiletask> superfluous. Expect a patch to appear during
next week that will allow you to do this without using undocumented
features.

Basically Ant won't die if it encounters an unknown task - only if you
try to use it. <taskdef>s living inside of targets (or having a
depends attribute) can then be used to achieve wgat you need.

Expect compiletask to vanish after that.

Stefan