Once upon a time, particularly in Eclipse-land, Lint would run on every build, and so if you failed Lint checks, you would find out immediately. With Android Studio (tested
One possible (but hard to implement) solution is to write an IDEA plugin to do this. You can avoid this by downloading the plugin below from the repository or the code from github. The following code snippet will execute the 'compile' and 'inspect code' actions, sequentially.
public class BuildAndLint extends AnAction {
public void actionPerformed(AnActionEvent e) {
String[] actions = {"CompileProject", "InspectCode"};
for(String action: actions) {
AnAction anAction = ActionManager.getInstance().getAction(action);
DataContext context = e.getDataContext();
AnActionEvent anActionEvent = new AnActionEvent(null, context, "", anAction.getTemplatePresentation(), ActionManager.getInstance(), 0);
anAction.actionPerformed(anActionEvent);
}
}
}
The code has been tested and works in Android Studio 1.3. It will open a window to select what to inspect, rather than doing the whole thing.
Links
Source code on github
Built and Lint Jar