Subversion Repositories DevTools

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
1877 phayes 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
 
19
        <attribute name="usemanifestpackageversion" default="${version}"/>
20
 
21
		<element   name="jars"  optional="yes"  implicit="yes" />
22
 
23
		<sequential>
24
 
25
			<!-- If version is UNOFFICIAL & jants.build.version is set, then use
26
			     jants.build.version, otherwise use version.
27
			  -->
28
			<if>
29
			    <and>
30
			        <equals arg1="@{version}" arg2="UNOFFICIAL"/>
31
			        <not><equals arg1="${jants.build.version}" arg2="$${jants.build.version}"/></not>
32
			    </and>
33
				<then>
34
				    <var name="ant.project.version" value="${jants.build.version}"/>
35
				</then>
36
				<else>
37
					<var name="ant.project.version" value="@{version}"/>
38
				</else>
39
			</if>
40
 
41
			<tstamp>
42
				<format property="NOW" pattern="E MMM dd HH:mm:ss z yyyy"/>
43
			</tstamp>
44
 
45
			<manifest file="${basedir}/build/pkg/descpkg" mode="update">
46
				<section name="Build Properties">
47
					<attribute name="Package Name"    value="@{package}"/>
48
					<attribute name="Package Version" value="${ant.project.version}"/>
49
					<attribute name="Built By"        value="@{builder}"/>
50
					<attribute name="Built On"        value="${NOW}"/>
51
				</section>
52
			</manifest>
53
 
54
			<!-- New stuff to simplify using version generation in manifest -->
55
			<propertyselector property="package.version.list"
56
                         delimiter=","
57
                         match="using\.([^\.]*)\.version"
58
                         select="\1"
59
                         casesensitive="true" />
60
 
61
			<for list="${package.version.list}" param="this.package.name">
62
				<sequential>
63
					<propertycopy name="this.package.version" from="using.@{this.package.name}.version" override="true"/>
64
 
65
					<manifest file="${basedir}/build/pkg/descpkg" mode="update">
66
						<section name="Build Dependencies">
67
							<attribute name="@{this.package.name}" value="${this.package.version}"/>
68
						</section>
69
					</manifest>
70
				</sequential>
71
			</for>
72
 
73
			<!-- End of new stuff -->
74
 
75
			<for param="jar.name">
76
			    <path>
77
			    	<jars/>
78
			    </path>
79
			    <sequential>
80
	    			<jar destfile="@{jar.name}" 
81
					     update="true" 
82
						 manifest="${basedir}/build/pkg/descpkg"/>
83
			    </sequential>
84
			</for>
85
 
86
		</sequential>
87
	</macrodef>
88
 
89
</project>