Repository navigation
fix: declare junit as a test-only dependency - #20
Open
mattiasgeniar wants to merge 1 commit into
Open
mattiasgeniar wants to merge 1 commit into
mattiasgeniar wants to merge 1 commit into
Conversation
mattiasgeniar
marked this pull request as ready for review
September 30, 2026 21:29
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.
Description
junit:junit:4.13.2is declared twice inbuild.gradle: once astestImplementation(correct) and once asimplementation. Theimplementationline puts it in the release runtime classpath, so the published POM forio.ionic.libs:ioncamera-androidlists JUnit withruntimescope:This PR removes the
implementationline. Nothing undersrc/mainimportsorg.junitororg.hamcrest, and the unit tests keep JUnit through the existingtestImplementationline.Context
Every app that uses
@capacitor/camera8.x depends on this library, so it ships JUnit and its Hamcrest dependency inside the release APK. Capacitor's app template does not enable R8 for release builds, so for most apps nothing strips these classes later.Measured on a production Capacitor 8.5 app, release build without R8 (the template default), identical except for this dependency:
junit/org.junit/org.hamcrestin the dexRelease runtime classpath of the library itself:
./gradlew dependencies --configuration releaseRuntimeClasspathjunit:junit:4.13.2,org.hamcrest:hamcrest-core:1.3Type of changes
Tests
./gradlew testDebugUnitTest assembleReleaseon this branch: 60 tests, 0 failures, release AAR builds.releaseRuntimeClasspathbefore and after, as in the table above.exclude group: 'junit'andexclude group: 'org.hamcrest'on itsreleaseRuntimeClasspath, which is the dependency graph this change publishes, measured withapkanalyzer dex packages.Screenshots (if appropriate)
n/a
Checklist