You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -19,12 +19,18 @@ class RootCoveragePlugin : Plugin<Project> {
19
19
20
20
overridefunapply(project:Project) {
21
21
if (project.rootProject !== project) {
22
-
throwGradleException("The RootCoveragePlugin cannot be applied to project '${project.name}' because it is not the root project. Build file: ${project.buildFile}")
22
+
throwGradleException(
23
+
"The RootCoveragePlugin cannot be applied to project '${project.name}' because it"+
24
+
" is not the root project. Build file: ${project.buildFile}"
if (project.plugins.withType(JacocoPlugin::class.java).isEmpty()) {
27
-
project.logger.warn("Warning: Jacoco plugin was not found for project: '${project.name}', it has been applied automatically, but you should do this manually. Build file: ${project.buildFile}")
30
+
project.logger.warn(
31
+
"Warning: Jacoco plugin was not found for project: '${project.name}', it has been"+
32
+
" applied automatically, but you should do this manually. Build file: ${project.buildFile}"
33
+
)
28
34
project.plugins.apply(JacocoPlugin::class.java)
29
35
}
30
36
@@ -96,14 +102,51 @@ class RootCoveragePlugin : Plugin<Project> {
} ?:throwGradleException("Build variant `$buildVariant` required for module `${project.name}` does not exist. Make sure to use a proper build variant configuration using rootCoverage.buildVariant and rootCoverage.buildVariantOverrides.")
105
+
}
106
+
?:throwGradleException(
107
+
"Build variant `$buildVariant` required for module `${project.name}` does not exist. Make sure to use"+
108
+
" a proper build variant configuration using rootCoverage.buildVariant and"+
// Only Android Application and Android Library modules are supported for now.
142
196
val extension = subProject.extensions.findByName("android")
143
197
if (extension ==null) {
144
198
// TODO support java modules?
145
-
subProject.logger.warn("Note: Skipping code coverage for module '${subProject.name}', currently the RootCoveragePlugin does not yet support Java Library Modules.")
199
+
subProject.logger.warn(
200
+
"Note: Skipping code coverage for module '${subProject.name}', currently the"+
201
+
" RootCoveragePlugin does not yet support Java Library Modules."
202
+
)
146
203
return
147
204
} elseif (extension is com.android.build.gradle.FeatureExtension) {
148
205
// TODO support feature modules?
149
-
subProject.logger.warn("Note: Skipping code coverage for module '${subProject.name}', currently the RootCoveragePlugin does not yet support Android Feature Modules.")
206
+
subProject.logger.warn(
207
+
"Note: Skipping code coverage for module '${subProject.name}', currently the"+
208
+
" RootCoveragePlugin does not yet support Android Feature Modules."
209
+
)
150
210
return
151
211
}
152
212
@@ -157,74 +217,68 @@ class RootCoveragePlugin : Plugin<Project> {
157
217
extension.libraryVariants.all { variant ->
158
218
if (variant.buildType.isTestCoverageEnabled && variant.name.capitalize() == buildVariant.capitalize()) {
159
219
if (subProject.plugins.withType(JacocoPlugin::class.java).isEmpty()) {
160
-
subProject.logger.warn("Warning: Jacoco plugin was not found for project: '${subProject.name}', it has been applied automatically but you should do this manually. Build file: ${subProject.buildFile}")
220
+
subProject.logger.info(
221
+
"Jacoco plugin was not found for project: '${subProject.name}', it"+
222
+
" has been applied automatically but you should do this manually. Build file:"+
if (variant.buildType.isTestCoverageEnabled && variant.name.capitalize() == buildVariant.capitalize()) {
171
234
if (subProject.plugins.withType(JacocoPlugin::class.java).isEmpty()) {
172
-
subProject.logger.warn("Jacoco plugin not applied to project: '${subProject.name}'! RootCoveragePlugin automatically applied it but you should do this manually: ${subProject.buildFile}")
235
+
subProject.logger.info(
236
+
"Jacoco plugin was not found for project: '${subProject.name}', it"+
237
+
" has been applied automatically but you should do this manually. Build file:"+
0 commit comments