1 | <!--
|
---|
2 |
|
---|
3 | ANT build script for both the Apollo and Expeditee project.
|
---|
4 |
|
---|
5 | Originally created for the apollo project - but can be used for
|
---|
6 | creating expeditee distributions.
|
---|
7 |
|
---|
8 | This does not include the lib jars within the distributed jar -
|
---|
9 | such resources would have to be handled specially in code
|
---|
10 | (i.e. jar loaders...).
|
---|
11 |
|
---|
12 | -->
|
---|
13 | <project name="Expeditee" default="fresh_dist_exp">
|
---|
14 |
|
---|
15 | <tstamp>
|
---|
16 | <format property="TODAY" pattern="d-MMMM-yyyy"/>
|
---|
17 | <format property="TODAY_EXP" pattern="ddMMMyyyy"/>
|
---|
18 | </tstamp>
|
---|
19 |
|
---|
20 | <!-- Expeditee must be compatible run on Java 1.5." -->
|
---|
21 | <property name="sourcelevel" value="1.5" />
|
---|
22 | <property name="targetlevel" value="1.5" />
|
---|
23 |
|
---|
24 | <property name="resources.dir.apollo" location="resources_apollo" /> <!-- resources files for apollo -->
|
---|
25 |
|
---|
26 | <property name="src.dir.exp" location="src" /> <!-- source files for expeditee -->
|
---|
27 | <property name="src.dir.apollo" location="src_apollo" /> <!-- source files for apollo -->
|
---|
28 |
|
---|
29 | <property name="build.dir" location="bin" /> <!-- compiled class files directory -->
|
---|
30 |
|
---|
31 | <property name="lib.dir.exp" location="releases/jars" /> <!-- external dependencies -->
|
---|
32 | <property name="lib.dir.apollo" location="jars_apollo" /> <!-- external dependencies -->
|
---|
33 |
|
---|
34 | <property name="dist.dir.exp" location="releases" /> <!-- Put the output jar file into the same directory as the others. The manifest file needs to be edited with relative dependencies if another directory structure is desired. -->
|
---|
35 | <property name="dist.dir.apollo" location="releases/apollo" /> <!-- Put the output jar file into the same directory as the others. The manifest file needs to be edited with relative dependencies if another directory structure is desired. -->
|
---|
36 |
|
---|
37 | <property name="dist.filename.exp" value="Exp${TODAY_EXP}A.jar" />
|
---|
38 | <property name="dist.filename.apollo" value="Apollo_jvm${targetlevel}-${TODAY}.jar" />
|
---|
39 |
|
---|
40 | <property name="manifest.path.exp" value="makeFiles/Manifest.txt" />
|
---|
41 | <property name="manifest.path.apollo" value="makeFiles/apollo_manifest.mf" />
|
---|
42 |
|
---|
43 | <path id="classpath.exp">
|
---|
44 | <!-- link with all jar files we can find in our defined lib directory -->
|
---|
45 | <fileset dir="${lib.dir.exp}">
|
---|
46 | <include name="*.jar" />
|
---|
47 | </fileset>
|
---|
48 | </path>
|
---|
49 |
|
---|
50 | <path id="classpath.apollo">
|
---|
51 | <!-- link with all jar files we can find in our defined lib directory -->
|
---|
52 | <fileset dir="${lib.dir.exp}">
|
---|
53 | <include name="*.jar" />
|
---|
54 | <exclude name="jnmp2p.jar"/> <!-- This is a zero-sized file! Its totally invalid and will fail any builds - omitting !-->
|
---|
55 | <exclude name="jxta.jar"/> <!-- Ditto !-->
|
---|
56 | </fileset>
|
---|
57 | <fileset dir="${lib.dir.apollo}">
|
---|
58 | <include name="*.jar" />
|
---|
59 | </fileset>
|
---|
60 | </path>
|
---|
61 |
|
---|
62 |
|
---|
63 | <!-- TARGETS -->
|
---|
64 | <target name="clean" description="Deletes contents of build directory.">
|
---|
65 | <delete dir="${build.dir}" />
|
---|
66 | <mkdir dir="${build.dir}" />
|
---|
67 | </target>
|
---|
68 |
|
---|
69 |
|
---|
70 | <!-- Set up directories that are needed for building." -->
|
---|
71 | <target name="init_expeditee">
|
---|
72 | <mkdir dir="${build.dir}" />
|
---|
73 | <mkdir dir="${lib.dir.exp}" />
|
---|
74 | </target>
|
---|
75 |
|
---|
76 | <target name="init_apollo" depends="init_expeditee">
|
---|
77 | <mkdir dir="${lib.dir.apollo}" />
|
---|
78 | </target>
|
---|
79 |
|
---|
80 |
|
---|
81 | <!-- Do the actual compilation." -->
|
---|
82 | <target name="compile_exp" depends="init_expeditee">
|
---|
83 | <javac srcdir="${src.dir.exp}"
|
---|
84 | destdir="${build.dir}"
|
---|
85 | debug="off"
|
---|
86 | optimize="on"
|
---|
87 | source="${sourcelevel}"
|
---|
88 | target="${targetlevel}"
|
---|
89 | compiler="modern"
|
---|
90 |
|
---|
91 | listfiles="true">
|
---|
92 | <classpath refid="classpath.exp" />
|
---|
93 | <compilerarg value="-Xlint:unchecked"/>
|
---|
94 | </javac>
|
---|
95 | </target>
|
---|
96 |
|
---|
97 | <target name="compile_apollo" depends="init_apollo, compile_exp">
|
---|
98 | <javac srcdir="${src.dir.apollo}"
|
---|
99 | destdir="${build.dir}"
|
---|
100 | debug="off"
|
---|
101 | optimize="on"
|
---|
102 | source="${sourcelevel}"
|
---|
103 | target="${targetlevel}"
|
---|
104 | compiler="modern"
|
---|
105 | listfiles="true">
|
---|
106 | <classpath refid="classpath.apollo" />
|
---|
107 | <compilerarg value="-Xlint:unchecked"/>
|
---|
108 | </javac>
|
---|
109 | </target>
|
---|
110 |
|
---|
111 |
|
---|
112 | <!-- Jaring up the projects." -->
|
---|
113 | <target name="lazy_dist_exp" depends="compile_exp" description="Warning: Does not clean before compile.">
|
---|
114 | <jar destfile="${dist.dir.exp}/${dist.filename.exp}" manifest="${manifest.path.exp}">
|
---|
115 | <fileset dir="${build.dir}"/>
|
---|
116 | </jar>
|
---|
117 | </target>
|
---|
118 |
|
---|
119 | <target name="fresh_dist_exp" depends="clean, lazy_dist_exp"/>
|
---|
120 |
|
---|
121 | <target name="lazy_dist_apollo" depends="compile_apollo" description="Warning: Does not clean before compile.">
|
---|
122 | <jar destfile="${dist.dir.apollo}/${dist.filename.apollo}" manifest="${manifest.path.apollo}">
|
---|
123 | <fileset dir="${build.dir}"/>
|
---|
124 | <fileset dir="${resources.dir.apollo}"/>
|
---|
125 | </jar>
|
---|
126 | </target>
|
---|
127 |
|
---|
128 | <target name="fresh_dist_apollo" depends="clean, lazy_dist_apollo"/>
|
---|
129 |
|
---|
130 | </project> |
---|