[edf9e1d] | 1 | <!-- |
---|
| 2 | Project file for ant to build java ABAC library and test cases. |
---|
| 3 | Requires Jung and bouncycastle. |
---|
| 4 | |
---|
| 5 | Targets: |
---|
[4ab0561] | 6 | all: clean then compile and make docs |
---|
[edf9e1d] | 7 | compile: build the library and test programs |
---|
| 8 | run-test: run a simple test program in GraphTest.java (params in target) |
---|
| 9 | run-dump: run a program to dump a certificate in ASN1 (params in target) |
---|
| 10 | jar: build jabac.jar in build/jar/jabac.jar |
---|
| 11 | doc: greate API javadocs in ./doc |
---|
| 12 | dev-doc: create developer API javadocs in ./dev-doc (includes |
---|
| 13 | package/private/protected functions) |
---|
| 14 | clean: remove created files (includes .der and .pem in this directory) |
---|
| 15 | --> |
---|
| 16 | |
---|
[20d3d3c] | 17 | <project name="jabac" default="all"> |
---|
[edf9e1d] | 18 | |
---|
[2750153] | 19 | <property name="src.dir" value="."/> |
---|
| 20 | <property name="lib.dir" value="jar"/> |
---|
| 21 | <property name="build.dir" value="build"/> |
---|
| 22 | <property name="classes.dir" value="${build.dir}/classes"/> |
---|
[008dc25] | 23 | <property name="example.dir" value="${src.dir}/example"/> |
---|
[fe71561] | 24 | <property name="regression.dir" value="${src.dir}/regression"/> |
---|
[2750153] | 25 | <property name="jar.dir" value="${build.dir}/jar"/> |
---|
[e36ea1d] | 26 | <property name="doc.dir" value="./doc"/> |
---|
[1b88de8] | 27 | <property name="devdoc.dir" value="./dev-doc"/> |
---|
[7ad0076] | 28 | <property name="main.class" value="GraphTest"/> |
---|
[ea3bddc] | 29 | <property name="dump.class" value="Dumper"/> |
---|
[7f16578] | 30 | <property name="read.class" value="Reader"/> |
---|
[797bebe] | 31 | <property name="write.class" value="Writer"/> |
---|
[8375d4f] | 32 | <property name="regression.class" value="Regression"/> |
---|
[6b31de6] | 33 | <property name="example.class" value="CreateExample"/> |
---|
[4560b65] | 34 | <property name="version" value="1.4"/> |
---|
[2750153] | 35 | |
---|
[edf9e1d] | 36 | <path id="compile.classpath"> |
---|
| 37 | <fileset dir="${lib.dir}" includes="**/*.jar"/> |
---|
| 38 | </path> |
---|
| 39 | |
---|
[4ab0561] | 40 | <target name="all" depends="clean, compile, jar, doc, dev-doc" |
---|
| 41 | description="Clean then build" /> |
---|
[edf9e1d] | 42 | |
---|
[2750153] | 43 | <target name="clean"> |
---|
| 44 | <delete dir="${build.dir}"/> |
---|
[e36ea1d] | 45 | <delete dir="${doc.dir}"/> |
---|
[1b88de8] | 46 | <delete dir="${devdoc.dir}"/> |
---|
[008dc25] | 47 | <delete dir="${example.dir}"/> |
---|
[2750153] | 48 | </target> |
---|
| 49 | |
---|
| 50 | |
---|
| 51 | <target name="compile" description="Compile the source"> |
---|
| 52 | <mkdir dir="${classes.dir}" /> |
---|
| 53 | <javac srcdir="${src.dir}" destdir="${classes.dir}" |
---|
[20d3d3c] | 54 | classpathref="compile.classpath" includeAntRuntime="no"/> |
---|
[2750153] | 55 | </target> |
---|
| 56 | |
---|
[1a7e6d3] | 57 | <target name="jar" depends="compile" description="Make a jar"> |
---|
| 58 | <mkdir dir="${jar.dir}"/> |
---|
[4ab0561] | 59 | <jar destfile="${jar.dir}/jabac-${version}.jar" basedir="${classes.dir}" |
---|
[8375d4f] | 60 | excludes="**/GraphTest.class **/Dumper.class net/deterlab/abac/regression/*"> |
---|
[1a7e6d3] | 61 | <manifest> |
---|
| 62 | <attribute name="Class-Path" value="${classpath}" /> |
---|
| 63 | </manifest> |
---|
| 64 | </jar> |
---|
| 65 | </target> |
---|
| 66 | |
---|
[e36ea1d] | 67 | <target name="doc" description="Generate API documentation"> |
---|
| 68 | <mkdir dir="${doc.dir}"/> |
---|
| 69 | <javadoc sourcepath="${src.dir}" destdir="${doc.dir}" |
---|
| 70 | classpathref="compile.classpath" access="public" |
---|
[98a9afb] | 71 | excludepackagenames="net.deterlab/abac.regression" |
---|
[e36ea1d] | 72 | noqualifier="java.lang:java.io:java.util:java.security:java.security.cert"/> |
---|
| 73 | </target> |
---|
| 74 | |
---|
[1b88de8] | 75 | <target name="dev-doc" description="Generate developer API documentation"> |
---|
| 76 | <mkdir dir="${doc.dir}"/> |
---|
| 77 | <javadoc sourcepath="${src.dir}" destdir="${devdoc.dir}" access="private" |
---|
| 78 | classpathref="compile.classpath" |
---|
[98a9afb] | 79 | excludepackagenames="net.deterlab/abac.regression" |
---|
[1b88de8] | 80 | noqualifier="java.lang:java.io:java.util:java.security:java.security.cert"/> |
---|
| 81 | </target> |
---|
| 82 | |
---|
[008dc25] | 83 | <target name="run-test-default" depends="compile,run-create-default" description="run test query on default example"> |
---|
[1a7e6d3] | 84 | <java classname="${main.class}" fork="true" > |
---|
| 85 | <classpath> |
---|
| 86 | <path refid="compile.classpath"/> |
---|
| 87 | <pathelement path="${classes.dir}"/> |
---|
| 88 | </classpath> |
---|
[008dc25] | 89 | <arg file="./example/default"/> |
---|
[281158a] | 90 | <arg value="Acme.experiment_create"/> |
---|
| 91 | <arg value="Bob"/> |
---|
[1a7e6d3] | 92 | </java> |
---|
| 93 | </target> |
---|
[1b88de8] | 94 | |
---|
[008dc25] | 95 | <target name="run-test-x509" depends="compile,run-create-x509" description="run test query on X.509 example"> |
---|
| 96 | <java classname="${main.class}" fork="true" > |
---|
[ea3bddc] | 97 | <classpath> |
---|
| 98 | <path refid="compile.classpath"/> |
---|
| 99 | <pathelement path="${classes.dir}"/> |
---|
| 100 | </classpath> |
---|
[008dc25] | 101 | <arg file="./example/X509Credential"/> |
---|
| 102 | <arg value="Acme.experiment_create"/> |
---|
| 103 | <arg value="Bob"/> |
---|
[ea3bddc] | 104 | </java> |
---|
| 105 | </target> |
---|
[7f16578] | 106 | |
---|
[008dc25] | 107 | <target name="run-test-geni" depends="compile,run-create-geni" description="run test query on GENI example"> |
---|
| 108 | <java classname="${main.class}" fork="true" > |
---|
[7f16578] | 109 | <classpath> |
---|
| 110 | <path refid="compile.classpath"/> |
---|
| 111 | <pathelement path="${classes.dir}"/> |
---|
| 112 | </classpath> |
---|
[008dc25] | 113 | <arg file="./example/GENICredential"/> |
---|
| 114 | <arg value="Acme.experiment_create"/> |
---|
| 115 | <arg value="Bob"/> |
---|
[7f16578] | 116 | </java> |
---|
| 117 | </target> |
---|
[fe71561] | 118 | |
---|
| 119 | <target name="run-test-priv" depends="compile,run-create-priv" description="run test query on GENI priv example"> |
---|
| 120 | <java classname="${main.class}" fork="true" > |
---|
| 121 | <classpath> |
---|
| 122 | <path refid="compile.classpath"/> |
---|
| 123 | <pathelement path="${classes.dir}"/> |
---|
| 124 | </classpath> |
---|
| 125 | <arg file="./example/priv"/> |
---|
| 126 | <arg value="Acme.experiment_create"/> |
---|
| 127 | <arg value="Bob"/> |
---|
| 128 | </java> |
---|
| 129 | </target> |
---|
| 130 | |
---|
| 131 | <target name="run-test" depends="run-test-default,run-test-x509,run-test-geni,run-test-priv" description="Run all the test queries"/> |
---|
[797bebe] | 132 | |
---|
[008dc25] | 133 | <target name="run-dump" depends="compile" description="run dumper"> |
---|
| 134 | <java classname="${dump.class}" fork="true" > |
---|
[797bebe] | 135 | <classpath> |
---|
| 136 | <path refid="compile.classpath"/> |
---|
| 137 | <pathelement path="${classes.dir}"/> |
---|
| 138 | </classpath> |
---|
[008dc25] | 139 | <arg file="attr0.der"/> |
---|
[797bebe] | 140 | </java> |
---|
| 141 | </target> |
---|
[3612811] | 142 | |
---|
[008dc25] | 143 | <target name="run-create-default" depends="compile" description="Create example certs in default format"> |
---|
[3612811] | 144 | <java classname="${example.class}" fork="true" > |
---|
| 145 | <classpath> |
---|
| 146 | <path refid="compile.classpath"/> |
---|
| 147 | <pathelement path="${classes.dir}"/> |
---|
| 148 | </classpath> |
---|
[6b31de6] | 149 | <arg value="default"/> |
---|
| 150 | </java> |
---|
| 151 | </target> |
---|
| 152 | |
---|
[008dc25] | 153 | <target name="run-create-geni" depends="compile" description="Create example certs in GENI format"> |
---|
[6b31de6] | 154 | <java classname="${example.class}" fork="true" > |
---|
| 155 | <classpath> |
---|
| 156 | <path refid="compile.classpath"/> |
---|
| 157 | <pathelement path="${classes.dir}"/> |
---|
| 158 | </classpath> |
---|
| 159 | <arg value="net.deterlab.abac.GENICredential"/> |
---|
| 160 | </java> |
---|
| 161 | </target> |
---|
| 162 | |
---|
[fe71561] | 163 | <target name="run-create-priv" depends="compile" description="Create example certs in GENI priv format"> |
---|
| 164 | <delete dir="${example.dir}/priv"/> |
---|
| 165 | <mkdir dir="${example.dir}/priv"/> |
---|
| 166 | <copy file="${regression.dir}/priv.xml" |
---|
| 167 | tofile="${example.dir}/priv/priv.xml"/> |
---|
| 168 | <copy file="${regression.dir}/owner_ID.pem" |
---|
| 169 | tofile="${example.dir}/priv/owner_ID.pem"/> |
---|
| 170 | <copy file="${regression.dir}/issuer_ID.pem" |
---|
| 171 | tofile="${example.dir}/priv/issuer_ID.pem"/> |
---|
| 172 | <copy file="${regression.dir}/target_ID.pem" |
---|
| 173 | tofile="${example.dir}/priv/target_ID.pem"/> |
---|
| 174 | </target> |
---|
| 175 | |
---|
[008dc25] | 176 | <target name="run-create-x509" depends="compile" description="Create example certs in X.509 format"> |
---|
[6b31de6] | 177 | <java classname="${example.class}" fork="true" > |
---|
| 178 | <classpath> |
---|
| 179 | <path refid="compile.classpath"/> |
---|
| 180 | <pathelement path="${classes.dir}"/> |
---|
| 181 | </classpath> |
---|
| 182 | <arg value="net.deterlab.abac.X509Credential"/> |
---|
[3612811] | 183 | </java> |
---|
| 184 | </target> |
---|
[008dc25] | 185 | |
---|
| 186 | <target name="run-create" depends="run-create-default,run-create-x509,run-create-geni" description="Create all the examples"/> |
---|
[8375d4f] | 187 | |
---|
| 188 | <target name="create-scratch" depends="compile" description="Create scratch directory"> |
---|
| 189 | <delete dir="${src.dir}/scratch"/> |
---|
| 190 | <mkdir dir="${src.dir}/scratch"/> |
---|
| 191 | </target> |
---|
| 192 | |
---|
| 193 | <target name="run-regression" depends="compile" description="Run the regression test program"> |
---|
| 194 | <java classname="${regression.class}" fork="true" > |
---|
| 195 | <classpath> |
---|
| 196 | <path refid="compile.classpath"/> |
---|
| 197 | <pathelement path="${classes.dir}"/> |
---|
| 198 | </classpath> |
---|
| 199 | <arg file="${src.dir}/regression"/> |
---|
| 200 | <arg file="${src.dir}/scratch"/> |
---|
| 201 | </java> |
---|
| 202 | </target> |
---|
| 203 | |
---|
| 204 | <target name="regression-test" depends="create-scratch,run-regression" description="Run the regression test "/> |
---|
[2750153] | 205 | </project> |
---|