Executing a custom ant task in Mac OS X.

Discussion in 'Mac Programming' started by sujithkrishnan, Jun 25, 2009.

  1. sujithkrishnan macrumors 6502

    May 9, 2008
    How to execute custom ant task in Mac OS x? The exact problem i am facing is that i have developed a custom ant task and calling that task in my ant script.

    This is the error that is displayed:

    $ ant -buildfile test.xml
    Buildfile: test.xml

    /Users/sujithkrishnan/Desktop/test.xml:11: taskdef A class needed by class com.digby.api.ProjectBuilder cannot be found: org/apache/tools/ant/Task

    Total time: 0 seconds

    ProjectBuilder is my class where i am using the ant's class which is org.apache.tools.ant.Task.

    My CLASSPATH is also correctly set as shown below:

    sujith-krishnans-mac-mini:Desktop sujithkrishnan$ echo $CLASSPATH

    This class was developed in windows machine with ant 1.6.4 and java 1.5.0_08

    The mac os is having java 1.5.0 and ant 1.7.0.

    Any solutions will be highly appreciated.
  2. pbw macrumors newbie

    May 18, 2006
    You have to define a classpath for the custom task in the build.xml file. See the docs for Taskdef and Typedef in the Tasks section of the Ant documentation. There are "classpath" and "classpathref" attributes available to the "taskdef" through its inheritance from Typedef.

Share This Page