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: