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 | regression-test: run a set of regression test programs |
---|
9 | jar: build jabac.jar in build/jar/jabac.jar |
---|
10 | doc: greate API javadocs in ./doc |
---|
11 | dev-doc: create developer API javadocs in ./dev-doc (includes |
---|
12 | package/private/protected functions) |
---|
13 | clean: remove created files (includes .der and .pem in this directory) |
---|
14 | --> |
---|
15 | |
---|
16 | <project name="jabac" default="all"> |
---|
17 | |
---|
18 | <property name="src.dir" value="."/> |
---|
19 | <property name="lib.dir" value="jar"/> |
---|
20 | <property name="build.dir" value="build"/> |
---|
21 | <property name="classes.dir" value="${build.dir}/classes"/> |
---|
22 | <property name="example.dir" value="${src.dir}/example"/> |
---|
23 | <property name="regression.dir" value="${src.dir}/regression"/> |
---|
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="regression.class" value="Regression"/> |
---|
32 | <property name="example.class" value="CreateExample"/> |
---|
33 | <property name="version" value="1.5"/> |
---|
34 | |
---|
35 | <path id="compile.classpath"> |
---|
36 | <fileset dir="${lib.dir}" includes="**/*.jar"/> |
---|
37 | </path> |
---|
38 | |
---|
39 | <target name="all" depends="clean, compile, jar, doc, dev-doc" |
---|
40 | description="Clean then build" /> |
---|
41 | |
---|
42 | <target name="clean"> |
---|
43 | <delete dir="${build.dir}"/> |
---|
44 | <delete dir="${doc.dir}"/> |
---|
45 | <delete dir="${devdoc.dir}"/> |
---|
46 | <delete dir="${example.dir}"/> |
---|
47 | <delete dir="${src.dir}/scratch"/> |
---|
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-dump" depends="compile" description="run dumper"> |
---|
84 | <java classname="${dump.class}" fork="true" > |
---|
85 | <classpath> |
---|
86 | <path refid="compile.classpath"/> |
---|
87 | <pathelement path="${classes.dir}"/> |
---|
88 | </classpath> |
---|
89 | <arg file="attr0.der"/> |
---|
90 | </java> |
---|
91 | </target> |
---|
92 | |
---|
93 | <target name="create-scratch" depends="compile" description="Create scratch directory"> |
---|
94 | <delete dir="${src.dir}/scratch"/> |
---|
95 | <mkdir dir="${src.dir}/scratch"/> |
---|
96 | </target> |
---|
97 | |
---|
98 | <target name="run-regression" depends="compile" description="Run the regression test program"> |
---|
99 | <java classname="${regression.class}" fork="true" > |
---|
100 | <classpath> |
---|
101 | <path refid="compile.classpath"/> |
---|
102 | <pathelement path="${classes.dir}"/> |
---|
103 | </classpath> |
---|
104 | <arg file="${src.dir}/regression"/> |
---|
105 | <arg file="${src.dir}/scratch"/> |
---|
106 | </java> |
---|
107 | </target> |
---|
108 | |
---|
109 | <target name="regression-test" depends="create-scratch,run-regression" description="Run the regression test "/> |
---|
110 | </project> |
---|