source: java/build.xml @ 496f937

abac0-leakabac0-meimei-idmei-rt0-nmei_rt0tvf-new-xml
Last change on this file since 496f937 was 7f16578, checked in by Ted Faber <faber@…>, 12 years ago

checkpoint

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