title: How to define custom source set without defining it's path explicitly in Gradle?
body: <p>It is written in manual:</p>
  
  <p><a href="https://i.stack.imgur.com/zOiRi.png" rel="noreferrer"><img src="https://i.stack.imgur.com/zOiRi.png" alt="enter image description here"></a></p>
  
  <p>I.e. that <code>src/sourceSet/java</code> is a default path for "Java source for the given source set".</p>
  
  <p>How to utilize this? Suppose I wish to create source set <code>demo</code>. </p>
  
  <p>Can I write</p>
  
  <pre><code>sourceSets {
      demo {
          java {
              srcDir 'src/demo/java'
          }
          resources {
              srcDir 'src/demo/resources'
          }
      }
  }
  </code></pre>
  
  <p>Can I write somehow without explicit paths?</p>
  
  <p>May be I not required to write anything, just put files into demo subfolder?</p>
  
  <p><strong>UPDATE</strong></p>
  
  <p>I have tested</p>
  
  <pre><code>sourceSets {
      demo {
          java {
              srcDir 'src/demo/java'
          }
          resources {
              srcDir 'src/demo/resources'
          }
      }
  }
  </code></pre>
  
  <p>and</p>
  
  <pre><code>sourceSets {
      demo {
          java
          resources
      }
  }
  </code></pre>
  
  <p>and</p>
  
  <pre><code>sourceSets {
      demo
  }
  </code></pre>
  
  <p>In all cases running <code>gradle build</code> does not cause sources compiled.</p>
  
  <p><code>build.gradle</code> file is follows:</p>
  
  <pre><code>group 'net.inthemoon.tests'
  version '1.0-SNAPSHOT'
  
  apply plugin: 'java'
  
  sourceCompatibility = 1.5
  
  repositories {
      mavenCentral()
  }
  
  dependencies {
      testCompile group: 'junit', name: 'junit', version: '4.11'
  }
  
  sourceSets {
      demo {
          java {
              srcDir 'src/demo/java'
          }
          resources {
              srcDir 'src/demo/resources'
          }
      }
  }
  </code></pre>
  
  <p>Sample project: <a href="https://github.com/dims12/MultipleSourceRoots" rel="noreferrer">https://github.com/dims12/MultipleSourceRoots</a></p>