~ubuntu-branches/ubuntu/quantal/junitperf/quantal

« back to all changes in this revision

Viewing changes to build.xml

  • Committer: Bazaar Package Importer
  • Author(s): Arnaud Vandyck
  • Date: 2006-11-06 12:10:29 UTC
  • mfrom: (3.1.3 edgy)
  • Revision ID: james.westby@ubuntu.com-20061106121029-0f8e7pzmig6sh1x5
Tags: 1.9.1-5
* built with java-gcj-compat-dev.
* debian/rules: 
  + removed ant-launcher.jar
  + removed the test target (closes: #396419)
* Standards-Version: 3.7.2 (no change)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
<?xml version="1.0"?>
2
 
 
3
 
<!-- 
4
 
 
5
 
    Builds JUnitPerf.
6
 
 
7
 
-->
8
 
 
9
 
<project name="JUnitPerf" default="default" basedir=".">
10
 
 
11
 
        <property file="${user.home}/build.properties" />
12
 
                
13
 
        <property name="Name"       value="JUnitPerf"/>
14
 
        <property name="name"       value="junitperf"/>
15
 
        <property name="version"        value="1.8"/>
16
 
        <property name="packages"       value="com.clarkware.junitperf.*"/>
17
 
        
18
 
        <property name="home"                   value="${basedir}"/>
19
 
        <property name="src.dir"                value="${home}/src/app"/>
20
 
        <property name="tests.dir"              value="${home}/src/tests"/>
21
 
        <property name="build.dir"              value="${home}/build"/>
22
 
        <property name="lib.dir"                value="${home}/lib"/>
23
 
        <property name="docs.dir"               value="${home}/docs"/>
24
 
        <property name="sample.dir"             value="${home}/samples"/>
25
 
        <property name="dist.dir"               value="${home}/dist/${name}"/>
26
 
        
27
 
        <path id="project.classpath">
28
 
                <pathelement location="${build.dir}" />
29
 
        </path> 
30
 
 
31
 
        <property name="main.test" 
32
 
                value="com.clarkware.junitperf.AllTests" />
33
 
 
34
 
        <property name="samples.test" 
35
 
                value="com.clarkware.junitperf.ExamplePerfTestSuite" />
36
 
                
37
 
        <property name="copyright"      
38
 
                value="Copyright &#169; 2001-2002 Clarkware Consulting, Inc. All Rights Reserved."/>
39
 
 
40
 
 
41
 
        <!--
42
 
        
43
 
                Default
44
 
        
45
 
        -->
46
 
        <target name="default" depends="build"/>
47
 
 
48
 
 
49
 
        <!--
50
 
        
51
 
                All
52
 
        
53
 
        -->
54
 
        <target name="all" depends="rebuild,test,test-samples,doc"/>
55
 
 
56
 
 
57
 
        <!--
58
 
        
59
 
                Rebuild
60
 
        
61
 
        -->
62
 
        <target name="rebuild" depends="clean,build"/>
63
 
 
64
 
 
65
 
        <!--
66
 
 
67
 
                Prepare
68
 
 
69
 
        -->
70
 
        <target name="prepare">
71
 
 
72
 
                <tstamp/>
73
 
 
74
 
                <mkdir dir="${build.dir}"/>
75
 
                <mkdir dir="${lib.dir}"/>
76
 
 
77
 
                <available property="junit.present" 
78
 
                        classname="junit.framework.TestCase" />
79
 
                        
80
 
        </target>
81
 
 
82
 
 
83
 
        <!--
84
 
        
85
 
                Build
86
 
        
87
 
        -->
88
 
        <target name="build" depends="compile,compile-samples,compile-tests"/>
89
 
 
90
 
 
91
 
        <!--
92
 
 
93
 
                Compile Java Source
94
 
 
95
 
        -->
96
 
        <target name="compile" depends="prepare">
97
 
 
98
 
                <javac srcdir="${src.dir}" destdir="${build.dir}">
99
 
                        <classpath refid="project.classpath" />
100
 
                </javac>
101
 
 
102
 
        </target>
103
 
 
104
 
 
105
 
        <!--
106
 
 
107
 
                Compile Sample Java Source
108
 
 
109
 
        -->
110
 
        <target name="compile-samples" depends="prepare">
111
 
 
112
 
                <javac srcdir="${sample.dir}" destdir="${build.dir}">
113
 
                        <classpath refid="project.classpath" />
114
 
                </javac>
115
 
 
116
 
        </target>
117
 
 
118
 
 
119
 
        <!--
120
 
 
121
 
                Compile Test Cases
122
 
 
123
 
        -->
124
 
        <target name="compile-tests" depends="compile" if="junit.present">
125
 
                
126
 
                <javac srcdir="${tests.dir}" destdir="${build.dir}">
127
 
                        <classpath refid="project.classpath" />
128
 
                </javac>
129
 
        
130
 
        </target>
131
 
 
132
 
        
133
 
        <!--
134
 
        
135
 
                Runs All Tests
136
 
        
137
 
        -->
138
 
        <target name="test" depends="compile-tests" if="junit.present">
139
 
                
140
 
                <junit printsummary="no" haltonfailure="yes">
141
 
                        <test name="${main.test}" />
142
 
                        <formatter type="plain" usefile="false" />
143
 
                        <classpath refid="project.classpath" />
144
 
                </junit>
145
 
 
146
 
        </target>
147
 
 
148
 
 
149
 
        <!--
150
 
        
151
 
                Runs All Sample Tests
152
 
        
153
 
        -->
154
 
        <target name="test-samples" depends="compile-samples" if="junit.present">
155
 
                
156
 
                <junit printsummary="no" haltonfailure="yes">
157
 
                        <test name="${samples.test}" />
158
 
                        <formatter type="plain" usefile="false" />
159
 
                        <classpath refid="project.classpath" />
160
 
                </junit>
161
 
 
162
 
        </target>
163
 
        
164
 
 
165
 
        <!--
166
 
 
167
 
                Jar
168
 
 
169
 
        -->
170
 
        <target name="jar" depends="build">
171
 
 
172
 
                <jar jarfile="${lib.dir}/${name}.jar"
173
 
                        basedir="${build.dir}" />
174
 
 
175
 
        </target>
176
 
  
177
 
  
178
 
        <!--
179
 
 
180
 
                JavaDoc
181
 
 
182
 
        -->
183
 
        <target name="doc" depends="build">
184
 
 
185
 
                <mkdir dir="${docs.dir}/api"/>
186
 
 
187
 
                <javadoc packagenames="${packages}"
188
 
                        sourcepath="${src.dir}"
189
 
                        destdir="${docs.dir}/api"
190
 
                        author="true"
191
 
                        version="true"
192
 
                        windowtitle="${Name} API"
193
 
                        doctitle="${Name} API"
194
 
                        bottom="${copyright}">
195
 
                </javadoc>
196
 
 
197
 
        </target>
198
 
        
199
 
        
200
 
        <!--
201
 
 
202
 
                Distribution
203
 
 
204
 
        -->
205
 
        <target name="dist" depends="rebuild,test,test-samples,jar,doc">
206
 
                
207
 
                <mkdir dir="${dist.dir}" />
208
 
                <mkdir dir="${dist.dir}/docs" />
209
 
                <mkdir dir="${dist.dir}/docs/api" />
210
 
                <mkdir dir="${dist.dir}/src" />
211
 
                <mkdir dir="${dist.dir}/samples" />
212
 
                <mkdir dir="${dist.dir}/lib" />
213
 
 
214
 
                <copy file="build.xml" tofile="${dist.dir}/build.xml" />
215
 
                <copy file="README" tofile="${dist.dir}/README" />
216
 
                <copy file="LICENSE" tofile="${dist.dir}/LICENSE" />
217
 
                                
218
 
                <copy todir="${dist.dir}/docs">
219
 
                        <fileset dir="${docs.dir}" excludes="**/CVS" /> 
220
 
                </copy>
221
 
                
222
 
                <copy todir="${dist.dir}/src/app">
223
 
                        <fileset dir="${src.dir}" 
224
 
                                excludes="**/.classpath, **/CVS" />
225
 
                </copy>
226
 
 
227
 
                <copy todir="${dist.dir}/src/tests">
228
 
                        <fileset dir="${tests.dir}" 
229
 
                                excludes="**/.classpath, **/CVS" />
230
 
                </copy>
231
 
                
232
 
                <copy todir="${dist.dir}/samples">
233
 
                        <fileset dir="${sample.dir}" 
234
 
                                excludes="**/.classpath, **/CVS" />
235
 
                </copy>
236
 
                
237
 
                <copy todir="${dist.dir}/lib">
238
 
                        <fileset dir="${lib.dir}"
239
 
                                excludes="**/CVS" />
240
 
                </copy>
241
 
 
242
 
        </target>
243
 
 
244
 
 
245
 
        <!--
246
 
 
247
 
                Distribution (ZIP)
248
 
 
249
 
        -->
250
 
        <target name="dist-zip" depends="dist">
251
 
                
252
 
                <zip zipfile="${name}${version}.zip" 
253
 
                        basedir="${home}/dist" includes="**" />
254
 
        
255
 
        </target>
256
 
 
257
 
        
258
 
        <!--
259
 
 
260
 
                Clean   
261
 
 
262
 
        -->
263
 
        <target name="clean">
264
 
 
265
 
                <delete dir="${build.dir}"/>
266
 
                <delete dir="${docs.dir}/api"/>
267
 
                <delete dir="${home}/dist"/>
268
 
                <delete file="${name}${version}.zip"/>
269
 
 
270
 
        </target>
271
 
 
272
 
</project>
 
1
<?xml version="1.0"?>
 
2
 
 
3
<project name="junitperf" default="test">
 
4
 
 
5
  <description>
 
6
    Builds and tests JUnitPerf.
 
7
  </description>
 
8
 
 
9
  <property file="build.properties"/>
 
10
  <property environment="env"/>
 
11
 
 
12
  <property name="Name" value="${ant.project.name}"/>
 
13
  <property name="version" value="1.9.1"/>
 
14
 
 
15
  <property name="src.dir" location="src"/>
 
16
  <property name="test.dir" location="test"/>
 
17
  <property name="build.dir" location="build"/>
 
18
  <property name="docs.dir" location="docs"/>
 
19
  <property name="dist.dir" location="dist"/>
 
20
  <property name="run.dir" location="${build.dir}"/>
 
21
 
 
22
  <property name="javadoc.dir" location="${build.dir}/docs/api"/>
 
23
  <property name="dist.name" value="${Name}-${version}"/>
 
24
  <property name="package.dir" location="${dist.dir}/${dist.name}"/>
 
25
 
 
26
  <property name="build.debug" value="true"/>
 
27
 
 
28
  <path id="project.classpath">
 
29
    <pathelement location="${build.dir}"/>
 
30
  </path>
 
31
 
 
32
  <target name="prepare">
 
33
    <tstamp />
 
34
    <mkdir dir="${build.dir}"/>
 
35
    <available property="junit.available"
 
36
               classname="junit.framework.TestCase"/>
 
37
    <fail message="Missing junit.jar in system CLASSPATH"
 
38
          unless="junit.available"/>
 
39
  </target>
 
40
 
 
41
  <target name="compile" depends="prepare"
 
42
    description="Compiles the source code">
 
43
    <javac srcdir="${src.dir}"
 
44
           destdir="${build.dir}"
 
45
           debug="${build.debug}">
 
46
      <classpath refid="project.classpath"/>
 
47
    </javac>
 
48
  </target>
 
49
 
 
50
  <target name="compile-samples" depends="prepare"
 
51
    description="Compiles the samples tests">
 
52
    <javac srcdir="samples"
 
53
           destdir="${build.dir}"
 
54
           debug="${build.debug}">
 
55
      <classpath refid="project.classpath"/>
 
56
    </javac>
 
57
  </target>
 
58
 
 
59
  <target name="compile-tests" depends="compile"
 
60
          if="junit.available"
 
61
    description="Compiles the test code">
 
62
    <javac srcdir="${test.dir}"
 
63
           destdir="${build.dir}"
 
64
           debug="${build.debug}">
 
65
      <classpath refid="project.classpath"/>
 
66
    </javac>
 
67
  </target>
 
68
 
 
69
  <target name="test" depends="compile-tests, test-samples"
 
70
          if="junit.available"
 
71
          description="Runs all the tests">
 
72
    <junit haltonfailure="yes" fork="yes">
 
73
      <test name="com.clarkware.junitperf.AllTests"/>
 
74
      <formatter type="plain" usefile="false"/>
 
75
      <classpath refid="project.classpath"/>
 
76
    </junit>
 
77
  </target>
 
78
 
 
79
  <target name="test-samples" depends="compile-samples"
 
80
          if="junit.available"
 
81
          description="Runs all the sample tests">
 
82
    <junit haltonfailure="yes" fork="yes">
 
83
      <test name="com.clarkware.junitperf.ExamplePerfTestSuite"/>
 
84
      <formatter type="plain" usefile="false"/>
 
85
      <classpath refid="project.classpath"/>
 
86
    </junit>
 
87
  </target>
 
88
 
 
89
  <target name="javadoc" depends="compile"
 
90
          description="Generates JavaDoc">
 
91
    
 
92
    <mkdir dir="${javadoc.dir}"/>
 
93
    
 
94
    <javadoc packagenames="*"
 
95
             sourcepath="${src.dir}"
 
96
             destdir="${javadoc.dir}"
 
97
             author="true"
 
98
             version="true"
 
99
             windowtitle="JUnitPerf ${version} API"
 
100
             doctitle="JUnitPerf ${version} API"
 
101
             bottom="Copyright &#169; 1999-2005 Clarkware Consulting, Inc.">
 
102
      <classpath refid="project.classpath"/>
 
103
    </javadoc>
 
104
  </target>
 
105
 
 
106
  <target name="jar" depends="compile"
 
107
          description="Creates a JAR file">
 
108
    
 
109
    <mkdir dir="${dist.dir}"/>
 
110
    
 
111
    <jar destfile="${dist.dir}/${dist.name}.jar"
 
112
         basedir="${build.dir}" />
 
113
 
 
114
  </target>
 
115
 
 
116
  <target name="package"
 
117
          depends="clean, test, jar, javadoc"
 
118
          description="Creates a distribution file">
 
119
 
 
120
    <copy todir="${package.dir}">
 
121
      <fileset dir="${basedir}">
 
122
        <include name="build.xml"/>
 
123
        <include name="README"/>
 
124
        <include name="CHANGES"/>
 
125
        <include name="LICENSE"/>
 
126
      </fileset>
 
127
    </copy>
 
128
    
 
129
    <copy todir="${package.dir}/docs">
 
130
      <fileset dir="${docs.dir}"/>
 
131
    </copy>
 
132
    
 
133
    <copy todir="${package.dir}/src">
 
134
      <fileset dir="${src.dir}"/>
 
135
    </copy>
 
136
    
 
137
    <copy todir="${package.dir}/test">
 
138
      <fileset dir="${test.dir}"/>
 
139
    </copy>  
 
140
    
 
141
    <copy todir="${package.dir}/samples">
 
142
      <fileset dir="samples"/>
 
143
    </copy>
 
144
    
 
145
    <copy todir="${package.dir}/lib"
 
146
          file="${dist.dir}/${dist.name}.jar"/>
 
147
 
 
148
    <tar tarfile="${dist.dir}/${dist.name}.tar.gz"
 
149
         basedir="${dist.dir}/"
 
150
         compression="gzip"
 
151
         includes="${dist.name}/**" />
 
152
 
 
153
    <zip destfile="${dist.dir}/${dist.name}.zip"
 
154
         basedir="${dist.dir}/"
 
155
         includes="${dist.name}/**" />
 
156
    
 
157
  </target> 
 
158
 
 
159
  <target name="clean" 
 
160
          description="Deletes all build artifacts">
 
161
    <delete dir="${build.dir}"/>
 
162
    <delete dir="${dist.dir}"/>
 
163
  </target>
 
164
 
 
165
</project>