Make multiplatform easier to read

This isn't significantly shorter than the first pass, but it's easier to
read and maintain.  To add a new platform to this (if anyone wants to do
that), just add sane default paths to ACBuild-default.properties, add a
conditional to detect your platform, and add an init-platform target
that does the configuration.

There's a bit cleaner solution in ant-contrib using the if task, but
that means adding to the dependencies and therefore the complexity of
building this thing.  I'm disinclined to do that.
This commit is contained in:
T. Joseph Carter 2017-11-03 08:13:08 -07:00
parent 117fe87cd9
commit 80b39372cb
1 changed files with 17 additions and 19 deletions

View File

@ -32,24 +32,6 @@
</not>
</and>
</condition>
<condition property="swtjar" value="${swtJarPathWin}">
<isset property="isWin" />
</condition>
<condition property="swtjar" value="${swtJarPathMac}">
<isset property="isMac" />
</condition>
<condition property="swtjar" value="${swtJarPathUnix}">
<isset property="isUnix" />
</condition>
<condition property="juintjar" value="${junitPathWin}">
<isset property="isWin" />
</condition>
<condition property="juintjar" value="${junitPathMac}">
<isset property="isMac" />
</condition>
<condition property="juintjar" value="${junitPathUnix}">
<isset property="isUnix" />
</condition>
<condition property="signing-needed">
<available file="${keyconf}" property="keyconf-exists" />
</condition>
@ -70,7 +52,23 @@
<echo>Building version ${acVersion}...</echo>
</target>
<target name="init" depends="version" description="Ensure work directory is present">
<target name="init-win" if="isWin">
<property name="swtjar" value="${swtJarPathWin}" />
<property name="juintjar" value="${junitPathWin}" />
</target>
<target name="init-mac" if="isMac">
<property name="swtjar" value="${swtJarPathMac}" />
<property name="juintjar" value="${junitPathMac}" />
</target>
<target name="init-unix" if="isUnix">
<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">
<mkdir dir="${work}"/>
<mkdir dir="${classes}"/>
<mkdir dir="${dist}"/>