Selaa lähdekoodia

Build-file fiddlage. Does not impact functionality.


git-svn-id: http://svn.dmdirc.com/trunk@4588 00569f92-eb28-0410-84fd-f71c24880f
tags/0.6
Chris Smith 15 vuotta sitten
vanhempi
commit
f8f10cfaf7
8 muutettua tiedostoa jossa 391 lisäystä ja 199 poistoa
  1. 3
    0
      build-installer.xml
  2. 7
    5
      build-plugins.xml
  3. 175
    0
      build-reports.xml
  4. 6
    6
      build-svn.xml
  5. 13
    3
      build-tests.xml
  6. 3
    8
      build.xml
  7. 177
    177
      checkstyle/build.xml
  8. 7
    0
      doreports.xml

+ 3
- 0
build-installer.xml Näytä tiedosto

@@ -22,4 +22,7 @@
22 22
         <echo message="This task only works on linux"/>
23 23
     </target>
24 24
 
25
+    <target name="installer" depends="-installer-nobuild, -installer-build"
26
+            description="Build the installer." />
27
+
25 28
 </project>

+ 7
- 5
build-plugins.xml Näytä tiedosto

@@ -17,7 +17,7 @@
17 17
     </taskdef>
18 18
     
19 19
     
20
-    <target name="makepluginjar">
20
+    <target name="-makepluginjar">
21 21
         <propertyregex property="pluginjar.name" input="${target.file}" regexp=".*[\\/](.*)$" select="\1.jar" casesensitive="false" />
22 22
         <propertyregex property="folder.name" input="${target.file}" regexp=".*${build.classes.dir}/(.*)$" select="\1" casesensitive="false" />
23 23
 
@@ -36,18 +36,20 @@
36 36
         </if>
37 37
     </target>
38 38
         
39
-    <target name="build-plugins" depends="build-plugins_bash, build-plugins_ant-contrib"/>
39
+    <target name="build-plugins"
40
+            depends="-build-plugins_bash, -build-plugins_ant-contrib"
41
+            description="Build all plugins. "/>
40 42
     
41
-    <target name="build-plugins_bash" unless="has.ant-contrib" if="has.bash">
43
+    <target name="-build-plugins_bash" unless="has.ant-contrib" if="has.bash">
42 44
         <exec executable="/bin/bash">
43 45
             <arg value="createAllPluginJar.sh"/>
44 46
             <arg value="${src.dir}/com/dmdirc/addons/"/>
45 47
         </exec>
46 48
     </target>
47 49
     
48
-    <target name="build-plugins_ant-contrib" if="has.ant-contrib">
50
+    <target name="-build-plugins_ant-contrib" if="has.ant-contrib">
49 51
         <mkdir dir="plugins/"/>
50
-        <foreach target="makepluginjar" param="target.file">
52
+        <foreach target="-makepluginjar" param="target.file">
51 53
             <path>
52 54
                 <dirset dir="${build.classes.dir}/com/dmdirc/addons/">
53 55
                     <include name="**/*"/>

+ 175
- 0
build-reports.xml Näytä tiedosto

