|
1 <?xml version="1.0" encoding="UTF-8"?> |
|
2 <project name="com.nokia.tracecompiler" default="cc" basedir=".."> |
|
3 |
|
4 <target name="cc" depends="init, test, analyze" description="Run unit tests and analyze code"/> |
|
5 |
|
6 <property name="javacVerbose" value="false"/> |
|
7 |
|
8 |
|
9 <!-- declare ant4eclipse --> |
|
10 <taskdef resource="net/sf/ant4eclipse/antlib.xml" /> |
|
11 |
|
12 |
|
13 <!-- PMD configuration --> |
|
14 <path id="pmd.lib" > |
|
15 <pathelement location="${ant.home}/lib/pmd-4.2.jar" /> |
|
16 <pathelement location="${ant.home}/lib/asm-3.1.jar" /> |
|
17 <pathelement location="${ant.home}/lib/jaxen-1.1.1.jar" /> |
|
18 </path> |
|
19 |
|
20 <taskdef name="pmd" classname="net.sourceforge.pmd.ant.PMDTask" classpathref="pmd.lib" /> |
|
21 |
|
22 <!-- Init target --> |
|
23 <target name="init"> |
|
24 <property environment="env"/> |
|
25 <property name="testdata.dir" location="${env.EPOCROOT}testdata"/> |
|
26 <property name="reports.dir" location="${env.EPOCROOT}testdata/reports"/> |
|
27 <property name="hudson_reports.dir" location="reports"/> |
|
28 |
|
29 <echo>Cleaning the ${hudson_reports.dir}</echo> |
|
30 <delete dir="${hudson_reports.dir}"/> |
|
31 <echo>Creating the ${hudson_reports.dir} directory</echo> |
|
32 <mkdir dir="${hudson_reports.dir}"/> |
|
33 </target> |
|
34 |
|
35 <!-- Test target --> |
|
36 <target name="test" depends="init"> |
|
37 <ant antfile="group/build.xml" target="run_unit"/> |
|
38 |
|
39 <!-- Copy reports folder to reports forder in Hudson workspace, so reports can be used in Hudson --> |
|
40 <copy todir="${hudson_reports.dir}"> |
|
41 <fileset dir="${reports.dir}"/> |
|
42 </copy> |
|
43 </target> |
|
44 |
|
45 <!-- Analyze target --> |
|
46 <target name="analyze" depends="init"> |
|
47 <!-- PMD --> |
|
48 <pmd> |
|
49 <!-- Rules --> |
|
50 <ruleset>basic</ruleset> |
|
51 <ruleset>codesize</ruleset> |
|
52 <ruleset>coupling</ruleset> |
|
53 <ruleset>design</ruleset> |
|
54 <ruleset>strictexception</ruleset> |
|
55 <ruleset>strings</ruleset> |
|
56 <ruleset>sunsecure</ruleset> |
|
57 <ruleset>unusedcode</ruleset> |
|
58 |
|
59 <!-- Output PMD report directly to reports forder in Hudson workspace, so report can be used in Hudson --> |
|
60 <formatter type="xml" toFile="${hudson_reports.dir}/report.pmd.xml"/> |
|
61 |
|
62 <!-- Files to analyze --> |
|
63 <fileset dir="../src/"> |
|
64 <include name="**/*.java"/> |
|
65 </fileset> |
|
66 </pmd> |
|
67 </target> |
|
68 |
|
69 </project> |