owahlen
2013-10-08 12:40:54 UTC
I am working in an environment with several dependent gradle projects each of
which result in artifacts in a Maven repo. If developers want to test code
changes in a sub-project they have to create snapshot releases, deploy them
locally and then compile the parent project.
This is very tedious and also does not allow to do cross-project code
refactorings in the IDE.
My idea is to make the top-level project configurable: Dependencies can
either be resolved from artifactory or be gradle sub-projects (i.e. a gradle
multi-project environment). I already managed to make the relevant changes
to settings.gradle and also configure the direct dependencies.
Unfortunately I am currently unable to transform the transitive Maven
dependencies into project dependencies.
In other words I am trying to do something like this:
/allprojects { Project subproject ->
subproject.configurations.all { Configuration configuration ->
configuration.resolutionStrategy { ResolutionStrategy strategy ->
strategy.eachDependency { DependencyResolveDetails details ->
if (details.requested.name == 'myartifact') {
*details.useTarget project(':myproject')*
}
}
}
}
}/
Unfortunately the /useTarget/ method does not accept a project dependency.
So this does not work.
Any ideas?
--
View this message in context: http://gradle.1045684.n5.nabble.com/howto-change-transitive-dependency-into-project-dependency-tp5711930.html
Sent from the gradle-user mailing list archive at Nabble.com.
which result in artifacts in a Maven repo. If developers want to test code
changes in a sub-project they have to create snapshot releases, deploy them
locally and then compile the parent project.
This is very tedious and also does not allow to do cross-project code
refactorings in the IDE.
My idea is to make the top-level project configurable: Dependencies can
either be resolved from artifactory or be gradle sub-projects (i.e. a gradle
multi-project environment). I already managed to make the relevant changes
to settings.gradle and also configure the direct dependencies.
Unfortunately I am currently unable to transform the transitive Maven
dependencies into project dependencies.
In other words I am trying to do something like this:
/allprojects { Project subproject ->
subproject.configurations.all { Configuration configuration ->
configuration.resolutionStrategy { ResolutionStrategy strategy ->
strategy.eachDependency { DependencyResolveDetails details ->
if (details.requested.name == 'myartifact') {
*details.useTarget project(':myproject')*
}
}
}
}
}/
Unfortunately the /useTarget/ method does not accept a project dependency.
So this does not work.
Any ideas?
--
View this message in context: http://gradle.1045684.n5.nabble.com/howto-change-transitive-dependency-into-project-dependency-tp5711930.html
Sent from the gradle-user mailing list archive at Nabble.com.