ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From John5342 <john5...@googlemail.com>
Subject Custom element for jar task.
Date Wed, 10 Sep 2008 18:08:11 GMT
Hi,

I have a rapidly evolving project which contains a large and varying number
of service providers. I was hoping to create to create a more specialized
version of the service element that automatically scans for providers in a
give classpath but have run into some trouble asuming what i want to do is
even possible.

I started off by subclassing org.apache.tools.ant.types.spi.Service which
provides the current service element and added setClassPath() and some lgic
to automatically scan the given classpath for any classes implementing the
the given type and add add appropriate providers to Service. I then added
the following to my build.xml:

<target name="autoservice.taskdef" depends="autoservice.compile">
    <typedef name="autoservice" classname="ag.tools.ant.AutoService"
classpath="${autoservice.classes}"/>
</target>

<target name="jar" depends="autoservice.taskdef,project.compile">
    <jar destfile="${build.dir}">
      <fileset dir="${src.dir}"/>
      <autoservice type="ag.core.AGApp" classpath="${build.dir}"/>
    </jar>
</target>


autoservice.taskdef runs fine but when i get to the jar target i get the
following error:

/Projects/ag/build.xml:103: jar doesn't support the nested "autoservice"
element.

Is what i am trying to do even possible? and if so any ideas where to go
from here?

Thanks, John

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message