@@ -0,0 +1,175 @@
1
+<?xml version="1.0" encoding="UTF-8"?>
2
+<project name="DMDirc-reports" default="default" basedir=".">
3
+    <description>Checkstyle, findbugs, CPD and PMD reports</description>
4
+
5
+    <target name="doallreports" depends="test-both,-allreports,javadoc"
6
+            description="Run all reports." />
7
+    <target name="domostreports" depends="test-both,-mostreports,javadoc"
8
+            description="Run all reports except Findbugs." />
9
+
10
+    <target name="checkstyle" depends="checkstyle-all, checkstyle-actions,
11
+                                       checkstyle-core,
12
+                                       checkstyle-commandparser,
13
+                                       checkstyle-config, checkstyle-logger,
14
+                                       checkstyle-parser, checkstyle-plugins,
15
+                                       checkstyle-ui, -remove-xml-files,
16
+                                       -move-index"
17
+            description="Run checkstyle." /> 
18
+
19
+    <target name="-allreports" depends="findbugs, cpd, pmd, checkstyle" /> 
20
+    <target name="-mostreports" depends="cpd, pmd, checkstyle" /> 
21
+    
22
+    <target name="checkstyle-plugins">
23
+        <taskdef resource="checkstyletask.properties"
24
+                         classpath="checkstyle-all-4.3.jar"/>
25
+        <checkstyle config="checkstyle/dmdirc_checks.xml" failureProperty="checkstyle.failure"
26
+                                failOnViolation="false">
27
+            <fileset dir="src/com/dmdirc/plugins/" includes="**/*.java"/>
28
+            <formatter type="xml" tofile="reports/report-plugins.xml"/>
29
+            
30
+        </checkstyle>
31
+        <xslt in="reports/report-plugins.xml" out="reports/report-plugins.html" style="checkstyle/checkstyle.xsl"/>
32
+    </target>
33
+    
34
+    <target name="checkstyle-actions">
35
+        <taskdef resource="checkstyletask.properties"
36
+                         classpath="checkstyle.jar"/>
37
+        <checkstyle config="checkstyle/dmdirc_checks.xml" failureProperty="checkstyle.failure"
38
+                                failOnViolation="false">
39
+            <fileset dir="src/com/dmdirc/actions/" includes="**/*.java"/>
40
+            <formatter type="xml" tofile="reports/report-actions.xml"/>
41
+            
42
+        </checkstyle>
43
+        <xslt in="reports/report-actions.xml" out="reports/report-actions.html" style="checkstyle/checkstyle.xsl"/>
44
+    </target>            
45
+    
46
+    <target name="checkstyle-ui">
47
+        <taskdef resource="checkstyletask.properties"
48
+                         classpath="checkstyle.jar"/>
49
+        <checkstyle config="checkstyle/dmdirc_checks.xml" failureProperty="checkstyle.failure"
50
+                                failOnViolation="false">
51
+            <fileset dir="src/com/dmdirc/ui/" includes="**/*.java"/>
52
+            <formatter type="xml" tofile="reports/report-ui.xml"/>
53
+        </checkstyle>
54
+        
55
+        <xslt in="reports/report-ui.xml" out="reports/report-ui.html" style="checkstyle/checkstyle.xsl"/>
56
+    </target>
57
+    
58
+    <target name="checkstyle-parser">
59
+        <taskdef resource="checkstyletask.properties"
60
+                         classpath="checkstyle.jar"/>
61
+        <checkstyle config="checkstyle/dmdirc_checks.xml" failureProperty="checkstyle.failure"
62
+                                failOnViolation="false">
63
+            <fileset dir="src/com/dmdirc/parser/" includes="**/*.java"/>
64
+            <formatter type="xml" tofile="reports/report-parser.xml"/>
65
+        </checkstyle>
66
+        <xslt in="reports/report-parser.xml" out="reports/report-parser.html" style="checkstyle/checkstyle.xsl"/>
67
+        
68
+    </target>
69
+    
70
+    <target name="checkstyle-logger">
71
+        <taskdef resource="checkstyletask.properties"
72
+                         classpath="checkstyle.jar"/>
73
+        <checkstyle config="checkstyle/dmdirc_checks.xml" failureProperty="checkstyle.failure"
74
+                                failOnViolation="false">
75
+            <fileset dir="src/com/dmdirc/logger/" includes="**/*.java"/>
76
+            <formatter type="xml" tofile="reports/report-logger.xml"/>
77
+        </checkstyle>
78
+        <xslt in="reports/report-logger.xml" out="reports/report-logger.html" style="checkstyle/checkstyle.xsl"/>
79
+    </target>
80
+    
81
+    
82
+    <target name="checkstyle-config">
83
+        <taskdef resource="checkstyletask.properties"
84
+                         classpath="checkstyle.jar"/>
85
+        <checkstyle config="checkstyle/dmdirc_checks.xml" failureProperty="checkstyle.failure"
86
+                                failOnViolation="false">
87
+            <fileset dir="src/com/dmdirc/config/" includes="**/*.java"/>
88
+            <formatter type="xml" tofile="reports/report-config.xml"/>
89
+        </checkstyle>
90
+        <xslt in="reports/report-config.xml" out="reports/report-config.html" style="checkstyle/checkstyle.xsl"/>
91
+    </target>
92
+    
93
+    <target name="checkstyle-commandparser">
94
+        <taskdef resource="checkstyletask.properties"
95
+                         classpath="checkstyle.jar"/>
96
+        <checkstyle config="checkstyle/dmdirc_checks.xml" failureProperty="checkstyle.failure"
97
+                                failOnViolation="false">
98
+            <fileset dir="src/com/dmdirc/commandparser/" includes="**/*.java"/>
99
+            <formatter type="xml" tofile="reports/report-commandparser.xml"/>
100
+        </checkstyle>
101
+        <xslt in="reports/report-commandparser.xml" out="reports/report-commandparser.html" style="checkstyle/checkstyle.xsl"/>
102
+    </target>
103
+    
104
+    <target name="checkstyle-core">
105
+        <taskdef resource="checkstyletask.properties"
106
+                         classpath="checkstyle.jar"/>
107
+        
108
+        <checkstyle config="checkstyle/dmdirc_checks.xml" failureProperty="checkstyle.failure"
109
+                                failOnViolation="false">
110
+            <fileset dir="src/com/dmdirc/" includes="*.java"/>
111
+            <formatter type="xml" tofile="reports/report-core.xml"/>
112
+        </checkstyle>
113
+        <xslt in="reports/report-core.xml" out="reports/report-core.html" style="checkstyle/checkstyle.xsl"/>
114
+    </target>
115
+    
116
+    <target name="checkstyle-all">
117
+        <taskdef resource="checkstyletask.properties"
118
+                         classpath="checkstyle.jar"/>
119
+        <checkstyle config="checkstyle/dmdirc_checks.xml" failureProperty="checkstyle.failure"
120
+                                failOnViolation="false">
121
+            
122
+            <fileset dir="src/com/dmdirc/" includes="**/*.java"/>
123
+            <formatter type="xml" tofile="reports/report-all.xml"/>
124
+        </checkstyle>
125
+        <xslt in="reports/report-all.xml" out="reports/report-all.html" style="checkstyle/checkstyle.xsl"/>
126
+    </target>
127
+    
128
+    <target name="-remove-xml-files">
129
+        <delete>
130
+            <fileset dir="reports/" includes="*.xml"/>
131
+        </delete>
132
+    </target>
133
+
134
+    <target name="-move-index">
135
+        <!-- <copy file="checkstyle/index.html" tofile="reports/index.html"/> -->
136
+        <copy file="checkstyle/sorttable.js" tofile="reports/sorttable.js"/>
137
+    </target>
138
+    
139
+    <target name="pmd" description="Run PMD.">
140
+        <taskdef name="pmd" classpath="pmd-3.9.jar" 
141
+                         classname="net.sourceforge.pmd.ant.PMDTask" />
142
+        <pmd shortFilenames="true">
143
+            
144
+            <ruleset>checkstyle/pmd_checks.xml</ruleset>
145
+            <formatter type="xml" toFile="reports/report-pmd.xml" linkPrefix="http://pmd.sourceforge.net/xref/"/>
146
+            <fileset dir="src/com/" includes="**/*.java" />
147
+        </pmd>
148
+        <xslt in="reports/report-pmd.xml" style="checkstyle/pmd.xslt" out="reports/report-pmd.html" />
149
+    </target>
150
+    
151
+    <target name="cpd" description="Run CPD.">
152
+        <taskdef name="cpd" classpath="pmd-3.9.jar" classname="net.sourceforge.pmd.cpd.CPDTask" />
153
+        
154
+        <cpd format="xml" minimumTokenCount="50" outputFile="reports/report-cpd.xml">
155
+            <fileset dir="src/com/">
156
+                <include name="**/*.java"/>
157
+            </fileset>
158
+        </cpd>
159
+        <xslt in="reports/report-cpd.xml" style="checkstyle/cpd.xslt" out="reports/report-cpd.html" />
160
+    </target>
161
+    
162
+    <target name="findbugs" depends="jar" description="Run Findbugs.">
163
+        <mkdir dir="reports/findbugs" />
164
+        <taskdef name="findbugs" classpath="findbugs-ant.jar"
165
+                         classname="edu.umd.cs.findbugs.anttask.FindBugsTask" />
166
+        <findbugs home="/usr/share/java/findbugs/" effort="max"
167
+                            jvmargs="-Xmx512M"
168
+                            output="xml:withMessages"
169
+                             outputFile="reports/findbugs/report-fb.xml" reportLevel="low">
170
+            <sourcePath path="src/" />
171
+            <class location="dist/DMDirc.jar" />
172
+        </findbugs>
173
+        <xslt in="reports/findbugs/report-fb.xml" style="checkstyle/findbugs.xslt" out="reports/report-fb.html" />
174
+    </target>
175
+</project>

