source: axis/build.xml @ 50b2af2

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

ALlow experiment name to be set directly

  • Property mode set to 100644
File size: 9.2 KB
RevLine 
[55de6a9]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"/>
[6b25610]27  <property name="wsdl.dir" value="../wsdl"/>
[ee7f7e4]28  <property name="cert.pem" value="./cert.pem"/>
29  <property name="fedid.pem" value="./fedid.pem"/>
[6dc10a7]30  <property name="topology.file" value="./deter-only.tcl"/>
[56baf92]31  <property name="version" value="1.0"/>
32  <property name="fedd.jar" value="fedd-${version}.jar"/>
[50b2af2]33  <property name="experiment.name" value="${user.name}-test"/>
[55de6a9]34
35  <path id="compile.classpath">
36    <fileset dir="${lib.dir}" includes="**/*.jar"/>
37  </path>
38
[56baf92]39  <path id="run.classpath">
40    <fileset dir="${lib.dir}" includes="**/*.jar"/>
41    <fileset dir="${jar.dir}" includes="**/*.jar"/>
42  </path>
43
44
[55de6a9]45  <taskdef resource="axis-tasks.properties" classpathref="compile.classpath" />
46
[56baf92]47  <target name="all" depends="clean,jar" description="Clean then build" />
48  <target name="run" depends="multistatus" description="Run multistatus" />
[55de6a9]49
[56baf92]50  <!-- remove all derived and compiled files -->
[ee7f7e4]51  <target name="clean" depends="clean-keys">
[55de6a9]52    <delete dir="${basedir}${file.separator}edu"/>
53    <delete dir="${build.dir}"/>
54    <delete dir="${doc.dir}"/>
55    <delete dir="${devdoc.dir}"/>
56    <delete file="${keystore.file}"/>
57  </target>
58
[56baf92]59  <!-- just remove command files -->
60  <target name="clean-commands" >
61    <delete>
62      <fileset dir="${classes.dir}"
[3c159d0]63        includes="**/FeddCommand.class **/Create.class **/MultiStatus.class **/Terminate.class **/MakeFedid.class **/ParseTopdl.class"/>
[56baf92]64    </delete>
65  </target>
66
[ee7f7e4]67  <!-- just remove keystore and ${fedid.pem}-->
68  <target name="clean-keys">
69    <delete file="${keystore.file}"/>
70    <delete file="${fedid.pem}"/>
71  </target>
[56baf92]72
[ee7f7e4]73
74  <!-- Check to see if the keystore file exists, if so the keystore.present
[6b25610]75       property is created. -->
[55de6a9]76  <target name="keystore.check">
77    <available property="keystore.present" 
78      file="${basedir}${file.separator}keystore"/>
79  </target>
80
[ee7f7e4]81  <!-- Check to see if the ${fedid.pem} file exists, if so the fedid.present
82       property is created. -->
83  <target name="fedid.check">
84    <available property="fedid.present" 
85      file="${basedir}${file.separator}${fedid.pem}"/>
86  </target>
87
88
89  <!-- Convert ${cert.pem} to a fedid in ${fedid.pem} that is, make it a self
90       signed-certificate with the same keys.  This is only run if ${fedid.pem}
91       does not exist -->
92  <target name="makefedid" depends="compile,jar,fedid.check" 
93    unless="fedid.present">
94    <echo message="converting ${cert.pem} to a fedid in ${fedid.pem}"/>
95    <java classname="MakeFedid" fork="true" >
96      <classpath>
97        <path refid="run.classpath"/>
98        <pathelement path="${classes.dir}"/>
99      </classpath>
100      <arg file="${cert.pem}"/>
101      <arg file="${fedid.pem}"/>
102      <arg value="${user.name}"/>
103    </java>
104  </target>
[55de6a9]105
[ee7f7e4]106  <!-- Convert ${fedid.pem} to a java keystore.  Makes use of the ImportKey
[6b25610]107       program available from http://www.agentbob.info/agentbob/79-AB.html .
108       That web page describes this process in detail. -->
[ee7f7e4]109  <target name="keys" depends="keystore.check,makefedid" 
110    unless="keystore.present" >
111    <echo message="Importing key ${fedid.pem}"/>
[6b25610]112    <!-- splitkey.pl splits a combo certificate file (both key and cert) into a
113         key.pem and cert.pem file for ImportKey -->
[55de6a9]114    <exec executable="/usr/bin/perl">
115      <arg value="./splitkey.pl"/>
[ee7f7e4]116      <arg file="${fedid.pem}"/>
[55de6a9]117    </exec>
118    <exec executable="openssl">
119      <arg value="pkcs8"/>
120      <arg value="-topk8"/>
121      <arg value="-nocrypt"/>
122      <arg value="-in"/>
123      <arg file="./key.pem"/>
124      <arg value="-inform"/>
125      <arg value="PEM"/>
126      <arg value="-out"/>
127      <arg file="./key.der"/>
128      <arg value="-outform"/>
129      <arg value="DER"/>
130    </exec>
131    <exec executable="openssl">
132      <arg value="x509"/>
133      <arg value="-in"/>
134      <arg file="./cert.pem"/>
135      <arg value="-inform"/>
136      <arg value="PEM"/>
137      <arg value="-out"/>
138      <arg file="./cert.der"/>
139      <arg value="-outform"/>
140      <arg value="DER"/>
141    </exec>
142    <java classname="ImportKey" fork="true">
143      <arg file="./key.der"/>
144      <arg file="./cert.der"/>
145      <arg value="fedd"/>
146    </java>
[6b25610]147    <move file="${user.home}${file.separator}keystore.ImportKey"
148      tofile="${keystore.file}"/>
[55de6a9]149    <delete>
150      <fileset dir="${basedir}" includes="**/cert.*"/>
151      <fileset dir="${basedir}" includes="**/key.*"/>
152    </delete>
153  </target>
154
[6b25610]155  <!-- Documentation targets -->
[56baf92]156  <!-- Generate basic javadoc -->
[b8d69ec]157  <target name="doc" depends="wsdl-parse"
158    description="Generate API documentation">
[6b25610]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
[56baf92]165  <!-- Generate pedentically complete javadoc -->
[b8d69ec]166  <target name="dev-doc" depends="wsdl-parse"
[6b25610]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
[56baf92]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"/>
[ee7f7e4]199        <available file="${classes.dir}${file.separator}MakeFedid.class"/>
[3c159d0]200        <available file="${classes.dir}${file.separator}ParseTopdl.class"/>
[56baf92]201      </and>
202    </condition>
203  </target>
204
205
[6b25610]206  <!-- compile the sources into the build directory.  Depends on the
[56baf92]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">
[6b25610]212    <mkdir dir="${classes.dir}" />
213    <javac srcdir="${src.dir}" destdir="${classes.dir}" 
214      classpathref="compile.classpath" includeAntRuntime="no"/>
215  </target>
216
[56baf92]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}"
[3c159d0]221      excludes="**/Create.class **/MultiStatus.class **/Terminate.class **/FeddCommand.class **/MakeFedid.class **/ParseTopdl.class"/>
[56baf92]222  </target>
223
[6b25610]224  <!-- Test programs -->
[56baf92]225  <target name="multistatus" depends="compile,jar,keys"
[55de6a9]226    description="run visualizer">
227    <java classname="MultiStatus" fork="true" >
228      <classpath>
[56baf92]229        <path refid="run.classpath"/>
[55de6a9]230        <pathelement path="${classes.dir}"/>
231      </classpath>
232    </java>
233  </target>
234
[56baf92]235  <target name="create" depends="compile,jar,keys"
[55de6a9]236    description="run visualizer">
237    <java classname="Create" fork="true" >
238      <classpath>
[56baf92]239        <path refid="run.classpath"/>
[55de6a9]240        <pathelement path="${classes.dir}"/>
241      </classpath>
[50b2af2]242      <arg value="${experiment.name}"/>
[6dc10a7]243      <arg file="${topology.file}"/>
[2ef3584]244      <arg file="${fedid.pem}"/>
[55de6a9]245    </java>
246  </target>
247
248
[56baf92]249  <target name="terminate" depends="compile,jar,keys"
[6b25610]250    description="run visualizer">
251    <java classname="Terminate" fork="true" >
252      <classpath>
[56baf92]253        <path refid="run.classpath"/>
[6b25610]254        <pathelement path="${classes.dir}"/>
255      </classpath>
[50b2af2]256      <arg value="${experiment.name}"/>
[6b25610]257    </java>
[55de6a9]258  </target>
259
260</project>
Note: See TracBrowser for help on using the repository browser.