Bug 17961

Summary: New task to collect services from a JAR
Product: Ant Reporter: Berin Loritsch <bloritsch>
Component: Optional TasksAssignee: Ant Notifications List <notifications>
Status: NEW ---    
Severity: enhancement Keywords: PatchAvailable
Priority: P3    
Version: unspecified   
Target Milestone: ---   
Hardware: All   
OS: other   
Attachments: ServiceCollector source code
Newer version that actually works--I forgot to copy the contents of the jar entries before
Ok This version officially works. The last time my copy and paste overwrote the part that actually wrote the results of the services collection

Description Berin Loritsch 2003-03-13 16:51:06 UTC
Enclosed is an Ant Task I wrote to support another project.  It seems general
enough to me to make available in Ant itself.  It takes an input JAR, and looks
at all classes in the JAR.  It tests to see if they are an implementation of
the specified service(s).

If there happens to be a class that implements more than one service, it will
appear in every service definition that it applies to.
Comment 1 Berin Loritsch 2003-03-13 16:52:00 UTC
Created attachment 5314 [details]
ServiceCollector source code
Comment 2 Berin Loritsch 2003-03-13 19:38:43 UTC
Created attachment 5327 [details]
Newer version that actually works--I forgot to copy the contents of the jar entries before
Comment 3 Berin Loritsch 2003-03-13 19:44:02 UTC
You use this taks like this:

        <taskdef name="collect-services"
classname="org.d_haven.guiapp.tools.ServiceCollector">
          <classpath>
            <path refid="project.class.path"/>
            <pathelement path="${tools.dir}/guiapp-tools.jar"/>
          </classpath>
        </taskdef>
        
            
         <collect-services inputjar="input-temp.jar"
                           outputjar="output.jar">
             <service name="org.d_haven.guiapp.roles.Screen"/>
             <service name="org.apache.excalibur.event.command.Command"/>
         </collect-services>
Comment 4 Berin Loritsch 2003-03-13 19:52:25 UTC
Created attachment 5328 [details]
Ok This version officially works.  The last time my copy and paste overwrote the part that actually wrote the results of the services collection