comparison sonar-ant.xml @ 28:ad0a75e20f7b

TL-34: Allow sonar to publish failing tests (ant 1.8.1+)
author smith@nwoca.org
date Mon, 11 Apr 2011 16:32:20 -0400
parents ea29594bb799
children bedf62f3916d
comparison
equal deleted inserted replaced
27:ea29594bb799 28:ad0a75e20f7b
10 value="http://ivy.ssdt.nwoca.org/repository/sonar/sonar-ant-task.jar"/> 10 value="http://ivy.ssdt.nwoca.org/repository/sonar/sonar-ant-task.jar"/>
11 <ssdt:fetch dest="${user.home.ant.lib}/sonar.jar" 11 <ssdt:fetch dest="${user.home.ant.lib}/sonar.jar"
12 src="${ssdt.sonar.jar.src}"/> 12 src="${ssdt.sonar.jar.src}"/>
13 <ssdt:import-ant file="jacoco-ant.xml"/> 13 <ssdt:import-ant file="jacoco-ant.xml"/>
14 14
15 <ssdt:add-dependency target="init" depends="-sonar-init"/>
16
17 <target name="-sonar-init">
18 <echo message="Sonar: Active"/>
19 <echoproperties prefix="ant"/>
20 <if>
21 <contains string="${ant.project.invoked-targets}" substring="sonar"/>
22 <then> <property name="ignore.failing.tests" value="true"/> </then>
23 </if>
24 <property name="sonar.active" value="true"/>
25 </target>
26
15 <target name="-check-sonar"> 27 <target name="-check-sonar">
16 <property file="${ssdt.devel.kit}/sonar.properties"/> 28 <property file="${ssdt.devel.kit}/sonar.properties"/>
17 <property name="sonar.host.url" value="http://ssdt-web-10.nwoca.org:9000" /> 29 <property name="sonar.host.url" value="http://ssdt-web-10.nwoca.org:9000" />
18 <property name="sonar.language" value="grvy"/> 30 <property name="sonar.language" value="grvy"/>
19 <taskdef uri="antlib:org.sonar.ant" resource="org/sonar/ant/antlib.xml"/> 31 <taskdef uri="antlib:org.sonar.ant" resource="org/sonar/ant/antlib.xml"/>
20 </target> 32 </target>
21 33
22 <target name="sonar" depends="project.init,-check-sonar,ivy-info,coverage.xml" if="sonar.enabled"> 34 <target name="sonar" depends="project.init,-check-sonar,ivy-info,coverage.xml" if="sonar.enabled">
35 <fail unless="sonar.active" message="Sonar has not been initialized"/>
23 <sonar:sonar 36 <sonar:sonar
24 workDir="${build.dir}/sonar" 37 workDir="${build.dir}/sonar"
25 key="${ivy.project.organisation}:${ivy.project.module}" 38 key="${ivy.project.organisation}:${ivy.project.module}"
26 version="${project.version}" > 39 version="${project.version}" >
27 <sources> 40 <sources>
36 <tests> 49 <tests>
37 <path location="${test.dir}" /> 50 <path location="${test.dir}" />
38 </tests> 51 </tests>
39 <binaries> 52 <binaries>
40 <path location="${build.dir}/classes" /> 53 <path location="${build.dir}/classes" />
41 </binaries> 54 </binaries>
42 </sonar:sonar> 55 </sonar:sonar>
56 <fail if="tests.failed">Some tests failed; see details above. (sonar)</fail>
43 </target> 57 </target>
44 58
45 </project> 59 </project>