Warn instead of error when no targets to run.
This code path is executed when a user passes --nobuild, in which case they expect there to be no targets. A non-zero exit code does not make sense.
@@ -206,8 +206,8 @@ public class MobileInstallCommand implements BlazeCommand {
Collection<ConfiguredTarget> targetsBuilt = result.getSuccessfulTargets();
if (targetsBuilt == null) {
- env.getReporter().handle(Event.error(NO_TARGET_MESSAGE));
- return BlazeCommandResult.exitCode(ExitCode.COMMAND_LINE_ERROR);
+ env.getReporter().handle(Event.warn(NO_TARGET_MESSAGE));
+ return BlazeCommandResult.exitCode(ExitCode.SUCCESS);
}
if (targetsBuilt.size() != 1) {
env.getReporter().handle(Event.error(SINGLE_TARGET_MESSAGE));
