title: Gradle subproject build dependency
body: <p>I have a dependency problem and I do not know how to solve it.</p>
  
  <p>I have a project A, B and C.</p>
  
  <p>A needs B and C</p>
  
  <p>B needs C</p>
  
  <p>My directory structure looks like this:</p>
  
  <pre><code>A
  |-settings.gradle
  |-build.gradle
  |-lib
     |- B
     |- C
  </code></pre>
  
  <p>settings.gradle content:</p>
  
  <pre><code>include 'lib/B'
  include 'lib/C'
  </code></pre>
  
  <p>build.gradle content:</p>
  
  <pre><code>apply plugin: 'java'
  dependencies {
    compile project(':lib/B'), 
            project(':lib/C') 
  }
  
  project(':lib/B'){
    dependencies {
      compile project(':lib/C')
    }
  }
  </code></pre>
  
  <p>If I do NOT declare the project(':lib/B'){...} part, project B can not be build because of dependencies.</p>
  
  <p>If I declare the project(':lib/B'){...} part, Gradle tells me : Could not find method compile() for arguments [project ':lib/C'] on org.gradle.api.internal.artifacts.dsl.pendencies.DefaultDependencyHandler_Decorated@221bad.</p>
  
  <p>How am I able to solve it, or compile C before B?</p>
  
  <p>PS: Data structure changes are not possible.</p>