title: How to specify relative path to checkstyle config in root project in gradle 2.2+
body: <p>I have the following project structure:</p>
  
  <pre><code>project
    checkstyle
      checkstyle.xml
    subproject1
      ...
    subproject2
      ...
    build.gradle
  </code></pre>
  
  <p>My configuration for checkstyle in the <code>build.gradle</code> is as follows:</p>
  
  <pre><code>allprojects {
    apply plugin: 'checkstyle'
    checkstyle {
      configFile = 'checkstyle/checkstyle.xml' as File
    }
  }
  </code></pre>
  
  <p>When I was using gradle 2.1, build worked OK. After upgrading to 2.2 or 2.2.1 the error occurs:</p>
  
  <pre><code>:subproject1:checkstyleMain FAILED
  FAILURE: Build failed with an exception.
  What went wrong:
  Execution failed for task ':subproject1:checkstyleMain'.
  &gt; Unable to create a Checker: unable to find /home/my/project/subproject1/checkstyle/checkstyle.xml
  </code></pre>
  
  <p>Gradle is now looking for 'checkstyle/checkstyle.xml' in the subproject directory, which is not what I would expect. </p>
  
  <p>I have found that <a href="https://gradle.org/docs/2.2/release-notes#configuring-code-quality-tasks/extensions-with-file-objects-representing-relative-paths" rel="noreferrer">they mentioned this change in 2.2 release notes</a>. But they did not tell how to maintain old behavior of resolving that path. How to do this?</p>
  
  <p>I tried using <code>project.file</code> but it does not work too.</p>