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

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

Use a var for the schema/wsdl dir. Was getting stuck with the initial value.

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     <attribute name="dependencies" default="empty.fileset" />
31     <sequential>
32       <taskdef resource="net/sf/antcontrib/antcontrib.properties" />
33      
34       <var name="sourcedestdir" value="@{module-base}/src" />
35      
36       <var name="org.bedework.wsdl.dir" unset="true" />
37       <dirname property="org.bedework.wsdl.dir" file="@{wsdl}"/>
38
39       <var name="org.bedework.source.changed" value="false" />
40      
41       <outofdate outputsources="org.bedework,changed.sources">
42         <sourcefiles>
43           <fileset dir="${org.bedework.wsdl.dir}"/>
44           <fileset refid="@{dependencies}"/>
45         </sourcefiles>
46         <targetfiles>
47           <pathelement path="@{jar-file}"/>
48         </targetfiles>
49         <sequential>
50           <var name="org.bedework.source.changed" value="true" />
51         </sequential>
52       </outofdate>
53      
54       <noisyMsg message="**** org.bedework,changed.sources = ${org.bedework,changed.sources}" />
55       <noisyMsg message="**** org.bedework.source.changed = ${org.bedework.source.changed}" />
56
57       <if>
58         <not>
59           <equals arg1="${org.bedework.source.changed}" arg2="true" />
60         </not>
61         <then>
62           <noisyMsg message="**** @{jar.file} is up to date" />
63         </then>
64         <else>
65           <noisyMsg message="**** @{jar.file} needs rebuilding" />
66
67           <delete dir="${sourcedestdir}" />
68           <mkdir dir="${sourcedestdir}" />
69      
70           <!--
71           <getJar name="jaxws-tools" version="2.2" />
72           <getJar name="jaxb-xjc" version="2.2" />
73           <getJar name="jaxws-rt" version="2.2" />
74           -->
75           <property name="wsimport.lib"
76                     location="${org.bedework.temp.dir}/wsimportlib" />
77           <mkdir dir="${org.bedework.temp.dir}" />
78           <delete dir="${wsimport.lib}" />
79           <mkdir dir="${wsimport.lib}" />
80          
81           <getJar lib="${wsimport.lib}"
82                   libcache="${org.bedework.libcache.dir}"
83                   name="jaxws-tools" version="2.1.4" />
84           <getJar lib="${wsimport.lib}"
85                   libcache="${org.bedework.libcache.dir}"
86                   name="jaxb-xjc" version="2.1.7" />
87           <getJar lib="${wsimport.lib}"
88                   libcache="${org.bedework.libcache.dir}"
89                   name="jaxb-impl" version="2.1.8" />
90           <getJar lib="${wsimport.lib}"
91                   libcache="${org.bedework.libcache.dir}"
92                   name="jaxws-rt" version="2.1.4" />
93           <getJar lib="${wsimport.lib}"
94                   libcache="${org.bedework.libcache.dir}"
95                   name="streambuffer" version="1.0" />
96           <getJar lib="${wsimport.lib}"
97                   libcache="${org.bedework.libcache.dir}"
98                   name="stax-ex" version="2.2.1" />
99      
100           <path id="wsimport.classpath">
101             <fileset dir="${ant.home}/lib">
102               <include name="jax*.jar"/>
103             </fileset>
104             <!--
105             <pathelement location="${wsimport.lib}/jaxws-tools-2.2.jar"/>
106             <pathelement location="${wsimport.lib}/jaxb-xjc-2.2.jar"/>
107             <pathelement location="${wsimport.lib}/jaxws-rt-2.2.jar"/>
108             -->
109             <pathelement location="${wsimport.lib}/jaxws-tools-2.1.4.jar"/>
110             <pathelement location="${wsimport.lib}/jaxb-xjc-2.1.7.jar"/>
111             <pathelement location="${wsimport.lib}/jaxb-impl-2.1.8.jar"/>
112             <pathelement location="${wsimport.lib}/jaxws-rt-2.1.4.jar"/>
113             <!--
114             <pathelement location="${wsimport.lib}/tools-1.6.0_21.jar" />
115             -->
116             <pathelement location="${wsimport.lib}/streambuffer-1.0.jar" />
117             <pathelement location="${wsimport.lib}/stax-ex-2.2.1.jar" />
118             <fileset dir="${ant.home}/lib">
119               <include name="**/*.jar"/>
120             </fileset>
121             <!--
122             <fileset dir="${org.bedework.appserver.dir}/lib/endorsed" >
123               <include name="**/*.jar"/>
124             </fileset>
125             -->
126           </path>
127          
128           <debugCpid idpar="wsimport.classpath" />
129      
130           <taskdef name="wsimportTask" classname="com.sun.tools.ws.ant.WsImport">
131             <classpath refid="wsimport.classpath" />
132           </taskdef>
133          
134           <!-- We don't want the generated classes but there doesn't appear to be a
135                way to suppress generation -->
136           <property name="wsimport.dest"
137                     location="${org.bedework.temp.dir}/wsclasses" />
138           <mkdir dir="${wsimport.dest}" />
139    
140           <if>
141             <equals arg1="@{bindingsdir}" arg2="" />
142             <then>
143               <wsimportTask keep="true"
144                             sourcedestdir="${sourcedestdir}"
145                             destdir="${wsimport.dest}"
146                             wsdl="@{wsdl}"
147                             wsdllocation="@{wsdllocation}"
148                             xendorsed="true" >
149               </wsimportTask>
150             </then>
151             <else>
152               <wsimportTask keep="true"
153                             sourcedestdir="${sourcedestdir}"
154                             destdir="${wsimport.dest}"
155                             wsdl="@{wsdl}"
156                             wsdllocation="@{wsdllocation}"
157                             xendorsed="true" >
158                 <binding dir="@{bindingsdir}" includes="*.xml">
159                 </binding>
160               </wsimportTask>
161             </else>
162           </if>
163          
164
165           <build-jar module-base="@{module-base}"
166                      jar-file="@{jar-file}" />
167         </else>
168       </if>
169     </sequential>
170   </macrodef>
171 </project>
Note: See TracBrowser for help on using the browser.