ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mspel...@gk-software.com
Subject Ant task with custom classpath?
Date Fri, 05 Jun 2009 08:29:40 GMT
Hello

Would it be possible to call Ant task with different classpath than the
one actual build is running with ?
Following should give you an idea:
<ant antfile="secondbuild.xml" target="run">
  <classpath><!-- this is not possible, but ilustrating the problem -->
    <pathelement location="ant-contrib.jar"/>
  </classpath>
</ant>

I have attempted to use taskdef to archieve this, but it does not seem
to work:
<path id="custom.classpath">
    <fileset dir="${env.ANT_HOME2}/lib">
      <include name="**/*.jar"/>
      <include name="**/**/*.jar"/>
      <pathelement location="ant-contrib.jar"/>
    </fileset>
</path>

<taskdef name="runAnt"
  classname="org.apache.tools.ant.taskdefs.Ant"
  classpathref="custom.classpath">
</taskdef>

This defines the task, but secondbuild.xml invoked with this new task
does not have access to tasks defined in 'custom.classpath'.

Is there any way to archive this ?
The motivation scenario is antscript used as an command interface
between two systems. Currently, they both have to use the same ant version and
classpath.

Thanks for any hints.
Martin.

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Mime
View raw message