-
Notifications
You must be signed in to change notification settings - Fork 300
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
Android module classes not included when tests run from Gradle #319
Comments
What classes ArchUnit will find should depend on the classpath supplied. Is it possible that IntelliJ supplies a bigger classpath than Gradle? What is the output of |
Here is a minimal example with the exact structure as I've described earlier: ArchUnitIssue319.zip When you run
But when you run it from terminal
|
I've debugged a little into it, and I think I've found the problem. In the past I already had some problem, because So I had some workaround already (e.g. for Now in your case the I'll do some research how big the performance impact of searching through the JARs really is. If it is not super big, I might drop the switch case for the workaround altogether and not use |
Tested with 0.14.1, works great, thank you! |
Let's say I have an Android project of 3 modules:
I have an ArchUnit tests set up and tests are placed in
:app
module that depends on both library modules.When I run them from Android Studio (IntelliJ Idea), the default
LocationProvider
will list classes of all modules:When I run
gradlew test
from console, the defaultLocationProvider
will list just classes of:app
module and.jar
file from:lib-java
module:My current workaround is to list all the modules manually in custom
LocationProvider
implementation.It seems that ArchUnit is not able to read classes from compiled output of
:lib-android
.Not sure what is a proper and generic solution for such Android modules. Maybe a special implementation of
com.tngtech.archunit.core.importer.Factory
but I didn't find a way how to register a customFactory
implementation to ArchUnit.The text was updated successfully, but these errors were encountered: