Rev 1974 | Blame | Compare with Previous | Last modification | View Log | RSS feed
<project><!--= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =macrodef: initivy~~~~~~~~~~~~~~~~~~~~~This macrodef takes an ivy dependency template file, and createsa new ivy.xml file that has all the revisions updated with the versionnumbers from the depends.xml file.= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =--><macrodef name="initivy"><sequential><available property="ivy.xml.exists" filepath="${basedir}" file="${basedir}/ivy-template.xml" /><available property="depends.xml.exists" filepath="${basedir}" file="${basedir}/${ant.project.name}depends.xml" /><available property="auto.xml.exists" filepath="${basedir}" file="${basedir}/auto.xml" /><if><and><isset property="ivy.xml.exists"/><isset property="depends.xml.exists"/></and><then><if><isset property="auto.xml.exists"/><then><property name="dependencies.xml" location="${basedir}/auto.xml"/></then><else><property name="dependencies.xml" location="${basedir}/${ant.project.name}depends.xml"/></else></if><loadproperties srcFile="${dependencies.xml}"><filterchain><tokenfilter><replaceregexpattern='<project.*>'replace=''flags="gi" /><replaceregexpattern='<property\s+name="packagename"\s+value="(.*)"\s*/>'replace=''flags="true" /><replaceregexpattern='<property\s+name="(.*)"\s+value="(.*)"\s*/>'replace='\1.rev=\2${line.separator}\1.branch=\2'flags="gi" /></tokenfilter><expandproperties/><tokenfilter><replaceregexpattern='(.*).rev=(.*?)\.?+[a-zA-Z]*$'replace='\1.rev=\2'flags="gi" /><replaceregexpattern='(.*).branch=.*?([a-zA-Z]*$)'replace='\1.branch=\2'flags="gi" /></tokenfilter></filterchain></loadproperties><loadfile property="ivy-template-file" srcFile="${basedir}/ivy-template.xml"><filterchain><expandproperties /></filterchain></loadfile><echo file="${basedir}/ivy.xml">${ivy-template-file}</echo></then></if></sequential></macrodef></project>