+ 6
- 6
build-svn.xml Näytä tiedosto

@@ -6,32 +6,32 @@
6 6
         This will revert the svn revision in Main.java to prevent commiting the
7 7
         change everyt time someone builds and causing conflicts.
8 8
       -->
9
-    <target name="unsvn" depends="unsvn_nobash, unsvn_bash"/>
9
+    <target name="-unsvn" depends="-unsvn_nobash, -unsvn_bash"/>
10 10
 
11
-    <target name="unsvn_bash" if="has.bash">
11
+    <target name="-unsvn_bash" if="has.bash">
12 12
         <exec executable="/bin/bash">
13 13
             <arg value="AddSVN.sh"/>
14 14
             <arg value="--post"/>
15 15
         </exec>
16 16
     </target>
17 17
 
18
-    <target name="unsvn_nobash" unless="has.bash">
18
+    <target name="-unsvn_nobash" unless="has.bash">
19 19
         <echo message="This task only works on linux"/>
20 20
     </target>
21 21
 
22 22
     <!--
23 23
         This will add the svn revision to Main.java
24 24
       -->
25
-    <target name="addsvn" depends="addsvn_nobash, addsvn_bash"/>
25
+    <target name="-addsvn" depends="-addsvn_nobash, -addsvn_bash"/>
26 26
 
27
-    <target name="addsvn_bash" if="has.bash">
27
+    <target name="-addsvn_bash" if="has.bash">
28 28
         <exec executable="/bin/bash">
