use of com.facebook.buck.rules.args.WorkerMacroArg in project buck by facebook.
the class Genrule method isWorkerGenrule.
@VisibleForTesting
public boolean isWorkerGenrule() {
Arg cmdArg = cmd.orElse(null);
Arg bashArg = bash.orElse(null);
Arg cmdExeArg = cmdExe.orElse(null);
if ((cmdArg instanceof WorkerMacroArg) || (bashArg instanceof WorkerMacroArg) || (cmdExeArg instanceof WorkerMacroArg)) {
if ((cmdArg != null && !(cmdArg instanceof WorkerMacroArg)) || (bashArg != null && !(bashArg instanceof WorkerMacroArg)) || (cmdExeArg != null && !(cmdExeArg instanceof WorkerMacroArg))) {
throw new HumanReadableException("You cannot use a worker macro in one of the cmd, bash, " + "or cmd_exe properties and not in the others for genrule %s.", getBuildTarget().getFullyQualifiedName());
}
return true;
}
return false;
}
Aggregations