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