29 29
             <arg value="AddSVN.sh"/>
30 30
             <arg value="--pre"/>
31 31
         </exec>
32 32
     </target>
33 33
 
34
-    <target name="addsvn_nobash" unless="has.bash">
34
+    <target name="-addsvn_nobash" unless="has.bash">
35 35
         <echo message="This task only works on linux"/>
36 36
     </target>
37 37
 

+ 13
- 3
build-tests.xml Näytä tiedosto

@@ -6,7 +6,8 @@
6 6
     <taskdef resource="cloverlib.xml" classpath="${clover.jar}"/>
7 7
     <available property="clover.installed" classname="com.cenqua.clover.CloverInstr" />
8 8
 
9
-    <target name="with.clover" depends="clean" if="clover.installed">
9
+    <target name="with.clover" depends="clean" if="clover.installed"
10
+            description="Set up Clover to instrument tests.">
10 11
         <clover-clean/>
11 12
         <clover-setup>
12 13
             <fileset dir="src/com/" includes="**/*.java" />
@@ -17,14 +18,16 @@
17 18
         </clover-setup>
18 19
     </target>
19 20
 
20
-    <target name="clover.xml" if="clover.installed">
21
+    <target name="clover.xml" if="clover.installed"
22
+            description="Generate a Clover XML report.">
21 23
         <mkdir dir="reports/clover" />
22 24
         <clover-report>
23 25
             <current outfile="reports/clover/clover.xml"/>
24 26
         </clover-report>
25 27
     </target>
26 28
 
27
-    <target name="clover.html" if="clover.installed">
29
+    <target name="clover.html" if="clover.installed"
30
+            description="Generate a Clover HTML report.">
28 31
         <mkdir dir="reports/clover" />
29 32
         <mkdir dir="reports/clover/history" />
30 33
         <clover-historypoint historydir="reports/clover/history" />
@@ -48,4 +51,11 @@
48 51
         </junitreport>
49 52
     </target>
50 53
 
54
+    <target name="test-html" depends="with.clover,compile-test,test,clover.html"
55
+            description="Run tests and generate a Clover HTML report."/>
56
+    <target name="test-xml" depends="with.clover,compile-test,test,clover.xml"
57
+            description="Run tests and generate a Clover XML report."/>
58
+    <target name="test-both" depends="test-html,test-xml"
59
+            description="Run tests and generate Clover XML and HTML reports."/>
60
+
51 61
 </project>

+ 3
- 8
build.xml Näytä tiedosto

@@ -7,17 +7,12 @@
7 7
     <import file="nbproject/build-impl.xml"/>
8 8
     <import file="build-installer.xml"/>
9 9
     <import file="build-plugins.xml"/>
10
+    <import file="build-reports.xml"/>
10 11
     <import file="build-svn.xml"/>
11 12
     <import file="build-tests.xml"/>
12 13
 
13
-    <target name="installer" depends="-installer-nobuild, -installer-build"/>
14
-    
15
-    <target name="-post-compile" depends="unsvn, build-plugins"/>
16
-    <target name="-pre-compile" depends="addsvn"/>
17
-
18
-    <target name="test-html" depends="with.clover,compile-test,test,clover.html"/>
19
-    <target name="test-xml" depends="with.clover,compile-test,test,clover.xml"/>
20
-    <target name="test-both" depends="test-html,test-xml"/>
14
+    <target name="-post-compile" depends="-unsvn, build-plugins"/>
15
+    <target name="-pre-compile" depends="-addsvn"/>
21 16
     <target name="-post-test-run" depends="-do-test-reports"/>
22 17
 
23 18
 </project>

+ 177
- 177
checkstyle/build.xml Näytä tiedosto

@@ -1,180 +1,180 @@
1 1
 <?xml version="1.0" encoding="UTF-8"?>
2 2
 <project name="DMDirc" default="default" basedir=".">
