GoTo Implementation in other gradle module

Answered

We have a gradle project with different modules. This module depends on each other but only on compile dependencies not on the complete module. This is achieved through a special configuration in the modules, which provides only the interfaces and data classes against which other modules can compile. This configuration is then declared as dependency in a gradle module:

implementation project(path: ":module-to-depend-on", configuration: "spi")

As this dependency contains no implementing classes, we cannot go to implementations of a certain interface of this dependency. If we include the whole module with

implementation project(":module-to-depend-on")

we are able to jump to implementations of interfaces. Is there a way to tell Intellij to search for implementations without declaring the whole module as dependency as we do not want to give access to the concrete implementations.

 

0
1 comment

For the navigation as for the compilation IDE uses the information from module's dependencies tab. There it adds the dependencies configured for this module. In case of a Gradle-based projects this information is taken solely from Gradle build files.

You can consider creating special configuration in build scripts that will only be activated when running/importing from IDE: IDE add special properties that you can evaluate in build scripts, please see https://stackoverflow.com/a/63411337/2000323

0

Please sign in to leave a comment.