Subversion Repositories DevTools

Rev

Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
1974 jgill 1
<project>
2
 
3
    	<!--
4
	    = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
5
		macrodef: initivy
6
		~~~~~~~~~~~~~~~~~~~~~
7
		This macrodef takes an ivy dependency template file, and creates 
8
		a new ivy.xml file that has all the revisions updated with the version 
9
		numbers from the depends.xml file.         
10
		= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
11
	  -->
12
	<macrodef name="initivy">
13
		<sequential>
14
			<available property="ivy.xml.exists" filepath="${basedir}" file="${basedir}/ivy-template.xml" />
15
			<available property="depends.xml.exists" filepath="${basedir}" file="${basedir}/${ant.project.name}depends.xml" />
16
			<available property="auto.xml.exists" filepath="${basedir}" file="${basedir}/auto.xml" />
17
			<if>
18
				<and>
19
					<isset property="ivy.xml.exists"/>
20
					<isset property="depends.xml.exists"/>
21
				</and>
22
				<then>
23
					<if>
24
						<isset property="auto.xml.exists"/>
25
						<then>
26
							<property name="dependencies.xml" location="${basedir}/auto.xml"/>
27
						</then>
28
						<else>
29
							<property name="dependencies.xml" location="${basedir}/${ant.project.name}depends.xml"/>
30
						</else>
31
					</if>
32
 
33
					<loadproperties srcFile="${dependencies.xml}">
34
						<filterchain>
35
							<tokenfilter>
36
								<replaceregex 
37
									pattern='&lt;project.*&gt;'
38
				                    replace=''
39
				                    flags="gi" />
40
				                <replaceregex 
41
				                    pattern='&lt;property name="packagename" value="(.*)" /&gt;'
42
		                            replace=''
43
		                            flags="true" />
44
                           		<replaceregex 
45
		                           pattern='&lt;property name="(.*)" value="(.*)" /&gt;'
46
		                           replace='\1.rev=\2${line.separator}\1.branch=\2'
47
		                           flags="gi" />
48
							</tokenfilter>
49
							<expandproperties/>
50
							<tokenfilter>
51
		                        <replaceregex 
52
                           			pattern='(.*).rev=(.*?)\.?+[a-zA-Z]*$'
53
                           			replace='\1.rev=\2'
54
                           			flags="gi" />
55
                           		<replaceregex 
56
                           			pattern='(.*).branch=.*?([a-zA-Z]*$)'
57
                           			replace='\1.branch=\2'
58
                           			flags="gi" />
59
							</tokenfilter>
60
						</filterchain>
61
					</loadproperties>
62
 
63
					<loadfile property="ivy-template-file" srcFile="${basedir}/ivy-template.xml">
64
						<filterchain>
65
							<expandproperties />
66
						</filterchain>
67
					</loadfile>
68
					<echo file="${basedir}/ivy.xml">${ivy-template-file}</echo>
69
				</then>
70
			</if>
71
		</sequential>
72
	</macrodef>
73
 
74
</project>