File: build.xml

package info (click to toggle)
libnb-platform18-java 12.1-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye
  • size: 729,624 kB
  • sloc: java: 5,058,967; xml: 574,432; php: 78,788; javascript: 29,039; ansic: 10,278; sh: 6,386; cpp: 4,612; jsp: 3,643; sql: 1,097; makefile: 540; objc: 288; perl: 277; haskell: 93
file content (505 lines) | stat: -rw-r--r-- 19,875 bytes parent folder | download | duplicates (3)
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
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
<?xml version="1.0" encoding="UTF-8"?>
<!--

    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 basedir="." default="all" name="changeme">
    <property name="netbeans.home" location="../../../nbbuild/netbeans"/>
    <!--the directory where the script will find ide.cfg files to start
        netbeans with -->
    <property name="configdir" value="configfiles"/>
    <!--the directory where *generated* data should go log files,
        subdirectories for each test run, etc, log files for later
        parsing, serialized data -->
    <property name="reportdir" location="report"/>
    <!--the directory that will be used as the user directory for the
        runs of NetBeans -->
    <property name="userdir" location="userdir"/>
    <property name="ant.home" location="../../../nbbuild/external/ant-1.4.1.jar"/>
    <!-- the DateFormat string for dates that are logged into log files -->
    <property name="logtime.pattern" value="yyyy.MM.dd hh:mm:ss:S z"/>
    <!-- the prefix string for garbage collection log files (e.g. gclog_1, gclog_2) -->
    <property name="gclogname" value="gclog"/>
    <!--the filename for the initial report generated by running the IDE.  This
        is not really a human readable report, just a bunch of pointers to 
        log files for each test-->
    <property name="reportname" value="outdata.dat"/>
    <!--filename for the defunct html report task -->
    <property name="outfilename" value="gcreport"/>
    <!--name (to write into the log) for this type of test.  Will be more 
        useful to specify dynamically, once test types are decoupled from
        the runner -->
    <property name="test-set-name" value="GC Tuning"/>
    <!--The directory to output html reports and such into-->
    <property name="htmldir" value="html"/>
    <!--Separator string for test sets in the log files this script
        generates (outdata.dat files)-->
    <property name="separator.testsets" value="%%%"/>
    <!--Separator string for data within a test set in the log files this
        script generates (outdata.dat files)-->
    <property name="separator.testdata" value="^^^"/>
    <!--The number of times each test should be run for averaging results
        and eliminating anomolies.  Script will run each test in configdir/
        count times-->
    <property name="count" value="10"/>
    <!--Name prefix for the time (start and end time) logs generated by
        this script-->
    <property name="timelogname" value="timelog"/>
    
<target name="all" depends="buildtasks,setup,test-configs,genoutput,cooldown" description=
   "Run garbage collection tests"/>
   
    <target name="foreachfile">
        <javac srcdir="src/" destdir="src/" includes="ForEachFileTask">
            <classpath>
                <pathelement location="${ant.home}"/>
                <pathelement location="src"/>
            </classpath>
        </javac>
        <taskdef name="foreachfile" classname="org.netbeans.performance.antext.ForEachFileTask">
            <classpath>
                <pathelement location="src"/>
            </classpath>
        </taskdef>
    </target>

    <target name="iteratingtask">
        <javac srcdir="src/" destdir="src/" includes="IteratingTask">
            <classpath>
                <pathelement location="${ant.home}"/>
                <pathelement location="src"/>
            </classpath>
        </javac>
        <taskdef name="iteratingtask" classname="org.netbeans.performance.antext.IteratingTask">
            <classpath>
                <pathelement location="src"/>
            </classpath>
        </taskdef>
    </target>    
    
    <target name="clean">
        <delete dir="${reportdir}"/>
        <delete dir="${htmldir}"/>
        <antcall target="delete-userdir"/>
        <!--remove the report directory
        remove the ide.cfg file -->
    </target>

    <target name="delete-userdir">
        <!--XXX find a way to preserve the userdir-->
        <delete dir="${userdir}"/>
    </target>
    
        
