title: Why does Gradle ignore sourceSets and/or srcDir when dealing with proto files?
body: <p>My directory structure is src/ps/proto.   My build.gradle file is located in the src directory.  I've set sourceSets to </p>
  
  <pre><code>sourceSets {
      ps {
          proto {
               srcDir 'ps/proto'
          }
      }
  }
  </code></pre>
  
  <p>Yet, a <strong>gradlew generatePsProto</strong> gives me a slew of error, one of which is that my source directory is <strong>src/src/ps/proto</strong>.  </p>
  
  <pre><code>Execution failed for task ':generatePsProto'.
  &gt; protoc: stdout: . stderr: /home/build/tree/src/src/ps/proto: warning: directory does not exist.
    [libprotobuf WARNING google/protobuf/compiler/parser.cc:546] No syntax specified for the proto file: cldb.proto. Please use 'syntax = "proto2";' or 'syntax = "proto3";' to specify a syntax version. (Defaulted to proto2 syntax.)
    ps/proto/security.proto: File not found.
    ps/proto/common.proto: File not found.
    ps/proto/cli.proto: File not found.
    ps/proto/volumemirrorcommon.proto: File not found.
    ps/proto/metrics.proto: File not found.
    cldb.proto: Import "ps/proto/security.proto" was not found or had errors.
    cldb.proto: Import "ps/proto/common.proto" was not found or had errors.
    mldb.proto: Import "ps/proto/cli.proto" was not found or had errors.
    mldb.proto:214:12: "CredentialsMsg" is not defined.
    mldb.proto:218:12: "CredentialsMsg" is not defined.
    [...]
    mldb.proto:3614:12: "Key" is not defined.
    mldb.proto:3618:12: "CredentialsMsg" is not defined.
    mldb.proto:3619:12: "ServerKeyType" is not defined.
  </code></pre>
  
  <p>I don't want the Gradle default of src/ps/proto.  I want ps/proto.  Can this be done?  My goal is to remove the hard coded exec calls to protoc and use the protobuf pluging to compile the *.proto files into their respective *.h, *.cc, and eventually into *.o files.  </p>
  
  <blockquote>
    <p>Gradle 4.7 Build time:   2018-04-18 09:09:12 UTC Revision:<br>
    b9a962bf70638332300e7f810689cb2febbd4a6c</p>
    
    <p>Groovy:       2.4.12 Ant:          Apache Ant(TM) version 1.9.9
    compiled on February 2 2017 JVM:          1.8.0_144 (Oracle
    Corporation 25.144-b01) OS:           Linux 3.10.0-514.el7.x86_64
    amd64</p>
  </blockquote>
  
  <p><strong>build.gradle</strong></p>
  
  <pre><code>buildscript {
      repositories {
          mavenCentral()
      }
      dependencies {
          classpath 'com.google.protobuf:protobuf-gradle-plugin:0.8.5'
      }
  }
  
  
  apply plugin: 'c'
  apply plugin: 'cpp'
  apply plugin: 'java'
  apply plugin: 'com.google.protobuf'
  
  repositories {
      mavenCentral()
  }
  
  dependencies {
      compile "com.google.protobuf:protobuf-java:2.4.1"
  }
  
  
  sourceSets {
      ps {
          proto {
              srcDir 'ps/proto'
          }
      }
  }
  
  protobuf {
      protoc {
          artifact = 'com.google.protobuf:protoc:2.4.1'
      }
  
      generateProtoTasks {
          all().each { task -&gt;
              task.plugins {
                  cpp {}
              }
          }
      }
  }
  </code></pre>