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