<target name="warmup" 
    description="Start the IDE thrice to load the disk cache and create the initial userdir contents, get Hotspot to compile away Ant overhead for consistency, etc."
    depends="create-userdir,add-userdir">
    <echo>Warmup 1 - running IDE once to prime disk and memory caches and create userdir</echo>

    <exec os="Windows NT Windows 95 Windows 98 Windows 2000 Windows XP" 
    executable="${netbeans.home}/bin/runide.exe" failonerror="yes" timeout="600000">
        <arg value="-J-Dnetbeans.close=true"/>
    </exec>

    <exec os="Linux SunOS Solaris" dir="." executable="sh" failonerror="yes" timeout="600000">
        <arg value="${netbeans.home}/bin/runide.sh"/>
        <arg value="-J-Dnetbeans.close=true"/>
    </exec>

    <echo>Warmup 2 - running IDE a second time prime disk and memory caches and create userdir</echo>
    <exec os="Windows NT Windows 95 Windows 98 Windows 2000 Windows XP" 
    executable="${netbeans.home}/bin/runide.exe" failonerror="yes" timeout="600000">
        <arg value="-J-Dnetbeans.close=true"/>
    </exec>

    <exec os="Linux SunOS Solaris" dir="." executable="sh" failonerror="yes" timeout="600000">
        <arg value="${netbeans.home}/bin/runide.sh"/>
        <arg value="-J-Dnetbeans.close=true"/>
    </exec>
</target>

 <!--moved compilation steps here to get out of the way and out of memory ahead of
 time in case they could affect tests-->
 <!--XXX put warmup task back-->
 <target name="setup" depends="clean,backup-idecfg,create-report-directory,create-userdir,warmup,begin-test-set" 
    description="Prepare environment for running tests"/>
    
<target name="backup-idecfg">
    <!--create file if missing so copy does not cause tests to bomb out-->
    <echo file="${netbeans.home}/bin/ide.cfg" append="true">
    </echo>
        <copy file="${netbeans.home}/bin/ide.cfg" tofile="${netbeans.home}/bin/ide.cfg.perftestbackup"/>
        <delete file="${netbeans.home}/bin/ide.cfg"/>
    <!--create file if missing so copy does not cause tests to bomb out-->
    <echo file="${netbeans.home}/bin/ide.log" append="true" message=""/>
        <copy file="${netbeans.home}/bin/ide.log" tofile="${netbeans.home}/bin/ide.log.perftestbackup"/>
        <delete file="${netbeans.home}/bin/ide.log"/>
</target>
    
<target name="create-report-directory">
    <mkdir dir="${reportdir}"/> 
</target>

<target name="create-userdir">
    <!--XXX find a way to make this conditional on keep.userdir-->
    <mkdir dir="${userdir}"/>
</target>

<target name="begin-test-set">
   <echo append="true" file="${reportdir}/${reportname}/" 
   message="TEST_SET:${test-set-name}${separator.testsets}"/>

   <!--XXX FIXME:  hard coded - should instead gather
   this info with a shell script which could later be wrapped.  -->
   <echo append="true" file="${reportdir}/${reportname}/" 
   message="PLATFORM:Solaris 5.8${separator.testsets}"/>

   <!--XXX FIXME:  hard coded - should instead gather
   this info with a shell script which could later be wrapped.  -->
   <echo append="true" file="${reportdir}/${reportname}/" 
   message="PLATFORM_CONFIG:Unknown${separator.testsets}"/>

</target>

<target name="test-configs" depends="setup,foreachfile" 
description="Test all of the config files in the config directory, logging results">
<!--update with foreachdir so that configuration sets can be tested-->
   <property name="reportfile" location="${reportdir}/${reportname}"/>
   <foreachfile target="iterate-one-config">
        <fileset dir="${configdir}">
            <include name="*"/>
        </fileset>
    </foreachfile>
    <antcall target="finish-test-set"/>
 </target>
    
 <target name="iterate-one-config" depends="iteratingtask">
    <property name="cfgdir" location="${reportdir}/${configfile_unqualified}"/>
    <property name="timelog" location="${cfgdir}/${timelogname}"/>
    <property name="gclog" location="${reportdir}/${configfile_unqualified}/${gclogname}"/>

    <antcall target="begin-report" inheritAll="true"/>
    <iteratingtask count="${count}" target="test-one-config">
    </iteratingtask>
 </target>
 
