If you want the Android Studio project to run a lint check before configuring the default launch, without affecting how your gradation tasks are configured. And you want to do this in the gradient building system, you can add the following block outside the android block in the app module build.gradle as follows:
android { .... lintOptions { abortOnError true } } tasks.whenTaskAdded { task -> if (task.name == 'compileDevDebugSources') { task.dependsOn lint task.mustRunAfter lint } }
Replace compileDevDebugSources with the desired build option that you have already defined, for example. compileReleaseSources , compileDebugSources , compileStagingDebugSources , etc.
This has been tested on Android Studio 3.0.
Phileo99 Jan 29 '18 at 4:33 2018-01-29 04:33
source share