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.6" -->
|
---|
21 | <property name="sourcelevel" value="1.6" />
|
---|
22 | <property name="targetlevel" value="1.6" />
|
---|
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 | <property name="manifest.path.apollo-applet" value="makeFiles/apollo_applet_manifest.mf" />
|
---|
43 |
|
---|
44 | <path id="classpath.exp">
|
---|
45 | <!-- link with all jar files we can find in our defined lib directory -->
|
---|
46 | <fileset dir="${lib.dir.exp}">
|
---|
47 | <include name="*.jar" />
|
---|
48 | </fileset>
|
---|
49 | </path>
|
---|
50 |
|
---|
51 | <path id="classpath.apollo">
|
---|
52 | <!-- link with all jar files we can find in our defined lib directory -->
|
---|
53 | <fileset dir="${lib.dir.exp}">
|
---|
54 | <include name="*.jar" />
|
---|
55 | <exclude name="jnmp2p.jar"/> <!-- This is a zero-sized file! Its totally invalid and will fail any builds - omitting !-->
|
---|
56 | <exclude name="jxta.jar"/> <!-- Ditto !-->
|
---|
57 | </fileset>
|
---|
58 | <fileset dir="${lib.dir.apollo}">
|
---|
59 | <include name="*.jar" />
|
---|
60 | </fileset>
|
---|
61 | </path>
|
---|
62 |
|
---|
63 |
|
---|
64 | <!-- TARGETS -->
|
---|
65 | <target name="clean" description="Deletes contents of build directory.">
|
---|
66 | <delete dir="${build.dir}" />
|
---|
67 | <mkdir dir="${build.dir}" />
|
---|
68 | </target>
|
---|
69 |
|
---|
70 |
|
---|
71 | <!-- Set up directories that are needed for building." -->
|
---|
72 | <target name="init_expeditee">
|
---|
73 | <mkdir dir="${build.dir}" />
|
---|
74 | <mkdir dir="${lib.dir.exp}" />
|
---|
75 | </target>
|
---|
76 |
|
---|
77 | <target name="init_apollo" depends="init_expeditee">
|
---|
78 | <mkdir dir="${lib.dir.apollo}" />
|
---|
79 | </target>
|
---|
80 |
|
---|
81 |
|
---|
82 | <!-- Do the actual compilation." -->
|
---|
83 | <target name="compile_exp" depends="init_expeditee">
|
---|
84 | <javac srcdir="${src.dir.exp}"
|
---|
85 | destdir="${build.dir}"
|
---|
86 | debug="true"
|
---|
87 | optimize="on"
|
---|
88 | source="${sourcelevel}"
|
---|
89 | target="${targetlevel}"
|
---|
90 | compiler="modern"
|
---|
91 |
|
---|
92 | listfiles="true">
|
---|
93 | <classpath refid="classpath.exp" />
|
---|
94 | <compilerarg value="-Xlint:unchecked"/>
|
---|
95 | </javac>
|
---|
96 | </target>
|
---|
97 |
|
---|
98 | <target name="compile_apollo" depends="init_apollo, compile_exp">
|
---|
99 | <javac srcdir="${src.dir.apollo}"
|
---|
100 | destdir="${build.dir}"
|
---|
101 | debug="true"
|
---|
102 | optimize="on"
|
---|
103 | source="${sourcelevel}"
|
---|
104 | target="${targetlevel}"
|
---|
105 | compiler="modern"
|
---|
106 | listfiles="true">
|
---|
107 | <classpath refid="classpath.apollo" />
|
---|
108 | <compilerarg value="-Xlint:unchecked"/>
|
---|
109 | </javac>
|
---|
110 | </target>
|
---|
111 |
|
---|
112 |
|
---|
113 | <!-- Jaring up the projects." -->
|
---|
114 | <target name="lazy_dist_exp" depends="compile_exp" description="Warning: Does not clean before compile.">
|
---|
115 | <jar destfile="${dist.dir.exp}/${dist.filename.exp}" manifest="${manifest.path.exp}">
|
---|
116 | <fileset dir="${build.dir}"/>
|
---|
117 | </jar>
|
---|
118 |
|
---|
119 | <!-- Now, with the most generic name possible, make a jar that is always the latest -->
|
---|
120 | <copy file="${dist.dir.exp}/${dist.filename.exp}" toFile="${dist.dir.exp}/Expeditee.jar"/>
|
---|
121 | </target>
|
---|
122 |
|
---|
123 | <target name="fresh_dist_exp" depends="clean, lazy_dist_exp"/>
|
---|
124 |
|
---|
125 | <target name="lazy_dist_apollo" depends="compile_apollo" description="Warning: Does not clean before compile.">
|
---|
126 |
|
---|
127 | <!-- Now, with the most generic name possible, make a jar that is always the latest -->
|
---|
128 | <jar destfile="${dist.dir.apollo}/${dist.filename.apollo}" manifest="${manifest.path.apollo}">
|
---|
129 | <fileset dir="${build.dir}"/>
|
---|
130 | <fileset dir="${resources.dir.apollo}"/>
|
---|
131 | <fileset dir="releases" includes="jars/*,jars/*/*"/>
|
---|
132 | <fileset dir="." includes="jars_apollo/*"/>
|
---|
133 | </jar>
|
---|
134 |
|
---|
135 | <!-- Now, with the most generic name possible, make a jar that is always the latest -->
|
---|
136 | <copy file="${dist.dir.apollo}/${dist.filename.apollo}" toFile="${dist.dir.apollo}/Apollo.jar"/>
|
---|
137 | </target>
|
---|
138 |
|
---|
139 | <target name="lazy_dist_apollo_applet" depends="compile_apollo">
|
---|
140 |
|
---|
141 | <jar destfile="${dist.dir.apollo}/ApolloApplet.jar" manifest="${manifest.path.apollo-applet}">
|
---|
142 | <fileset dir="${build.dir}"/>
|
---|
143 | <fileset dir="${resources.dir.apollo}"/>
|
---|
144 | <fileset dir="unjarred-for-expeditee-applet" includes="*/"/>
|
---|
145 | <fileset dir="unjarred-for-apollo-applet" includes="*/"/>
|
---|
146 | </jar>
|
---|
147 |
|
---|
148 | <exec executable="./MAKE-APOLLO-SIGNED-JAR.sh" osfamily="unix" />
|
---|
149 | <exec executable="MAKE-APOLLO-SIGNED-JAR.bat" osfamily="windows"/>
|
---|
150 | </target>
|
---|
151 |
|
---|
152 | <target name="sign-test">
|
---|
153 | <exec executable="dev/bin/script/MAKE-APOLLO-SIGNED-JAR.sh" osfamily="unix" />
|
---|
154 | <exec executable="dev/bin/script/MAKE-APOLLO-SIGNED-JAR.bat" osfamily="windows"/>
|
---|
155 | </target>
|
---|
156 |
|
---|
157 | <target name="fresh_dist_apollo" depends="clean, lazy_dist_apollo, lazy_dist_apollo_applet"/>
|
---|
158 |
|
---|
159 | </project>
|
---|