Subversion Repositories DevTools

Rev

Details | Last modification | View Log | RSS feed

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