]> source.dussan.org Git - gitblit.git/commitdiff
build: Activate JaCoCo explicitly for Ant build
authorFlorian Zschocke <f.zschocke+git@gmail.com>
Thu, 22 Oct 2020 18:43:45 +0000 (20:43 +0200)
committerFlorian Zschocke <f.zschocke+git@gmail.com>
Thu, 22 Oct 2020 18:43:45 +0000 (20:43 +0200)
When building with Ant, instead of Moxie, JaCoCo is not included in the
classpath. So explicitly initialise the full `jacocoant.jar` from the
`.moxie` repository.

For this we had to switch the dependency to use the `nodeps` jar which
includes all dependencies.

build.moxie
build.xml

index bb0d426e7bf1465768975ccf79d14ccc7bca4f35..ab1d79a9163fadfc6301c3bfb70b8fcd0b290d5c 100644 (file)
@@ -192,5 +192,5 @@ dependencies:
 - test 'org.mockito:mockito-core:1.10.19'
 # Dependencies with the "build" scope are retrieved
 # and injected into the Ant runtime classpath
-- build 'org.jacoco:org.jacoco.ant:0.8.4'
+- build 'org.jacoco:org.jacoco.ant:0.8.4:nodeps'
 - build 'org.parboiled:parboiled-java:1.3.1'
index 0caa3bd2d8aa85bb5a53c279d7a0ba3c5f10a217..afe60496955aab2ec250ba1a3a5872912639a6ac 100644 (file)
--- a/build.xml
+++ b/build.xml
@@ -12,7 +12,9 @@
        <property name="moxie.url" value="http://gitblit.github.io/moxie/maven" />\r
        <property name="moxie.jar" value="moxie-toolkit-${moxie.version}.jar" />\r
        <property name="moxie.dir" value="${user.home}/.moxie" />\r
-       \r
+\r
+       <property name="jacoco.version" value="0.8.4" />\r
+\r
        <!-- Download Moxie from it's Maven repository to user.home -->\r
        <mkdir dir="${moxie.dir}" />\r
        <get src="${moxie.url}/com/gitblit/moxie/moxie-toolkit/${moxie.version}/${moxie.jar}"\r
                     If it exists, build.properties is automatically loaded.\r
                     Explicitly set mxroot allowing CI servers to override the default. -->\r
                <mx:init verbose="no" mxroot="${moxie.dir}" />\r
-                               \r
+\r
+               <!-- Register JaCoCo tasks -->\r
+               <taskdef uri="antlib:org.jacoco.ant">\r
+                       <classpath location="${moxie.dir}/remote/repo1.maven.org_maven2/org/jacoco/org.jacoco.ant/${jacoco.version}/org.jacoco.ant-${jacoco.version}-nodeps.jar" />\r
+               </taskdef>\r
+\r
                <!-- Set Ant project properties -->\r
                <property name="release.tag" value="v${project.version}" />\r
                <property name="currentRelease.tag" value="v${project.releaseVersion}" />\r