[GRADLE-2017] Tooling API: Avoid incorrect dependency scope merge Created: 28/Dec/11 Updated: 02/Apr/14 Resolved: 02/Apr/14
|Affects Version/s:||1.0-milestone-6, 1.0-milestone-7|
|Reporter:||Denis Zhdanov||Assignee:||Radim Kubacki|
There is a possible case that the same dependency is mapped to the following standard java dependency configurations - 'testCompile' and 'runtime'. That means that we want to achieve the following:
Gradle tooling api returns single dependency for such a situation. It's scope is 'runtime'. That is incorrect because of inability to compile test sources at the project based on that information.
I see the following solutions:
|Comment by Szczepan Faber [ 16/Jan/12 ]|
Looks like a bug. I'm wondering if the *.iml also incorrectly generated if one uses vanilla idea plugin.
|Comment by Vladislav Soroka [ 22/Oct/13 ]|
It's blocking this IntelliJ Gradle feature: http://youtrack.jetbrains.com/issue/IDEA-79209
|Comment by Radim Kubacki [ 21/Feb/14 ]|
I'm going to take a look how to fix this. Just to make sure what we want to achieve:
we want to make sure that IdeaModule.getDependencies() will return dependencies where it is possible to see that :impl is used with TEST and RUNTIME scope. If we run 'gradle idea' for this module there will be two entries:
BTW: I don't know how to set this up from the UI but it works if I edit .iml file by hand.
Similar should be done for all types of dependencies (module-libraries too).
|Comment by Radim Kubacki [ 22/Feb/14 ]|
At the moment it seems to me that current computation of TEST scope is not accurate: http://www.gradle.org/docs/current/dsl/org.gradle.plugins.ide.idea.model.IdeaModule.html describes that
while it seems to me that we would need
I can try that but need to find a way how to make it compatible with current Map<String, Map<String, Collection<Configuration>>> scopes definition.
|Comment by Vladislav Soroka [ 24/Feb/14 ]|
for the following dependencies defined in Gradle scripts:
I'm expecting the next entries in the .iml file:
This is how it currently works in IDEA but using internal API (IdeDependenciesExtractor).