I have a project which was not constructed using Gradle before, and I am adding Gradle to it.
(I have seem something similar but not quite sure how to apply to my case Gradle: custom source set as dependency for the main and test ones)
The original source folders are separated, so I added something similar to the following.
Now I want package each sourceSet into a separate jar, and have the following (each sourceSet do have dependencies on each other)
task cusJar(type: Jar) {
from(sourceSets.cus.output) {
include '**/*.class'
}
}
When I execute this, Gradle will also execute “compileCusJava”, but this task will fail, because it cannot find any of the jar files I defined in “dependencies” or other sourseSet.
How do I set this up correctly and efficiently?
No, I did not do that, at least not yet.
Because all my source folders have dependencies depends on each other, so I was wondering do I have to do that for all the sourceSets?
So I must do something like this for all my sourceSet? and if I add another one I have to add it to all other sourceSets? Or is there a more clever way of doing this?
This is an old project and we were trying separate modules into different source folders and package them into different jars show our modularity.
I can see separating them into project sounds good, but there will be lots circular dependencies between the projects, not sure if it will cause problems.
Also, I am trying to preserve how the project presents in our Eclipse. (this is a good-to-have option but not necessary)