source: axis/build.xml @ cfc4d68

compt_changesinfo-ops
Last change on this file since cfc4d68 was cfc4d68, checked in by Ted Faber <faber@…>, 12 years ago

Take url as a parameter for easier testing

  • Property mode set to 100644
File size: 10.1 KB
Line 
1<!--
2  Project file for ant to build the crudge viewer.  Requires Jung and
3  bouncycastle.
4
5  Targets:
6    all: clean then compile and make docs
7    compile: build the library and test programs
8    run: run crudge
9    jar: build jar file
10    signjar: sign jar files for export
11    install: copy filed to web host
12    doc: greate API javadocs in ./doc
13    dev-doc: create developer API javadocs in ./dev-doc (includes
14            package/private/protected functions)
15    clean: remove created files (includes .der and .pem in this directory)
16-->
17
18<project name="Fedd Axis" default="all">
19  <property name="src.dir" value="${basedir}"/>
20  <property name="lib.dir" value="${basedir}${file.separator}jar"/>
21  <property name="doc.dir" value="${basedir}${file.separator}doc"/>
22  <property name="devdoc.dir" value="${basedir}${file.separator}dev-doc"/>
23  <property name="build.dir" value="${basedir}${file.separator}build"/>
24  <property name="classes.dir" value="${build.dir}/classes"/>
25  <property name="jar.dir" value="${build.dir}${file.separator}jar"/>
26  <property name="keystore.file" value="${basedir}${file.separator}keystore"/>
27  <property name="wsdl.dir" value="../wsdl"/>
28  <property name="cert.pem" value="./cert.pem"/>
29  <property name="fedid.pem" value="./fedid.pem"/>
30  <property name="topology.file" value="./deter-only.xml"/>
31  <property name="version" value="1.0"/>
32  <property name="fedd.jar" value="fedd-${version}.jar"/>
33  <property name="experiment.name" value="${user.name}-test"/>
34  <property name="fedd.url" value="https://users.isi.deterlab.net:23235"/>
35
36  <path id="compile.classpath">
37    <fileset dir="${lib.dir}" includes="**/*.jar"/>
38  </path>
39
40  <path id="run.classpath">
41    <fileset dir="${lib.dir}" includes="**/*.jar"/>
42    <fileset dir="${jar.dir}" includes="**/*.jar"/>
43  </path>
44
45
46  <taskdef resource="axis-tasks.properties" classpathref="compile.classpath" />
47
48  <target name="all" depends="clean,jar" description="Clean then build" />
49  <target name="run" depends="multistatus" description="Run multistatus" />
50
51  <!-- remove all derived and compiled files -->
52  <target name="clean" depends="clean-keys">
53    <delete dir="${basedir}${file.separator}edu"/>
54    <delete dir="${build.dir}"/>
55    <delete dir="${doc.dir}"/>
56    <delete dir="${devdoc.dir}"/>
57    <delete file="${keystore.file}"/>
58  </target>
59
60  <!-- just remove command files -->
61  <target name="clean-commands" >
62    <delete>
63      <fileset dir="${classes.dir}"
64        includes="**/FeddCommand.class **/Create.class **/MultiStatus.class **/Terminate.class **/MakeFedid.class **/ParseTopdl.class"/>
65    </delete>
66  </target>
67
68  <!-- just remove keystore and ${fedid.pem}-->
69  <target name="clean-keys">
70    <delete file="${keystore.file}"/>
71    <delete file="${fedid.pem}"/>
72  </target>
73
74
75  <!-- Check to see if the keystore file exists, if so the keystore.present
76       property is created. -->
77  <target name="keystore.check">
78    <available property="keystore.present" 
79      file="${basedir}${file.separator}keystore"/>
80  </target>
81
82  <!-- Check to see if the ${fedid.pem} file exists, if so the fedid.present
83       property is created. -->
84  <target name="fedid.check">
85    <available property="fedid.present" 
86      file="${basedir}${file.separator}${fedid.pem}"/>
87  </target>
88
89
90  <!-- Convert ${cert.pem} to a fedid in ${fedid.pem} that is, make it a self
91       signed-certificate with the same keys.  This is only run if ${fedid.pem}
92       does not exist -->
93  <target name="makefedid" depends="compile,jar,fedid.check" 
94    unless="fedid.present">
95    <echo message="converting ${cert.pem} to a fedid in ${fedid.pem}"/>
96    <java classname="MakeFedid" fork="true" >
97      <classpath>
98        <path refid="run.classpath"/>
99        <pathelement path="${classes.dir}"/>
100      </classpath>
101      <arg file="${cert.pem}"/>
102      <arg file="${fedid.pem}"/>
103      <arg value="${user.name}"/>
104    </java>
105  </target>
106
107  <!-- Convert ${fedid.pem} to a java keystore.  Makes use of the ImportKey
108       program available from http://www.agentbob.info/agentbob/79-AB.html .
109       That web page describes this process in detail. -->
110  <target name="keys" depends="keystore.check,makefedid" 
111    unless="keystore.present" >
112    <echo message="Importing key ${fedid.pem}"/>
113    <!-- splitkey.pl splits a combo certificate file (both key and cert) into a
114         key.pem and cert.pem file for ImportKey -->
115    <exec executable="/usr/bin/perl">
116      <arg value="./splitkey.pl"/>
117      <arg file="${fedid.pem}"/>
118    </exec>
119    <exec executable="openssl">
120      <arg value="pkcs8"/>
121      <arg value="-topk8"/>
122      <arg value="-nocrypt"/>
123      <arg value="-in"/>
124      <arg file="./splitkey.pem"/>
125      <arg value="-inform"/>
126      <arg value="PEM"/>
127      <arg value="-out"/>
128      <arg file="./key.der"/>
129      <arg value="-outform"/>
130      <arg value="DER"/>
131    </exec>
132    <exec executable="openssl">
133      <arg value="x509"/>
134      <arg value="-in"/>
135      <arg file="./splitcert.pem"/>
136      <arg value="-inform"/>
137      <arg value="PEM"/>
138      <arg value="-out"/>
139      <arg file="./cert.der"/>
140      <arg value="-outform"/>
141      <arg value="DER"/>
142    </exec>
143    <java classname="ImportKey" fork="true">
144      <arg file="./key.der"/>
145      <arg file="./cert.der"/>
146      <arg value="fedd"/>
147    </java>
148    <move file="${user.home}${file.separator}keystore.ImportKey"
149      tofile="${keystore.file}"/>
150    <delete>
151      <fileset dir="${basedir}" includes="**/splitcert.pem **/splitkey.pem cert.der key.der"/>
152    </delete>
153  </target>
154
155  <!-- Documentation targets -->
156  <!-- Generate basic javadoc -->
157  <target name="doc" depends="wsdl-parse"
158    description="Generate API documentation">
159    <mkdir dir="${doc.dir}"/>
160    <javadoc sourcepath="${src.dir}" destdir="${doc.dir}"
161      classpathref="compile.classpath" access="public"
162      noqualifier="java.lang:java.io:java.util:java.security:java.security.cert"/>
163  </target>
164
165  <!-- Generate pedentically complete javadoc -->
166  <target name="dev-doc" depends="wsdl-parse"
167    description="Generate detailed/developer API documentation">
168    <mkdir dir="${devdoc.dir}"/>
169    <javadoc sourcepath="${src.dir}" destdir="${devdoc.dir}"
170      classpathref="compile.classpath" access="private"
171      noqualifier="java.lang:java.io:java.util:java.security:java.security.cert"/>
172  </target>
173
174  <!-- Check to see if the wsdl-generated directories exist: if so
175       the wsdl.available property is set -->
176  <target name="wsdl.check">
177    <available file="${basedir}${file.separator}edu" type="dir" 
178      property="wsdl.available"/>
179  </target>
180
181  <!-- Generate wsdl-generated source files if they do not exist.  The
182       axis-wsdl2java tasks are from axis.  -->
183  <target name="wsdl-parse" depends="wsdl.check" unless="wsdl.available" >
184    <axis-wsdl2java url="${wsdl.dir}${file.separator}fedd.wsdl"
185      output="${basedir}" />
186    <axis-wsdl2java url="${wsdl.dir}${file.separator}fedd_internal.wsdl"
187      output="${basedir}" />
188  </target>
189
190  <!-- check to see if the test classes and are present.  If so
191       set the compile.done property -->
192  <target name="compile.check">
193    <condition property="compile.done">
194      <and>
195        <available file="${classes.dir}${file.separator}Create.class"/>
196        <available file="${classes.dir}${file.separator}MultiStatus.class"/>
197        <available file="${classes.dir}${file.separator}Terminate.class"/>
198        <available file="${classes.dir}${file.separator}FeddCommand.class"/>
199        <available file="${classes.dir}${file.separator}MakeFedid.class"/>
200        <available file="${classes.dir}${file.separator}ParseTopdl.class"/>
201      </and>
202    </condition>
203  </target>
204
205
206  <!-- compile the sources into the build directory.  Depends on the
207       wsdl-generated files being created, and only happens if one if
208       one or more of the files checked for by the compile.check target
209       is missing. -->
210  <target name="compile" depends="wsdl-parse,compile.check" 
211    unless="compile.done" description="Compile the source">
212    <mkdir dir="${classes.dir}" />
213    <javac srcdir="${src.dir}" destdir="${classes.dir}" 
214      classpathref="compile.classpath" includeAntRuntime="no"/>
215  </target>
216
217  <!-- Create the fedd jar file in ${jar.dir} (build/jar) -->
218  <target name="jar" depends="compile" description="make fedd jar">
219    <jar destfile="${jar.dir}${file.separator}${fedd.jar}"
220      basedir="${classes.dir}"
221      excludes="**/Create.class **/MultiStatus.class **/Terminate.class **/FeddCommand.class **/MakeFedid.class **/ParseTopdl.class"/>
222  </target>
223
224  <!-- Test programs -->
225  <target name="multistatus" depends="compile,jar,keys">
226    <java classname="MultiStatus" fork="true" >
227      <classpath>
228        <path refid="run.classpath"/>
229        <pathelement path="${classes.dir}"/>
230      </classpath>
231      <arg value="${fedd.url}"/>
232    </java>
233  </target>
234
235  <target name="create" depends="compile,jar,keys">
236    <java classname="Create" fork="true" >
237      <classpath>
238        <path refid="run.classpath"/>
239        <pathelement path="${classes.dir}"/>
240      </classpath>
241      <arg value="${experiment.name}"/>
242      <arg file="${topology.file}"/>
243      <arg file="${fedid.pem}"/>
244      <arg value="${fedd.url}"/>
245    </java>
246  </target>
247
248
249  <target name="terminate" depends="compile,jar,keys">
250    <java classname="Terminate" fork="true" >
251      <classpath>
252        <path refid="run.classpath"/>
253        <pathelement path="${classes.dir}"/>
254      </classpath>
255      <arg value="${experiment.name}"/>
256      <arg value="${fedd.url}"/>
257    </java>
258  </target>
259
260  <target name="terminate-force" depends="compile,jar,keys">
261    <java classname="Terminate" fork="true" >
262      <classpath>
263        <path refid="run.classpath"/>
264        <pathelement path="${classes.dir}"/>
265      </classpath>
266      <arg value="${experiment.name}"/>
267      <arg value="${fedd.url}"/>
268      <arg value="force"/>
269    </java>
270  </target>
271
272  <target name="parse" depends="compile,jar,keys">
273    <java classname="ParseTopdl" fork="true" >
274      <classpath>
275        <path refid="run.classpath"/>
276        <pathelement path="${classes.dir}"/>
277      </classpath>
278      <arg value="${topology.file}"/>
279    </java>
280  </target>
281
282  <target name="ftopo" depends="compile,jar,keys">
283    <java classname="Ftopo" fork="true" >
284      <classpath>
285        <path refid="run.classpath"/>
286        <pathelement path="${classes.dir}"/>
287      </classpath>
288      <arg value="${experiment.name}"/>
289      <arg value="${fedd.url}"/>
290    </java>
291  </target>
292
293</project>
Note: See TracBrowser for help on using the repository browser.