Subversion Repositories DevTools

Rev

Rev 1974 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
1974 jgill 1
<project name="summarise-manifest-macrodef"
2
		 xmlns:ivy="antlib:fr.jayasoft.ivy.ant">
1972 jgill 3
   <description>
4
	The summarise-manifest macro updates the descpkg file with the build information.
5
	If there are any .jar files in the pkg directory then the updated
6
   </description>
7
 
8
	<macrodef name="summarise-manifest">
9
 
10
		<attribute	name="package" 
11
					default="${packagename}" 
12
					description="The name of the package in release manager and dpkg_archive."/>
13
 
14
		<attribute 	name="version" 
15
					default="${packageversion}"
16
					description="The version of the package in release manager and dpkg_archive."/>
17
 
18
		<attribute name="builder" default="${user.name}"/>
19
 
20
        <attribute name="usemanifestpackageversion" default="${version}"/>
21
 
22
		<element   name="jars"  optional="yes"  implicit="yes" />
23
 
24
		<sequential>
25
 
1974 jgill 26
			<available property="ivy.xml.exists" filepath="${basedir}" file="ivy.xml"/>
1972 jgill 27
			<if>
1974 jgill 28
				<isset property="ivy.xml.exists"/>
1972 jgill 29
				<then>
1974 jgill 30
					<ivy:resolve />
31
					<ivy:artifactproperty 	name="using.[module].version" value="[revision](.[branch])"/>
1972 jgill 32
				</then>
33
			</if>
34
 
35
			<tstamp>
36
				<format property="NOW" pattern="E MMM dd HH:mm:ss z yyyy"/>
37
			</tstamp>
38
 
1974 jgill 39
			<mkdir dir="${basedir}/build/pkg"/>
40
 
1972 jgill 41
			<manifest file="${basedir}/build/pkg/descpkg" mode="update">
42
				<section name="Build Properties">
43
					<attribute name="Package Name"    value="@{package}"/>
1976 jgill 44
					<attribute name="Package Version" value="@{version}"/>
1972 jgill 45
					<attribute name="Built By"        value="@{builder}"/>
46
					<attribute name="Built On"        value="${NOW}"/>
47
				</section>
48
			</manifest>
49
 
50
			<!-- New stuff to simplify using version generation in manifest -->
51
			<propertyselector property="package.version.list"
52
                         delimiter=","
53
                         match="using\.([^\.]*)\.version"
54
                         select="\1"
55
                         casesensitive="true" />
56
 
57
			<for list="${package.version.list}" param="this.package.name">
58
				<sequential>
59
					<propertycopy name="this.package.version" from="using.@{this.package.name}.version" override="true"/>
60
 
61
					<manifest file="${basedir}/build/pkg/descpkg" mode="update">
62
						<section name="Build Dependencies">
63
							<attribute name="@{this.package.name}" value="${this.package.version}"/>
64
						</section>
65
					</manifest>
66
				</sequential>
67
			</for>
68
 
69
			<!-- End of new stuff -->
70
 
71
			<for param="jar.name">
72
			    <path>
73
			    	<jars/>
74
			    </path>
75
			    <sequential>
76
	    			<jar destfile="@{jar.name}" 
77
					     update="true" 
78
						 manifest="${basedir}/build/pkg/descpkg"/>
79
			    </sequential>
80
			</for>
81
 
82
		</sequential>
83
	</macrodef>
84
 
85
</project>