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="jar.dir" value="${build.dir}/jar"/> |
---|
25 | <property name="doc.dir" value="./doc"/> |
---|
26 | <property name="devdoc.dir" value="./dev-doc"/> |
---|
27 | <property name="main.class" value="GraphTest"/> |
---|
28 | <property name="dump.class" value="Dumper"/> |
---|
29 | <property name="read.class" value="Reader"/> |
---|
30 | <property name="write.class" value="Writer"/> |
---|
31 | <property name="example.class" value="CreateExample"/> |
---|
32 | <property name="version" value="1.4"/> |
---|
33 | |
---|
34 | <path id="compile.classpath"> |
---|
35 | <fileset dir="${lib.dir}" includes="**/*.jar"/> |
---|
36 | </path> |
---|
37 | |
---|
38 | <target name="all" depends="clean, compile, jar, doc, dev-doc" |
---|
39 | description="Clean then build" /> |
---|
40 | |
---|
41 | <target name="clean"> |
---|
42 | <delete dir="${build.dir}"/> |
---|
43 | <delete dir="${doc.dir}"/> |
---|
44 | <delete dir="${devdoc.dir}"/> |
---|
45 | <delete dir="${example.dir}"/> |
---|
46 | <delete> |
---|
47 | <fileset dir="${basedir}" includes="**/*.der"/> |
---|
48 | <fileset dir="${basedir}" includes="**/*.pem"/> |
---|
49 | <fileset dir="${basedir}" includes="**/*.zip"/> |
---|
50 | </delete> |
---|
51 | </target> |
---|
52 | |
---|
53 | |
---|
54 | <target name="compile" description="Compile the source"> |
---|
55 | <mkdir dir="${classes.dir}" /> |
---|
56 | <javac srcdir="${src.dir}" destdir="${classes.dir}" |
---|
57 | classpathref="compile.classpath" includeAntRuntime="no"/> |
---|
58 | </target> |
---|
59 | |
---|
60 | <target name="jar" depends="compile" description="Make a jar"> |
---|
61 | <mkdir dir="${jar.dir}"/> |
---|
62 | <jar destfile="${jar.dir}/jabac-${version}.jar" basedir="${classes.dir}" |
---|
63 | excludes="**/GraphTest.class **/Dumper.class"> |
---|
64 | <manifest> |
---|
65 | <attribute name="Class-Path" value="${classpath}" /> |
---|
66 | </manifest> |
---|
67 | </jar> |
---|
68 | </target> |
---|
69 | |
---|
70 | <target name="doc" description="Generate API documentation"> |
---|
71 | <mkdir dir="${doc.dir}"/> |
---|
72 | <javadoc sourcepath="${src.dir}" destdir="${doc.dir}" |
---|
73 | classpathref="compile.classpath" access="public" |
---|
74 | noqualifier="java.lang:java.io:java.util:java.security:java.security.cert"/> |
---|
75 | </target> |
---|
76 | |
---|
77 | <target name="dev-doc" description="Generate developer API documentation"> |
---|
78 | <mkdir dir="${doc.dir}"/> |
---|
79 | <javadoc sourcepath="${src.dir}" destdir="${devdoc.dir}" access="private" |
---|
80 | classpathref="compile.classpath" |
---|
81 | noqualifier="java.lang:java.io:java.util:java.security:java.security.cert"/> |
---|
82 | </target> |
---|
83 | |
---|
84 | <target name="run-test-default" depends="compile,run-create-default" description="run test query on default example"> |
---|
85 | <java classname="${main.class}" fork="true" > |
---|
86 | <classpath> |
---|
87 | <path refid="compile.classpath"/> |
---|
88 | <pathelement path="${classes.dir}"/> |
---|
89 | </classpath> |
---|
90 | <arg file="./example/default"/> |
---|
91 | <arg value="Acme.experiment_create"/> |
---|
92 | <arg value="Bob"/> |
---|
93 | </java> |
---|
94 | </target> |
---|
95 | |
---|
96 | <target name="run-test-x509" depends="compile,run-create-x509" description="run test query on X.509 example"> |
---|
97 | <java classname="${main.class}" fork="true" > |
---|
98 | <classpath> |
---|
99 | <path refid="compile.classpath"/> |
---|
100 | <pathelement path="${classes.dir}"/> |
---|
101 | </classpath> |
---|
102 | <arg file="./example/X509Credential"/> |
---|
103 | <arg value="Acme.experiment_create"/> |
---|
104 | <arg value="Bob"/> |
---|
105 | </java> |
---|
106 | </target> |
---|
107 | |
---|
108 | <target name="run-test-geni" depends="compile,run-create-geni" description="run test query on GENI example"> |
---|
109 | <java classname="${main.class}" fork="true" > |
---|
110 | <classpath> |
---|
111 | <path refid="compile.classpath"/> |
---|
112 | <pathelement path="${classes.dir}"/> |
---|
113 | </classpath> |
---|
114 | <arg file="./example/GENICredential"/> |
---|
115 | <arg value="Acme.experiment_create"/> |
---|
116 | <arg value="Bob"/> |
---|
117 | </java> |
---|
118 | </target> |
---|
119 | <target name="run-test" depends="run-test-default,run-test-x509,run-test-geni" description="Run all the test queries"/> |
---|
120 | |
---|
121 | <target name="run-dump" depends="compile" description="run dumper"> |
---|
122 | <java classname="${dump.class}" fork="true" > |
---|
123 | <classpath> |
---|
124 | <path refid="compile.classpath"/> |
---|
125 | <pathelement path="${classes.dir}"/> |
---|
126 | </classpath> |
---|
127 | <arg file="attr0.der"/> |
---|
128 | </java> |
---|
129 | </target> |
---|
130 | |
---|
131 | <target name="run-create-default" depends="compile" description="Create example certs in default format"> |
---|
132 | <java classname="${example.class}" fork="true" > |
---|
133 | <classpath> |
---|
134 | <path refid="compile.classpath"/> |
---|
135 | <pathelement path="${classes.dir}"/> |
---|
136 | </classpath> |
---|
137 | <arg value="default"/> |
---|
138 | </java> |
---|
139 | </target> |
---|
140 | |
---|
141 | <target name="run-create-geni" depends="compile" description="Create example certs in GENI format"> |
---|
142 | <java classname="${example.class}" fork="true" > |
---|
143 | <classpath> |
---|
144 | <path refid="compile.classpath"/> |
---|
145 | <pathelement path="${classes.dir}"/> |
---|
146 | </classpath> |
---|
147 | <arg value="net.deterlab.abac.GENICredential"/> |
---|
148 | </java> |
---|
149 | </target> |
---|
150 | |
---|
151 | <target name="run-create-x509" depends="compile" description="Create example certs in X.509 format"> |
---|
152 | <java classname="${example.class}" fork="true" > |
---|
153 | <classpath> |
---|
154 | <path refid="compile.classpath"/> |
---|
155 | <pathelement path="${classes.dir}"/> |
---|
156 | </classpath> |
---|
157 | <arg value="net.deterlab.abac.X509Credential"/> |
---|
158 | </java> |
---|
159 | </target> |
---|
160 | |
---|
161 | <target name="run-create" depends="run-create-default,run-create-x509,run-create-geni" description="Create all the examples"/> |
---|
162 | </project> |
---|