Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
429 views
in Technique[技术] by (71.8m points)

gradle - Configure JaCoCo exclusions according to subprojects

The Gradle project structure: a root project with 2 subproject: sub1 and sub2.

Each subproject applies JaCoCo and configure its own exclusions, for example for project sub1:

        getClassDirectories().setFrom(classDirectories.files.collect {
            fileTree(dir: it, exclude: ['/sub1Exclusions/**'])
        })

The root project is creating a jacocoTestReport after a jacocoMerge was being done on the subprojects reports.

However, the exclusions of the subprojects are not respected by the root because the jacocoMerge only looks at the executionData.

I would like to configure the root's jacocoTestReport to have a configuration equals to:

        getClassDirectories().setFrom(classDirectories.files.collect {
            fileTree(dir: it, exclude: ['/sub1Exclusions/**', '/sub2Exclusions/**'])
        })

but obviously programatically and not everytime specify in 2 different places (subproject and a root).

Note that the jacoco plugin is intentionally not applied to the root project.

Any ideas?

question from:https://stackoverflow.com/questions/65943631/configure-jacoco-exclusions-according-to-subprojects

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...