Compiling a new sourceset

I am trying to compile a new sourceSet ‘tools’. I have included a selective list of files to be included in this tools sourceSet as below.

sourceSets{ tools {


srcDir “$rootDir/tools”

include “/basic//*”

} } }

The compiled files for tools sourceset will be created in “$buildDir/classes/tools”

*************** Requirement:

*************** Now tools sourceSet has few dependencies (java files) and those dependencies should also be compiled and added to the output dir “$buildDir/classes/tools”. The location of dependencies is same as the source files of tools SourceSet i.e: “$rootDir/tools”.

Please clarify how to achieve this using gradle sourceSet…

In simple words I want to compile a selective list of files and its dependencies alone present in a directory.

Directory: “$rootDir/tools”

include: /basic//* and its dependencies

What do you mean by “its dependencies”?