users@jersey.java.net

Re: [Fwd: Re: WADL and JavaScript generation]

From: Paul Sandoz <Paul.Sandoz_at_Sun.COM>
Date: Thu, 03 Jan 2008 19:03:28 +0100

Gérald Quintana wrote:
> Hi Paul,
>
> Happy new year!
>
>>> Question 1: I wondered whether it was possible to generate WADL
>>> descriptor from Java sources using an Ant script or command line tool?
>>>
>> Would you be interested and have
>> time to help out on developing such an ant task? My knowledge of the ant
>> API is limited...
>>
> Sorry but I don't have a lot of free time and my Ant knowledge is
> limited to using it.
>

I have just committed an ant task, so you can test with source from the
trunk or from the latest build [1]. If no big issues occur this should
be part of the 0.5 release.

Below is a simple template of its use:

     <taskdef name="wadl"
           classname="com.sun.ws.rest.api.wadl.WadlGeneratorTask">
         <classpath>
             <fileset dir="<jersey lib location>" includes="*.jar" />
         </classpath>
     </taskdef>

     <wadl destfile="application.wadl">
         <classpath>
            <pathelement location="<jar file or classes dir location"/>
         </classpath>
     </wadl>

I still need to document the code...

Basically the ant task will scan all classes in the declared classpath
for root resources then create a WADL document for those root resources
whose name is declared by the destfile attribute.

Paul.

[1]
https://jersey.dev.java.net/servlets/ProjectDocumentList?folderID=7653&expandFolder=7653&folderID=0

-- 
| ? + ? = To question
----------------\
    Paul Sandoz
         x38109
+33-4-76188109