Subversion Repositories DevTools

Rev

Rev 2180 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 2180 Rev 2182
Line 1... Line 1...
1
<project name="jboss-config-jms" default="install" basedir=".">
1
<project name="jboss-config-jms" default="install" basedir=".">
2
 
2
 
3
	<description>
3
	<description/>
4
	Configures JBoss with MASS server configuration(s) as required.
-
 
5
 
-
 
6
	Prerequisites:
-
 
7
		- JBoss version 3.2.3 must be installed.
-
 
8
		- The JBOSS_HOME environment variable must be set to the base directory
-
 
9
		  where JBoss is installed.
-
 
10
		- The ANTSHIELD Ant plugin must be installed in the %ANT_HOME%\lib directory.
-
 
11
		- The JANTS Ant plugin must be installed in the %ANT_HOME%\lib directory.
-
 
12
	</description>
-
 
13
 
-
 
14
 
4
 
15
	<taskdef resource="antshield.properties"/>
5
	<taskdef resource="antshield.properties"/>
16
	<taskdef resource="jats.properties"/>
6
	<taskdef resource="jats.properties"/>
17
 
7
 
18
	<!-- =================================================================== -->
8
	<!-- =================================================================== -->
19
	<!--  GLOBAL PROPERTIES                                                  -->
9
	<!--  GLOBAL PROPERTIES                                                  -->
20
	<!-- =================================================================== -->
10
	<!-- =================================================================== -->
21
	<property file="${user.home}/.ant.properties" />
11
	<property file="${user.home}/.ant.properties" />
22
	<property name="env" environment="env"         value="not used"/>
12
	<property name="env" environment="env"         value="not used"/>
23
	<property name="jboss.cfg"                     value="project"/>
-
 
24
 
-
 
25
 
-
 
26
	<!--
-
 
27
	  -  Pulls in project dependencies.
-
 
28
	  -->
-
 
29
	<!-- <target name="sandbox"
-
 
30
		description="Prepare the project dependency 'sandbox'.">
-
 
31
		<echo message="Prepare the sandbox."/>
-
 
32
		<ant antfile="depends.xml"/>
-
 
33
	</target> -->
-
 
34
 
13
 
-
 
14
	<import file="jboss-config-jmsdepends.xml"/>
-
 
15
	<import file="${env.JATS_HOME}/ant-using/${ant-using}/ant-using.xml"/>
-
 
16
	
-
 
17
	<using name="ant-manifest"		version="${ant-manifest}"/>
-
 
18
	
35
 
19
 
36
	<!--
20
	<!--
37
	  -  Cleans derived objects.
21
	  -  Cleans derived objects.
38
	  -->
22
	  -->
39
	<target name="clean">
23
	<target name="clean">
Line 44... Line 28...
44
 
28
 
45
	</target>
29
	</target>
46
 
30
 
47
 
31
 
48
	<!--
32
	<!--
49
	  -  Checks the JBoss environment.
-
 
50
	  -
-
 
51
	  -  This target verifies that the compatible version of JBoss is installed
-
 
52
	  -  on the build machine. This latest release supports JBoss 3.2.3 only.
-
 
53
	  -->
-
 
54
	<target name="-check-environment" depends="">
-
 
55
 
-
 
56
		<property name="jboss.home" value="${env.JBOSS_HOME}"/>
-
 
57
		<fail unless="jboss.home">
-
 
58
			Environment variable 'JBOSS_HOME' is not set.
-
 
59
		</fail>
-
 
60
	  	<available property="jboss.present" file="${env.JBOSS_HOME}/bin/run.jar"/>
-
 
61
	  	<fail unless="jboss.present">
-
 
62
	  		Environment variable JBOSS_HOME is set but it does
-
 
63
		    not seem to point to the right directory. The file
-
 
64
			'run.jar' must be available at ${env.JBOSS_HOME}/bin"
-
 
65
		</fail>
-
 
66
 
-
 
67
		<property name="jats.home" value="${env.JATS_HOME}"/>
-
 
68
		<fail unless="jats.home">
-
 