<target name="test-one-config">
    <echo>Testing ${configfile_unqualified} iteration ${index}
    </echo>
    
    <antcall target="prepare-one-test" inheritAll="true"/>
    <antcall target="run-one-test" inheritAll="true">
     </antcall>
</target>

<target name="prepare-one-test" 
  depends="copy-next-config-file,add-killargument,add-userdir,add-verbose-gcflags,create-report-subdir,copy-configfile-to-subdir"
  description="Set up environment for a single test"/>
    
<target name="copy-next-config-file">
    <delete file="${netbeans.home}/bin/ide.cfg"/>
    <echo>
Copying config file ${configfile} to ${netbeans.home}/bin/ide.cfg
</echo>        
    <copy file="${configfile}" tofile="${netbeans.home}/bin/ide.cfg"/>
</target>

<target name="add-killargument">
    <echo file="${netbeans.home}/bin/ide.cfg" append="true">
-J-Dnetbeans.close=true </echo>
</target>

<target name="add-verbose-gcflags">
    <echo file="${netbeans.home}/bin/ide.cfg" append="true">
-J-verbose:gc </echo>
</target>

<target name="add-userdir">
    <echo file="${netbeans.home}/bin/ide.cfg" append="true">
-userdir ${userdir} </echo>
</target>
    
<target name="copy-configfile-to-subdir">
   <copy file="${configfile}" tofile="${cfgdir}/ide.cfg"/>
</target>
    
<target name="create-report-subdir">
    <mkdir dir="${cfgdir}"/>
</target>

<target name="begin-report">
   <!--XXX - should not need to redefine cfgdir here-->
<!--   <property name="cfgdir" location="${reportdir}/${configfile_unqualified}"/> -->
   <echo append="true" file="${reportfile}" 
   message="TEST_RUN:${configfile_unqualified}${separator.testdata}"/>
   <echo append="true" file="${reportfile}" 
   message="LOGFILE:${cfgdir}/ide.log${separator.testdata}"/>
   <echo append="true" file="${reportfile}" 
   message="CONFIG:${cfgdir}/ide.cfg${separator.testdata}"/>
   <echo append="true" file="${reportfile}" 
   message="GCLOG:${cfgdir}/gclog${separator.testdata}"/>
   <echo append="true" file="${reportfile}" 
   message="TIMELOG:${timelog}${separator.testsets}"/>
</target>
        
<target name="run-one-test">
    <echo>Testing ${configfile}</echo>
    <antcall target="create-report-subdir" inheritAll="true"/>
    <antcall target="log-start-time" inheritAll="true"/>
    <antcall target="runide" inheritAll="true"/>
    <antcall target="log-end-time" inheritAll="true"/>
    <antcall target="copy-log-file" inheritAll="true"/>
</target>

<target name="finish-test-set">
    <echo>
Test {configfile_unqualified} completed</echo>
<echo file="${reportdir}/${reportname}/" append="true"
message="${separator.testsets}"/>
</target>

<target name="log-start-time">
    <echo> Timelog = ${timelog}</echo>
  <tstamp>
    <format pattern="${logtime.pattern}" property="timestamp"/>
  </tstamp>
  <echo file="${timelog}_${index}" append="true"
    message="START:${timestamp}${separator.testdata}"/>
</target>
    
  <target name="log-end-time">
    <property name="timelog" location="${cfgdir}/${timelogname}_${index}"/>
      <tstamp>
        <format property="timestamp" pattern="${logtime.pattern}"/>
      </tstamp>
      <echo file="${timelog}_${index}" append="true"
message="END:${timestamp}${separator.testdata}"/>
  </target>
  
  <target name="copy-log-file">
<echo>
Copying ide.log</echo>  
    <!--create file if missing so copy does not cause tests to bomb out-->
    <echo file="${netbeans.home}/bin/ide.log" append="true" message=""/>
    <copy file="${userdir}/system/ide.log" todir="${cfgdir}"/>
    <delete file="${userdir}/system/ide.log"/>
  </target>
    
  
