File: build.xml

package info (click to toggle)
libconcurrentlinkedhashmap-java 1.1~jdk5-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd, stretch, wheezy
  • size: 536 kB
  • ctags: 990
  • sloc: java: 4,903; xml: 630; sh: 21; makefile: 16
file content (358 lines) | stat: -rw-r--r-- 11,936 bytes parent folder | download
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
<?xml version="1.0" encoding="UTF-8"?>
<project name="ConcurrentLinkedHashMap" default="package" basedir=".">
  <description>A concurrent version of java.util.LinkedHashMap</description>

  <!-- Load user overrides -->
  <property file="${user.home}/.${ant.project.name}-build.properties"/>
  <property file="${user.home}/.build.properties"/>
  <property file="build.properties"/>

  <!-- Load environment variables -->
  <property environment="env"/>

  <!-- Load tool settings -->
  <import file="${external.import}"/>

  <path id="deploy.path">
    <path refid="cache.benchmark.deploy.path"/>
    <path refid="caliper.deploy.path"/>
    <path refid="colt.deploy.path"/>
    <path refid="commons.collections.deploy.path"/>
    <path refid="commons.lang.deploy.path"/>
    <path refid="commons.math.deploy.path"/>
    <path refid="ehcache.deploy.path"/>
    <path refid="guava.deploy.path" />
    <path refid="hamcrest.deploy.path" />
    <path refid="testng.deploy.path" />
  </path>

  <path id="empty.path"/>

  <path id="test.path">
    <path refid="deploy.path"/>
    <pathelement location="${api.build.dir}"/>
    <pathelement location="${test.build.dir}"/>
  </path>
  
  <path id="benchmark.path">
    <path refid="deploy.path"/>
    <pathelement location="${api.build.dir}"/>
    <pathelement location="${test.build.dir}"/>
    <pathelement location="${benchmark.build.dir}"/>
  </path>

  <!--
  Do not provide a target with a description attribute unless the target
  is valid to call from outside the build file.
  -->
  <target name="init">
    <tstamp/>
    <mkdir dir="${api.build.dir}"/>
    <mkdir dir="${dist.dir}"/>
    <mkdir dir="${test.build.dir}"/>
    <mkdir dir="${tools.build.dir}"/>
  </target>

  <target name="clean" description="Removes all build artifacts.">
    <delete dir="${build.dir}"/>
    <delete dir="${dist.dir}"/>
  </target>

  <target
   name="compile"
   depends="init"
   description="Compiles Java sources into class files."
  >
    <macrodef name="compile.macro">
      <attribute name="srcdir"/>
      <attribute name="destdir"/>
      <attribute name="pathref"/>
      <sequential>
        <depend
         srcDir="@{srcdir}"
         destDir="@{destdir}"
         cache="@{destdir}"
         classpath="${api.build.dir}"
        />

        <javac
         srcdir="@{srcdir}"
         destdir="@{destdir}"
         classpathref="@{pathref}"
         debug="${javac.debug}"
         deprecation="${javac.deprecation}"
         fork="${javac.fork}"
         optimize="${javac.optimize}"
         source="${javac.source}"
         target="${javac.target}"
         verbose="${javac.verbose}"
         includeAntRuntime="false"
        >
          <compilerarg value="-Xlint:all,-path" compiler="modern"/>
        </javac>
      </sequential>
    </macrodef>

    <compile.macro srcdir="${api.src.dir}" destdir="${api.build.dir}" pathref="empty.path"/>
    <compile.macro srcdir="${test.src.dir}" destdir="${test.build.dir}" pathref="test.path"/>
    <compile.macro srcdir="${benchmark.src.dir}" destdir="${benchmark.build.dir}" pathref="test.path"/>
  </target>

  <target
   name="document"
   depends="compile"
   description="Generates API documentation in HTML format."
  >
    <javadoc sourcepath="${api.src.dir}" destdir="${javadoc.build.dir}"/>
  </target>

  <target
   name="package"
   depends="compile"
   description="Packages build artifacts into a jar."
  >
    <macrodef name="package.macro">
      <attribute name="destfile"/>
      <attribute name="dir"/>
      <sequential>
        <jar destfile="@{destfile}" duplicate="fail">
          <fileset dir="@{dir}" excludes="dependencies.txt"/>
          <manifest>
            <attribute name="Built-By" value="${user.name}"/>
            <section name="common">
              <attribute
               name="Implementation-Title"
               value="${manifest.impl.title}"
              />
              <attribute
               name="Implementation-URL"
               value="${manifest.impl.url}"
              />
              <attribute
               name="Implementation-Vendor"
               value="${manifest.impl.vendor}"
              />
              <attribute
               name="Implementation-Version"
               value="${manifest.impl.version}"
              />
            </section>
          </manifest>
        </jar>
      </sequential>
    </macrodef>

    <package.macro destfile="${dist.dir}/${manifest.impl.vendor}-${DSTAMP}.jar" dir="${api.build.dir}"/>
    <package.macro destfile="${dist.dir}/${manifest.impl.vendor}-test-${DSTAMP}.jar" dir="${test.build.dir}"/>
  </target>

  <!-- Tasks devoted to code reviews. -->
  <target
   name="run-analyzers"
   depends="run-findbugs, run-pmd"
   description="Runs various code analyzers."
  />

  <target
   name="run-findbugs"
   depends="compile"
   description="Runs the FindBugs tool."
  >
    <findbugs
     failOnError="${findbugs.failOnError}"
     home="${findbugs.home}"
     jvmargs="-Xms128m -Xmx128m"
     output="html"
     outputFile="${findbugs.outputFile}"
     reportLevel="${findbugs.reportLevel}"
    >
      <auxClasspath refid="deploy.path"/>
      <class location="${api.build.dir}"/>
      <class location="${test.build.dir}"/>
      <sourcePath path="${api.src.dir}"/>
      <sourcePath path="${test.src.dir}"/>
    </findbugs>
  </target>

  <target
   name="run-pmd"
   depends="compile"
   description="Runs the PMD tool."
  >
    <pmd
     failOnError="${pmd.failOnError}"
     failOnRuleViolation="${pmd.failOnRuleViolation}"
     rulesetfiles="${pmd.rulesetfiles}"
     shortFilenames="${pmd.shortFilenames}"
     targetjdk="${pmd.targetjdk}"
    >
      <fileset dir="${api.src.dir}" includes="**/*.java"/>
      <fileset dir="${test.src.dir}" includes="**/*.java"/>
      <formatter type="html" toFile="${pmd.toFile}"/>
    </pmd>
  </target>

  <macrodef name="testng.macro">
    <attribute name="pathref"/>
    <attribute name="outputdir"/>
    <element name="args" optional="true"/>
    <sequential>
      <testng
       classpathref="@{pathref}"
       dumpCommand="${testng.dumpCommand}"
       groups="${testng.groups}"
       haltonfailure="${testng.haltonfailure}"
       haltonskipped="${testng.haltonskipped}"
       outputdir="@{outputdir}"
      >
        <classfileset dir="${test.build.dir}"/>
        <jvmarg value="-Xms64m"/>
        <jvmarg value="-Xmx512m"/>
        <jvmarg value="-Xss1m"/>

        <!-- All tests -->
        <sysproperty key="test.debugMode" value="${test.debugMode}"/>
        <sysproperty key="test.exhaustive" value="${test.exhaustive}"/>

        <!-- Efficiency tests -->
        <sysproperty key="efficiency.maximumCapacity" value="${efficiency.maximumCapacity}"/>
        <sysproperty key="efficiency.workingSetSize" value="${efficiency.workingSetSize}"/>
        <sysproperty key="efficiency.distribution" value="${efficiency.distribution}"/>
        <sysproperty key="efficiency.distribution.uniform.lower" value="${efficiency.distribution.uniform.lower}"/>
        <sysproperty key="efficiency.distribution.uniform.upper" value="${efficiency.distribution.uniform.upper}"/>
        <sysproperty key="efficiency.distribution.exponential.mean" value="${efficiency.distribution.exponential.mean}"/>
        <sysproperty key="efficiency.distribution.gaussian.mean" value="${efficiency.distribution.gaussian.mean}"/>
        <sysproperty key="efficiency.distribution.gaussian.sigma" value="${efficiency.distribution.gaussian.sigma}"/>
        <sysproperty key="efficiency.distribution.poisson.mean" value="${efficiency.distribution.poisson.mean}"/>
        <sysproperty key="efficiency.distribution.zipfian.skew" value="${efficiency.distribution.zipfian.skew}"/>

        <!-- Multi-threaded tests -->
        <sysproperty key="multiThreaded.maximumCapacity" value="${multiThreaded.maximumCapacity}"/>
        <sysproperty key="multiThreaded.nThreads" value="${multiThreaded.nThreads}"/>
        <sysproperty key="multiThreaded.iterations" value="${multiThreaded.iterations}"/>
        <sysproperty key="multiThreaded.timeout" value="${multiThreaded.timeout}"/>
        <args/>
      </testng>
    </sequential>
  </macrodef>

  <target
   name="run-tests"
   depends="compile"
   description="Runs unit tests over the build artifacts."
  >
    <testng.macro pathref="test.path" outputdir="${testng.outputdir}"/>
  </target>

  <target
   name="run-coverage"
   depends="compile"
   description="Runs code coverage tests over the build artifacts."
  >
    <delete dir="${cobertura.dir}"/>
    <mkdir dir="${cobertura.dir}"/>

    <cobertura-instrument
     datafile="${cobertura.datafile}"
     todir="${cobertura.todir}"
    >
      <fileset dir="${api.build.dir}" includes="**/*.class"/>
    </cobertura-instrument>

    <path id="coverage.path">
      <pathelement location="${cobertura.todir}"/>
      <path refid="cobertura.compile.path"/>
      <path refid="test.path"/>
    </path>

    <testng.macro pathref="coverage.path" outputdir="${cobertura.dir}/test-output">
      <args>
        <sysproperty key="net.sourceforge.cobertura.datafile" file="${cobertura.datafile}"/>
      </args>
    </testng.macro>

    <cobertura-report
     format="${cobertura.format}"
     datafile="${cobertura.datafile}"
     destdir="${cobertura.destdir}"
     srcdir="${api.src.dir}"
    />
  </target>

  <target
    name="run-caliper"
    depends="compile"
    description="Runs Caliper micro-benchmarks over the build artifacts."
  >  
    <java
     classname="com.googlecode.concurrentlinkedhashmap.${caliper.scenario}Benchmark"
     classpathref="benchmark.path"
     fork="true"
     maxmemory="${caliper.heap}"
    >
      <arg value="--warmupMillis"/>
      <arg value="${caliper.warmupMillis}"/>
      
      <arg value="--runMillis"/>
      <arg value="${caliper.runMillis}"/>
      
      <arg value="--timeUnit"/>
      <arg value="${caliper.timeUnit}"/>
      
      <arg value="-DconcurrencyLevel=${caliper.benchmark.concurrencyLevel}"/>
      <arg value="-DinitialCapacity=${caliper.benchmark.initialCapacity}"/>
      <arg value="-DmaximumCapacity=${caliper.benchmark.maximumCapacity}"/>
      <arg value="-DnumberOfThreads=${caliper.benchmark.numberOfThreads}"/>
      <arg value="-DreadRatio=${caliper.scenario.getPut.readRatio}"/>
    </java>
  </target>
  
  <target
   name="run-benchmarks"
   depends="compile"
   description="Runs JBoss Cache micro-benchmarks over the build artifacts."
  >
    <mkdir dir="${cacheBenchFwk.report.dir}"/>

    <java
     classname="org.cachebench.CacheBenchmarkRunner"
     classpathref="benchmark.path"
     fork="true"
     maxmemory="${cacheBenchFwk.heap}"
     dir="${cacheBenchFwk.report.dir}"
    >
      <classpath>
        <path refid="${cacheBenchFwk.path}"/>
        <pathelement location="${cacheBenchFwk.config.dir}"/>
      </classpath>

      <jvmarg value="-Xms${cacheBenchFwk.heap}"/>

      <sysproperty key="cacheBenchFwk.cacheConfigFile" value="${cacheBenchFwk.config}"/>
      <sysproperty key="cacheBenchFwk.cacheProductName" value="${cacheBenchFwk.product}"/>
      <sysproperty key="cacheBenchFwk.cacheWrapperClassName" value="${cacheBenchFwk.wrapper}"/>
      <sysproperty key="cacheBenchFwk.fwkCfgFile" value="${cacheBenchFwk.config.file}"/>
      <sysproperty key="localOnly" value="true"/>
    </java>
  </target>

  <target
   name="run-reports"
   description="Runs the report generator for JBoss Cache micro-benchmark visualization."
  >
    <java
     classname="org.cachebench.reportgenerators.ChartGenerator"
     classpathref="benchmark.path"
     fork="true"
     dir="${cacheBenchFwk.report.dir}"
    >
      <classpath>
        <pathelement location="${cacheBenchFwk.config.dir}"/>
      </classpath>

      <arg line="-chartType ${cacheBenchFwk.report.chart}"/>
      <arg line="-o ${cacheBenchFwk.report.file}"/>
      <arg line="-reportDir ."/>
    </java>
  </target>
</project>