-
Couldn't load subscription status.
- Fork 245
Description
The current solution to find the dependencies of a module/project invokes Gradle from the command line and parses the output:
A more elegant solution, however, would be to have direct, programmatic access to Gradle's APIs in order to fetch a list of dependency JARs. Both Eclipse and IntelliJ IDEA have custom project models inside the Gradle API that fit their specific use cases, but which can be used externally too (EclipseModel and IdeaModel). Unfortunately, these do have some limitations regarding Android support, which is why the current solution involves a custom Gradle script that is invoked as described above. Instead, a custom model could be built using the Tooling API.
Resources:
- The tooling API should provide a way to get the dependencies of the project gradle/gradle#4215 (comment)
- https://docs.gradle.org/current/javadoc/org/gradle/tooling/provider/model/ToolingModelBuilderRegistry.html (Tooling API extensibility points)
- https://stackoverflow.com/questions/40739674/external-registration-of-tooling-api-custom-models
- https://github.com/gradle/gradle/blob/38e0df22ecff6c894f5c3eeecb94106e2ba557ff/subprojects/docs/src/samples/toolingApi/eclipse/src/main/java/org/gradle/sample/Main.java#L28-L28 (EclipseModel sample)
- https://github.com/gradle/gradle/blob/38e0df22ecff6c894f5c3eeecb94106e2ba557ff/subprojects/docs/src/samples/toolingApi/idea/src/main/java/org/gradle/sample/Main.java (IdeaModel sample)
- https://mvnrepository.com/artifact/org.gradle/gradle-kotlin-dsl-tooling-models/0.18.1 (DSL tooling models)