2004-06-18 05:13:45 +00:00
|
|
|
<project name="AppleCommander" default="all" basedir="..">
|
2003-03-16 05:27:04 +00:00
|
|
|
<description>
|
2008-05-24 03:37:01 +00:00
|
|
|
This script builds the distribution components.
|
2003-03-16 05:27:04 +00:00
|
|
|
</description>
|
2017-11-03 16:07:06 +00:00
|
|
|
|
|
|
|
<!-- Fix ant warning (explained: https://stackoverflow.com/questions/5103384) -->
|
|
|
|
<presetdef name="javac">
|
|
|
|
<javac includeantruntime="false" />
|
|
|
|
</presetdef>
|
|
|
|
|
2003-03-16 05:27:04 +00:00
|
|
|
<property name="work" value="work"/>
|
|
|
|
<property name="classes" value="${work}/classes"/>
|
2004-06-18 05:13:45 +00:00
|
|
|
<property name="dist" value="${work}/dist"/>
|
2003-03-16 05:27:04 +00:00
|
|
|
<property name="source" value="src"/>
|
2004-06-18 05:13:45 +00:00
|
|
|
<property name="testsrc" value="test"/>
|
2003-03-16 05:27:04 +00:00
|
|
|
<property name="build" value="build"/>
|
|
|
|
<property name="doc" value="documentation"/>
|
|
|
|
<property name="web" value="web"/>
|
2004-06-18 05:13:45 +00:00
|
|
|
<property name="javadoc" value="${work}/javadoc"/>
|
2008-06-06 16:52:56 +00:00
|
|
|
<property name="builddir" value="${basedir}/build" />
|
|
|
|
<property file="${builddir}/ACBuild.properties"/>
|
|
|
|
<property file="${builddir}/ACBuild-default.properties"/>
|
2017-11-03 16:07:06 +00:00
|
|
|
|
|
|
|
<!-- If you want to add a platform, create a conditional property for it here -->
|
2017-11-03 14:50:28 +00:00
|
|
|
<condition property="isWin" value="true">
|
|
|
|
<os family="windows" />
|
|
|
|
</condition>
|
|
|
|
<condition property="isMac" value="true">
|
|
|
|
<and>
|
|
|
|
<os family="mac" />
|
|
|
|
<os family="unix" />
|
|
|
|
</and>
|
|
|
|
</condition>
|
|
|
|
<condition property="isUnix" value="true">
|
2017-11-03 16:07:06 +00:00
|
|
|
<!-- macOS also provides unix, so we must explicitly exclude it here -->
|
2017-11-03 14:50:28 +00:00
|
|
|
<and>
|
|
|
|
<os family="unix" />
|
|
|
|
<not>
|
|
|
|
<os family="mac" />
|
|
|
|
</not>
|
|
|
|
</and>
|
|
|
|
</condition>
|
2017-11-03 16:07:06 +00:00
|
|
|
|
2008-06-07 12:51:19 +00:00
|
|
|
<condition property="signing-needed">
|
|
|
|
<available file="${keyconf}" property="keyconf-exists" />
|
|
|
|
</condition>
|
2008-05-24 03:37:01 +00:00
|
|
|
|
|
|
|
<target name="version" description="Get version from source.">
|
|
|
|
<property name="main.path" value="src/com/webcodepro/applecommander/ui"/>
|
|
|
|
<loadfile srcfile="${main.path}/AppleCommander.java" property="acVersion">
|
|
|
|
<filterchain>
|
|
|
|
<linecontainsregexp>
|
|
|
|
<regexp pattern='^.*String VERSION = ".*";.*$'/>
|
|
|
|
</linecontainsregexp>
|
|
|
|
<tokenfilter>
|
|
|
|
<replaceregex pattern='^.*String VERSION = "(.*)";.*$' replace='\1'/>
|
|
|
|
</tokenfilter>
|
|
|
|
<striplinebreaks/>
|
|
|
|
</filterchain>
|
|
|
|
</loadfile>
|
|
|
|
<echo>Building version ${acVersion}...</echo>
|
|
|
|
</target>
|
|
|
|
|
2017-11-03 15:13:08 +00:00
|
|
|
<target name="init-win" if="isWin">
|
2017-11-03 16:07:06 +00:00
|
|
|
<property name="antjar" value="${antJarPathWin}" />
|
2017-11-03 15:13:08 +00:00
|
|
|
<property name="swtjar" value="${swtJarPathWin}" />
|
|
|
|
<property name="juintjar" value="${junitPathWin}" />
|
|
|
|
</target>
|
|
|
|
|
|
|
|
<target name="init-mac" if="isMac">
|
2017-11-03 16:07:06 +00:00
|
|
|
<property name="antjar" value="${antJarPathMac}" />
|
2017-11-03 15:13:08 +00:00
|
|
|
<property name="swtjar" value="${swtJarPathMac}" />
|
|
|
|
<property name="juintjar" value="${junitPathMac}" />
|
|
|
|
</target>
|
|
|
|
|
|
|
|
<target name="init-unix" if="isUnix">
|
2017-11-03 16:07:06 +00:00
|
|
|
<property name="antjar" value="${antJarPathUnix}" />
|
2017-11-03 15:13:08 +00:00
|
|
|
<property name="swtjar" value="${swtJarPathUnix}" />
|
|
|
|
<property name="juintjar" value="${junitPathUnix}" />
|
|
|
|
</target>
|
|
|
|
|
|
|
|
<target name="init" depends="version,init-win,init-mac,init-unix"
|
|
|
|
description="Ensure work directory is present">
|
2003-03-16 05:27:04 +00:00
|
|
|
<mkdir dir="${work}"/>
|
|
|
|
<mkdir dir="${classes}"/>
|
2004-06-18 05:13:45 +00:00
|
|
|
<mkdir dir="${dist}"/>
|
|
|
|
<mkdir dir="${javadoc}"/>
|
2004-11-09 03:22:00 +00:00
|
|
|
<property name="guijar" value="${dist}/AppleCommander-${acVersion}.jar"/>
|
2006-04-23 05:04:32 +00:00
|
|
|
<property name="cmdjar" value="${dist}/AppleCommander-${acVersion}-ac.jar"/>
|
2008-05-24 03:37:01 +00:00
|
|
|
<property name="maczip" value="${dist}/AppleCommander-${acVersion}-mac.zip"/>
|
2004-11-09 03:22:00 +00:00
|
|
|
<property name="srczip" value="${dist}/AppleCommander-${acVersion}-src.zip"/>
|
|
|
|
<property name="webzip" value="${dist}/AppleCommander-${acVersion}-web.zip"/>
|
2003-03-16 05:27:04 +00:00
|
|
|
</target>
|
|
|
|
|
|
|
|
<target name="clean" depends="init" description="Wipes out work contents">
|
|
|
|
<delete dir="${classes}"/>
|
2004-06-18 05:13:45 +00:00
|
|
|
<delete dir="${dist}"/>
|
|
|
|
<delete dir="${javadoc}"/>
|
2003-03-16 05:27:04 +00:00
|
|
|
</target>
|
|
|
|
|
2008-06-07 21:17:28 +00:00
|
|
|
<target name="all" depends="init,jars,macBundle,sourceZip,javadoc,websiteZip" description="Everything">
|
2008-05-24 03:37:01 +00:00
|
|
|
<!-- Nothing else to do - depends handles it all. -->
|
|
|
|
</target>
|
|
|
|
|
2008-06-07 21:17:28 +00:00
|
|
|
<target name="jars" depends="init,executableGuiJar,executableCmdJar,signJars" description="Build executable jars">
|
2008-06-07 12:51:19 +00:00
|
|
|
<!-- Nothing else to do - depends handles it all. -->
|
|
|
|
</target>
|
|
|
|
|
|
|
|
<target name="signJars" depends="init" if="signing-needed" description="Signs the jars">
|
2008-06-06 21:41:06 +00:00
|
|
|
<!-- In ACBuild.properties => keyconf=${user.home}/.secret alias=name -->
|
|
|
|
<!-- See man keytool, http://java.sun.com/j2se/1.5.0/docs/tooldocs/ -->
|
|
|
|
<loadfile srcfile="${keyconf}" property="password"/>
|
|
|
|
<signjar alias="${alias}" storepass="${password}">
|
|
|
|
<fileset dir="${basedir}">
|
|
|
|
<include name="${cmdjar}"/>
|
|
|
|
<include name="${guijar}"/>
|
|
|
|
</fileset>
|
|
|
|
</signjar>
|
2004-06-18 05:13:45 +00:00
|
|
|
</target>
|
|
|
|
|
|
|
|
<target name="executableGuiJar" depends="init" description="Build GUI executable JAR">
|
2017-11-03 16:07:06 +00:00
|
|
|
<javac srcdir="${source}" destdir="${classes}" classpath="${antjar}:${swtjar}">
|
2003-03-16 05:27:04 +00:00
|
|
|
<include name="**/*.java"/>
|
|
|
|
<exclude name="**/*Test.java"/>
|
|
|
|
</javac>
|
2004-06-18 05:13:45 +00:00
|
|
|
<jar jarfile="${guijar}" manifest="build/manifest.mf">
|
2003-03-16 05:27:04 +00:00
|
|
|
<fileset dir="${classes}"/>
|
|
|
|
<fileset dir="${source}">
|
|
|
|
<include name="**/*.dump"/>
|
|
|
|
<include name="**/*.properties"/>
|
|
|
|
<include name="**/*.gif"/>
|
|
|
|
</fileset>
|
|
|
|
<fileset dir=".">
|
|
|
|
<include name="LICENSE"/>
|
|
|
|
<include name="TODO"/>
|
|
|
|
<include name="VERSIONS"/>
|
|
|
|
</fileset>
|
|
|
|
</jar>
|
|
|
|
</target>
|
|
|
|
|
2004-06-18 05:13:45 +00:00
|
|
|
<target name="executableCmdJar" depends="init" description="Build command-line only executable JAR">
|
2017-11-03 16:07:06 +00:00
|
|
|
<javac srcdir="${source}" destdir="${classes}" classpath="${antjar}">
|
2004-06-18 05:13:45 +00:00
|
|
|
<include name="**/*.java"/>
|
|
|
|
<exclude name="**/*Test.java"/>
|
2017-06-12 17:22:22 +00:00
|
|
|
<compilerarg value="-XDignore.symbol.file"/>
|
2004-06-18 05:13:45 +00:00
|
|
|
</javac>
|
2008-05-29 12:45:41 +00:00
|
|
|
<jar jarfile="${cmdjar}" manifest="build/ac.mf">
|
2004-06-18 05:13:45 +00:00
|
|
|
<fileset dir="${classes}">
|
|
|
|
<exclude name="com/webcodepro/applecommander/ui/swt/**"/>
|
|
|
|
<exclude name="com/webcodepro/applecommander/ui/images/**"/>
|
|
|
|
</fileset>
|
|
|
|
<fileset dir="${source}">
|
|
|
|
<include name="**/*.dump"/>
|
|
|
|
<include name="**/*.properties"/>
|
|
|
|
</fileset>
|
|
|
|
<fileset dir=".">
|
|
|
|
<include name="LICENSE"/>
|
|
|
|
<include name="TODO"/>
|
|
|
|
<include name="VERSIONS"/>
|
|
|
|
</fileset>
|
|
|
|
</jar>
|
|
|
|
</target>
|
|
|
|
|
2008-05-24 03:37:01 +00:00
|
|
|
<target name="macBundle" depends="init,jars" description="Build Mac application bundle.">
|
|
|
|
<property name="mac.dir" value="mac"/>
|
|
|
|
<property name="mac.app" value="${mac.dir}/AppleCommander.app"/>
|
|
|
|
<property name="mac.Contents" value="${mac.app}/Contents"/>
|
|
|
|
<property name="mac.Java" value="${mac.Contents}/Resources/Java"/>
|
2008-06-07 12:08:20 +00:00
|
|
|
<copy file="${mac.dir}/Info.plist" todir="${mac.Contents}" overwrite="true">
|
|
|
|
<filterset>
|
|
|
|
<filter token="version" value="${acVersion}"/>
|
|
|
|
</filterset>
|
|
|
|
</copy>
|
2008-05-24 03:37:01 +00:00
|
|
|
<copy file="${guijar}" tofile="${mac.Java}/AppleCommander.jar"/>
|
|
|
|
<copy file="${cmdjar}" tofile="${user.home}/bin/ac.jar"/>
|
|
|
|
<zip destfile="${maczip}">
|
|
|
|
<zipfileset dir="${mac.app}" prefix="AppleCommander.app"/>
|
|
|
|
<zipfileset dir="${mac.app}" prefix="AppleCommander.app"
|
|
|
|
includes="Contents/MacOS/JavaApplicationStub" filemode="755"/>
|
|
|
|
</zip>
|
|
|
|
</target>
|
|
|
|
|
2003-03-16 05:27:04 +00:00
|
|
|
<target name="sourceZip" depends="init" description="Build source ZIP archive">
|
2004-06-18 05:13:45 +00:00
|
|
|
<zip zipfile="${srczip}">
|
2003-03-16 05:27:04 +00:00
|
|
|
<zipfileset dir=".">
|
|
|
|
<include name="ECLIPSE-CONFIG"/>
|
|
|
|
<include name="HEADER"/>
|
|
|
|
<include name="LICENSE"/>
|
|
|
|
<include name="NATIVE-COMPILE"/>
|
|
|
|
<include name="TODO"/>
|
|
|
|
<include name="VERSIONS"/>
|
|
|
|
</zipfileset>
|
|
|
|
<zipfileset dir="${source}" prefix="${source}">
|
|
|
|
<include name="**/*.java"/>
|
|
|
|
<include name="**/*.dump"/>
|
|
|
|
<include name="**/*.properties"/>
|
|
|
|
<include name="**/*.gif"/>
|
|
|
|
</zipfileset>
|
2004-06-18 05:13:45 +00:00
|
|
|
<zipfileset dir="${testsrc}" prefix="${testsrc}">
|
|
|
|
<include name="**/*.java"/>
|
|
|
|
<include name="**/*.dump"/>
|
|
|
|
<include name="**/*.properties"/>
|
|
|
|
<include name="**/*.gif"/>
|
|
|
|
</zipfileset>
|
2003-03-16 05:27:04 +00:00
|
|
|
<zipfileset dir="${build}" prefix="${build}"/>
|
|
|
|
<zipfileset dir="${doc}" prefix="${doc}">
|
|
|
|
<include name="**/*.txt"/>
|
|
|
|
</zipfileset>
|
|
|
|
<zipfileset dir="${web}" prefix="${web}">
|
|
|
|
<include name="**/*.html"/>
|
|
|
|
<include name="**/*.gif"/>
|
|
|
|
<include name="**/*.png"/>
|
|
|
|
</zipfileset>
|
|
|
|
</zip>
|
|
|
|
</target>
|
2004-06-18 05:13:45 +00:00
|
|
|
|
|
|
|
<target name="javadoc" depends="init" description="Build javadoc">
|
2004-11-09 03:22:00 +00:00
|
|
|
<javadoc destdir="${javadoc}" author="true" windowtitle="AppleCommander ${acVersion} JavaDoc"
|
2008-12-16 09:33:58 +00:00
|
|
|
classpath="${swtjar};${junitjar}">
|
|
|
|
<fileset dir="${source}">
|
|
|
|
<exclude name="**/*gif"/>
|
|
|
|
<exclude name="**/*dump"/>
|
|
|
|
<exclude name="**/*properties"/>
|
|
|
|
</fileset>
|
|
|
|
<fileset dir="${testsrc}">
|
|
|
|
<exclude name="**/*properties"/>
|
|
|
|
</fileset>
|
2004-06-18 05:13:45 +00:00
|
|
|
</javadoc>
|
|
|
|
</target>
|
|
|
|
|
|
|
|
<target name="websiteZip" depends="javadoc" description="Build website ZIP archive">
|
|
|
|
<zip zipfile="${webzip}">
|
2004-06-19 21:07:46 +00:00
|
|
|
<zipfileset dir="${web}">
|
2004-06-18 05:13:45 +00:00
|
|
|
<include name="**/*.html"/>
|
|
|
|
<include name="**/*.gif"/>
|
|
|
|
<include name="**/*.png"/>
|
|
|
|
</zipfileset>
|
2004-06-19 21:07:46 +00:00
|
|
|
<zipfileset dir="${javadoc}" prefix="javadoc"/>
|
2004-06-18 05:13:45 +00:00
|
|
|
</zip>
|
|
|
|
</target>
|
2017-11-03 14:50:28 +00:00
|
|
|
</project>
|