1 | <?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
---|
2 | <project basedir="." default="build" name="Expeditee">
|
---|
3 |
|
---|
4 | <tstamp>
|
---|
5 | <format property="TODAY_EXP" pattern="yy.MM.dd"/>
|
---|
6 | </tstamp>
|
---|
7 |
|
---|
8 | <property environment="env"/>
|
---|
9 |
|
---|
10 | <property name="dist.dir.exp" location="releases" />
|
---|
11 | <!--
|
---|
12 | <property name="dist.filename.exp" value="Exp.${TODAY_EXP}.jar" />
|
---|
13 | -->
|
---|
14 | <property name="dist.filename.exp" value="Expeditee.jar" />
|
---|
15 | <property name="build.dir.exp" location="bin" />
|
---|
16 | <property name="manifest.path.exp" value="makeFiles/Manifest.txt" />
|
---|
17 | <property name="lib.dir.exp" location="releases/jars" />
|
---|
18 | <property name="inst.dir.exp" location="inst" />
|
---|
19 |
|
---|
20 | <!--
|
---|
21 | If changing this value, make sure you run `ant clean`
|
---|
22 | -->
|
---|
23 | <property name="javac.source" value="1.8" />
|
---|
24 | <property name="javac.target" value="${javac.source}" />
|
---|
25 |
|
---|
26 | <property name="expeditee.server.port" value="3000"/>
|
---|
27 |
|
---|
28 | <!--
|
---|
29 | The following approach turned out to be terribly slow as the number of
|
---|
30 | jar files incluced increase. This is because the 'zipfileset' task functions
|
---|
31 | by using a separate file IO pass for each file extraced. For more details
|
---|
32 | see:
|
---|
33 |
|
---|
34 | https://bz.apache.org/bugzilla/show_bug.cgi?id=43144
|
---|
35 |
|
---|
36 | which also highlights how the unzip task can be used to write a faster alternative,
|
---|
37 | which (imprinted to the same 'exludes' pattern specified here) is used in
|
---|
38 | the 'mergejars' target below
|
---|
39 | -->
|
---|
40 |
|
---|
41 | <union id="reallyslowIO.portable.includes.exp">
|
---|
42 | <zipfileset excludes="META-INF/*.SF" src="releases/jars/junit.jar"/>
|
---|
43 | <zipfileset excludes="META-INF/*.SF" src="releases/jars/activation.jar"/>
|
---|
44 | <zipfileset excludes="META-INF/*.SF" src="releases/jars/cobra.jar"/>
|
---|
45 | <zipfileset excludes="META-INF/*.SF" src="releases/jars/iText-2.1.3.jar"/>
|
---|
46 | <zipfileset excludes="META-INF/*.SF" src="releases/jars/jcommon-1.0.13.jar"/>
|
---|
47 | <zipfileset excludes="META-INF/*.SF" src="releases/jars/JEP.jar"/>
|
---|
48 | <zipfileset excludes="META-INF/*.SF" src="releases/jars/JFreeCharts.jar"/>
|
---|
49 | <zipfileset excludes="META-INF/*.SF" src="releases/jars/js.jar"/>
|
---|
50 | <zipfileset excludes="META-INF/*.SF" src="releases/jars/jython-standalone-2.7.0.jar"/>
|
---|
51 | <zipfileset excludes="META-INF/*.SF" src="releases/jars/lobo.jar"/>
|
---|
52 | <zipfileset excludes="META-INF/*.SF" src="releases/jars/lobo-pub.jar"/>
|
---|
53 | <zipfileset excludes="META-INF/*.SF" src="releases/jars/mail.jar"/>
|
---|
54 | <zipfileset excludes="META-INF/*.SF" src="releases/jars/xercesImpl.jar"/>
|
---|
55 | <zipfileset excludes="META-INF/*.SF" src="releases/jars/jazzy-core.jar"/>
|
---|
56 | <zipfileset excludes="META-INF/*.SF" src="releases/jars/PDFRenderer-0.9.1.jar"/>
|
---|
57 | <zipfileset excludes="META-INF/*.SF" src="releases/jars/json-simple-1.1.1.jar"/>
|
---|
58 | <zipfileset excludes="META-INF/*.SF" src="releases/jars/commons-cli-1.2.jar"/>
|
---|
59 | <zipfileset excludes="META-INF/*.SF" src="releases/jars/jgraphx.jar"/>
|
---|
60 | <zipfileset excludes="META-INF/*.SF" src="releases/jars/svgSalamander.jar"/>
|
---|
61 | <zipfileset excludes="META-INF/*.SF" src="releases/jars/jl1.0.1.jar"/>
|
---|
62 | <zipfileset excludes="META-INF/*.SF" src="releases/jars/tritonus_share.jar"/>
|
---|
63 | <zipfileset excludes="META-INF/*.SF" src="releases/jars/mp3spi1.9.5.jar"/>
|
---|
64 | </union>
|
---|
65 |
|
---|
66 | <path id="classpath.exp">
|
---|
67 | <fileset dir="${lib.dir.exp}">
|
---|
68 | <include name="*.jar" />
|
---|
69 | <include name="ext/*.jar" />
|
---|
70 | </fileset>
|
---|
71 | </path>
|
---|
72 |
|
---|
73 | <path id="classpath.jfx">
|
---|
74 | <!-- Check this points to an existing file, if you can't find the jar just compile with build-nojfx -->
|
---|
75 | <pathelement location="${java.home}/lib/jfxrt.jar"/>
|
---|
76 | </path>
|
---|
77 |
|
---|
78 |
|
---|
79 | <path id="portable.includes.exp">
|
---|
80 | <fileset dir="${dist.dir.exp}/unjarred">
|
---|
81 | </fileset>
|
---|
82 | </path>
|
---|
83 |
|
---|
84 | <target name="clean">
|
---|
85 | <!-- delete only the class files built by expeditee -->
|
---|
86 | <delete dir="${build.dir.exp}/org"/>
|
---|
87 | <delete dir="${inst.dir.exp}" />
|
---|
88 | </target>
|
---|
89 | <target depends="clean" name="cleanall"/>
|
---|
90 |
|
---|
91 | <target name="init">
|
---|
92 | <echo message="${ant.project.name}: ${ant.file}"/>
|
---|
93 | <mkdir dir="${build.dir.exp}"/>
|
---|
94 | <copy includeemptydirs="false" todir="${build.dir.exp}">
|
---|
95 | <fileset dir="src">
|
---|
96 | <exclude name="**/*.java"/>
|
---|
97 | </fileset>
|
---|
98 | </copy>
|
---|
99 | <copy includeemptydirs="false" todir="${build.dir.exp}">
|
---|
100 | <fileset dir="tests">
|
---|
101 | <exclude name="**/*.java"/>
|
---|
102 | </fileset>
|
---|
103 | </copy>
|
---|
104 | </target>
|
---|
105 |
|
---|
106 | <target depends="init" name="build">
|
---|
107 | <javac encoding="UTF-8"
|
---|
108 | source="${javac.source}" target="${javac.target}" debug="true"
|
---|
109 | destdir="${build.dir.exp}" includeantruntime="false">
|
---|
110 |
|
---|
111 | <src path="src"/>
|
---|
112 | <src path="tests"/>
|
---|
113 |
|
---|
114 | <exclude name="org/expeditee/items/widgets/WebBrowser.java"/>
|
---|
115 |
|
---|
116 | <!-- After refactoring for JavaFX, the following files no longer compile -->
|
---|
117 | <!-- Check with Corey, and if no longer needed, they should be removed -->
|
---|
118 | <exclude name="org/expeditee/gui/FrameKeyboardActions.java" />
|
---|
119 | <exclude name="org/expeditee/gui/FrameMouseActions.java" />
|
---|
120 | <exclude name="org/apollo/AudioFrameKeyboardActions.java" />
|
---|
121 | <exclude name="org/apollo/AudioFrameMouseActions.java" />
|
---|
122 | <exclude name="org/expeditee/importer/FrameDNDTransferHandler.java" />
|
---|
123 | <exclude name="org/apollo/util/PopupReaper.java" />
|
---|
124 |
|
---|
125 | <!-- After refactoring for JavaFX, the following test files no longer compile -->
|
---|
126 | <exclude name="org/expeditee/gui/FrameKeyboardsActionsTest.java" />
|
---|
127 | <exclude name="org/expeditee/gui/FrameMouseActionsTest.java" />
|
---|
128 | <exclude name="org/expeditee/gui/FrameTest.java" />
|
---|
129 | <exclude name="org/expeditee/gui/DisplayIOTest.java" />
|
---|
130 | <exclude name="org/expeditee/gui/FreeItemsTest.java" />
|
---|
131 | <exclude name="org/expeditee/io/ConversionTest.java" />
|
---|
132 | <exclude name="org/expeditee/items/LineTest.java" />
|
---|
133 | <exclude name="org/expeditee/items/widgets/InteractiveWidgetTest.java" />
|
---|
134 |
|
---|
135 | <classpath>
|
---|
136 | <path refid="classpath.exp"/>
|
---|
137 |
|
---|
138 | <!-- jfxrt.jar path -->
|
---|
139 | <path refid="classpath.jfx"/>
|
---|
140 | </classpath>
|
---|
141 | </javac>
|
---|
142 | </target>
|
---|
143 |
|
---|
144 | <target depends="init" name="build-nojfx">
|
---|
145 | <javac encoding="UTF-8"
|
---|
146 | source="${javac.source}" target="${javac.target}" debug="false"
|
---|
147 | destdir="${build.dir.exp}" includeantruntime="false">
|
---|
148 |
|
---|
149 | <src path="tests"/>
|
---|
150 | <src path="src"/>
|
---|
151 | <exclude name="org/expeditee/items/widgets/WebBrowser.java"/>
|
---|
152 |
|
---|
153 | <!-- Files that rely on JavaFX. Use build to build with them included -->
|
---|
154 | <exclude name="org/expeditee/items/widgets/JfxBrowser.java"/>
|
---|
155 | <exclude name="org/expeditee/io/WebParser.java"/>
|
---|
156 | <exclude name="org/expeditee/items/widgets/JfxMedia.java"/>
|
---|
157 | <exclude name="org/expeditee/actions/JfxBrowserActions.java"/>
|
---|
158 |
|
---|
159 | <classpath refid="classpath.exp"/>
|
---|
160 | </javac>
|
---|
161 | </target>
|
---|
162 |
|
---|
163 |
|
---|
164 |
|
---|
165 | <target depends="build" name="jar-cwd"> <!-- version to run if current working directory (cwd) same as jar -->
|
---|
166 | <jar destfile="${dist.dir.exp}/${dist.filename.exp}" manifest="${manifest.path.exp}">
|
---|
167 | <manifest>
|
---|
168 | <attribute name="Main-Class" value="org.apollo.ApolloSystem"/>
|
---|
169 | <attribute name="Class-Path" value="."/>
|
---|
170 | </manifest>
|
---|
171 | <fileset dir="${build.dir.exp}">
|
---|
172 | <exclude name="src/**"/>
|
---|
173 | </fileset>
|
---|
174 | </jar>
|
---|
175 | </target>
|
---|
176 | <target depends="build" name="reallyslowIO.jar"> <!-- self-contained, portable jar -->
|
---|
177 | <jar destfile="${dist.dir.exp}/${dist.filename.exp}" filesetmanifest="mergewithoutmain">
|
---|
178 | <manifest>
|
---|
179 | <attribute name="Main-Class" value="org.apollo.ApolloSystem"/>
|
---|
180 | <attribute name="Class-Path" value="."/>
|
---|
181 | </manifest>
|
---|
182 | <fileset dir="${build.dir.exp}">
|
---|
183 | <exclude name="src/**"/>
|
---|
184 | </fileset>
|
---|
185 | <resources refid="reallyslowIO.portable.includes.exp" />
|
---|
186 | </jar>
|
---|
187 | </target>
|
---|
188 |
|
---|
189 |
|
---|
190 | <target name="mergejars">
|
---|
191 | <unzip dest="${dist.dir.exp}/unjarred">
|
---|
192 | <patternset>
|
---|
193 | <exclude name="META-INF/*.SF"/>
|
---|
194 | </patternset>
|
---|
195 | <!-- fileset to include ... -->
|
---|
196 | <path refid="classpath.exp"/>
|
---|
197 | </unzip>
|
---|
198 | </target>
|
---|
199 |
|
---|
200 |
|
---|
201 | <target depends="build,mergejars" name="jar"> <!-- self-contained, portable jar -->
|
---|
202 | <jar destfile="${dist.dir.exp}/${dist.filename.exp}" filesetmanifest="mergewithoutmain">
|
---|
203 | <manifest>
|
---|
204 | <attribute name="Main-Class" value="org.apollo.ApolloSystem"/>
|
---|
205 | <attribute name="Class-Path" value="."/>
|
---|
206 | </manifest>
|
---|
207 | <fileset dir="${build.dir.exp}">
|
---|
208 | <exclude name="src/**"/>
|
---|
209 | </fileset>
|
---|
210 | <resources refid="portable.includes.exp" />
|
---|
211 | </jar>
|
---|
212 | <delete dir="${dist.dir.exp}/unjarred" quiet="true"/>
|
---|
213 | </target>
|
---|
214 |
|
---|
215 |
|
---|
216 | <target depends="jar" name="inst">
|
---|
217 | <mkdir dir="${inst.dir.exp}" />
|
---|
218 | <mkdir dir="${inst.dir.exp}/jars" />
|
---|
219 | <copy file="${dist.dir.exp}/${dist.filename.exp}" tofile="${inst.dir.exp}/${dist.filename.exp}" />
|
---|
220 | <copy todir="${inst.dir.exp}/jars">
|
---|
221 | <path refid="classpath.exp" />
|
---|
222 | </copy>
|
---|
223 | </target>
|
---|
224 |
|
---|
225 | <target name="run">
|
---|
226 | <java classname="org.apollo.ApolloSystem" failonerror="true" fork="yes">
|
---|
227 | <classpath>
|
---|
228 | <path refid="classpath.exp"/>
|
---|
229 |
|
---|
230 | <!-- jfxrt.jar path -->
|
---|
231 | <path refid="classpath.jfx"/>
|
---|
232 |
|
---|
233 | <pathelement location="${build.dir.exp}"/>
|
---|
234 | </classpath>
|
---|
235 | </java>
|
---|
236 | </target>
|
---|
237 |
|
---|
238 | <target name="run-fresh">
|
---|
239 | <java classname="org.apollo.ApolloSystem" failonerror="true" fork="yes">
|
---|
240 | <classpath refid="classpath.exp"/>
|
---|
241 | <classpath>
|
---|
242 | <pathelement location="${build.dir.exp}"/>
|
---|
243 | </classpath>
|
---|
244 | <jvmarg value="-Dexpeditee.home=${user.dir}/expeditee-fresh"/>
|
---|
245 | </java>
|
---|
246 | </target>
|
---|
247 |
|
---|
248 | <target name="run-fresh-login">
|
---|
249 | <java classname="org.apollo.ApolloSystem" failonerror="true" fork="yes">
|
---|
250 | <classpath refid="classpath.exp"/>
|
---|
251 | <classpath>
|
---|
252 | <pathelement location="${build.dir.exp}"/>
|
---|
253 | </classpath>
|
---|
254 | <jvmarg value="-Dexpeditee.home=${user.dir}/expeditee-fresh"/>
|
---|
255 | <jvmarg value="-Dauth=true"/>
|
---|
256 | </java>
|
---|
257 | </target>
|
---|
258 |
|
---|
259 |
|
---|
260 |
|
---|
261 |
|
---|
262 | <target name="run-server">
|
---|
263 | <echo>Launching Command-line Expeditee Server on port ${expeditee.server.port}</echo>
|
---|
264 | <java classname="org.expeditee.network.FrameShare" failonerror="true" fork="yes">
|
---|
265 | <classpath refid="classpath.exp"/>
|
---|
266 | <classpath>
|
---|
267 | <pathelement location="${build.dir.exp}"/>
|
---|
268 | </classpath>
|
---|
269 | <jvmarg value="-Dexpeditee.home=${user.dir}/expeditee-home"/>
|
---|
270 | <arg value="${expeditee.server.port}"/>
|
---|
271 | </java>
|
---|
272 | </target>
|
---|
273 | </project>
|
---|