[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"/> |
---|
[56baf92] | 30 | <property name="version" value="1.0"/> |
---|
| 31 | <property name="fedd.jar" value="fedd-${version}.jar"/> |
---|
[55de6a9] | 32 | |
---|
| 33 | <path id="compile.classpath"> |
---|
| 34 | <fileset dir="${lib.dir}" includes="**/*.jar"/> |
---|
| 35 | </path> |
---|
| 36 | |
---|
[56baf92] | 37 | <path id="run.classpath"> |
---|
| 38 | <fileset dir="${lib.dir}" includes="**/*.jar"/> |
---|
| 39 | <fileset dir="${jar.dir}" includes="**/*.jar"/> |
---|
| 40 | </path> |
---|
| 41 | |
---|
| 42 | |
---|
[55de6a9] | 43 | <taskdef resource="axis-tasks.properties" classpathref="compile.classpath" /> |
---|
| 44 | |
---|
[56baf92] | 45 | <target name="all" depends="clean,jar" description="Clean then build" /> |
---|
| 46 | <target name="run" depends="multistatus" description="Run multistatus" /> |
---|
[55de6a9] | 47 | |
---|
[56baf92] | 48 | <!-- remove all derived and compiled files --> |
---|
[ee7f7e4] | 49 | <target name="clean" depends="clean-keys"> |
---|
[55de6a9] | 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 | |
---|
[56baf92] | 57 | <!-- just remove command files --> |
---|
| 58 | <target name="clean-commands" > |
---|
| 59 | <delete> |
---|
| 60 | <fileset dir="${classes.dir}" |
---|
[ee7f7e4] | 61 | includes="**/FeddCommand.class **/Create.class **/MultiStatus.class **/Terminate.class **/MakeFedid.class"/> |
---|
[56baf92] | 62 | </delete> |
---|
| 63 | </target> |
---|
| 64 | |
---|
[ee7f7e4] | 65 | <!-- just remove keystore and ${fedid.pem}--> |
---|
| 66 | <target name="clean-keys"> |
---|
| 67 | <delete file="${keystore.file}"/> |
---|
| 68 | <delete file="${fedid.pem}"/> |
---|
| 69 | </target> |
---|
[56baf92] | 70 | |
---|
[ee7f7e4] | 71 | |
---|
| 72 | <!-- Check to see if the keystore file exists, if so the keystore.present |
---|
[6b25610] | 73 | property is created. --> |
---|
[55de6a9] | 74 | <target name="keystore.check"> |
---|
| 75 | <available property="keystore.present" |
---|
| 76 | file="${basedir}${file.separator}keystore"/> |
---|
| 77 | </target> |
---|
| 78 | |
---|
[ee7f7e4] | 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> |
---|
[55de6a9] | 103 | |
---|
[ee7f7e4] | 104 | <!-- Convert ${fedid.pem} to a java keystore. Makes use of the ImportKey |
---|
[6b25610] | 105 | program available from http://www.agentbob.info/agentbob/79-AB.html . |
---|
| 106 | That web page describes this process in detail. --> |
---|
[ee7f7e4] | 107 | <target name="keys" depends="keystore.check,makefedid" |
---|
| 108 | unless="keystore.present" > |
---|
| 109 | <echo message="Importing key ${fedid.pem}"/> |
---|
[6b25610] | 110 | <!-- splitkey.pl splits a combo certificate file (both key and cert) into a |
---|
| 111 | key.pem and cert.pem file for ImportKey --> |
---|
[55de6a9] | 112 | <exec executable="/usr/bin/perl"> |
---|
| 113 | <arg value="./splitkey.pl"/> |
---|
[ee7f7e4] | 114 | <arg file="${fedid.pem}"/> |
---|
[55de6a9] | 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> |
---|
[6b25610] | 145 | <move file="${user.home}${file.separator}keystore.ImportKey" |
---|
| 146 | tofile="${keystore.file}"/> |
---|
[55de6a9] | 147 | <delete> |
---|
| 148 | <fileset dir="${basedir}" includes="**/cert.*"/> |
---|
| 149 | <fileset dir="${basedir}" includes="**/key.*"/> |
---|
| 150 | </delete> |
---|
| 151 | </target> |
---|
| 152 | |
---|
[6b25610] | 153 | <!-- Documentation targets --> |
---|
[56baf92] | 154 | <!-- Generate basic javadoc --> |
---|
[6b25610] | 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 | |
---|
[56baf92] | 162 | <!-- Generate pedentically complete javadoc --> |
---|
[6b25610] | 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 | |
---|
[56baf92] | 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"/> |
---|
[ee7f7e4] | 196 | <available file="${classes.dir}${file.separator}MakeFedid.class"/> |
---|
[56baf92] | 197 | </and> |
---|
| 198 | </condition> |
---|
| 199 | </target> |
---|
| 200 | |
---|
| 201 | |
---|
[6b25610] | 202 | <!-- compile the sources into the build directory. Depends on the |
---|
[56baf92] | 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"> |
---|
[6b25610] | 208 | <mkdir dir="${classes.dir}" /> |
---|
| 209 | <javac srcdir="${src.dir}" destdir="${classes.dir}" |
---|
| 210 | classpathref="compile.classpath" includeAntRuntime="no"/> |
---|
| 211 | </target> |
---|
| 212 | |
---|
[56baf92] | 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}" |
---|
[ee7f7e4] | 217 | excludes="**/Create.class **/MultiStatus.class **/Terminate.class **/FeddCommand.class **/MakeFedid.class"/> |
---|
[56baf92] | 218 | </target> |
---|
| 219 | |
---|
[6b25610] | 220 | <!-- Test programs --> |
---|
[56baf92] | 221 | <target name="multistatus" depends="compile,jar,keys" |
---|
[55de6a9] | 222 | description="run visualizer"> |
---|
| 223 | <java classname="MultiStatus" fork="true" > |
---|
| 224 | <classpath> |
---|
[56baf92] | 225 | <path refid="run.classpath"/> |
---|
[55de6a9] | 226 | <pathelement path="${classes.dir}"/> |
---|
| 227 | </classpath> |
---|
| 228 | </java> |
---|
| 229 | </target> |
---|
| 230 | |
---|
[56baf92] | 231 | <target name="create" depends="compile,jar,keys" |
---|
[55de6a9] | 232 | description="run visualizer"> |
---|
| 233 | <java classname="Create" fork="true" > |
---|
| 234 | <classpath> |
---|
[56baf92] | 235 | <path refid="run.classpath"/> |
---|
[55de6a9] | 236 | <pathelement path="${classes.dir}"/> |
---|
| 237 | </classpath> |
---|
| 238 | <arg value="${user.name}-test"/> |
---|
[56baf92] | 239 | <arg file="./deter-only.tcl"/> |
---|
[2ef3584] | 240 | <arg file="${fedid.pem}"/> |
---|
[55de6a9] | 241 | </java> |
---|
| 242 | </target> |
---|
| 243 | |
---|
| 244 | |
---|
[56baf92] | 245 | <target name="terminate" depends="compile,jar,keys" |
---|
[6b25610] | 246 | description="run visualizer"> |
---|
| 247 | <java classname="Terminate" fork="true" > |
---|
| 248 | <classpath> |
---|
[56baf92] | 249 | <path refid="run.classpath"/> |
---|
[6b25610] | 250 | <pathelement path="${classes.dir}"/> |
---|
| 251 | </classpath> |
---|
| 252 | <arg value="${user.name}-test"/> |
---|
| 253 | </java> |
---|
[55de6a9] | 254 | </target> |
---|
| 255 | |
---|
| 256 | </project> |
---|