I know there is ant-contribone that provides if-else logic for ant. But I need to achieve the same without ant-contrib . Is it possible?
ant-contrib
The pseudocode I need to work is:
if(property-"myProp"-is-true){ do-this; }else{ do-that; }
Thank!
I would highly recommend using ant -contribs anyway, but if you are testing a property that always matters, I would consider using the ant macro as part of the name of the new property, which you then checked for
<macrodef name="create-myprop-value"> <attribute name="prop"/> <sequential> <!-- should create a property called optional.myprop.true or --> <!-- optional.myprop.false --> <property name="optional.myprop.@{prop}" value="set" /> </sequential> </macrodef> <target name="load-props"> <create-myprop-value prop="${optional.myprop}" /> </target> <target name="when-myprop-true" if="optional.myprop.true" depends="load-props"> ... </target> <target name="when-myprop-false" if="optional.myprop.false" depends="load-props"> ... </target> <target name="do-if-else" depends="when-myprop-true,when-myprop-false"> ... </target>
"".
<target name="do-this-when-myProp-is-true" if="myProp"> ... </target>
"myProp". myProp , , , , . , :
<target name="do-this-when-myProp-is-false" unless="myProp"> ... </target>
Source: https://habr.com/ru/post/1753625/More articles:Grails: How to run several applications in development? - tomcatHow to implement a convex optimization package? - convex-optimizationWCF Native Binding - Content Type Not Supported by Service - .netAre jQuery UI language files hosted on Google CDN? - jquery-uiDownload .wav file from asp.net in Internet Explorer - httpImport profile data into a common analysis and visualization tool - performanceCan you determine if email attachments are only from the email header - mime-typesAndroid - service with application life cycle - androidHow to make my site compatible with PCI - pci-dsshttps://translate.googleusercontent.com/translate_c?depth=1&pto=aue&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1753630/how-can-i-get-the-changes-from-a-master-repository-in-mercurial-for-a-project-hosted-on-google-code&usg=ALkJrhh__YusNU7qi8BciO27jmKByVnCfwAll Articles