can I use the same ant build file for windows and unix -
i had ant build file windows box , can use same build file deploying on unix ?
take file names , os-dependent items , put them in properties files same keys. use <condition> task load correct properties file:
<target name="init-os"> <condition property="os.windows"> <os family="windows"/> </condition> <condition property="os.unix"> <os family="unix"/> </condition> </target> <target name="init-windows-properties" depends="init-os" if="os.windows"> <property file="windows.properties"/> </target> <target name="init-unix-properties" depends="init-os" if="os.unix"> <property file="unix.properties"/> </target> <target name="init-properties" depends="init-windows-properties, init-unix-properties"/> <target name="init-directories" depends="init-properties"> <mkdir .../> <!-- more directories --> </target> <target name="init" depends="init-properties, init-directories"/> add more "init" target rest of work need do.
Comments
Post a Comment