Is it possible to use something like ResolutionStrategy http://www.gradle.org/docs/current/javadoc/org/gradle/api/artifacts/ResolutionStrategy.html for project dependencies? The docs seem focused on remote dependencies (the example used is "How to override a version).
I’m writing a plugin that specifies a custom configuration. I’d like to modify how those project dependencies are resolved to task dependencies.
Simplified Usecase: I’d like the use to be able to specify
pluginConfig project(":myProject")
and say, have it resolve as:
pluginConfig project(path: ":myProject", configuration: 'pluginConfig')
More Complex Usecase: I’d like to be able to do:
pluginConfig project(":myProject")
and say, have it resolve as:
pluginConfigA project(path: ":myProject", configuration: 'pluginConfigA')
pluginConfigB project(path: ":myProject", configuration: 'pluginConfigB')
I know the user having to specify a configuration is only a minor annoyance, but them having to specify two (for both the outputs of my plugin) is a more serious problem, because I have to handle (or leave undefined) the usecases where the user add’s one and not the other. Also, because it is something that should be able to be automated away :P.
I’m currently looking at providing a marco that the user can call (a closure the user can call that sets up the dependency for them), but since I’m defining this configuration, seems I should be able to customize it’s resolution instead.