title: Get Android gradle plugin & checkstyle working together / command line usage
body: <p>I'm evaluating the ability of the new gradle-based build system to reproduce our current ant-based build process and, as a gradle beginner, I failed to get checkstyle running with the android gradle plugin.</p>
  
  <p><em>Environment:</em></p>
  
  <ul>
  <li><p>gradle 1.6 running fine on a standard java project (checkstyle check target included)</p></li>
  <li><p>up-to-date android SDK (22.0.1 with platform tools and build tools 17)</p></li>
  <li><p>no eclipse, no android studio, only my lovely terminal</p></li>
  </ul>
  
  <p><em>Symptom:</em></p>
  
  <p>The target project is <a href="https://github.com/nibua-r/LigoTextDemo" rel="noreferrer">https://github.com/nibua-r/LigoTextDemo</a> and I succeeded to build it using gradle but if I naively add <code>apply plugin: checkstyle</code> to my <code>build.gradle</code>:</p>
  
  <pre><code>buildscript {
    repositories {
      mavenCentral()
    }
    dependencies {
      classpath 'com.android.tools.build:gradle:0.4.2'
    }
  }
  apply plugin: 'android'
  apply plugin: 'checkstyle'
  
  android {
    buildToolsVersion '17'
    compileSdkVersion 15
    testBuildType 'debug'
  
    defaultConfig {
      versionCode = 1
      versionName = '1.0'
      minSdkVersion 12
      targetSdkVersion 15
    }
  
    buildTypes {
      debug {
        packageNameSuffix = '.debug'
      }
    }
  }
  </code></pre>
  
  <p>then <code>gradle check</code> doesn't even complain on not finding the <code>checkstyle.xml</code> file (at the default <code>config/checkstyle</code> location) and returns:</p>
  
  <pre><code>:check UP-TO-DATE
  
  BUILD SUCCESSFUL
  </code></pre>
  
  <p><em>What's needed:</em></p>
  
  <p>First, I just need a running checkstyle target. Then, I need to automate checkstyle running as a dependency of the compilation (but lets get the chekstyle target up and running first).</p>
  
  <p><em>Assumption:</em></p>
  
  <p>This may be related to the fact that (from the [user guide][1]):</p>
  
  <blockquote>
    <p>The Android plugin […] uses its own sourceSets</p>
  </blockquote>
  
  <p>but I'm not enough gradle-efficient to understand what I'm missing there. Please, gradle Master, enlighten me with your valuable knowledge!</p>