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 |
---|
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"> |
---|
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="jar.dir" value="${build.dir}/jar"/> |
---|
24 | <property name="doc.dir" value="./doc"/> |
---|
25 | <property name="devdoc.dir" value="./dev-doc"/> |
---|
26 | <property name="main.class" value="GraphTest"/> |
---|
27 | <property name="dump.class" value="Dumper"/> |
---|
28 | |
---|
29 | <path id="compile.classpath"> |
---|
30 | <fileset dir="${lib.dir}" includes="**/*.jar"/> |
---|
31 | </path> |
---|
32 | |
---|
33 | <target name="all" depends="clean, compile" description="Clean then build" /> |
---|
34 | |
---|
35 | <target name="clean"> |
---|
36 | <delete dir="${build.dir}"/> |
---|
37 | <delete dir="${doc.dir}"/> |
---|
38 | <delete dir="${devdoc.dir}"/> |
---|
39 | <delete> |
---|
40 | <fileset dir="${basedir}" includes="**/*.der"/> |
---|
41 | <fileset dir="${basedir}" includes="**/*.pem"/> |
---|
42 | <fileset dir="${basedir}" includes="**/*.zip"/> |
---|
43 | </delete> |
---|
44 | </target> |
---|
45 | |
---|
46 | |
---|
47 | <target name="compile" description="Compile the source"> |
---|
48 | <mkdir dir="${classes.dir}" /> |
---|
49 | <javac srcdir="${src.dir}" destdir="${classes.dir}" |
---|
50 | classpathref="compile.classpath"/> |
---|
51 | </target> |
---|
52 | |
---|
53 | <target name="jar" depends="compile" description="Make a jar"> |
---|
54 | <mkdir dir="${jar.dir}"/> |
---|
55 | <jar destfile="${jar.dir}/jabac.jar" basedir="${classes.dir}" |
---|
56 | excludes="**/GraphTest.class **/Dumper.class"> |
---|
57 | <manifest> |
---|
58 | <attribute name="Class-Path" value="${classpath}" /> |
---|
59 | </manifest> |
---|
60 | </jar> |
---|
61 | </target> |
---|
62 | |
---|
63 | <target name="doc" description="Generate API documentation"> |
---|
64 | <mkdir dir="${doc.dir}"/> |
---|
65 | <javadoc sourcepath="${src.dir}" destdir="${doc.dir}" |
---|
66 | classpathref="compile.classpath" access="public" |
---|
67 | noqualifier="java.lang:java.io:java.util:java.security:java.security.cert"/> |
---|
68 | </target> |
---|
69 | |
---|
70 | <target name="dev-doc" description="Generate developer API documentation"> |
---|
71 | <mkdir dir="${doc.dir}"/> |
---|
72 | <javadoc sourcepath="${src.dir}" destdir="${devdoc.dir}" access="private" |
---|
73 | classpathref="compile.classpath" |
---|
74 | noqualifier="java.lang:java.io:java.util:java.security:java.security.cert"/> |
---|
75 | </target> |
---|
76 | |
---|
77 | <target name="run-test" depends="compile" description="run visualizer"> |
---|
78 | <java classname="${main.class}" fork="true" > |
---|
79 | <classpath> |
---|
80 | <path refid="compile.classpath"/> |
---|
81 | <pathelement path="${classes.dir}"/> |
---|
82 | </classpath> |
---|
83 | <arg file="../examples/experiment_create/"/> |
---|
84 | <arg value="Acme.experiment_create"/> |
---|
85 | <arg value="Bob"/> |
---|
86 | </java> |
---|
87 | </target> |
---|
88 | |
---|
89 | <target name="run-dump" depends="compile" description="run dumper"> |
---|
90 | <java classname="${dump.class}" fork="true" > |
---|
91 | <classpath> |
---|
92 | <path refid="compile.classpath"/> |
---|
93 | <pathelement path="${classes.dir}"/> |
---|
94 | </classpath> |
---|
95 | <arg file="attr0.der"/> |
---|
96 | </java> |
---|
97 | </target> |
---|
98 | </project> |
---|