Repository navigation
Support Android JVM test agents with lazy variant configuration - #419
Merged
Merged
Conversation
🔎 No tests executed 🔎🏷️ Commit: 495d366 Learn more about TestLens at testlens.app/docs. |
ryandens
marked this pull request as ready for review
October 17, 2026 20:03
ryandens
added a commit
that referenced
this pull request
Oct 17, 2026
Kotlin Multiplatform projects declare JVM test tasks such as `jvmTest` or `desktopTest` instead of Java's `test` task. Configure JVM `Test` tasks lazily so agents attach with either plugin order and projects without JVM targets remain supported. Resolve agents independently per test task, inferring omitted versions from its runtime classpath while preserving shared declarations, dependency-specific options, and configuration-cache reuse. Add Multiplatform usage documentation and regression coverage for default and named JVM targets, plugin order, disabling agents, and non-JVM projects. Validation: `./gradlew :plugin:check` passes (30 tests, formatting checks, and plugin validation). Rechecked after rebasing onto the Android support change in #419. Closes #323.
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.
Closes #260.
Adds
com.ryandens.javaagent-test-androidin a separateandroidsubproject, following the structure and configuration-avoidance guidance in #300. Android application and library modules can attach agents to their host-side JVM tests without applying the incompatible Java plugin.Uses AGP’s public
onVariantsand lazyconfigureTestTaskAPIs, covering arbitrary flavors/build types and either plugin order. Each host test resolves versionless agents from its own runtime classpath, including BOM constraints and selected-version overrides. Sharedjavaagentdeclarations andtestJavaagentoption overrides use the existing resolver. Enablement stays lazy; disabled agents are not resolved, and project agent JARs retain their producing-task dependencies.Validation: the full build passes with 40 tests on AGP 9.4.1 / Gradle 9.8.1; all nine Android regressions also pass on AGP 8.13.2 / Gradle 9.5.0. Coverage includes configuration-cache reuse, build-cache restoration, Isolated Projects, parallel execution, lazy
help, and disabled/empty configurations. CI provisions the Android SDK and runs both compatibility suites on Linux and Windows; both platforms pass on the latest head. Fixtures use private, pre-created Android preference caches, and CI retains their reports. AGP is compile-only in the published module; generated publication metadata was checked.