How to find out the current platform using Ant -
i'm creating installer using ant , i'm facing problem. need create file different extension depending on platform (unix or windows) don't know how current platform ant.
can me? thank in advance, joshua.
is you're attempting in build.xml? <condition> task supports condition os can determine platform install script:
<condition property="is.windows"> <os family="windows"/> </condition> then can split tasks unix , windows:
<target name="deploy" depends="deploy.unix, deploy.windows"> <yadda/> <yadda/> <yadda/> </target> <target name="deploy.unix" unless="is.windows"> <yadda/> <yadda/> <yadda/> </target> <target name="deploy.windows" if="is.windows"> <yadda/> <yadda/> <yadda/> </target> the deploy target call both deploy.unix , deploy.windows. however, deploy.unix target skipped if it's windows system , deploy.windows skipped if it's not windows system.
and, if you're using <exec> task, can specify if you're running windows or unix:
<exec executable="${unix.program}" osfamily="unix"/> <exec executable="${windows.program}" osfamily="windows"/>
Comments
Post a Comment