69
			Environment variable 'JATS_HOME' is not set.
-
 
70
		</fail>
-
 
71
 
-
 
72
		<!-- Check JBoss version - do not proceed unless compatible -->
-
 
73
		<mkdir dir="tmp"/>
-
 
74
		<unjar src="${env.JBOSS_HOME}/bin/run.jar" dest="tmp">
-
 
75
			<patternset includes="META-INF/MANIFEST.MF"/>
-
 
76
		</unjar>
-
 
77
		<loadfile property="jboss.manifest" srcfile="tmp/META-INF/MANIFEST.MF"/>
-
 
78
		<delete dir="tmp"/>
-
 
79
 
-
 
80
		<condition property="jboss.active.version" value="3.2.3">
-
 
81
			<contains string="${jboss.manifest}" substring="Implementation-Version: 3.2.3"/>
-
 
82
		</condition>
-
 
83
 
-
 
84
		<fail unless="jboss.active.version">
-
 
85
			Incompatible version of JBoss detected. This configuration script is only
-
 
86
			compatible with JBoss 3.2.3
-
 
87
		</fail>
-
 
88
   	</target>
-
 
89
 
-
 
90
	<!--
-
 
91
	  -  Packages the release
33
	  -  Packages the release
92
	  -
34
	  -
93
	  -  This target looks for the installed JDBC drivers, and flags their existence.
-
 
94
	  -  This package should be dependent on the JDBC drivers, because it contains
-
 
95
	  -  them within the release.
-
 
96
	  -->
35
	  -->
97
	<target name    ="package"
36
	<target name    ="package">
98
	        depends ="-check-environment">
-
 
99
 
37
 
100
		<delete dir="${basedir}/build"/>
38
		<delete dir="${basedir}/build"/>
101
 
39
		
102
		<property name="jboss.cfg.directory" location="${basedir}/build/${jboss.cfg}.mas"/>
40
		<property name="package.dir"		location="${basedir}/build/pkg"/>	
103
		<property name="jboss.default.directory" location="${env.JBOSS_HOME}/server/default"/>
-
 
104
 
41
		
105
		<available file="${jboss.cfg.directory}" type="dir" property="jboss.cfg.present"/>
42
		<mkdir dir="${package.dir}"/>
106
		<fail if="jboss.cfg.present" message="JBoss configuration for ${jboss.cfg.directory} already exists."/>
-
 
107
 
-
 
108
		<mkdir dir="${jboss.cfg.directory}"/>
43
		<mkdir dir="${package.dir}/pkg/conf"/>
109
		<mkdir dir="${jboss.cfg.directory}/conf"/>
44
		<mkdir dir="${package.dir}/pkg/deploy"/>
110
		<mkdir dir="${jboss.cfg.directory}/deploy"/>
45
		<mkdir dir="${package.dir}/pkg/lib"/>
111
		<mkdir dir="${jboss.cfg.directory}/lib"/>
46
		<mkdir dir="${package.dir}/scripts"/>
112
 
47
 
113
		<!-- Prepare configuration -->
48
		<!-- Prepare configuration -->
114
		<copy todir="${jboss.cfg.directory}/conf">
49
		<copy todir="${package.dir}/pkg/conf">
115
			<fileset dir="${basedir}/conf"/>
50
			<fileset dir="${basedir}/conf"/>
116
		</copy>
51
		</copy>
117
 
52
 
118
		<copy todir="${jboss.cfg.directory}/deploy">
53
		<copy todir="${package.dir}/pkg/deploy">
119
			<fileset dir="${basedir}/deploy"/>
54
			<fileset dir="${basedir}/deploy"/>
120
		</copy>
55
		</copy>
121
		
56
		
122
		<copy todir="${jboss.cfg.directory}/lib">
57
		<copy todir="${package.dir}/pkg/lib">
123
			<fileset dir="${basedir}/lib"/>
58
			<fileset dir="${basedir}/lib"/>
124
		</copy>
59
		</copy>
-
 
60
		
-
 
61
		<copy todir="${package.dir}/scripts">
-
 
62
			<fileset dir="${basedir}/scripts" includes="*"/>
