Subversion Repositories DevTools

Rev

Rev 1972 | 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="load-using-macrodef"
2
         xmlns:ivy="antlib:fr.jayasoft.ivy.ant">
1972 jgill 3
 
4
	<!--	C O P Y R I G H T   N O T I C E
5
			This material is confidential to ERG and may not be disclosed in whole
6
			or in part to any third party nor used in any manner whatsoever other
7
			than for the purposes expressly consented to by ERG in writing.
8
 
9
			This material is also copyright and may not be reproduced, stored in a
10
			retrieval system or transmitted in any form or by any means in whole or
11
			in part without the express written consent of ERG.
12
	-->
13
 
14
 
15
	<!-- 
16
	  - REPLACE_ANT_USING will get replaced with the release version of ant-using on release. 
17
	  -->
18
	<property name="ant-using-version" value="REPLACE_ANT_USING"/>
19
 
20
 
21
	<fail message="An existing ANT using macro has been declared with a different version" status="2">
22
		<condition>
23
			<and>
24
				<isset	property="using.ant-using.version"/>
25
				<not><equals arg1="${using.ant-using.version}" arg2="${ant-using-version}"/></not>
26
			</and>
27
		</condition>
28
	</fail>
29
 
30
	<property name="using.ant-using.version" value="${ant-using-version}"/>
31
 
32
	<fail message="The mandatory environment variable GBE_DPKG is missing" status="1">
33
		<condition>
34
			<and>
35
				<not><isset property="env.GBE_DPKG"/></not>
36
			</and>
37
		</condition>
38
	</fail>
39
 
40
	<dirname property="dirname.load-using-macrodef" file="${ant.file.load-using-macrodef}"/>
1974 jgill 41
	<property name="using.ant-using.basedir" location="${dirname.load-using-macrodef}"/>
1972 jgill 42
 
43
	<taskdef resource="net/sf/antcontrib/antlib.xml">
44
		 <classpath>
45
		     <pathelement location="${dirname.load-using-macrodef}/jar/ant-contrib.jar"/>
46
		 </classpath>
47
	</taskdef>
48
 
1974 jgill 49
	<path id="ivy.lib.path">
50
		<fileset dir="${dirname.load-using-macrodef}/jar" includes="ivy*.jar"/>
51
	</path>
52
 
53
	<taskdef resource="fr/jayasoft/ivy/ant/antlib.xml"
54
			uri="antlib:fr.jayasoft.ivy.ant" classpathref="ivy.lib.path"/>
55
 
56
	<available property="ivy.xml.exists" filepath="${basedir}" file="ivy.xml"/>
57
	<available property="ivy-template.xml.exists" filepath="${basedir}" file="ivy-template.xml"/>
58
	<if>
59
		<or>
60
			<isset property="ivy.xml.exists"/>
61
			<isset property="ivy-template.xml.exists"/>
62
		</or>
63
		<then>
64
			<ivy:configure file="${dirname.load-using-macrodef}/ivyconf.xml" />
65
		</then>
66
	</if>
67
 
1972 jgill 68
	<!-- 
69
	  - Do we have an environment variable for GBE_DPKG_CACHE?
70
	  - If so, use it as the build location.
71
	  - If not, look for a properties file : ant-build-properties (if one exists)
72
	  - If the properties are not found, default to ${user.home}/build-repository
73
	  -->
74
	<if>
75
		<isset property="env.GBE_DPKG_CACHE"/>
76
		<then>
77
			<property name="build.repository" value="${env.GBE_DPKG_CACHE}"/>
78
			<echo taskname="ant-using">Using environment variable 'GBE_DPKG_CACHE' as build.repository from : ${build.repository}</echo>
79
		</then>
80
		<else>
81
			<available property="ant-build-properties_available" filepath="${user.home}" file="ant-build-properties"/>
82
			<if>
83
				<isset property="ant-build-properties_available"/>
84
				<then>
85
					<property file="${user.home}/ant-build-properties"/>
86
					<echo taskname="ant-using">Using 'ant-build-properties' file for build.repository as : ${build.repository}</echo>
87
				</then>
88
				<else>
89
					<property name="build.repository" value="${user.home}/build-repository"/>
90
				</else>
91
			</if>
92
		</else>
93
	</if>
94
 
95
 
96
	<!-- 
97
	  - Pick up ant-using-macro.xml from same directory as this file was imported. 
98
	  -->
99
	<import file="${dirname.load-using-macrodef}/ant-using-macro.xml" optional="false"/>
100
    <import file="${dirname.load-using-macrodef}/ant-clean.xml" optional="false"/>
101
    <import file="${dirname.load-using-macrodef}/ant-manifest.xml" optional="false"/>
102
    <import file="${dirname.load-using-macrodef}/ant-release.xml" optional="false"/>
103
    <import file="${dirname.load-using-macrodef}/ant-javadoc.xml" optional="false"/>
104
    <import file="${dirname.load-using-macrodef}/ant-jants.xml" optional="false"/>
1974 jgill 105
	<import file="${dirname.load-using-macrodef}/ant-ivy.xml" optional="false"/>
1972 jgill 106
 
107
	<!-- 
108
	  - Import the auto.xml file (if it exists), and if it does not then import the depends.xml.
109
	  - The name of the depends.xml it will look for (in this order) is ${ant.project.name}-depends.xml or
110
	  - ${ant.project.name}depends.xml.
111
	  -->
112
	<available property="auto.xml.exists" filepath="${basedir}" file="auto.xml"/>
113
	<if>
114
	    <isset property="auto.xml.exists"/>
115
		<then>
116
			<import file="${basedir}/auto.xml" optional="true"/>
117
		</then>
118
		<else>
119
			<available property="depends.xml.exists" filepath="${basedir}" file="${ant.project.name}-depends.xml"/>
120
			<if>
121
				<isset property="depends.xml.exists"/>
122
				<then>
123
					<import file="${basedir}/${ant.project.name}-depends.xml" optional="true"/>
124
				</then>
125
				<else>
126
					<import file="${basedir}/${ant.project.name}depends.xml" optional="true"/>
127
				</else>
128
			</if>
129
		</else>
130
	</if>
131
 
132
</project>