Is there a way to write tests to prove that only t...
# dependency-management
m
Is there a way to write tests to prove that only the api configuration is exposed to consuming projects, and that the implementation configuration jars are not leaked?
I guess it is not possible since the test classpaths always contain both the api and the implementation configurations:
v
Why do you want to test that Gradle works as expected? Or what is your intention?
m
I am having a hard time trying to find a way to test that I only declare what's needed for the api configuration so only the intended classes are exposed to consumers and no more. I thought I'd write a test that only had "api" and not "implementation", but I am not finding a way to do that, and the diagram says that too. To have a test with just the the api classes, it's not possible (have to get implementation too).
v
Just use https://github.com/autonomousapps/dependency-analysis-android-gradle-plugin/ then. It tells you if you have dependencies in api that you should have in implementation and many other things.
thank you 1
m
Wow, that plugin really is something. Thank you @Vampire! ❤️
👌 1
After using that plugin, I find that for one project it was somewhat helpful, and for another it did not appear to work at all, so I filled an issue https://github.com/autonomousapps/dependency-analysis-android-gradle-plugin/issues/668