title: Gradle task dependency on other source folder classes
body: <p>I am working on a gradle file which has 2 tasks with different src directories. Task 2 is dependent on some of the classes from task1. Is there any way i can mention that dependency in task2 and run them separately. </p>
  
  <p>SouceSet1:</p>
  
  <pre><code>sourceSets {
      integrationTest {
          java {
              compileClasspath += main.output + test.output
              runtimeClasspath += main.output + test.output
              srcDir file('src/integration-test/java')   
          }
          resources.srcDir file('src/integration-test/resources')
      }
  }
  </code></pre>
  
  <p>SourceSet2:</p>
  
  <pre><code>sourceSets {
      functionTest {
          java {
              compileClasspath += main.output + test.output
              runtimeClasspath += main.output + test.output
              srcDir file('src/function-test/java')   
          }
          resources.srcDir file('src/integration-test/resources')
      }
  }
  </code></pre>
  
  <p>Source set 1 runs fine but source set 2 through error of some methods which doesn't recognize because they are in sourceset 1 source folder. Is there any solution of this problem in gradle? I want to run both tasks separately.</p>