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="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="read.class" value="Reader"/> |
---|
29 | <property name="write.class" value="Writer"/> |
---|
30 | <property name="example.class" value="XMLExample"/> |
---|
31 | <property name="version" value="1.4"/> |
---|
32 | |
---|
33 | <path id="compile.classpath"> |
---|
34 | <fileset dir="${lib.dir}" includes="**/*.jar"/> |
---|
35 | </path> |
---|
36 | |
---|
37 | <target name="all" depends="clean, compile, jar, doc, dev-doc" |
---|
38 | description="Clean then build" /> |
---|
39 | |
---|
40 | <target name="clean"> |
---|
41 | <delete dir="${build.dir}"/> |
---|
42 | <delete dir="${doc.dir}"/> |
---|
43 | <delete dir="${devdoc.dir}"/> |
---|
44 | <delete> |
---|
45 | <fileset dir="${basedir}" includes="**/*.der"/> |
---|
46 | <fileset dir="${basedir}" includes="**/*.pem"/> |
---|
47 | <fileset dir="${basedir}" includes="**/*.zip"/> |
---|
48 | </delete> |
---|
49 | </target> |
---|
50 | |
---|
51 | |
---|
52 | <target name="compile" description="Compile the source"> |
---|
53 | <mkdir dir="${classes.dir}" /> |
---|
54 | <javac srcdir="${src.dir}" destdir="${classes.dir}" |
---|
55 | classpathref="compile.classpath" includeAntRuntime="no"/> |
---|
56 | </target> |
---|
57 | |
---|
58 | <target name="jar" depends="compile" description="Make a jar"> |
---|
59 | <mkdir dir="${jar.dir}"/> |
---|
60 | <jar destfile="${jar.dir}/jabac-${version}.jar" basedir="${classes.dir}" |
---|
61 | excludes="**/GraphTest.class **/Dumper.class"> |
---|
62 | <manifest> |
---|
63 | <attribute name="Class-Path" value="${classpath}" /> |
---|
64 | </manifest> |
---|
65 | </jar> |
---|
66 | </target> |
---|
67 | |
---|
68 | <target name="doc" description="Generate API documentation"> |
---|
69 | <mkdir dir="${doc.dir}"/> |
---|
70 | <javadoc sourcepath="${src.dir}" destdir="${doc.dir}" |
---|
71 | classpathref="compile.classpath" access="public" |
---|
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 | noqualifier="java.lang:java.io:java.util:java.security:java.security.cert"/> |
---|
80 | </target> |
---|
81 | |
---|
82 | <target name="run-test" depends="compile" description="run visualizer"> |
---|
83 | <java classname="${main.class}" fork="true" > |
---|
84 | <classpath> |
---|
85 | <path refid="compile.classpath"/> |
---|
86 | <pathelement path="${classes.dir}"/> |
---|
87 | </classpath> |
---|
88 | <!-- <arg file="../examples/experiment_create/"/> --> |
---|
89 | <arg file="./example"/> |
---|
90 | <arg value="Acme.experiment_create"/> |
---|
91 | <arg value="Bob"/> |
---|
92 | </java> |
---|
93 | </target> |
---|
94 | |
---|
95 | <target name="run-dump" depends="compile" description="run dumper"> |
---|
96 | <java classname="${dump.class}" fork="true" > |
---|
97 | <classpath> |
---|
98 | <path refid="compile.classpath"/> |
---|
99 | <pathelement path="${classes.dir}"/> |
---|
100 | </classpath> |
---|
101 | <arg file="attr0.der"/> |
---|
102 | </java> |
---|
103 | </target> |
---|
104 | |
---|
105 | <target name="run-read" depends="compile" description="run visualizer"> |
---|
106 | <java classname="${read.class}" fork="true" > |
---|
107 | <classpath> |
---|
108 | <path refid="compile.classpath"/> |
---|
109 | <pathelement path="${classes.dir}"/> |
---|
110 | </classpath> |
---|
111 | <arg file="./example"/> |
---|
112 | </java> |
---|
113 | </target> |
---|
114 | |
---|
115 | <target name="run-write" depends="compile" description="run visualizer"> |
---|
116 | <java classname="${write.class}" fork="true" > |
---|
117 | <classpath> |
---|
118 | <path refid="compile.classpath"/> |
---|
119 | <pathelement path="${classes.dir}"/> |
---|
120 | </classpath> |
---|
121 | <arg file="./fedid.pem"/> |
---|
122 | <arg value="0a778934b93d546406d195d18e4f208af11ea84a.experiment_create"/> |
---|
123 | <arg value="Bob"/> |
---|
124 | <arg file="./test.xml"/> |
---|
125 | </java> |
---|
126 | </target> |
---|
127 | |
---|
128 | <target name="run-create" depends="compile" description="run visualizer"> |
---|
129 | <java classname="${example.class}" fork="true" > |
---|
130 | <classpath> |
---|
131 | <path refid="compile.classpath"/> |
---|
132 | <pathelement path="${classes.dir}"/> |
---|
133 | </classpath> |
---|
134 | </java> |
---|
135 | </target> |
---|
136 | </project> |
---|