3
-	<description>Builds, tests, and runs the project DMDirc.</description>
4
-	<import file="nbproject/build-impl.xml"/>    
5
-	<target name="checkstyle" depends=" 
6
-					checkstyle-all, 
7
-					checkstyle-actions,
8
-					checkstyle-core,
9
-					checkstyle-commandparser,
10
-					checkstyle-config,
11
-					checkstyle-logger,
12
-					checkstyle-parser,
13
-					checkstyle-plugins,
14
-					checkstyle-ui,
15
-					remove-xml-files, move-index" /> 
16
-	<target name="allreports" depends=" 
17
-					findbugs, 
18
-					cpd, 
19
-					pmd,
20
-					checkstyle" /> 
21
-	<target name="mostreports" depends=" 
22
-					cpd,
23
-					pmd,
24
-					checkstyle" /> 
25
-	
26
-	<target name="checkstyle-plugins">
27
-		<taskdef resource="checkstyletask.properties"
28
-						 classpath="checkstyle-all-4.3.jar"/>
29
-		<checkstyle config="checkstyle/dmdirc_checks.xml" failureProperty="checkstyle.failure"
30
-								failOnViolation="false">
31
-			<fileset dir="src/com/dmdirc/plugins/" includes="**/*.java"/>
32
-			<formatter type="xml" tofile="reports/report-plugins.xml"/>
33
-			
34
-		</checkstyle>
35
-		<xslt in="reports/report-plugins.xml" out="reports/report-plugins.html" style="checkstyle/checkstyle.xsl"/>
36
-	</target>
37
-	
38
-	<target name="checkstyle-actions">
39
-		<taskdef resource="checkstyletask.properties"
40
-						 classpath="checkstyle.jar"/>
41
-		<checkstyle config="checkstyle/dmdirc_checks.xml" failureProperty="checkstyle.failure"
42
-								failOnViolation="false">
43
-			<fileset dir="src/com/dmdirc/actions/" includes="**/*.java"/>
44
-			<formatter type="xml" tofile="reports/report-actions.xml"/>
45
-			
46
-		</checkstyle>
47
-		<xslt in="reports/report-actions.xml" out="reports/report-actions.html" style="checkstyle/checkstyle.xsl"/>
48
-	</target>            
49
-	
50
-	<target name="checkstyle-ui">
51
-		<taskdef resource="checkstyletask.properties"
52
-						 classpath="checkstyle.jar"/>
53
-		<checkstyle config="checkstyle/dmdirc_checks.xml" failureProperty="checkstyle.failure"
54
-								failOnViolation="false">
55
-			<fileset dir="src/com/dmdirc/ui/" includes="**/*.java"/>
56
-			<formatter type="xml" tofile="reports/report-ui.xml"/>
57
-		</checkstyle>
58
-		
59
-		<xslt in="reports/report-ui.xml" out="reports/report-ui.html" style="checkstyle/checkstyle.xsl"/>
60
-	</target>
61
-	
62
-	<target name="checkstyle-parser">
63
-		<taskdef resource="checkstyletask.properties"
64
-						 classpath="checkstyle.jar"/>
65
-		<checkstyle config="checkstyle/dmdirc_checks.xml" failureProperty="checkstyle.failure"
66
-								failOnViolation="false">
67
-			<fileset dir="src/com/dmdirc/parser/" includes="**/*.java"/>
68
-			<formatter type="xml" tofile="reports/report-parser.xml"/>
69
-		</checkstyle>
70
-		<xslt in="reports/report-parser.xml" out="reports/report-parser.html" style="checkstyle/checkstyle.xsl"/>
71
-		
72
-	</target>
73
-	
74
-	<target name="checkstyle-logger">
75
-		<taskdef resource="checkstyletask.properties"
76
-						 classpath="checkstyle.jar"/>
77
-		<checkstyle config="checkstyle/dmdirc_checks.xml" failureProperty="checkstyle.failure"
78
-								failOnViolation="false">
79
-			<fileset dir="src/com/dmdirc/logger/" includes="**/*.java"/>
80
-			<formatter type="xml" tofile="reports/report-logger.xml"/>
81
-		</checkstyle>
82
-		<xslt in="reports/report-logger.xml" out="reports/report-logger.html" style="checkstyle/checkstyle.xsl"/>
83
-	</target>
84
-	
85
-	
86
-	<target name="checkstyle-config">
87
-		<taskdef resource="checkstyletask.properties"
88
-						 classpath="checkstyle.jar"/>
89
-		<checkstyle config="checkstyle/dmdirc_checks.xml" failureProperty="checkstyle.failure"
90
-								failOnViolation="false">
91
-			<fileset dir="src/com/dmdirc/config/" includes="**/*.java"/>
92
-			<formatter type="xml" tofile="reports/report-config.xml"/>
93
-		</checkstyle>
94
-		<xslt in="reports/report-config.xml" out="reports/report-config.html" style="checkstyle/checkstyle.xsl"/>
95
-	</target>
96
-	
97
-	<target name="checkstyle-commandparser">
98
-		
99
-		<taskdef resource="checkstyletask.properties"
100
-						 classpath="checkstyle.jar"/>
101
-		<checkstyle config="checkstyle/dmdirc_checks.xml" failureProperty="checkstyle.failure"
102
-								failOnViolation="false">
103
-			<fileset dir="src/com/dmdirc/commandparser/" includes="**/*.java"/>
104
-			<formatter type="xml" tofile="reports/report-commandparser.xml"/>
105
-		</checkstyle>
106
-		<xslt in="reports/report-commandparser.xml" out="reports/report-commandparser.html" style="checkstyle/checkstyle.xsl"/>
107
-	</target>
108
-	
109
-	<target name="checkstyle-core">
110
-		<taskdef resource="checkstyletask.properties"
111
-						 classpath="checkstyle.jar"/>
112
-		
113
-		<checkstyle config="checkstyle/dmdirc_checks.xml" failureProperty="checkstyle.failure"
114
-								failOnViolation="false">
115
-			<fileset dir="src/com/dmdirc/" includes="*.java"/>
116
-			<formatter type="xml" tofile="reports/report-core.xml"/>
117
-		</checkstyle>
118
-		<xslt in="reports/report-core.xml" out="reports/report-core.html" style="checkstyle/checkstyle.xsl"/>
119
-	</target>
120
-	
121
-	<target name="checkstyle-all">
122
-		<taskdef resource="checkstyletask.properties"
123
-						 classpath="checkstyle.jar"/>
124
-		<checkstyle config="checkstyle/dmdirc_checks.xml" failureProperty="checkstyle.failure"
125
-								failOnViolation="false">
126
-			
127
-			<fileset dir="src/com/dmdirc/" includes="**/*.java"/>
128
-			<formatter type="xml" tofile="reports/report-all.xml"/>
129
-		</checkstyle>
130
-		<xslt in="reports/report-all.xml" out="reports/report-all.html" style="checkstyle/checkstyle.xsl"/>
131
-	</target>
132
-	
133
-	<target name="remove-xml-files">
134
-		<delete>
135
-			<fileset dir="reports/" includes="*.xml"/>
136
-		</delete>
137
-		
138
-	</target>
139
-	<target name="move-index">
140
-		<!-- <copy file="checkstyle/index.html" tofile="reports/index.html"/> -->
141
-		<copy file="checkstyle/sorttable.js" tofile="reports/sorttable.js"/>
142
-	</target>
143
-	
144
-	<target name="pmd">
145
-		<taskdef name="pmd" classpath="pmd-3.9.jar" 
146
-						 classname="net.sourceforge.pmd.ant.PMDTask" />
147
-		<pmd shortFilenames="true">
148
-			
149
-			<ruleset>checkstyle/pmd_checks.xml</ruleset>
150
-			<formatter type="xml" toFile="reports/report-pmd.xml" linkPrefix="http://pmd.sourceforge.net/xref/"/>
151
-			<fileset dir="src/com/" includes="**/*.java" />
152
-		</pmd>
153
-		<xslt in="reports/report-pmd.xml" style="checkstyle/pmd.xslt" out="reports/report-pmd.html" />
154
-	</target>
155
-	
156
-	<target name="cpd">
157
-		<taskdef name="cpd" classpath="pmd-3.9.jar" classname="net.sourceforge.pmd.cpd.CPDTask" />
158
-		
159
-		<cpd format="xml" minimumTokenCount="50" outputFile="reports/report-cpd.xml">
160
-			<fileset dir="src/com/">
161
-				<include name="**/*.java"/>
162
-			</fileset>
163
-		</cpd>
164
-		<xslt in="reports/report-cpd.xml" style="checkstyle/cpd.xslt" out="reports/report-cpd.html" />
165
-	</target>
166
-	
167
-	<target name="findbugs" depends="jar">
168
-		<mkdir dir="reports/findbugs" />
169
-		<taskdef name="findbugs" classpath="findbugs-ant.jar"
170
-						 classname="edu.umd.cs.findbugs.anttask.FindBugsTask" />
171
-		<findbugs home="/usr/share/java/findbugs/" effort="max"
172
-							jvmargs="-Xmx512M"
173
-							output="xml:withMessages"
174
-							 outputFile="reports/findbugs/report-fb.xml" reportLevel="low">
175
-			<sourcePath path="src/" />
176
-			<class location="dist/DMDirc.jar" />
177
-		</findbugs>
178
-		<xslt in="reports/findbugs/report-fb.xml" style="checkstyle/findbugs.xslt" out="reports/report-fb.html" />
179
-	</target>
3
+    <!--
4
+
5
+    THIS FILE IS DEPRECATED. THE TASKS HAVE BEEN INTEGRATED INTO THE MAIN
6
+    DMDIRC BUILD FILE. IT WILL BE REMOVED IN THE FUTURE. STOP USING IT.
7
+
8
+    -->
9
+
10
+    <description>Builds, tests, and runs the project DMDirc.</description>
11
+    <import file="nbproject/build-impl.xml"/>    
12
+    <target name="checkstyle" depends=" 
13
+                    checkstyle-all, 
14
+                    checkstyle-actions,
15
+                    checkstyle-core,
16
+                    checkstyle-commandparser,
17
+                    checkstyle-config,
18
+                    checkstyle-logger,
19
+                    checkstyle-parser,
20
+                    checkstyle-plugins,
21
+                    checkstyle-ui,
22
+                    remove-xml-files, move-index" /> 
23
+    <target name="allreports" depends="findbugs, cpd, pmd, checkstyle" /> 
24
+    <target name="mostreports" depends="cpd, pmd, checkstyle" /> 
25
+    
26
+    <target name="checkstyle-plugins">
27
+        <taskdef resource="checkstyletask.properties"
28
+                         classpath="checkstyle-all-4.3.jar"/>
29
+        <checkstyle config="checkstyle/dmdirc_checks.xml" failureProperty="checkstyle.failure"
30
+                                failOnViolation="false">
31
+            <fileset dir="src/com/dmdirc/plugins/" includes="**/*.java"/>
32
+            <formatter type="xml" tofile="reports/report-plugins.xml"/>
33
+            
34
+        </checkstyle>
35
+        <xslt in="reports/report-plugins.xml" out="reports/report-plugins.html" style="checkstyle/checkstyle.xsl"/>
36
+    </target>
37
+    
38
+    <target name="checkstyle-actions">
39
+        <taskdef resource="checkstyletask.properties"
40
+                         classpath="checkstyle.jar"/>
41
+        <checkstyle config="checkstyle/dmdirc_checks.xml" failureProperty="checkstyle.failure"
42
+                                failOnViolation="false">
43
+            <fileset dir="src/com/dmdirc/actions/" includes="**/*.java"/>
44
+            <formatter type="xml" tofile="reports/report-actions.xml"/>
45
+            
46
+        </checkstyle>
47
+        <xslt in="reports/report-actions.xml" out="reports/report-actions.html" style="checkstyle/checkstyle.xsl"/>
48
+    </target>            
49
+    
50
+    <target name="checkstyle-ui">
51
+        <taskdef resource="checkstyletask.properties"
52
+                         classpath="checkstyle.jar"/>
53
+        <checkstyle config="checkstyle/dmdirc_checks.xml" failureProperty="checkstyle.failure"
54
+                                failOnViolation="false">
55
+            <fileset dir="src/com/dmdirc/ui/" includes="**/*.java"/>
56
+            <formatter type="xml" tofile="reports/report-ui.xml"/>
57
+        </checkstyle>
58
+        
59
+        <xslt in="reports/report-ui.xml" out="reports/report-ui.html" style="checkstyle/checkstyle.xsl"/>
60
+    </target>
61
+    
62
+    <target name="checkstyle-parser">
63
+        <taskdef resource="checkstyletask.properties"
64
+                         classpath="checkstyle.jar"/>
65
+        <checkstyle config="checkstyle/dmdirc_checks.xml" failureProperty="checkstyle.failure"
66
+                                failOnViolation="false">
67
+            <fileset dir="src/com/dmdirc/parser/" includes="**/*.java"/>
68
+            <formatter type="xml" tofile="reports/report-parser.xml"/>
69
+        </checkstyle>
70
+        <xslt in="reports/report-parser.xml" out="reports/report-parser.html" style="checkstyle/checkstyle.xsl"/>
71
+        
72
+    </target>
73
+    
74
+    <target name="checkstyle-logger">
75
+        <taskdef resource="checkstyletask.properties"
76
+                         classpath="checkstyle.jar"/>
77
+        <checkstyle config="checkstyle/dmdirc_checks.xml" failureProperty="checkstyle.failure"
78
+                                failOnViolation="false">
79
+            <fileset dir="src/com/dmdirc/logger/" includes="**/*.java"/>
80
+            <formatter type="xml" tofile="reports/report-logger.xml"/>
81
+        </checkstyle>
82
+        <xslt in="reports/report-logger.xml" out="reports/report-logger.html" style="checkstyle/checkstyle.xsl"/>
83
+    </target>
84
+    
85
+    
86
+    <target name="checkstyle-config">
87
+        <taskdef resource="checkstyletask.properties"
88
+                         classpath="checkstyle.jar"/>
89
+        <checkstyle config="checkstyle/dmdirc_checks.xml" failureProperty="checkstyle.failure"
90
+                                failOnViolation="false">
91
+            <fileset dir="src/com/dmdirc/config/" includes="**/*.java"/>
92
+            <formatter type="xml" tofile="reports/report-config.xml"/>
93
+        </checkstyle>
94
+        <xslt in="reports/report-config.xml" out="reports/report-config.html" style="checkstyle/checkstyle.xsl"/>
95
+    </target>
96
+    
97
+    <target name="checkstyle-commandparser">
98
+        
99
+        <taskdef resource="checkstyletask.properties"
100
+                         classpath="checkstyle.jar"/>
101
+        <checkstyle config="checkstyle/dmdirc_checks.xml" failureProperty="checkstyle.failure"
102
+                                failOnViolation="false">
103
+            <fileset dir="src/com/dmdirc/commandparser/" includes="**/*.java"/>
104
+            <formatter type="xml" tofile="reports/report-commandparser.xml"/>
105
+        </checkstyle>
106
+        <xslt in="reports/report-commandparser.xml" out="reports/report-commandparser.html" style="checkstyle/checkstyle.xsl"/>
107
+    </target>
108
+    
109
+    <target name="checkstyle-core">
110
+        <taskdef resource="checkstyletask.properties"
111
+                         classpath="checkstyle.jar"/>
112
+        
113
+        <checkstyle config="checkstyle/dmdirc_checks.xml" failureProperty="checkstyle.failure"
114
+                                failOnViolation="false">
115
+            <fileset dir="src/com/dmdirc/" includes="*.java"/>
116
+            <formatter type="xml" tofile="reports/report-core.xml"/>
117
+        </checkstyle>
118
+        <xslt in="reports/report-core.xml" out="reports/report-core.html" style="checkstyle/checkstyle.xsl"/>
119
+    </target>
120
+    
121
+    <target name="checkstyle-all">
122
+        <taskdef resource="checkstyletask.properties"
123
+                         classpath="checkstyle.jar"/>
124
+        <checkstyle config="checkstyle/dmdirc_checks.xml" failureProperty="checkstyle.failure"
125
+                                failOnViolation="false">
126
+            
127
+            <fileset dir="src/com/dmdirc/" includes="**/*.java"/>
128
+            <formatter type="xml" tofile="reports/report-all.xml"/>
129
+        </checkstyle>
130
+        <xslt in="reports/report-all.xml" out="reports/report-all.html" style="checkstyle/checkstyle.xsl"/>
131
+    </target>
132
+    
133
+    <target name="remove-xml-files">
134
+        <delete>
135
+            <fileset dir="reports/" includes="*.xml"/>
136
+        </delete>
137
+        
138
+    </target>
139
+    <target name="move-index">
140
+        <!-- <copy file="checkstyle/index.html" tofile="reports/index.html"/> -->
141
+        <copy file="checkstyle/sorttable.js" tofile="reports/sorttable.js"/>
142
+    </target>
143
+    
144
+    <target name="pmd">
145
+        <taskdef name="pmd" classpath="pmd-3.9.jar" 
146
+                         classname="net.sourceforge.pmd.ant.PMDTask" />
147
+        <pmd shortFilenames="true">
148
+            
149
+            <ruleset>checkstyle/pmd_checks.xml</ruleset>
150
+            <formatter type="xml" toFile="reports/report-pmd.xml" linkPrefix="http://pmd.sourceforge.net/xref/"/>
151
+            <fileset dir="src/com/" includes="**/*.java" />
152
+        </pmd>
153
+        <xslt in="reports/report-pmd.xml" style="checkstyle/pmd.xslt" out="reports/report-pmd.html" />
154
+    </target>
155
+    
156
+    <target name="cpd">
157
+        <taskdef name="cpd" classpath="pmd-3.9.jar" classname="net.sourceforge.pmd.cpd.CPDTask" />
158
+        
159
+        <cpd format="xml" minimumTokenCount="50" outputFile="reports/report-cpd.xml">
160
+            <fileset dir="src/com/">
161
+                <include name="**/*.java"/>
162
+            </fileset>
163
+        </cpd>
164
+        <xslt in="reports/report-cpd.xml" style="checkstyle/cpd.xslt" out="reports/report-cpd.html" />
165
+    </target>
166
+    
167
+    <target name="findbugs" depends="jar">
168
+        <mkdir dir="reports/findbugs" />
169
+        <taskdef name="findbugs" classpath="findbugs-ant.jar"
170
+                         classname="edu.umd.cs.findbugs.anttask.FindBugsTask" />
171
+        <findbugs home="/usr/share/java/findbugs/" effort="max"
172
+                            jvmargs="-Xmx512M"
173
+                            output="xml:withMessages"
174
+                             outputFile="reports/findbugs/report-fb.xml" reportLevel="low">
175
+            <sourcePath path="src/" />
176
+            <class location="dist/DMDirc.jar" />
177
+        </findbugs>
178
+        <xslt in="reports/findbugs/report-fb.xml" style="checkstyle/findbugs.xslt" out="reports/report-fb.html" />
179
+    </target>
180 180
 </project>

+ 7
- 0
doreports.xml Näytä tiedosto

@@ -1,5 +1,12 @@
1 1
 <?xml version="1.0" encoding="UTF-8"?>
2 2
 <project name="DMDirc" default="default" basedir=".">
3
+    <!--
4
+
5
+    THIS FILE IS DEPRECATED. THE TASKS HAVE BEEN INTEGRATED INTO THE MAIN
6
+    DMDIRC BUILD FILE. IT WILL BE REMOVED IN THE FUTURE. STOP USING IT.
7
+
8
+    -->
9
+
3 10
     <description>Builds, tests, and runs the project DMDirc.</description>
4 11
     <import file="junitreport.xml" />
5 12
     <import file="style_build.xml" />

Loading…
Peruuta
Tallenna