ANT - Conditional execution of macro within target -
i'm attempting implement believe should pretty basic conditioning not having success. have target (deploy.development) , within target call 2 macros backup/restore ini file using configuration. outline this:
<target name="deploy.development" description="deploy development"> <echo>start: deploy ${mode.dev}</echo> <echo>source: ${dir.source}</echo> <macrobackupsourceconfigfile /> <macroupdateconfigfile keydatasource="${setting.devdsn}" keyserver="${server.devdevweb11}" keyappname="${setting.devappname}" keyapplicationid="${setting.applicationid}"/> <macrocopyfiles dirsource="${dir.source}" dirtarget="${dir.devdevweb11}"/> <macrorestoresourceconfigfile /> <echo>end: deploy ${mode.dev}</echo> </target>
in projects ini file not required, therefore not need run either of 2 macros, macrocopyfiles run. i'd set property @ top of ant file specify whether these macros should executed.
any assistance appreciated.
best regards,
gary
i think need... perform check. if file abc.txt available, abc.present property exist. other target call check-abc , check wether property abc.present exists. if so, execute, else not.
<target name="check-abc"> <available file="abc.txt" property="abc.present"/> </target> <target name="do-if-abc" depends="check-abc" if="abc.present"> ... </target>
Comments
Post a Comment