如何将JaCoCo配置导出到可在多个项目中重复使用的插件?
import org.gradle.api.Plugin
import org.gradle.api.Project
class MyJacoco implements Plugin<Project> {
@Override
void apply(Project project) {
project.configure(project) {
apply plugin: 'jacoco'
jacoco {
toolVersion = "0.8.0"
}
jacocoTestReport { // throws up on this
afterEvaluate {...}
group = "Reporting"
reports {...}
}
}
println(project.getPlugins().findPlugin('jacoco'))
}
}
在我发布的项目中,我只想使用...
apply plugin: MyJacoco
我也尝试过How to configure Gradle Java plugin from a custom Gradle plugin,但没有结果。