1 | <!-- |
---|
2 | Project file for ant to build java ABAC library and test cases. |
---|
3 | Requires Jung and bouncycastle. |
---|
4 | |
---|
5 | Targets: |
---|
6 | all: clean then compile and make docs |
---|
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 | |
---|
17 | <project name="jabac" default="all"> |
---|
18 | |
---|
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"/> |
---|
23 | <property name="example.dir" value="${src.dir}/example"/> |
---|
24 | <property name="regression.dir" value="${src.dir}/regression"/> |
---|
25 | <property name="jar.dir" value="${build.dir}/jar"/> |
---|
26 | <property name="doc.dir" value="./doc"/> |
---|
27 | <property name="devdoc.dir" value="./dev-doc"/> |
---|
28 | <property name="main.class" value="GraphTest"/> |
---|
29 | <property name="dump.class" value="Dumper"/> |
---|
30 | <property name="read.class" value="Reader"/> |
---|
31 | <property name="write.class" value="Writer"/> |
---|
32 | <property name="regression.class" value="Regression"/> |
---|
33 | <property name="example.class" value="CreateExample"/> |
---|
34 | <property name="version" value="1.4"/> |
---|
35 | |
---|
36 | <path id="compile.classpath"> |
---|
37 | <fileset dir="${lib.dir}" includes="**/*.jar"/> |
---|
38 | </path> |
---|
39 | |
---|
40 | <target name="all" depends="clean, compile, jar, doc, dev-doc" |
---|
41 | description="Clean then build" /> |
---|
42 | |
---|
43 | <target name="clean"> |
---|
44 | <delete dir="${build.dir}"/> |
---|
45 | <delete dir="${doc.dir}"/> |
---|
46 | <delete dir="${devdoc.dir}"/> |
---|
47 | <delete dir="${example.dir}"/> |
---|
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}" |
---|
54 | classpathref="compile.classpath" includeAntRuntime="no"/> |
---|
55 | </target> |
---|
56 | |
---|
57 | <target name="jar" depends="compile" description="Make a jar"> |
---|
58 | <mkdir dir="${jar.dir}"/> |
---|
59 | <jar destfile="${jar.dir}/jabac-${version}.jar" basedir="${classes.dir}" |
---|
60 | excludes="**/GraphTest.class **/Dumper.class net/deterlab/abac/regression/*"> |
---|
61 | <manifest> |
---|
62 | <attribute name="Class-Path" value="${classpath}" /> |
---|
63 | </manifest> |
---|
64 | </jar> |
---|
65 | </target> |
---|
66 | |
---|
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" |
---|
71 | excludepackagenames="net.deterlab/abac.regression" |
---|
72 | noqualifier="java.lang:java.io:java.util:java.security:java.security.cert"/> |
---|
73 | </target> |
---|
74 | |
---|
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" |
---|
79 | excludepackagenames="net.deterlab/abac.regression" |
---|
80 | noqualifier="java.lang:java.io:java.util:java.security:java.security.cert"/> |
---|
81 | </target> |
---|
82 | |
---|
83 | <target name="run-test-default" depends="compile,run-create-default" description="run test query on default example"> |
---|
84 | <java classname="${main.class}" fork="true" > |
---|
85 | <classpath> |
---|
86 | <path refid="compile.classpath"/> |
---|
87 | <pathelement path="${classes.dir}"/> |
---|
88 | </classpath> |
---|
89 | <arg file="./example/default"/> |
---|
90 | <arg value="Acme.experiment_create"/> |
---|
91 | <arg value="Bob"/> |
---|
92 | </java> |
---|
93 | </target> |
---|
94 | |
---|
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" > |
---|
97 | <classpath> |
---|
98 | <path refid="compile.classpath"/> |
---|
99 | <pathelement path="${classes.dir}"/> |
---|
100 | </classpath> |
---|
101 | <arg file="./example/X509Credential"/> |
---|
102 | <arg value="Acme.experiment_create"/> |
---|
103 | <arg value="Bob"/> |
---|
104 | </java> |
---|
105 | </target> |
---|
106 | |
---|
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" > |
---|
109 | <classpath> |
---|
110 | <path refid="compile.classpath"/> |
---|
111 | <pathelement path="${classes.dir}"/> |
---|
112 | </classpath> |
---|
113 | <arg file="./example/GENICredential"/> |
---|
114 | <arg value="Acme.experiment_create"/> |
---|
115 | <arg value="Bob"/> |
---|
116 | </java> |
---|
117 | </target> |
---|
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"/> |
---|
132 | |
---|
133 | <target name="run-dump" depends="compile" description="run dumper"> |
---|
134 | <java classname="${dump.class}" fork="true" > |
---|
135 | <classpath> |
---|
136 | <path refid="compile.classpath"/> |
---|
137 | <pathelement path="${classes.dir}"/> |
---|
138 | </classpath> |
---|
139 | <arg file="attr0.der"/> |
---|
140 | </java> |
---|
141 | </target> |
---|
142 | |
---|
143 | <target name="run-create-default" depends="compile" description="Create example certs in default format"> |
---|
144 | <java classname="${example.class}" fork="true" > |
---|
145 | <classpath> |
---|
146 | <path refid="compile.classpath"/> |
---|
147 | <pathelement path="${classes.dir}"/> |
---|
148 | </classpath> |
---|
149 | <arg value="default"/> |
---|
150 | </java> |
---|
151 | </target> |
---|
152 | |
---|
153 | <target name="run-create-geni" depends="compile" description="Create example certs in GENI format"> |
---|
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 | |
---|
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 | |
---|
176 | <target name="run-create-x509" depends="compile" description="Create example certs in X.509 format"> |
---|
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"/> |
---|
183 | </java> |
---|
184 | </target> |
---|
185 | |
---|
186 | <target name="run-create" depends="run-create-default,run-create-x509,run-create-geni" description="Create all the examples"/> |
---|
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 "/> |
---|
205 | </project> |
---|