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