source: trunk/build.xml@ 391

Last change on this file since 391 was 391, checked in by ra33, 16 years ago

Fixed build issue with jars being in the release folder

File size: 4.6 KB
Line 
1<!--
2
3ANT build script for both the Apollo and Expeditee project.
4
5Originally created for the apollo project - but can be used for
6creating expeditee distributions.
7
8This does not include the lib jars within the distributed jar -
9such 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 </tstamp>
18
19 <property name="sourcelevel" value="1.6" />
20 <property name="targetlevel" value="1.6" />
21
22 <property name="resources.dir.apollo" location="resources_apollo" /> <!-- resources files for apollo -->
23
24 <property name="src.dir.exp" location="src" /> <!-- source files for expeditee -->
25 <property name="src.dir.apollo" location="src_apollo" /> <!-- source files for apollo -->
26
27 <property name="build.dir" location="bin" /> <!-- compiled class files directory -->
28
29 <property name="lib.dir.exp" location="releases/jars" /> <!-- external dependencies -->
30 <property name="lib.dir.apollo" location="jars_apollo" /> <!-- external dependencies -->
31
32 <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. -->
33 <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. -->
34
35 <property name="dist.filename.exp" value="Expeditee.jar" />
36 <property name="dist.filename.apollo" value="Apollo_jvm${targetlevel}-${TODAY}.jar" />
37
38 <property name="manifest.path.exp" value="makeFiles/Manifest.txt" />
39 <property name="manifest.path.apollo" value="makeFiles/apollo_manifest.mf" />
40
41 <path id="classpath.exp">
42 <!-- link with all jar files we can find in our defined lib directory -->
43 <fileset dir="${lib.dir.exp}">
44 <include name="*.jar" />
45 <exclude name="jnmp2p.jar"/> <!-- This is a zero-sized file! Its totally invalid and will fail any builds - omitting !-->
46 <exclude name="jxta.jar"/> <!-- Ditto !-->
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 excludes="org/expeditee/items/widgets/charts/**"
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>
Note: See TracBrowser for help on using the repository browser.