How to add source files to android studio project?
<p>I currently try to get a huge Android Studio Project to compile. My problem is that I depend on java classes in a different git repo. I fixed it by adding the repo as a submodule. I'm an absolute newbie to gradle, so my approach was to add root, where the .java files are located as a a sourceset:</p>

<pre><code>  sourceSets {

    main.java.srcDirs += '../../ROOT-OF-SOURCE-FILES/'
}
</code></pre>

<p>This resolves the dependencies. In "ROOT-OF-SOURCE-FILES" are a bunch of files not needed for my project and this also causes gradle not to build, because there are also no android files. 
Next thing I tried is to point to the specific folders I depend on, but then it say "File path does not correspond to package name"</p>

<p>My question is how can I add the classes (including their dependencies) I need or how can I exclude the stuff I don't need (I also tried the exclude with gradle, but that didn't work).</p>