blob: 1b21d45cdca2e55735199f18c4de95ed6f6f7a74 (
plain)
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
|
<project name="Integration tests" basedir=".">
<property environment="env"/>
<property name="projects.dir" value="${basedir}/custom-projects"/>
<target name="prepare-extensions" depends="build-extensions">
<delete dir="${basedir}/target/extensions"/>
<mkdir dir="${basedir}/target/extensions"/>
<copy todir="${basedir}/target/extensions/rules/checkstyle" overwrite="true" verbose="true" flatten="true">
<fileset dir="${basedir}/../checkstyle-extensions">
<include name="checkstyle-extensions.xml"/>
<include name="target/checkstyle-extensions-*.jar"/>
</fileset>
</copy>
<copy todir="${basedir}/target/extensions/rules/pmd" overwrite="true" verbose="true" flatten="true">
<fileset dir="${basedir}/../pmd-extensions">
<include name="pmd-extensions.xml"/>
<include name="target/pmd-extensions-*.jar"/>
</fileset>
</copy>
<copy todir="${basedir}/target/extensions/plugins" flatten="true">
<fileset dir="${basedir}/target/sonar-basic-sample-plugin/target/">
<include name="sonar-basic-sample-plugin-*-SNAPSHOT.jar"/>
</fileset>
<fileset dir="${basedir}/target/sonar-gwt-sample-plugin/target/">
<include name="sonar-gwt-sample-plugin-*-SNAPSHOT.jar"/>
</fileset>
<fileset dir="${basedir}/../sonar-it-reference-plugin/">
<include name="target/sonar-it-reference-plugin-*-SNAPSHOT.jar"/>
</fileset>
</copy>
</target>
<target name="build-extensions">
<mkdir dir="${basedir}/target"/>
<mvn dir="target"
args="archetype:generate -B -DarchetypeGroupId=org.codehaus.sonar.archetypes -DarchetypeArtifactId=sonar-basic-plugin-archetype -DarchetypeVersion=${sonar.runtimeVersion} -DgroupId=com.mycompany.sonar -DartifactId=sonar-basic-sample-plugin -Dversion=0.1-SNAPSHOT"/>
<mvn args="install" dir="${basedir}/target/sonar-basic-sample-plugin"/>
<mvn dir="target"
args="archetype:generate -B -DarchetypeGroupId=org.codehaus.sonar.archetypes -DarchetypeArtifactId=sonar-gwt-plugin-archetype -DarchetypeVersion=${sonar.runtimeVersion} -DgroupId=com.mycompany.sonar -DartifactId=sonar-gwt-sample-plugin -Dversion=0.1-SNAPSHOT"/>
<mvn args="install" dir="${basedir}/target/sonar-gwt-sample-plugin"/>
</target>
<target name="analyze-custom-projects"
depends="ant-static,ant-dynamic-clover,ant-dynamic-cobertura,ant-dynamic-junit,deprecated-sonar-light,struts,timemachine,reuse-coverage-reports"/>
<target name="ant-static">
<execant dir="${projects.dir}/ant-static/"/>
<mvnsonar pom="${projects.dir}/ant-static/pom.xml"/>
</target>
<target name="ant-dynamic-clover">
<execant dir="${projects.dir}/ant-dynamic-clover/"/>
<mvnsonar pom="${projects.dir}/ant-dynamic-clover/pom.xml"/>
</target>
<target name="ant-dynamic-cobertura">
<execant dir="${projects.dir}/ant-dynamic-cobertura/"/>
<mvnsonar pom="${projects.dir}/ant-dynamic-cobertura/pom.xml"/>
</target>
<target name="ant-dynamic-junit">
<execant dir="${projects.dir}/ant-dynamic-junit/"/>
<mvnsonar pom="${projects.dir}/ant-dynamic-junit/pom.xml"/>
</target>
<target name="deprecated-sonar-light">
<execant dir="${projects.dir}/deprecated-sonar-light/"/>
<mvnsonar pom="${projects.dir}/deprecated-sonar-light/pom.xml"/>
</target>
<target name="reuse-coverage-reports">
<mvn args="clean install" dir="${projects.dir}/reuse-coverage-reports/" failonerror="false"/>
<mvnsonar pom="${projects.dir}/reuse-coverage-reports/pom.xml"/>
</target>
<target name="struts">
<mvn
args="scm:checkout -DconnectionUrl=scm:svn:http://svn.apache.org/repos/asf/struts/struts1/tags/STRUTS_1_3_9 -DcheckoutDirectory=struts-1.3.9"
dir="${projects.dir}"/>
<mvn args="clean install -DskipTests" dir="${projects.dir}/struts-1.3.9"/>
<mvnsonar pom="${projects.dir}/struts-1.3.9/pom.xml"/>
</target>
<target name="timemachine">
<mvn args="clean install -DskipTests" dir="${projects.dir}/timemachine"/>
<!-- last : 1.0-SNAPSHOT -->
<mvnsonar failonerror="false" pom="${projects.dir}/timemachine/pom.xml"/>
<!-- past revisions -->
<mvnsonar failonerror="false"
args="-Dsonar.projectDate=2007-03-12 -Dsonar.projectVersion=0.5-SNAPSHOT"
pom="${projects.dir}/timemachine/pom.xml"/>
<mvnsonar failonerror="false"
args="-Dsonar.projectDate=2007-04-20 -Dsonar.projectVersion=0.5"
pom="${projects.dir}/timemachine/pom.xml"/>
<mvnsonar args="-Dsonar.projectDate=2007-10-20 -Dsonar.projectVersion=0.6"
pom="${projects.dir}/timemachine/pom.xml"/>
<mvnsonar args="-Dsonar.projectDate=2007-12-10 -Dsonar.projectVersion=0.7"
pom="${projects.dir}/timemachine/pom.xml"/>
<mvnsonar args="-Dsonar.projectDate=2008-02-07 -Dsonar.projectVersion=0.8"
pom="${projects.dir}/timemachine/pom.xml"/>
<mvnsonar failonerror="false"
args="-Dsonar.projectDate=2008-04-15 -Dsonar.projectVersion=0.8"
pom="${projects.dir}/timemachine/pom.xml"/>
<mvnsonar failonerror="false"
args="-Dsonar.projectDate=2008-11-27 -Dsonar.projectVersion=0.9"
pom="${projects.dir}/timemachine/pom.xml"/>
<mvnsonar failonerror="false"
args="-Dsonar.projectDate=2008-10-19 -Dsonar.projectVersion=0.9"
pom="${projects.dir}/timemachine/pom.xml"/>
</target>
<target name="big-project">
<exec executable="ruby" failonerror="true" dir="${projects.dir}/big-project">
<arg line="generate-sources.rb 20 50"/>
</exec>
<mvn dir="${projects.dir}/big-project" args="clean install -DskipTests"/>
<mvnsonar pom="${projects.dir}/big-project/pom.xml" args="-Dcpd.skip=true"/>
<delete dir="${projects.dir}/big-project/src/main/java"/>
</target>
<target name="huge-project">
<exec executable="ruby" failonerror="true" dir="${projects.dir}/big-project">
<arg line="generate-sources.rb 50 500"/>
</exec>
<mvn dir="${projects.dir}/big-project" args="clean install -DskipTests"/>
<mvnsonar pom="${projects.dir}/big-project/pom.xml" args="-Dcpd.skip=true"/>
<delete dir="${projects.dir}/big-project/src/main/java"/>
</target>
<macrodef name="execant">
<attribute name="failonerror" default="true"/>
<attribute name="dir"/>
<sequential>
<exec dir="@{dir}" failonerror="@{failonerror}" executable="${env.ANT_HOME}/bin/ant.bat" osfamily="Windows">
</exec>
<exec dir="@{dir}" failonerror="@{failonerror}" executable="${env.ANT_HOME}/bin/ant" osfamily="unix">
</exec>
</sequential>
</macrodef>
<macrodef name="mvn">
<attribute name="failonerror" default="true"/>
<attribute name="args" default=""/>
<attribute name="dir"/>
<sequential>
<echo>Executing ${maven.home}/bin/mvn @{args}</echo>
<exec dir="@{dir}" failonerror="@{failonerror}" executable="${maven.home}/bin/mvn.bat" osfamily="Windows">
<arg line="@{args} -B -e"/>
</exec>
<exec dir="@{dir}" failonerror="@{failonerror}" executable="${maven.home}/bin/mvn" osfamily="unix">
<arg line="@{args} -B -e"/>
</exec>
</sequential>
</macrodef>
<macrodef name="mvnsonar">
<attribute name="failonerror" default="true"/>
<attribute name="args" default=""/>
<attribute name="pom"/>
<sequential>
<exec failonerror="@{failonerror}" executable="${maven.home}/bin/mvn.bat" osfamily="Windows">
<arg line="org.codehaus.mojo:sonar-maven-plugin:1.0-beta-1:sonar @{args} -B -e"/>
<arg line="-f @{pom}"/>
<arg value='-Dsonar.jdbc.url="${sonar.jdbc.url}"'/>
<arg value="-Dsonar.jdbc.driver=${sonar.jdbc.driver}"/>
<arg value="-Dsonar.jdbc.username=${sonar.jdbc.username}"/>
<arg value="-Dsonar.jdbc.password=${sonar.jdbc.password}"/>
</exec>
<exec failonerror="@{failonerror}" executable="${maven.home}/bin/mvn" osfamily="unix">
<arg line="org.codehaus.mojo:sonar-maven-plugin:1.0-beta-1:sonar @{args} -B -e"/>
<arg line="-f @{pom}"/>
<arg value='-Dsonar.jdbc.url=${sonar.jdbc.url}'/>
<arg value="-Dsonar.jdbc.driver=${sonar.jdbc.driver}"/>
<arg value="-Dsonar.jdbc.username=${sonar.jdbc.username}"/>
<arg value="-Dsonar.jdbc.password=${sonar.jdbc.password}"/>
</exec>
</sequential>
</macrodef>
</project>
|