Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Reduce noise of AmbiguousArtifactVariantsException logs even more
The content of the `AmbiguousArtifactVariantsException` `message` is the following: ``` The consumer was configured to find a library for use during runtime, preferably optimized for Android, as well as attribute 'com.android.build.api.attributes.AgpVersionAttr' with value '8.4.0', attribute 'com.android.build.api.attributes.BuildTypeAttr' with value 'debug', attribute 'com.android.build.api.attributes.ProductFlavor:appType' with value 'standalone', attribute 'com.android.build.api.attributes.ProductFlavor:endpoint' with value 'dev', attribute 'com.android.build.api.attributes.ProductFlavor:platform' with value 'androidtv', attribute 'com.android.build.api.attributes.ProductFlavor:tenant' [...] [...] - Configuration [...] - Configuration ':coreUi:tenantADebugRuntimeElements' variant supported-locale-list declares a library for use during runtime, preferably optimized for Android, as well as attribute 'com.android.build.api.attributes.AgpVersionAttr' with value '8.4.0', attribute 'com.android.build.api.attributes.BuildTypeAttr' with value 'debug', attribute 'com.android.build.api.attributes.ProductFlavor:tenant' with value 'tenantA', attribute 'org.jetbrains.kotlin.platform.type' with value 'androidJvm': - Unmatched attributes: - Doesn't say anything about com.android.build.api.attributes.ProductFlavor:appType (required 'standalone') - Doesn't say anything about com.android.build.api.attributes.ProductFlavor:endpoint (required 'dev') - Doesn't say anything about com.android.build.api.attributes.ProductFlavor:platform (required 'androidtv') - Provides attribute 'artifactType' with value 'supported-locale-list' but the consumer didn't ask for it - Provides attribute 'com.android.build.gradle.internal.attributes.VariantAttr' with value 'tenantADebug' but the consumer didn't ask for it - Provides attribute 'tenant' with value 'tenantA' but the consumer didn't ask for it ``` So printing the `message` of this exception is also adding a lot of noise to the Gradle logs. It can take up to 157 lines when using four Android Flavors. And this exception is thrown multiple times. In the case of four Flavors 30 times (30*157=4710 lines). Also the `isDebugEnabled` condition is seemingly inverted. Printing the exception stacktrace for non-debug logs is likely unwanted. Since `warn` is always printed (`isWarnEnabled` is always `true`) this (expected) exception should only be printed on higher log levels: * `isInfoEnabled` (enabled via Gradle `--info` CLI parameter) includes only an hint that there's an ambiguity in the resolved config, and *no* details * `isDebugEnabled` (enabled via Gradle `--debug` CLI parameter) includes the complete exception with all the details
- Loading branch information