<target name="runide-freshuserdir" depends="delete-userdir,create-userdir,runide" />
  
<target name="runide" description="Start the IDE with the userdir specified in the userdir property">
<exec os="Windows NT Windows 95 Windows 98 Windows 2000 Windows XP" 
executable="${netbeans.home}/bin/runide.exe" failonerror="yes" timeout="600000" 
output="${gclog}_${index}">
</exec>

<exec os="Linux SunOS Solaris" dir="." executable="sh" failonerror="yes" timeout="600000"
  output="${gclog}_${index}">
<arg value="${netbeans.home}/bin/runide.sh"/> 
</exec>
</target>


<target name="runide-uitests" description="Start the IDE and run the QA tests">

  <!--output file for the ant process (just in case)-->
<property name="qaoutfile" value="${cfgdir}/${gclogname}.antout_${index}"/>  

<ant dir="../../qa/test" antfile="../../qa/test/build.xml" output="${qaoutfile}">
    <property name="xtest.outputfile" location="${gclog}_${index}"/>
    <property name="xtest.userdir" location="${userdir}"/>
    <property name="xtest.testtype" value="qa-functional"/>
    <property name="xtest.attribs" value="validation"/>
</ant>
</target>



<target name="cooldown" description="Restore the universe to order"
  depends="restore-idecfg"/>
  
    <target name="restore-idecfg">
        <echo>
Removing generated ide.cfg file
        </echo>
        <delete file="${netbeans.home}/bin/ide.cfg"/>
        <echo>
Removing test userdir
        </echo>
        <delete dir="${userdir}"/>
        <echo>
Restoring original ide.cfg file
        </echo>
        <copy file="${netbeans.home}/bin/ide.cfg.perftestbackup" tofile="${netbeans.home}/bin/ide.cfg"/>
        <echo>
Deleting temporary backup ide.cfg file
        </echo>
        <delete file="${netbeans.home}/bin/ide.cfg.perftestbackup"/>
<echo>
Restoring original ide.log file
</echo>        
        <copy tofile="${netbeans.home}/bin/ide.log" file="${netbeans.home}/bin/ide.log.perftestbackup"/>
<echo>
Deleting backup ide.log file
</echo>
        <delete file="${netbeans.home}/bin/ide.log.perftestbackup"/>
    </target>

<target name="analyze" depends="buildtasks" description="Generate an html report">
      <mkdir dir="${htmldir}"/>
      <property name="outdir" location="${htmldir}"/>
      <tstamp>
        <format pattern="yyyyMMddhhmm" property="timestamp"/>
      </tstamp>
      
  <echo>
Generating report ${outdir}/${outfilename}.html</echo>
  <report datafile="${reportdir}/${reportname}" 
outfile="${outdir}/${outfilename}.html"
  dateformat="${logtime.pattern}"/>   
</target>  

    <target name="genserializeddata" depends="buildtasks">
        <genrunsdata datafile="${reportdir}/${reportname}" outfile="${reportdir}/logs.ser"/>
    </target>

   <target name="genoutput" depends="genserializeddata">
        <mkdir dir="${htmldir}"/>
        <gccharts datafile="${reportdir}/logs.ser" outdir="${htmldir}"/>
   </target>

    <target name="buildtasks"> 
        <javac srcdir="src" destdir="src" debug="true">
            <classpath>
                <pathelement location="src/"/>
                <fileset dir="lib/ext">
                    <include name="lib/ext/jcommon-0.7.0.jar"/>
                    <include name="lib/ext/jtreechart-0.9.3.jar"/> 
                </fileset>
            </classpath>
        </javac>
        <taskdef name="gccharts" classname="org.netbeans.performance.impl.analysis.GcCharts">
            <classpath>
                <pathelement location="src/"/>
                <fileset dir="lib/ext">
                    <include name="lib/ext/jcommon-0.7.0.jar"/>
                    <include name="lib/ext/jtreechart-0.9.3.jar"/> 
                </fileset>
            </classpath>
        </taskdef>
        <taskdef name="foreachfiletask" classname="org.netbeans.performance.antext.ForEachFileTask">
            <classpath>
                <pathelement location="src"/>
            </classpath>
        </taskdef>
        <taskdef name="genrunsdata" classname="org.netbeans.performance.impl.analysis.GenRunsData">
            <classpath>
                <pathelement location="src/"/>
            </classpath>
        </taskdef>
        
    </target> 
    
    <target name="get-jfreechart">
      <property name="libdir" location="lib/ext"/>
      <echo>
