Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: a53034b3382efc2f3c827257395473a09763a92e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
<project>
	<import file="${buckminster.pdetasks}"/>
	<target name="peruse.about.mappings">
		<!-- action.input appoints a directory. Convert it to the single file that it contains -->
		<pathconvert property="jarfile">
			<buckminster.valuefileset value="${fs:action.input}"/>
		</pathconvert>
		
		<!-- Extract the feature version from the feature manifest -->
		<extractFeatureVersion file="${sp:manifest}" property="feature.version"/>

		<!-- Obtain the build.id property from the build context and assign it to an ant
		     property with the same name -->
		<buckminster.contextProperty name="build.id"/>

		<!-- Unzip, replace tokens, an rezip -->
		<property name="jartmp" location="${buckminster.temp}/jartmp"/>
		<delete dir="${jartmp}"/>
		<mkdir dir="${jartmp}"/>
		<unzip dest="${jartmp}" src="${jarfile}"/>
		<replace token="@build@" value="${build.id}" file="${jartmp}/about.mappings"/>
		<replace token="@featureVersion@" value="${feature.version}" file="${jartmp}/about.mappings"/>
		<zip destfile="${jarfile}" basedir="${jartmp}"/>
		<delete dir="${jartmp}"/>
	</target>
</project>

Back to the top