Android : Gradle can not find 'lint' as dependency for custom task

on Wednesday, April 15, 2015


I want to create a simple, easy-to-use Gradle task that runs everything I expect the continuous integration server to run. For now, my app/build.gradle file contains the following code (rest omitted):



task continuousIntegrationDebug(dependsOn: [assembleDebug, lint, runCheckstyle, runPmd, runFindbugs]) {
}


Sadly, Gradle complains that it can not find lint (same for lintDebug and lintRelease):



A problem occurred evaluating project ':app'.
> Could not find property 'lint' on project ':app'.


Interestingly, the following line works when I run a check:



check.dependsOn 'lint'


And the following external call works, too (from project root):



./gradlew app:lint


What did I forget? I am using version com.android.tools.build:gradle:1.1.0 and the latest versions of build tools etc.


Also, I had to run pmd, checkstyle and findbugs externally first before I could run the task itself (were not installed before). How can I ensure they always get downloaded the first time the Gradle files get synced in Android Studio?


0 comments:

Post a Comment