title: How to include Gradle subproject into composite build?
body: <p>I'm trying to use composite builds of Gradle (3.5) for the 1st time and I need to include a library which is a subproject of another project (both in Java):</p>
  
  <pre><code>&gt; gradle projects
  :projects
  
  ------------------------------------------------------------
  Root project
  ------------------------------------------------------------
  
  Root project 'projects'
  +--- ...
  +--- Project ':common'    &lt;-- this is a library I need
  +--- ...
  </code></pre>
  
  <p>Gradle <a href="https://docs.gradle.org/3.5/userguide/composite_builds.html" rel="nofollow noreferrer">documentation</a> gives examples of single-module projects only but specifying the path to <code>common</code> directory directly (i.e. <code>includeBuild '../../projects/common'</code>) is not an option as it ends up with expectable error:</p>
  
  <pre><code>FAILURE: Build failed with an exception.
  ...
  * What went wrong:
  A problem occurred evaluating project ':common'.
  &gt; Could not find method sourceSets() for arguments [build_9fu2oyxlwh2mr0i7k6l680fpz$_run_closure1@66e1cb67] on project ':common' of type org.gradle.api.Project.
  </code></pre>
  
  <p>Another supposedly appropriate feature is <a href="https://docs.gradle.org/3.5/userguide/composite_builds.html#included_build_declaring_substitutions" rel="nofollow noreferrer">substitutions</a> but I don't see how to apply it to my case. I also haven't seen any <a href="https://docs.gradle.org/3.5/userguide/composite_builds.html#included_build_substitution_limitations" rel="nofollow noreferrer">statements</a> in documentation telling that such an including is not possible. Depending on the whole <code>projects</code> is not right also because it is quite heavy repo.</p>
  
  <p>So the question is:
  How to declare a dependency on certain subproject in Gradle composite build?</p>