Downloading JFreeChart and common libraries from sourceforge.net.  These 
libraries cannot be hosted on netbeans.org for licensing reasons.

If this download fails (perhaps because you are behind a firewall), 
you can either run 

ant -DproxySet=true -DproxyHost=some.proxy.url -DproxyPort=[a port number here]

(you can also put these settings in the ANT_OPTS environment variable)
or you can download the libraries manually from 
 http://cesnet.dl.sourceforge.net/sourceforge/jfreechart/jfreechart-0.9.3.tar.gz
and
 http://cesnet.dl.sourceforge.net/sourceforge/jfreechart/jcommon-0.7.0.tar.gz
and put them in the lib/ext subdirectory of ${libdir}
      </echo>
<!--      <setproxy proxyhost="${proxy}" proxyport="${proxyport}"/> -->
      <get src="http://cesnet.dl.sourceforge.net/sourceforge/jfreechart/jfreechart-0.9.3.tar.gz"
        dest="/tmp/jfreechart-0.9.3.tar.gz" verbose="yes"/>
      <get src="http://cesnet.dl.sourceforge.net/sourceforge/jfreechart/jcommon-0.7.0.tar.gz"
        dest="/tmp/jcommon-0.7.0.tar.gz" verbose="yes"/>
      <gunzip src="/tmp/jcommon-0.7.0.tar.gz" dest="/tmp"/>
      <gunzip src="/tmp/jfreechart-0.9.3.tar.gz" dest="/tmp"/>
      <untar src="/tmp/jcommon-0.7.0.tar"/>
      <untar src="/tmp/jfreechart-0.9.3.tar" dest="/tmp"/>
      <copy todir="lib/ext" file="/tmp/jfreechart-0.9.3/jcommon-0.7.0.jar"/>
      <copy todir="lib/ext" file="/tmp/jcommon-0.7.0/jfreechart-0.9.3.jar"/>
    </target>

<!--
    <target name="reportengine">
        <javac srcdir="lib/antext" destdir="lib/antext" debug="true">
            <classpath>
                <pathelement location="${ant.home}"/>
                <pathelement location="lib/ext/jcommon-0.7.0.jar"/>
                <pathelement location="lib/ext/jtreechart-0.9.3.jar"/> 
            </classpath>
        </javac>
        <taskdef name="report" classname="nbperf.ReportEngine">
            <classpath>
                <pathelement location="lib/antext"/>
                <pathelement location="lib/ext/jcommon-0.7.0.jar"/>
                <pathelement location="lib/ext/jtreechart-0.9.3.jar"/> 
            </classpath>
        </taskdef>
    </target> -->
    
<!--

    <target name="checkchartlib">
        <javac srcdir="lib/antext" destdir="lib/antext" debug="true">
            <classpath>
                <pathelement location="${ant.home}"/>
            </classpath>
        </javac>
        <taskdef name="checkchartlib" classname="nbperf.CheckForJFreeChart">
            <classpath>
                <pathelement location="lib/antext"/>
            </classpath>
        </taskdef>
    </target>
    
    <target name="compilecharttask">
        <javac srcdir="lib/antext" destdir="lib/antext" debug="true">
            <classpath>
                <pathelement location="${ant.home}"/>
            </classpath>
        </javac>
        <taskdef name="buildcharts" classname="nbperf.CheckForJFreeChart">
            <classpath>
                <pathelement location="lib/antext"/>
            </classpath>
        </taskdef>
    </target>
    
    <target name="createcharts" depends="checkchartlib">
        <antcall target="compilecharttask"/>
        <property 
    </target>
    
-->

           
</project>