summaryrefslogtreecommitdiff
path: root/management/core/build-old.xml
blob: df00b95bccec3061e79032c9343fe46380257473 (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
<?xml version="1.0"?>
<!--
 -
 - Copyright (c) 2006 The Apache Software Foundation
 -
 - Licensed 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.
 -
 -->

<!-- AMQP Management Core Java build file -->

<project name="management-core" default="jar" basedir=".">
    <property name="lib" value="${basedir}/lib"/>
    <property name="src" value="${basedir}/src"/>
    <property name="generated.src" value="${basedir}/generated/src"/>
    <property name="tests" value="${basedir}/test"/>
    <property name="etc" value="${basedir}/etc"/>
    <property name="classes" value="${basedir}/classes"/>
    <property name="testclasses" value="${basedir}/testclasses"/>
    <property name="dist" value="${basedir}/dist"/>
    <property name="apache.root" value="${basedir}/../../clients_java"/>
    <property name="apache.dist" value="${apache.root}/dist"/>
    <property name="apache.lib" value="${apache.root}/lib"/>

    <taskdef name="xmlbean" classname="org.apache.xmlbeans.impl.tool.XMLBean" classpathref="core.classpath"/>

    <!-- Setup details -->
    <target name="init">
        <tstamp>
            <format property="release" pattern="-dMMMyy" locale="en" timezone="GMT"/>
        </tstamp>

        <mkdir dir="${generated.src}"/>
        <mkdir dir="${classes}"/>
        <mkdir dir="${testclasses}"/>
        <mkdir dir="${dist}"/>
    </target>

    <path id="core.classpath">
        <fileset dir="${lib}">
            <include name="**/*.jar"/>
        </fileset>
        <pathelement path="${classes}"/>
        <pathelement path="${testclasses}/"/>
        <fileset dir="${apache.dist}">
            <include name="**/*.jar"/>
        </fileset>
        <fileset dir="${apache.lib}">
            <include name="**/*.jar"/>
        </fileset>
    </path>

    <!-- Remove all built files -->
    <target name="clean" depends="init">
        <delete dir="${generated.src}"/>
        <delete dir="${classes}"/>
        <delete dir="${dist}"/>
        <delete dir="${testclasses}"/>
    </target>

    <!-- Generate code from the XML schema -->
    <target name="xmlbeans" depends="init">
        <xmlbean classgendir="${classes}" classpathref="core.classpath"
                 failonerror="true" srcgendir="${generated.src}"
                 javasource="1.5" source="1.5">
            <fileset dir="${etc}" includes="**/*.xsd"/>
        </xmlbean>
    </target>

    <!-- Compile Java -->
    <target name="compile" depends="xmlbeans">
        <javac destdir="${classes}" target="1.5" source="1.5" debug="on">
            <classpath refid="core.classpath"/>
            <src path="${src}"/>
            <src path="${generated.src}"/>
        </javac>

        <copy todir="${classes}">
            <!-- copy any non java src files into the build tree, e.g. log4j.properties -->
            <fileset dir="${src}">
                <exclude name="**/*.java"/>
                <exclude name="**/package.html"/>
            </fileset>
        </copy>
    </target>


    <target name="compiletests" depends="compile">
        <javac destdir="${testclasses}" target="1.5" source="1.5" classpathref="core.classpath"
               debug="on">
            <src path="${tests}"/>
        </javac>

        <copy todir="${testclasses}">
            <!-- copy any non java src files into the build tree, e.g. log4j.properties -->
            <fileset dir="${tests}">
                <exclude name="**/*.java"/>
                <exclude name="**/package.html"/>
            </fileset>
        </copy>
    </target>

    <!-- Build jar archive -->
    <target name="jar" depends="compiletests">
        <mkdir dir="${dist}"/>
        <jar basedir="${classes}" jarfile="${dist}/apache-management-common.jar"/>
        <jar basedir="${testclasses}" jarfile="${dist}/apache-management-tests.jar"/>
    </target>


    <target name="javadoc" depends="compile, compiletests">
        <mkdir dir="${dist}/docs/api"/>
        <javadoc sourcepath="${src}" destdir="${dist}/docs/api"
                 packagenames="org.apache.qpid.*" classpathref="apache.classpath" author="true"
                 version="true" windowTitle="AMQP Client API" doctitle="AMQP Client API"
                 footer="See &lt;a href=&quot;http://www.apache.org&quot;&gt;www.apache.org&lt;/a&gt; for more information."
                 use="true" verbose="false"/>
    </target>

    <target name="ServiceProvidingClient" depends="compiletests">
        <java fork="yes" classname="org.apache.qpid.requestreply1.ServiceProvidingClient">
              <classpath refid="apache.classpath"/>
              <jvmarg value="-server"/>
              <jvmarg value="-Damqj.logging.level=INFO"/>
              <arg value="localhost"/>
              <arg value="5672"/>
              <arg value="guest"/>
              <arg value="guest"/>
              <arg value="/vpath"/>
              <arg value="serviceQ1"/>
        </java>
    </target>

     <target name="ServiceRequestingClient" depends="compiletests">
        <java fork="yes" classname="org.apache.qpid.requestreply1.ServiceRequestingClient">
              <classpath refid="apache.classpath"/>
              <jvmarg value="-server"/>
              <jvmarg value="-Damqj.logging.level=INFO"/>
              <arg value="localhost"/>
              <arg value="5672"/>
              <arg value="guest"/>
              <arg value="guest"/>
              <arg value="/vpath"/>
              <arg value="serviceQ1"/>
              <arg value="5000"/>
        </java>
    </target>

    <target name="profile" depends="compile" description="Profile Project">
        <fail unless="netbeans.home">This target can only run inside the NetBeans IDE.</fail>
        <nbprofiledirect>
          <classpath refid="apache.classpath"/>
        </nbprofiledirect>
        <java fork="true" classname="org.apache.qpid.requestreply1.ServiceRequestingClient"
              dir="${profiler.session.working.dir}"
              jvm="${profiler.info.jvm}">
          <jvmarg value="${profiler.info.jvmargs.agent}"/>
          <jvmarg line="${profiler.info.jvmargs}"/>
          <env key="Path" path="${profiler.info.agentpath}:${env.Path}"/>
          <classpath refid="apache.classpath"/>
          <jvmarg value="-server"/>
          <jvmarg value="-Damqj.logging.level=INFO"/>
          <arg value="localhost"/>
          <arg value="5672"/>
          <arg value="guest"/>
          <arg value="guest"/>
          <arg value="/vpath"/>
          <arg value="serviceQ1"/>
          <arg value="5000"/>
        </java>
    </target>

    <target name="profile-single" depends="compile" description="Profile File">
        <fail unless="netbeans.home">This target can only run inside the NetBeans IDE.</fail>
        <nbprofile classname="${profile.class}">
            <classpath refid="apache.classpath"/>
        </nbprofile>
    </target>
</project>