Subversion Repositories DevTools

Rev

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

Rev Author Line No. Line
1960 mtynas 1
<project name="load-using-macrodef">
2
 
3
	<!--	C O P Y R I G H T   N O T I C E
1962 mhunt 4
			This material is confidential to ERG and may not be disclosed in whole
1960 mtynas 5
			or in part to any third party nor used in any manner whatsoever other
6
			than for the purposes expressly consented to by ERG in writing.
7
 
8
			This material is also copyright and may not be reproduced, stored in a
9
			retrieval system or transmitted in any form or by any means in whole or
10
			in part without the express written consent of ERG.
11
	-->
12
 
13
	<!-- ============================================================================================== -->
14
	<!-- Install ant-using -->
15
 
1966 bivey 16
	<property name="ant-using-version" value="1.5.0.tool"/>
1960 mtynas 17
 
18
 
19
	<fail message="An existing ANT using macro has been declared with a different version" status="2">
20
		<condition>
21
			<and>
22
				<isset	property="using.ant-using.version"/>
1962 mhunt 23
				<not><equals arg1="${using.ant-using.version}" arg2="${ant-using-version}"/></not>
1960 mtynas 24
			</and>
25
		</condition>
26
	</fail>
27
 
28
 
1962 mhunt 29
	<!-- For backward compatibilty, EITHER the GBE_DPKG variable OR the JATS_HOME variable should be set -->
30
	<fail message="The mandatory environment variable GBE_DPKG (or the alternative JATS_HOME) is missing" status="1">
1960 mtynas 31
		<condition>
1962 mhunt 32
			<and>
33
				<not><isset property="env.GBE_DPKG"/></not>
34
				<not><isset property="env.JATS_HOME"/></not>
35
			</and>
1960 mtynas 36
		</condition>
37
	</fail>
38
 
1962 mhunt 39
	<!-- If one (or the other) is not set, we will set it up here -->
40
	<condition property="env.GBE_DPKG" value="${env.JATS_HOME}">
41
		<not><isset property="env.GBE_DPKG"/></not>
42
	</condition>
43
	<condition property="env.JATS_HOME" value="${env.GBE_DPKG}">
44
		<not><isset property="env.JATS_HOME"/></not>
45
	</condition>
46
 
47
 
1960 mtynas 48
	<!-- ============================================================================================== -->
49
	<!-- Install ant-antcontrib -->
50
	<property name="antcontrib-version" value="1.0b2"/>
51
	<property name="using.ant-antcontrib.basedir" value="${env.GBE_DPKG}/ant-antcontrib/${antcontrib-version}"/>
52
	<property name="using.antcontrib.basedir" value="${env.GBE_DPKG}/antcontrib/${antcontrib-version}"/>
53
	<mkdir dir="${using.ant-antcontrib.basedir}"/>
54
	<mkdir dir="${using.antcontrib.basedir}"/>
55
	<copy todir="${using.ant-antcontrib.basedir}" verbose="yes">
56
		<fileset dir="${env.GBE_DPKG}/ant-antcontrib/${antcontrib-version}">
57
			<include name="*.xml"/>
58
		</fileset>
59
	</copy>
60
	<copy todir="${using.antcontrib.basedir}" verbose="yes">
61
		<fileset dir="${env.GBE_DPKG}/antcontrib/${antcontrib-version}">
62
			<include name="**/*.jar"/>
63
		</fileset>
64
	</copy>
65
	<import file="${using.ant-antcontrib.basedir}/ant-antcontrib.xml" optional="false"/>
66
	<!-- ============================================================================================== -->
67
 
68
 
1962 mhunt 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 	-->
1960 mtynas 73
	<if>
1962 mhunt 74
		<isset property="${env.GBE_DPKG_CACHE}"/>
1960 mtynas 75
		<then>
1962 mhunt 76
			<property name="build.repository" value="${env.GBE_DPKG_CACHE}"/>
77
			<echo taskname="ant-using">Using environment variable 'GBE_DPKG_CACHE' as build.repository from : ${build.repository}</echo>
78
		</then>
79
		<else>
1960 mtynas 80
			<available property="ant-build-properties_available" filepath="${user.home}" file="ant-build-properties"/>
81
			<if>
1962 mhunt 82
				<isset property="ant-build-properties_available"/>
1960 mtynas 83
				<then>
84
					<property file="${user.home}/ant-build-properties"/>
85
					<echo taskname="ant-using">Using 'ant-build-properties' file for build.repository as : ${build.repository}</echo>
86
				</then>
87
				<else>
1962 mhunt 88
					<property name="build.repository" value="${user.home}/build-repository"/>
1960 mtynas 89
				</else>
90
			</if>
91
		</else>
92
	</if>
93
 
94
 
95
	<property name="using.ant-using.basedir" value="${build.repository}/ant-using/${ant-using-version}"/>
96
	<mkdir dir="${using.ant-using.basedir}"/>
97
	<copy todir="${using.ant-using.basedir}" verbose="yes">
98
		<fileset dir="${env.GBE_DPKG}/ant-using/${ant-using-version}">
99
			<include name="*.xml"/>
100
		</fileset>
101
	</copy>
102
	<import file="${using.ant-using.basedir}/ant-using-macro.xml" optional="false"/>
103
	<!-- ============================================================================================== -->
1964 wkiely 104
 
105
	<!-- Import the auto.xml file (if it exists), and if it does not then import the depends.xml.
106
	      The name of the depends.xml it will look for (in this order) is ${ant.project.name}-depends.xml or
107
	       ${ant.project.name}depends.xml.
108
	-->
109
	<available property="auto.xml.exists" filepath="${basedir}" file="auto.xml"/>
110
	<if>
111
	    <isset property="auto.xml.exists"/>
112
		<then>
113
			<import file="${basedir}/auto.xml" optional="true"/>
114
		</then>
115
		<else>
116
			<available property="depends.xml.exists" filepath="${basedir}" file="${ant.project.name}-depends.xml"/>
117
			<if>
118
				<isset property="depends.xml.exists"/>
119
				<then>
120
					<import file="${basedir}/${ant.project.name}-depends.xml" optional="true"/>
121
				</then>
122
				<else>
123
					<import file="${basedir}/${ant.project.name}depends.xml" optional="true"/>
124
				</else>
125
			</if>
126
		</else>
127
	</if>
1960 mtynas 128
 
129
</project>