From ddc5ee77b118c1101913ef4b73d17d2a9bbd0a48 Mon Sep 17 00:00:00 2001 From: Patrick Paul Date: Mon, 6 May 2019 18:01:09 -0700 Subject: [PATCH] Include support for jacoco source inclusion pattern Change-Id: Iec75f7041e38bda09abf4d85abc15219259eff2c --- jenkins_jobs/modules/publishers.py | 3 +++ tests/publishers/fixtures/jacoco-full.xml | 1 + tests/publishers/fixtures/jacoco-full.yaml | 1 + tests/publishers/fixtures/jacoco-minimal.xml | 1 + tests/publishers/fixtures/jacoco001.xml | 1 + tests/publishers/fixtures/jacoco001.yaml | 1 + 6 files changed, 8 insertions(+) diff --git a/jenkins_jobs/modules/publishers.py b/jenkins_jobs/modules/publishers.py index 393e530f5..65330b51b 100644 --- a/jenkins_jobs/modules/publishers.py +++ b/jenkins_jobs/modules/publishers.py @@ -1085,6 +1085,8 @@ def jacoco(registry, xml_parent, data): to locate class files (default ``**/classes``) :arg str source-pattern: This is a file name pattern that can be used to locate source files (default ``**/src/main/java``) + :arg str source-inclusion-pattern: This is a file name pattern that can + be used to include certain source files (default ``**/*.java``) :arg bool update-build-status: Update the build according to the results (default false) :arg str inclusion-pattern: This is a file name pattern that can be used @@ -1117,6 +1119,7 @@ def jacoco(registry, xml_parent, data): ('exec-pattern', 'execPattern', '**/**.exec'), ('class-pattern', 'classPattern', '**/classes'), ('source-pattern', 'sourcePattern', '**/src/main/java'), + ('source-inclusion-pattern', 'sourceInclusionPattern', '**/*.java'), ('update-build-status', 'changeBuildStatus', False), ('inclusion-pattern', 'inclusionPattern', ''), ('exclusion-pattern', 'exclusionPattern', ''), diff --git a/tests/publishers/fixtures/jacoco-full.xml b/tests/publishers/fixtures/jacoco-full.xml index 1c11bb977..43d07ef1f 100644 --- a/tests/publishers/fixtures/jacoco-full.xml +++ b/tests/publishers/fixtures/jacoco-full.xml @@ -5,6 +5,7 @@ **/**.exec **/classes **/src/main/java + **/*.java,**/*.kt true **/*.class **/*Test*.class diff --git a/tests/publishers/fixtures/jacoco-full.yaml b/tests/publishers/fixtures/jacoco-full.yaml index f1ea1d8b5..df3619cb4 100644 --- a/tests/publishers/fixtures/jacoco-full.yaml +++ b/tests/publishers/fixtures/jacoco-full.yaml @@ -3,6 +3,7 @@ publishers: exec-pattern: '**/**.exec' class-pattern: '**/classes' source-pattern: '**/src/main/java' + source-inclusion-pattern: '**/*.java,**/*.kt' update-build-status: true inclusion-pattern: '**/*.class' exclusion-pattern: '**/*Test*.class' diff --git a/tests/publishers/fixtures/jacoco-minimal.xml b/tests/publishers/fixtures/jacoco-minimal.xml index 309e36dd9..c18aef282 100644 --- a/tests/publishers/fixtures/jacoco-minimal.xml +++ b/tests/publishers/fixtures/jacoco-minimal.xml @@ -5,6 +5,7 @@ **/**.exec **/classes **/src/main/java + **/*.java false diff --git a/tests/publishers/fixtures/jacoco001.xml b/tests/publishers/fixtures/jacoco001.xml index ab66dab41..982dd0752 100644 --- a/tests/publishers/fixtures/jacoco001.xml +++ b/tests/publishers/fixtures/jacoco001.xml @@ -5,6 +5,7 @@ **/**.exec **/classes **/src/main/java + **/*.java true diff --git a/tests/publishers/fixtures/jacoco001.yaml b/tests/publishers/fixtures/jacoco001.yaml index fc45fd1c7..296e1ffc0 100644 --- a/tests/publishers/fixtures/jacoco001.yaml +++ b/tests/publishers/fixtures/jacoco001.yaml @@ -3,6 +3,7 @@ publishers: exec-pattern: "**/**.exec" class-pattern: "**/classes" source-pattern: "**/src/main/java" + source-inclusion-pattern: '**/*.java' update-build-status: true targets: - branch: