root/trunk/build/buildTools/wsimport.xml

Revision 3118 (checked in by douglm, 2 years ago)

Bring all the sub-project builds into line for trunk and 3.7.

Added some default targets to the buildtools deftasks file allowing simplification of all build files

Line 
1 <!-- ===================================================================
2      Run wsimport on web service definitions.
3      
4      The jaxb released with java6 is version 2.1. However, to resolve some
5      issues we have to use version 2.2. This requires either placing the
6      jaxb jars in the endorsed directory or setting xendorsed="true" when
7      running wsimport and adding the 2.2 jars to the classpath.
8      
9      The version of jboss in the quickstart has the 2.2 jars in its
10      endorsed directory. For the moment we point at that.
11      
12      Hold that: Unfortunately eclipse doesn't appear to have a way to set
13      an endorsed directory for a single project. The generated 2.2 classes
14      don't compile. Managed to get 2.1 wsimport to run - the generated code
15      appears to run OK on 2.2
16      
17      @param wsdl     Location of the wsdl
18      @param sourcedestdir     Location for the generated source
19        
20      Authors: Mike Douglass   douglm    rpi.edu
21      =================================================================== -->
22
23 <project name="do.wsimport" basedir="." default="">
24   <macrodef name="wsimport">
25     <attribute name="wsdl"/>
26     <attribute name="module-base"/>
27     <attribute name="jar-file"/>
28     <attribute name="bindingsdir" default="" />
29     <sequential>
30       <taskdef resource="net/sf/antcontrib/antcontrib.properties" />
31      
32       <property name="sourcedestdir" location="@{module-base}/src" />
33
34      
35       <dirname property="org.bedework.wsdl.dir" file="@{wsdl}"/>
36
37       <if>
38         <available file="${sourcedestdir}" type="dir" />
39         <then>
40           <uptodate property="org.bedework.wsimport.uptodate"
41                     targetfile="@{jar-file}" >
42             <srcfiles dir="${org.bedework.wsdl.dir}" />
43           </uptodate>
44         </then>
45       </if>
46
47       <if>
48         <isset property="org.bedework.wsimport.uptodate"/>
49         <then>
50           <noisyMsg message="**** @{jar.file} is up to date" />
51         </then>
52         <else>
53           <noisyMsg message="**** @{jar.file} needs rebuilding" />
54
55           <delete dir="${sourcedestdir}" />
56           <mkdir dir="${sourcedestdir}" />
57      
58           <!--
59           <getJar name="jaxws-tools" version="2.2" />
60           <getJar name="jaxb-xjc" version="2.2" />
61           <getJar name="jaxws-rt" version="2.2" />
62           -->
63           <property name="wsimport.lib"
64                     location="${org.bedework.temp.dir}/wsimportlib" />
65           <mkdir dir="${org.bedework.temp.dir}" />
66           <delete dir="${wsimport.lib}" />
67           <mkdir dir="${wsimport.lib}" />
68          
69           <getJar lib="${wsimport.lib}"
70                   libcache="${org.bedework.libcache.dir}"
71                   name="jaxws-tools" version="2.1.4" />
72           <getJar lib="${wsimport.lib}"
73                   libcache="${org.bedework.libcache.dir}"
74                   name="jaxb-xjc" version="2.1.7" />
75           <getJar lib="${wsimport.lib}"
76                   libcache="${org.bedework.libcache.dir}"
77                   name="jaxb-impl" version="2.1.8" />
78           <getJar lib="${wsimport.lib}"
79                   libcache="${org.bedework.libcache.dir}"
80                   name="jaxws-rt" version="2.1.4" />
81           <getJar lib="${wsimport.lib}"
82                   libcache="${org.bedework.libcache.dir}"
83                   name="streambuffer" version="1.0" />
84           <getJar lib="${wsimport.lib}"
85                   libcache="${org.bedework.libcache.dir}"
86                   name="stax-ex" version="2.2.1" />
87      
88           <path id="wsimport.classpath">
89             <fileset dir="${ant.home}/lib">
90               <include name="jax*.jar"/>
91             </fileset>
92             <!--
93             <pathelement location="${wsimport.lib}/jaxws-tools-2.2.jar"/>
94             <pathelement location="${wsimport.lib}/jaxb-xjc-2.2.jar"/>
95             <pathelement location="${wsimport.lib}/jaxws-rt-2.2.jar"/>
96             -->
97             <pathelement location="${wsimport.lib}/jaxws-tools-2.1.4.jar"/>
98             <pathelement location="${wsimport.lib}/jaxb-xjc-2.1.7.jar"/>
99             <pathelement location="${wsimport.lib}/jaxb-impl-2.1.8.jar"/>
100             <pathelement location="${wsimport.lib}/jaxws-rt-2.1.4.jar"/>
101             <pathelement location="${wsimport.lib}/tools-1.6.0_21.jar" />
102             <pathelement location="${wsimport.lib}/streambuffer-1.0.jar" />
103             <pathelement location="${wsimport.lib}/stax-ex-2.2.1.jar" />
104             <fileset dir="${ant.home}/lib">
105               <include name="**/*.jar"/>
106             </fileset>
107             <!--
108             <fileset dir="${org.bedework.appserver.dir}/lib/endorsed" >
109               <include name="**/*.jar"/>
110             </fileset>
111             -->
112           </path>
113          
114           <debugCpid idpar="wsimport.classpath" />
115      
116           <taskdef name="wsimport" classname="com.sun.tools.ws.ant.WsImport">
117             <classpath refid="wsimport.classpath" />
118           </taskdef>
119          
120           <!-- We don't want the generated classes but there doesn't appear to be a
121                way to suppress generation -->
122           <property name="wsimport.dest"
123                     location="${org.bedework.temp.dir}/wsclasses" />
124           <mkdir dir="${wsimport.dest}" />
125    
126           <if>
127             <equals arg1="@{bindingsdir}" arg2="" />
128             <then>
129               <wsimport keep="true"
130                         sourcedestdir="${sourcedestdir}"
131                         destdir="${wsimport.dest}"
132                         wsdl="@{wsdl}"
133                         xendorsed="true" >
134               </wsimport>
135             </then>
136             <else>
137               <wsimport keep="true"
138                         sourcedestdir="${sourcedestdir}"
139                         destdir="${wsimport.dest}"
140                         wsdl="@{wsdl}"
141                         xendorsed="true" >
142                 <binding dir="@{bindingsdir}" includes="*.xml">
143                 </binding>
144               </wsimport>
145             </else>
146           </if>
147          
148
149           <build-jar module-base="@{module-base}"
150                      jar-file="@{jar-file}" />
151         </else>
152       </if>
153     </sequential>
154   </macrodef>
155 </project>
Note: See TracBrowser for help on using the browser.