source: axis/build.xml @ 2ef3584

axis_examplecompt_changesinfo-ops
Last change on this file since 2ef3584 was 2ef3584, checked in by Ted Faber <faber@…>, 13 years ago

Built the fedid, better use it.

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