-
 
63
		</copy>		
125
 
64
 
126
	</target>
65
	</target>
127
 
66
	
128
	<!--
-
 
129
	  -  Formally releases package 'jboss_config'
-
 
130
	  -->
-
 
131
	<target name="release"
-
 
132
		description="Formally release this package as a patch release.">
-
 
133
		<antshield packageName="${ant.project.name}"/>
-
 
134
		<antcall target="-label"/>
-
 
135
	</target>
-
 
136
 
-
 
137
 
67
	
138
	<!--
-
 
139
	  -  Undoes a failed release
-
 
140
	  -->
-
 
141
	<target name="undo"
-
 
142
		description="Remove artifacts from a partially complete build.">
68
	<!-- ===================================================================
143
		<antshield packageName="${ant.project.name}" type="minor"/>
-
 
144
		<!-- Remove any label for the given version -->
69
	  -  Target called by automated build tool (ABT).
145
		<ccrmlabel labelname="${ant.project.name}_${antshield.release}"/>
-
 
146
		<!-- Remove any network drive mapping, and remove any view corresponding to the label -->
-
 
147
		<ccrmview viewname="${user.name}_jats_build_${ant.project.name}_${antshield.release}" unmap="${jants.map.drive}"/>
-
 
148
	</target>
-
 
149
 
-
 
150
 
-
 
151
	<!--
70
	  -
152
	  -  Creates a label, a view based on the label, and invokes a build in the new view.
71
	  -  This target will be called by the ABT to perform an automated build,
153
	  -->
-
 
154
	<target name="-label">
-
 
155
 
-
 
156
		<cclabel package       = "${ant.project.name}"
72
	  -  package and release of this package.
157
				 version       = "${antshield.release}"
-
 
158
				 findCheckouts = "true"
-
 
159
				 mkview        = "true"
-
 
160
				 mapview       = "${jants.map.drive}"
-
 
161
				 labelname     = "jants.build.label"
-
 
162
				 viewname      = "jants.build.view.name"
-
 
163
				 viewpath      = "jants.build.view.path"/>
-
 
164
		<ant antfile="build.xml" dir="${jants.build.view.path}" inheritAll="false" inheritRefs="false" target="-release">
-
 
165
			<property name="jants.build.version" value="${antshield.release}"/>
-
 
166
		</ant>
-
 
167
		<cclocklabel labelname="${jants.build.label}"/>
-
 
168
		<ccrmview viewname="${jants.build.view.name}" unmap="${jants.map.drive}"/>
-
 
169
 
-
 
170
	</target>
-
 
171
 
-
 
172
 
-
 
173
	<!--
-
 
174
	  -  Puts release elements in their staging location, and puts them into dpkg_archive.
-
 
175
	  -->
73
	  -->
176
	<target name="-release" depends="package">
74
	<target name        = "auto"
177
		<!-- Clean the package directory -->
-
 
178
		<delete dir="pkg"/>
75
	        depends     = "package"
179
		<mkdir dir="pkg"/>
-
 
180
		<mkdir dir="pkg/pkg"/>
-
 
181
		<mkdir dir="pkg/scripts"/>
-
 
182
 
-
 
183
		<!-- Prepare the package entities -->
-
 
184
		<copy todir="pkg/pkg">
-
 
185
			<fileset dir="${basedir}/build/project.mas"/>
76
	        description = "Called during build using the automated build tool">
186
		</copy>
-
 
187
 
77
 
188
		<copy todir="pkg/scripts">
78
		<echo message="AUTO BUILD"/>
189
			<fileset dir="${basedir}/scripts" includes="*"/>
79
		<summarise-manifest package="${packagename}" version="${packageversion}"/>
190
		</copy>
-
 
191
 
80
 
192
		<!-- And perform the dpkg release -->
-
 
193
		<jats package="${ant.project.name}">
-
 
194
			<release version="${jants.build.version}" label="${jants.build.label}"/>
-
 
195
		</jats>
-
 
196
	</target>
81
	</target>		
197
 
82
 
198
</project>
83
</project>
199
84