source: axis/build.xml @ 6b25610

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

Clean up build.xml

  • Property mode set to 100644
File size: 6.0 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="./emulab.pem"/>
29
30  <path id="compile.classpath">
31    <fileset dir="${lib.dir}" includes="**/*.jar"/>
32  </path>
33
34  <taskdef resource="axis-tasks.properties" classpathref="compile.classpath" />
35
36  <target name="all" depends="clean" description="Clean then build" />
37
38  <target name="clean">
39    <delete dir="${basedir}${file.separator}edu"/>
40    <delete dir="${build.dir}"/>
41    <delete dir="${doc.dir}"/>
42    <delete dir="${devdoc.dir}"/>
43    <delete file="${keystore.file}"/>
44  </target>
45
46  <!-- Check to see if the keystore file exists, if so the keystore.available
47       property is created. -->
48  <target name="keystore.check">
49    <available property="keystore.present" 
50      file="${basedir}${file.separator}keystore"/>
51  </target>
52
53
54  <!-- Convert ${cert.pem} to a java keystore.  Makes use of the ImportKey
55       program available from http://www.agentbob.info/agentbob/79-AB.html .
56       That web page describes this process in detail. -->
57  <target name="keys" depends="keystore.check" unless="keystore.present" >
58    <!-- splitkey.pl splits a combo certificate file (both key and cert) into a
59         key.pem and cert.pem file for ImportKey -->
60    <exec executable="/usr/bin/perl">
61      <arg value="./splitkey.pl"/>
62      <arg file="${cert.pem}"/>
63    </exec>
64    <exec executable="openssl">
65      <arg value="pkcs8"/>
66      <arg value="-topk8"/>
67      <arg value="-nocrypt"/>
68      <arg value="-in"/>
69      <arg file="./key.pem"/>
70      <arg value="-inform"/>
71      <arg value="PEM"/>
72      <arg value="-out"/>
73      <arg file="./key.der"/>
74      <arg value="-outform"/>
75      <arg value="DER"/>
76    </exec>
77    <exec executable="openssl">
78      <arg value="x509"/>
79      <arg value="-in"/>
80      <arg file="./cert.pem"/>
81      <arg value="-inform"/>
82      <arg value="PEM"/>
83      <arg value="-out"/>
84      <arg file="./cert.der"/>
85      <arg value="-outform"/>
86      <arg value="DER"/>
87    </exec>
88    <java classname="ImportKey" fork="true">
89      <arg file="./key.der"/>
90      <arg file="./cert.der"/>
91      <arg value="fedd"/>
92    </java>
93    <move file="${user.home}${file.separator}keystore.ImportKey"
94      tofile="${keystore.file}"/>
95    <delete>
96      <fileset dir="${basedir}" includes="**/cert.*"/>
97      <fileset dir="${basedir}" includes="**/key.*"/>
98    </delete>
99  </target>
100
101  <!-- Documentation targets -->
102  <target name="doc" description="Generate API documentation">
103    <mkdir dir="${doc.dir}"/>
104    <javadoc sourcepath="${src.dir}" destdir="${doc.dir}"
105      classpathref="compile.classpath" access="public"
106      noqualifier="java.lang:java.io:java.util:java.security:java.security.cert"/>
107  </target>
108
109  <target name="dev-doc" 
110    description="Generate detailed/developer API documentation">
111    <mkdir dir="${devdoc.dir}"/>
112    <javadoc sourcepath="${src.dir}" destdir="${devdoc.dir}"
113      classpathref="compile.classpath" access="private"
114      noqualifier="java.lang:java.io:java.util:java.security:java.security.cert"/>
115  </target>
116
117  <!-- Check to see if the wsdl-generated directories exist: if so
118       the wsdl.available property is set -->
119  <target name="wsdl.check">
120    <available file="${basedir}${file.separator}edu" type="dir" 
121      property="wsdl.available"/>
122  </target>
123
124  <!-- Generate wsdl-generated source files if they do not exist.  The
125       axis-wsdl2java tasks are from axis.  -->
126  <target name="wsdl-parse" depends="wsdl.check" unless="wsdl.available" >
127    <axis-wsdl2java url="${wsdl.dir}${file.separator}fedd.wsdl"
128      output="${basedir}" />
129    <axis-wsdl2java url="${wsdl.dir}${file.separator}fedd_internal.wsdl"
130      output="${basedir}" />
131  </target>
132
133  <!-- compile the sources into the build directory.  Depends on the
134       wsdl-generated files being created. -->
135  <target name="compile" depends="wsdl-parse" description="Compile the source">
136    <mkdir dir="${classes.dir}" />
137    <javac srcdir="${src.dir}" destdir="${classes.dir}" 
138      classpathref="compile.classpath" includeAntRuntime="no"/>
139  </target>
140
141  <!-- Test programs -->
142  <target name="multistatus" depends="compile,keys"
143    description="run visualizer">
144    <java classname="MultiStatus" fork="true" >
145      <classpath>
146        <path refid="compile.classpath"/>
147        <pathelement path="${classes.dir}"/>
148      </classpath>
149    </java>
150  </target>
151
152  <target name="create" depends="compile,keys"
153    description="run visualizer">
154    <java classname="Create" fork="true" >
155      <classpath>
156        <path refid="compile.classpath"/>
157        <pathelement path="${classes.dir}"/>
158      </classpath>
159      <arg value="${user.name}-test"/>
160    </java>
161  </target>
162
163
164  <target name="terminate" depends="compile,keys"
165    description="run visualizer">
166    <java classname="Terminate" fork="true" >
167      <classpath>
168        <path refid="compile.classpath"/>
169        <pathelement path="${classes.dir}"/>
170      </classpath>
171      <arg value="${user.name}-test"/>
172    </java>
173  </target>
174
175</project>
Note: See TracBrowser for help on using the repository browser.