root/releases/bedework-3.7/build/buildTools/wsimport.xml

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

Changes to introduce bwxml project - all xml schemas now located in this project built separately.

Other projects with a dependency now build this project.

Also fixed a few java warnings that surfaced from the noise.

Added an updateall action to bw

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="wsdllocation" />
27     <attribute name="module-base"/>
28     <attribute name="jar-file"/>
29     <attribute name="bindingsdir" default="" />
30     <sequential>
31       <taskdef resource="net/sf/antcontrib/antcontrib.properties" />
32      
33       <var name="sourcedestdir" value="@{module-base}/src" />
34      
35       <dirname property="org.bedework.wsdl.dir" file="@{wsdl}"/>
36
37       <if>
38         <and>
39           <available file="${sourcedestdir}" type="dir" />
40           <uptodate property="org.bedework.wsimport.uptodate"
41                     targetfile="@{jar-file}" >
42             <srcfiles dir="${org.bedework.wsdl.dir}" />
43           </uptodate>
44         </and>
45         <then>
46           <noisyMsg message="**** @{jar.file} is up to date" />
47         </then>
48         <else>
49           <noisyMsg message="**** @{jar.file} needs rebuilding" />
50
51           <delete dir="${sourcedestdir}" />
52           <mkdir dir="${sourcedestdir}" />
53      
54           <!--
55           <getJar name="jaxws-tools" version="2.2" />
56           <getJar name="jaxb-xjc" version="2.2" />
57           <getJar name="jaxws-rt" version="2.2" />
58           -->
59           <property name="wsimport.lib"
60                     location="${org.bedework.temp.dir}/wsimportlib" />
61           <mkdir dir="${org.bedework.temp.dir}" />
62           <delete dir="${wsimport.lib}" />
63           <mkdir dir="${wsimport.lib}" />
64          
65           <getJar lib="${wsimport.lib}"
66                   libcache="${org.bedework.libcache.dir}"
67                   name="jaxws-tools" version="2.1.4" />
68           <getJar lib="${wsimport.lib}"
69                   libcache="${org.bedework.libcache.dir}"
70                   name="jaxb-xjc" version="2.1.7" />
71           <getJar lib="${wsimport.lib}"
72                   libcache="${org.bedework.libcache.dir}"
73                   name="jaxb-impl" version="2.1.8" />
74           <getJar lib="${wsimport.lib}"
75                   libcache="${org.bedework.libcache.dir}"
76                   name="jaxws-rt" version="2.1.4" />
77           <getJar lib="${wsimport.lib}"
78                   libcache="${org.bedework.libcache.dir}"
79                   name="streambuffer" version="1.0" />
80           <getJar lib="${wsimport.lib}"
81                   libcache="${org.bedework.libcache.dir}"
82                   name="stax-ex" version="2.2.1" />
83      
84           <path id="wsimport.classpath">
85             <fileset dir="${ant.home}/lib">
86               <include name="jax*.jar"/>
87             </fileset>
88             <!--
89             <pathelement location="${wsimport.lib}/jaxws-tools-2.2.jar"/>
90             <pathelement location="${wsimport.lib}/jaxb-xjc-2.2.jar"/>
91             <pathelement location="${wsimport.lib}/jaxws-rt-2.2.jar"/>
92             -->
93             <pathelement location="${wsimport.lib}/jaxws-tools-2.1.4.jar"/>
94             <pathelement location="${wsimport.lib}/jaxb-xjc-2.1.7.jar"/>
95             <pathelement location="${wsimport.lib}/jaxb-impl-2.1.8.jar"/>
96             <pathelement location="${wsimport.lib}/jaxws-rt-2.1.4.jar"/>
97             <!--
98             <pathelement location="${wsimport.lib}/tools-1.6.0_21.jar" />
99             -->
100             <pathelement location="${wsimport.lib}/streambuffer-1.0.jar" />
101             <pathelement location="${wsimport.lib}/stax-ex-2.2.1.jar" />
102             <fileset dir="${ant.home}/lib">
103               <include name="**/*.jar"/>
104             </fileset>
105             <!--
106             <fileset dir="${org.bedework.appserver.dir}/lib/endorsed" >
107               <include name="**/*.jar"/>
108             </fileset>
109             -->
110           </path>
111          
112           <debugCpid idpar="wsimport.classpath" />
113      
114           <taskdef name="wsimportTask" classname="com.sun.tools.ws.ant.WsImport">
115             <classpath refid="wsimport.classpath" />
116           </taskdef>
117          
118           <!-- We don't want the generated classes but there doesn't appear to be a
119                way to suppress generation -->
120           <property name="wsimport.dest"
121                     location="${org.bedework.temp.dir}/wsclasses" />
122           <mkdir dir="${wsimport.dest}" />
123    
124           <if>
125             <equals arg1="@{bindingsdir}" arg2="" />
126             <then>
127               <wsimportTask keep="true"
128                             sourcedestdir="${sourcedestdir}"
129                             destdir="${wsimport.dest}"
130                             wsdl="@{wsdl}"
131                             wsdllocation="@{wsdllocation}"
132                             xendorsed="true" >
133               </wsimportTask>
134             </then>
135             <else>
136               <wsimportTask keep="true"
137                             sourcedestdir="${sourcedestdir}"
138                             destdir="${wsimport.dest}"
139                             wsdl="@{wsdl}"
140                             wsdllocation="@{wsdllocation}"
141                             xendorsed="true" >
142                 <binding dir="@{bindingsdir}" includes="*.xml">
143                 </binding>
144               </wsimportTask>
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.