summaryrefslogtreecommitdiff
path: root/java/management/client/build.xml
blob: 4e595c69bfe778828c7d81448c3fe3332028f560 (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
<!--
 -
 - 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"/>
	
	<import file="../../module.xml"/>

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

	<target name="release-bin-other">
		<mkdir dir="${module.release}${file.separator}log"/>
	</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>
	    	</fileset>
	    </copy>
		<copy todir="${module.release}${file.separator}lib" failonerror="true">
		    <fileset file="${module.jar}"/>
		    <fileset dir="${build.lib}" includes="${module.depends.jars}"/>
		</copy>
		<jar destfile="${module.release}${file.separator}lib${file.separator}${war.name}" basedir="${web.module}"/>
	</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}"/>
        </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>
    </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" description="Build WS-DM module"/>
		<path id="module.test.path">
	    	<pathelement path="${module.test.classes}" />
	    	<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="test" depends="build,compile-tests" if="module.test.src.exists" unless="${dontruntest}" description="execute unit tests">
		<delete file="${module.failed}"/>
		<echo message="Using config:${config}" 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>