Enable test coverage only for debug builds - #63
Merged
Conversation
The Jacoco convention plugins enabled enableAndroidTestCoverage and
enableUnitTestCoverage on every build type. Coverage instrumentation
forces a variant to be debuggable, so all release artifacts since the
convention-plugin restructure carried android:debuggable=true.
This surfaced twice in the release pipeline: Gradle Play Publisher
skipped the release variants ('GPP cannot configure variant ... because
it is debuggable'), and the Play Developer API rejected the upload of
the v0.6.2 bundle ('APK is marked as debuggable').
Coverage is now enabled only for the debug build type, in both the
application and library convention plugins. Verified locally: the
release APK no longer contains the debuggable attribute.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Release artifacts have been built with
android:debuggable="true"since the convention-plugin restructure. The Jacoco convention plugins enabledenableAndroidTestCoverage/enableUnitTestCoverageon every build type, and coverage instrumentation forces a variant to be debuggable.This surfaced twice in the release pipeline:
GPP cannot configure variant 'playRelease' because it is debuggable) — the v0.6.1 failureAPK is marked as debuggable)Change
Coverage is now enabled only for the
debugbuild type, in bothAndroidApplicationJacocoConventionPluginandAndroidLibraryJacocoConventionPlugin.Testing
./gradlew :app:assembleFullReleaselocally: the release APK manifest no longer contains thedebuggableattribute (verified withaapt2 dump badging)./gradlew testpasses🤖 Generated with Claude Code