[507] | 1 | <?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
---|
| 2 | <project basedir="." default="build" name="Expeditee">
|
---|
[216] | 3 |
|
---|
[507] | 4 | <tstamp>
|
---|
| 5 | <format property="TODAY_EXP" pattern="yy.MM.dd"/>
|
---|
| 6 | </tstamp>
|
---|
[216] | 7 |
|
---|
[507] | 8 | <property environment="env"/>
|
---|
[216] | 9 |
|
---|
[507] | 10 | <property name="dist.dir.exp" location="releases" />
|
---|
[510] | 11 | <!--
|
---|
| 12 | <property name="dist.filename.exp" value="Exp.${TODAY_EXP}.jar" />
|
---|
| 13 | -->
|
---|
[647] | 14 | <property name="dist.filename.exp" value="Expeditee.jar" />
|
---|
| 15 | <property name="build.dir.exp" location="bin" />
|
---|
[527] | 16 | <property name="manifest.path.exp" value="makeFiles/Manifest.txt" />
|
---|
[647] | 17 | <property name="lib.dir.exp" location="releases/jars" />
|
---|
[528] | 18 | <property name="inst.dir.exp" location="inst" />
|
---|
[216] | 19 |
|
---|
[651] | 20 | <!--
|
---|
| 21 | If changing this value, make sure you run `ant clean`
|
---|
| 22 | -->
|
---|
[995] | 23 | <property name="javac.source" value="1.8" />
|
---|
[647] | 24 | <property name="javac.target" value="${javac.source}" />
|
---|
[872] | 25 |
|
---|
[647] | 26 | <property name="expeditee.server.port" value="3000"/>
|
---|
| 27 |
|
---|
[1542] | 28 | <!--
|
---|
| 29 | The following approach turned out to be terribly slow as the number of
|
---|
[1572] | 30 | jar files included increase. This is because the 'zipfileset' task functions
|
---|
[1542] | 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,
|
---|
[1572] | 37 | which (imprinted to the same 'excludes' pattern specified here) is used in
|
---|
[1542] | 38 | the 'mergejars' target below
|
---|
| 39 | -->
|
---|
| 40 |
|
---|
| 41 | <union id="reallyslowIO.portable.includes.exp">
|
---|
[507] | 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"/>
|
---|
[1078] | 50 | <zipfileset excludes="META-INF/*.SF" src="releases/jars/jython-standalone-2.7.0.jar"/>
|
---|
[507] | 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"/>
|
---|
[858] | 57 | <zipfileset excludes="META-INF/*.SF" src="releases/jars/json-simple-1.1.1.jar"/>
|
---|
[995] | 58 | <zipfileset excludes="META-INF/*.SF" src="releases/jars/commons-cli-1.2.jar"/>
|
---|
[872] | 59 | <zipfileset excludes="META-INF/*.SF" src="releases/jars/jgraphx.jar"/>
|
---|
[995] | 60 | <zipfileset excludes="META-INF/*.SF" src="releases/jars/svgSalamander.jar"/>
|
---|
[1014] | 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"/>
|
---|
[507] | 64 | </union>
|
---|
[216] | 65 |
|
---|
[527] | 66 | <path id="classpath.exp">
|
---|
| 67 | <fileset dir="${lib.dir.exp}">
|
---|
| 68 | <include name="*.jar" />
|
---|
[531] | 69 | <include name="ext/*.jar" />
|
---|
[527] | 70 | </fileset>
|
---|
[216] | 71 | </path>
|
---|
[1542] | 72 |
|
---|
[748] | 73 | <path id="classpath.jfx">
|
---|
[1542] | 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"/>
|
---|
[748] | 76 | </path>
|
---|
[216] | 77 |
|
---|
[1542] | 78 |
|
---|
| 79 | <path id="portable.includes.exp">
|
---|
| 80 | <fileset dir="${dist.dir.exp}/unjarred">
|
---|
| 81 | </fileset>
|
---|
| 82 | </path>
|
---|
| 83 |
|
---|
[507] | 84 | <target name="clean">
|
---|
| 85 | <!-- delete only the class files built by expeditee -->
|
---|
| 86 | <delete dir="${build.dir.exp}/org"/>
|
---|
[528] | 87 | <delete dir="${inst.dir.exp}" />
|
---|
[216] | 88 | </target>
|
---|
[507] | 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>
|
---|
[216] | 104 | </target>
|
---|
[748] | 105 |
|
---|
[507] | 106 | <target depends="init" name="build">
|
---|
[1535] | 107 | <javac encoding="UTF-8"
|
---|
| 108 | source="${javac.source}" target="${javac.target}" debug="true"
|
---|
[647] | 109 | destdir="${build.dir.exp}" includeantruntime="false">
|
---|
[748] | 110 |
|
---|
[507] | 111 | <src path="src"/>
|
---|
| 112 | <src path="tests"/>
|
---|
[748] | 113 |
|
---|
[507] | 114 | <exclude name="org/expeditee/items/widgets/WebBrowser.java"/>
|
---|
[1115] | 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 |
|
---|
[748] | 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">
|
---|
[1535] | 145 | <javac encoding="UTF-8"
|
---|
| 146 | source="${javac.source}" target="${javac.target}" debug="false"
|
---|
[748] | 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"/>
|
---|
[925] | 156 | <exclude name="org/expeditee/items/widgets/JfxMedia.java"/>
|
---|
[748] | 157 | <exclude name="org/expeditee/actions/JfxBrowserActions.java"/>
|
---|
| 158 |
|
---|
[527] | 159 | <classpath refid="classpath.exp"/>
|
---|
[216] | 160 | </javac>
|
---|
| 161 | </target>
|
---|
[748] | 162 |
|
---|
| 163 |
|
---|
| 164 |
|
---|
[1004] | 165 | <target depends="build" name="jar-cwd"> <!-- version to run if current working directory (cwd) same as jar -->
|
---|
[527] | 166 | <jar destfile="${dist.dir.exp}/${dist.filename.exp}" manifest="${manifest.path.exp}">
|
---|
| 167 | <manifest>
|
---|
[1067] | 168 | <attribute name="Main-Class" value="org.apollo.ApolloSystem"/>
|
---|
[527] | 169 | <attribute name="Class-Path" value="."/>
|
---|
| 170 | </manifest>
|
---|
| 171 | <fileset dir="${build.dir.exp}">
|
---|
| 172 | <exclude name="src/**"/>
|
---|
| 173 | </fileset>
|
---|
| 174 | </jar>
|
---|
| 175 | </target>
|
---|
[1542] | 176 | <target depends="build" name="reallyslowIO.jar"> <!-- self-contained, portable jar -->
|
---|
[507] | 177 | <jar destfile="${dist.dir.exp}/${dist.filename.exp}" filesetmanifest="mergewithoutmain">
|
---|
| 178 | <manifest>
|
---|
[1067] | 179 | <attribute name="Main-Class" value="org.apollo.ApolloSystem"/>
|
---|
[507] | 180 | <attribute name="Class-Path" value="."/>
|
---|
| 181 | </manifest>
|
---|
| 182 | <fileset dir="${build.dir.exp}">
|
---|
| 183 | <exclude name="src/**"/>
|
---|
| 184 | </fileset>
|
---|
[1542] | 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>
|
---|
[527] | 210 | <resources refid="portable.includes.exp" />
|
---|
[507] | 211 | </jar>
|
---|
[1542] | 212 | <delete dir="${dist.dir.exp}/unjarred" quiet="true"/>
|
---|
[216] | 213 | </target>
|
---|
[1542] | 214 |
|
---|
| 215 |
|
---|
[528] | 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">
|
---|
[531] | 221 | <path refid="classpath.exp" />
|
---|
[528] | 222 | </copy>
|
---|
| 223 | </target>
|
---|
| 224 |
|
---|
[507] | 225 | <target name="run">
|
---|
[1067] | 226 | <java classname="org.apollo.ApolloSystem" failonerror="true" fork="yes">
|
---|
[510] | 227 | <classpath>
|
---|
[748] | 228 | <path refid="classpath.exp"/>
|
---|
| 229 |
|
---|
| 230 | <!-- jfxrt.jar path -->
|
---|
| 231 | <path refid="classpath.jfx"/>
|
---|
| 232 |
|
---|
[507] | 233 | <pathelement location="${build.dir.exp}"/>
|
---|
| 234 | </classpath>
|
---|
| 235 | </java>
|
---|
[216] | 236 | </target>
|
---|
[498] | 237 |
|
---|
[995] | 238 | <target name="run-fresh">
|
---|
[1067] | 239 | <java classname="org.apollo.ApolloSystem" failonerror="true" fork="yes">
|
---|
[995] | 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>
|
---|
[647] | 247 |
|
---|
[1265] | 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>
|
---|
[995] | 258 |
|
---|
| 259 |
|
---|
| 260 |
|
---|
[1265] | 261 |
|
---|
[647] | 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>
|
---|
[498] | 273 | </project>
|
---|