Browse Source

Merge pull request #1348 from flaix/ci-coverage

build: Create single XML JaCoCo report
tags/v1.9.2
Florian Zschocke 3 years ago
parent
commit
460fdcf4b0
No account linked to committer's email address
3 changed files with 33 additions and 7 deletions
  1. 6
    2
      .circleci/config.yml
  2. 1
    1
      build.moxie
  3. 26
    4
      build.xml

+ 6
- 2
.circleci/config.yml View File

path: build/target/reports path: build/target/reports




version: 2
version: 2.1


jobs: jobs:
buildJ8: buildJ8:
version: 2 version: 2
build: build:
jobs: jobs:
- "buildJ8"
- "buildJ8":
post-steps:
- run:
name: Upload coverage to Codecov
command: bash <(curl -s https://codecov.io/bash)
- "buildJ9" - "buildJ9"
- "buildJ11" - "buildJ11"

+ 1
- 1
build.moxie View File

- test 'org.mockito:mockito-core:1.10.19' - test 'org.mockito:mockito-core:1.10.19'
# Dependencies with the "build" scope are retrieved # Dependencies with the "build" scope are retrieved
# and injected into the Ant runtime classpath # 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' - build 'org.parboiled:parboiled-java:1.3.1'

+ 26
- 4
build.xml View File

<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<project name="gitblit" default="compile" xmlns:mx="antlib:org.moxie">
<project name="gitblit" default="compile" xmlns:mx="antlib:org.moxie" xmlns:jacoco="antlib:org.jacoco.ant">
<!-- <!--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
<property name="moxie.url" value="http://gitblit.github.io/moxie/maven" /> <property name="moxie.url" value="http://gitblit.github.io/moxie/maven" />
<property name="moxie.jar" value="moxie-toolkit-${moxie.version}.jar" /> <property name="moxie.jar" value="moxie-toolkit-${moxie.version}.jar" />
<property name="moxie.dir" value="${user.home}/.moxie" /> <property name="moxie.dir" value="${user.home}/.moxie" />
<property name="jacoco.version" value="0.8.4" />
<!-- Download Moxie from it's Maven repository to user.home --> <!-- Download Moxie from it's Maven repository to user.home -->
<mkdir dir="${moxie.dir}" /> <mkdir dir="${moxie.dir}" />
<get src="${moxie.url}/com/gitblit/moxie/moxie-toolkit/${moxie.version}/${moxie.jar}" <get src="${moxie.url}/com/gitblit/moxie/moxie-toolkit/${moxie.version}/${moxie.jar}"
If it exists, build.properties is automatically loaded. If it exists, build.properties is automatically loaded.
Explicitly set mxroot allowing CI servers to override the default. --> Explicitly set mxroot allowing CI servers to override the default. -->
<mx:init verbose="no" mxroot="${moxie.dir}" /> <mx:init verbose="no" mxroot="${moxie.dir}" />
<!-- Register JaCoCo tasks -->
<taskdef uri="antlib:org.jacoco.ant">
<classpath location="${moxie.dir}/remote/repo1.maven.org_maven2/org/jacoco/org.jacoco.ant/${jacoco.version}/org.jacoco.ant-${jacoco.version}-nodeps.jar" />
</taskdef>
<!-- Set Ant project properties --> <!-- Set Ant project properties -->
<property name="release.tag" value="v${project.version}" /> <property name="release.tag" value="v${project.version}" />
<property name="currentRelease.tag" value="v${project.releaseVersion}" /> <property name="currentRelease.tag" value="v${project.releaseVersion}" />
<!-- Run unit tests --> <!-- Run unit tests -->
<mx:test failonerror="true" /> <mx:test failonerror="true" />
<!-- Create JaCoCo single XML report file for code coverage service. -->
<jacoco:report>
<executiondata>
<file file="${project.outputDirectory}/jacoco.exec"/>
</executiondata>
<structure name="${project.name}">
<classfiles>
<fileset dir="${project.outputDirectory}/classes"/>
</classfiles>
<sourcefiles encoding="UTF-8">
<fileset dir="${project.src.dir}"/>
</sourcefiles>
</structure>
<xml destfile="${project.targetDirectory}/reports/coverage/jacoco.xml"/>
</jacoco:report>
</target> </target>

Loading…
Cancel
Save