summaryrefslogtreecommitdiff
path: root/qpid/java/management/client/build.xml
blob: a67f69c43dfd8a4fa83109acbd57d6e6035e4e3f (plain)
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
<!--
 -
 - Licensed to the Apache Software Foundation (ASF) under one
 - or more contributor license agreements.  See the NOTICE file
 - distributed with this work for additional information
 - regarding copyright ownership.  The ASF licenses this file
 - to you under the Apache License, Version 2.0 (the
 - "License"); you may not use this file except in compliance
 - with the License.  You may obtain a copy of the License at
 - 
 -   http://www.apache.org/licenses/LICENSE-2.0
 - 
 - Unless required by applicable law or agreed to in writing,
 - software distributed under the License is distributed on an
 - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 - KIND, either express or implied.  See the License for the
 - specific language governing permissions and limitations
 - under the License.
 -
 -->
<project name="QMan - Qpid JMX / WS-DM Adapter" default="build">

    <property name="module.depends" value="client common"/>
    <property name="module.test.depends" value="client common common/test"/>
	
	<import file="../../module.xml"/>

    <property name="build.root" value="${module.build}"/>
    <property name="web.module" value="${module.build}${file.separator}wsdm-module"/>	
    <property name="web-inf.folder" value="${web.module}${file.separator}WEB-INF"/>
    <property name="classes.folder" value="${web-inf.folder}${file.separator}classes"/>
	<property name="examples.folder" value="${module.build}${file.separator}examples"/>

	<target name="release-bin-other">
		<mkdir dir="${module.release}${file.separator}log"/>
		<mkdir dir="${module.release}${file.separator}examples"/>
		<mkdir dir="${module.release}${file.separator}examples${file.separator}sample_messages"/>
	
	</target>
	
    <target name="release-bin" depends="release-bin-tasks"/>
    
	<target name="resources-release" description="copy resources into module release">
		<copy todir="${module.release}" failonerror="false" flatten="true">
			<fileset dir="${resources}" excludes="META-INF">
				<exclude name="META-INF"/>
				<exclude name="README.txt"/>
			</fileset>
			<fileset file="${module.build}${file.separator}README.txt"/>
	    </copy>
	</target>

	<target name="libs-release" description="copy dependencies into module release">
	    <copy todir="${module.release}${file.separator}" failonerror="true" verbose="true">
	    	<fileset dir="${build}" casesensitive="yes" includes="${module.libs}">
	    		<not><filename name="**/*javassist*"/></not>	
	    		<not><filename name="**/*xml-api*"/></not>	    		
	    		<not><filename name="**/*xerces*"/></not>	    		
	    		<not><filename name="**/*xalan*"/></not>	    		
	    		<not><filename name="**/*wsdl*"/></not>	    		
	    		<not><filename name="**/*muse*"/></not>
	    		<not><filename name="**/*jsp*"/></not>
		    		<not><filename name="**/*core-3.1.1.jar*"/></not>
	    	</fileset>
	    </copy>
		<copy todir="${module.release}${file.separator}lib" failonerror="true">
		    <fileset file="${module.jar}"/>
		    <fileset dir="${build.lib}" includes="${module.depends.jars}"/>
		</copy>
		<mkdir dir="${module.release}${file.separator}app${file.separator}qman"/>
		<copy todir="${module.release}${file.separator}app${file.separator}qman" failonerror="true">
		    <fileset dir="${web.module}" includes="*/**"/>
		</copy>
		<mkdir dir="${module.release}${file.separator}examples"/>
		<copy todir="${module.release}${file.separator}examples">
			<fileset dir="${examples.folder}"/> 		
		</copy>	
	</target>
	
	<target name="prepare-wsdm-module">        
        <mkdir dir="${web.module}"/>
        <mkdir dir="${web-inf.folder}"/>
    	<mkdir dir="${classes.folder}"/>
        <copy file=".${file.separator}web.xml" todir="${web-inf.folder}" verbose="false"/>
	 	<copy todir="${classes.folder}" verbose="false">
        	<fileset dir="${module.classes}">            	
				<include name="wsdl/**"/>
            	<include name="muse.xml"/>
            	<include name="router-entries/**"/>
			</fileset>  
		</copy>         
        <copy todir="${web-inf.folder}">
            <fileset dir="${build}" includes="${module.libs}">
            	<exclude name="lib/jetty*.jar"/>
                <exclude name="lib/start*.jar"/>                       
            </fileset>
        </copy>
        <copy todir="${web-inf.folder}${file.separator}lib">
            <fileset dir="${build}/lib">
                <include name="qpid-client-*.jar"/>
                <include name="qpid-common-*.jar"/>
                <include name="qpid-management-client-*.jar"/>           
            	<exclude name="qpid-client-example*.jar"/>
            	<exclude name="qpid-client-tests*.jar"/>
            	<exclude name="qpid-common-tests*.jar"/>
                <exclude name="qpid-management-client-tests*.jar"/>           
            </fileset>
        </copy>
        <copy todir="${web.module}">
        	<fileset dir="${module.src}${file.separator}..${file.separator}..${file.separator}..${file.separator}console">            	
				<include name="*/**"/>
			</fileset>          	
        </copy>	
    </target> 
	<target name="jar.manifest" depends="compile" if="module.manifest">
		<jar destfile="${module.jar}" manifest="${module.manifest}">
			<fileset dir="${module.classes}" casesensitive="yes">
				<include name="**/**"/>
            	<exclude name="wsdl/**"/>
            	<exclude name="muse.xml"/>
            	<exclude name="router-entries/**"/>
			</fileset>
		</jar>
	</target>
	<target name="jar.nomanifest" depends="compile" unless="module.manifest">
		<jar destfile="${module.jar}">
			<metainf dir="${project.root}${file.separator}resources/" />
			<fileset dir="${module.classes}" casesensitive="yes">
				<include name="**/**"/>
            	<exclude name="wsdl/**"/>
            	<exclude name="muse.xml"/>
            	<exclude name="router-entries/**"/>
	    	</fileset>
		</jar>
	</target>
    <target name="postbuild" depends="prepare-wsdm-module,copy-examples-to-build,copy-README-to-build" description="Build WS-DM module"/>
		
	<path id="module.test.path">
		<pathelement path="${module.test.classes}" />
	    <pathelement path="${module.test.depends.path}"/>
	    <path refid="module.test.libs"/>
		<fileset dir="${build}/lib">
	    	<include name="qpid-client-*.jar"/>
	        <include name="qpid-common-*.jar"/>
	        <include name="qpid-management-client-*.jar"/>           
	        <exclude name="qpid-client-example*.jar"/>
	        <exclude name="qpid-client-tests*.jar"/>
	        <exclude name="qpid-common-tests*.jar"/>
	        <exclude name="qpid-management-client-tests*.jar"/>           
		</fileset> 
	</path>
	
	<target name="copy-README-to-build">
		<copy todir="${module.build}">
			<fileset dir="${module.src}${file.separator}..${file.separator}..${file.separator}..">
				<include name="README.txt"/>				
			</fileset>
		</copy>			
	</target>
	
	<target name="copy-examples-to-build">
		<mkdir dir="${examples.folder}${file.separator}src"/>
		<mkdir dir="${examples.folder}${file.separator}sample_messages"/>
		<copy todir="${examples.folder}">
			<fileset dir="${module.src}${file.separator}..${file.separator}..${file.separator}example">
				<include name="README.txt"/>				
			</fileset>
		</copy>		
		<copy todir="${examples.folder}${file.separator}src">
			<fileset dir="${module.src}${file.separator}..${file.separator}..${file.separator}example">
				<include name="**/*.java"/>
				<exclude name="**/*.out.*"/>
			</fileset>
		</copy>
		<copy todir="${examples.folder}${file.separator}sample_messages">
			<fileset dir="${module.src}${file.separator}..${file.separator}..${file.separator}example" >
				<exclude name="**/*.java"/>
				<exclude name="**/README.txt"/>				
				<include name="**/*.out.*"/>
			</fileset>
		</copy>
	</target>
	
	<target name="test" depends="build,compile-tests" if="module.test.src.exists" unless="${dontruntest}" description="execute unit tests">
		<delete file="${module.failed}"/>
		<echo message="Using profile:${profile}" level="info"/>
	     <junit fork="${test.fork}" maxmemory="1024M" reloading="no"
			haltonfailure="${haltonfailure}" haltonerror="${haltonerror}"
	        failureproperty="test.failures" printsummary="on" timeout="600000" >
	        	
			<jvmarg value="${jvm.args}"/>
			<sysproperty key="qman.war" value="${web.module}"/>
	    	
			<formatter type="plain"/>
			<formatter type="xml"/>

			<classpath refid="module.test.path"/>

			<batchtest fork="${test.fork}" todir="${module.results}">
	        	<fileset dir="${module.test.src}" excludes="${module.test.excludes}">
					<include name="**/${test}.java"/>	        		
	        	</fileset>
			</batchtest>
		</junit>
		<antcall target="touch-failed"/>
		<condition property="failed">
			<and>
				<isfalse value="${test.failures.ignore}"/>
				<available file="${module.failed}"/>
			</and>
		</condition>
		<fail if="failed" message="TEST SUITE FAILED"/>
	</target>
</project>