Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Preinstrumentation does not work for plugins that depend on other plugins #13

Open
ogolberg opened this issue May 15, 2024 · 0 comments

Comments

@ogolberg
Copy link
Member

ogolberg commented May 15, 2024

E.g. if plugin under test has a compile-only dependency on AGP, which is typical for plugins that need to have some Android-specific variant/source set resolution logic, and the test project has AGP applied, as usual, the test will result in a ClassDefNotFoundError because the plugin under test and AGP live in different classloaders.

The other version of this issue is when the plugin under test depends on a first-party Kotlin plugin, e.g. Kapt. Because of artifact filtering, again, the Kapt plugin will live in a different classloader and will not be acessible by the plugin under test.

To fix this, we would have to bring compile-time dependencies into the TestKit plugin classpath and fine-tune dependency filtering or go back to the agent-based coverage collection after Gradle 8.8.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant