root/trunk/build/buildTools/wsimport.xml

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

Add a header for superuser use that essentially provides a run-as capability to caldav.

Header is "Schedule-Assistant-Run-As" and takes the account as a value.

Minor format change to wsimport

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}" includes="*"/>
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           <var name="org.bedework.wsimport.tstamp" unset="true" />
76           <tstamp>
77             <format property="org.bedework.wsimport.tstamp" pattern="yyyyMMddhhmmss"/>
78           </tstamp>
79
80           <property name="wsimport.lib"
81                     location="${org.bedework.temp.dir}/wsimportlib${org.bedework.wsimport.tstamp}" />
82           <mkdir dir="${org.bedework.temp.dir}" />
83           <!--<delete dir="${wsimport.lib}" />-->
84           <mkdir dir="${wsimport.lib}" />
85          
86           <getJar lib="${wsimport.lib}"
87                   libcache="${org.bedework.libcache.dir}"
88                   name="jaxws-tools" version="2.1.4" />
89           <getJar lib="${wsimport.lib}"
90                   libcache="${org.bedework.libcache.dir}"
91                   name="jaxb-xjc" version="2.1.7" />
92           <getJar lib="${wsimport.lib}"
93                   libcache="${org.bedework.libcache.dir}"
94                   name="jaxb-impl" version="2.1.8" />
95           <getJar lib="${wsimport.lib}"
96                   libcache="${org.bedework.libcache.dir}"
97                   name="jaxws-rt" version="2.1.4" />
98           <getJar lib="${wsimport.lib}"
99                   libcache="${org.bedework.libcache.dir}"
100                   name="streambuffer" version="1.0" />
101           <getJar lib="${wsimport.lib}"
102                   libcache="${org.bedework.libcache.dir}"
103                   name="stax-ex" version="2.2.1" />
104      
105           <path id="wsimport.classpath">
106             <fileset dir="${ant.home}/lib">
107               <include name="jax*.jar"/>
108             </fileset>
109             <!--
110             <pathelement location="${wsimport.lib}/jaxws-tools-2.2.jar"/>
111             <pathelement location="${wsimport.lib}/jaxb-xjc-2.2.jar"/>
112             <pathelement location="${wsimport.lib}/jaxws-rt-2.2.jar"/>
113             -->
114             <pathelement location="${wsimport.lib}/jaxws-tools-2.1.4.jar"/>
115             <pathelement location="${wsimport.lib}/jaxb-xjc-2.1.7.jar"/>
116             <pathelement location="${wsimport.lib}/jaxb-impl-2.1.8.jar"/>
117             <pathelement location="${wsimport.lib}/jaxws-rt-2.1.4.jar"/>
118             <!--
119             <pathelement location="${wsimport.lib}/tools-1.6.0_21.jar" />
120             -->
121             <pathelement location="${wsimport.lib}/streambuffer-1.0.jar" />
122             <pathelement location="${wsimport.lib}/stax-ex-2.2.1.jar" />
123             <fileset dir="${ant.home}/lib">
124               <include name="**/*.jar"/>
125             </fileset>
126             <!--
127             <fileset dir="${org.bedework.appserver.dir}/lib/endorsed" >
128               <include name="**/*.jar"/>
129             </fileset>
130             -->
131           </path>
132          
133           <debugCpid idpar="wsimport.classpath" />
134      
135           <taskdef name="wsimportTask" classname="com.sun.tools.ws.ant.WsImport">
136             <classpath refid="wsimport.classpath" />
137           </taskdef>
138          
139           <!-- We don't want the generated classes but there doesn't appear to be a
140                way to suppress generation -->
141           <property name="wsimport.dest"
142                     location="${org.bedework.temp.dir}/wsclasses" />
143           <mkdir dir="${wsimport.dest}" />
144    
145           <infoMsg message="* =========== Compiling @{wsdl}" />
146          
147           <if>
148             <equals arg1="@{bindingsdir}" arg2="" />
149             <then>
150               <wsimportTask keep="true"
151                             sourcedestdir="${sourcedestdir}"
152                             destdir="${wsimport.dest}"
153                             wsdl="@{wsdl}"
154                             wsdllocation="@{wsdllocation}"
155                             xendorsed="true" >
156               </wsimportTask>
157             </then>
158             <else>
159               <wsimportTask keep="true"
160                             sourcedestdir="${sourcedestdir}"
161                             destdir="${wsimport.dest}"
162                             wsdl="@{wsdl}"
163                             wsdllocation="@{wsdllocation}"
164                             xendorsed="true" >
165                 <binding dir="@{bindingsdir}" includes="*.xml">
166                 </binding>
167               </wsimportTask>
168             </else>
169           </if>
170          
171
172           <build-jar module-base="@{module-base}"
173                      jar-file="@{jar-file}" />
174         </else>
175       </if>
176     </sequential>
177   </macrodef>
178 </project>
Note: See TracBrowser for help on using the browser.