I have specified some things, e.g. Hamcrest, to be testCompile dependencies of my sub-project but when I run the idea task to generate my idea project these testCompile dependencies are marked as runtime and not compile scope in Idea. Consequently the compile fails, the only way I can get around this is to specify them as compile dependencies but I dont really want to do that because they are not needed by the published jar.
I think the offending code is this in ideaPlugin.groovy
testCompile dependencies should be mapped to the idea test scope. In the snippet of the IdeaPlugin above you can see that the testRuntime configuration (which extends testCompile) is added to the scope TEST of Idea. do you have declared any custom configurations? can you provide a selfcontained example that demos your issue?
Hmm, yes I have custom test tasks/configurations, these extendFrom testCompile but the dependencies are specified as testCompile in my build,gradle. I had to manually add to the testSourcesDir in my code because the sourceSet for these is not test but testUtil or testUnit
I will try and split the code out into a stand along project so I can post here, however the problem I have is anonymising the code to remove anything company specific, the company I am currently working at is quite particular about not being identified.
Yes, that looks like something I can work with. The scopes setting in you ivy module is the thing I am missing, I had tried several ways of doing that but could not get it to work.
I will add that in how you have it and see if the problem gets solved.