title: Package name does not correspond to the file path - Gradle configuration
body: <p>I'm trying migrating a normal Android Studio (IntelliJ) project to Gradle project recently.  And currently I'm encounter a problem: IntelliJ gives me a warning on the beginning of every file says that my <em>'package name does not correspond to the file path'</em>. e.g.</p>
  
  <p>The first line of my some/prefixes/a/b/c/d/E.java is:</p>
  
  <pre><code>package a.b.c.d;
  ....
  </code></pre>
  
  <p>IntelliJ thinks the package name should be '<strong>c.d</strong>' instead of '<strong>a.b.c.d</strong>'. Because I set</p>
  
  <pre><code>SourceSets {
      main.java.srcDirs = ["some/prefixes/a/b"] 
  }
  </code></pre>
  
  <p>in the module's build.gradle.</p>
  
  <p>I know I could do the change below to make IntelliJ happy:</p>
  
  <pre><code>SourceSets {
      main.java.srcDirs = ['some/prefixes'] 
  }
  </code></pre>
  
  <p>But I can't do that because there're huge numbers of projects under '<code>some/prefixes</code>' and I definitely don't want to introduce all of them into this module.</p>
  
  <p>I used to add a <strong>packagePrefix="a.b"</strong> in my '<code>module.iml</code>' in my original Android studio project and it works well:
  <a href="https://www.jetbrains.com/idea/help/configuring-content-roots.html#d2814695e312" rel="nofollow noreferrer">https://www.jetbrains.com/idea/help/configuring-content-roots.html#d2814695e312</a></p>
  
  <p>But I don't know how to accomplish similar fix after migrating to Gradle project.</p>