bool ExternalCommand::
configureAttribute(const ConfigureContext& ctx, StringRef name,
                   StringRef value) {
  if (name == "allow-missing-inputs") {
    if (value != "true" && value != "false") {
      ctx.error("invalid value: '" + value + "' for attribute '" +
                name + "'");
      return false;
    }
    allowMissingInputs = value == "true";
    return true;
  } else if (name == "allow-modified-outputs") {
    if (value != "true" && value != "false") {
      ctx.error("invalid value: '" + value + "' for attribute '" +
                name + "'");
      return false;
    }
    allowModifiedOutputs = value == "true";
    return true;
  } else if (name == "always-out-of-date") {
    if (value != "true" && value != "false") {
      ctx.error("invalid value: '" + value + "' for attribute '" +
                name + "'");
      return false;
    }
    alwaysOutOfDate = value == "true";
    return true;
  } else {
    ctx.error("unexpected attribute: '" + name + "'");
    return false;
  }
}
Esempio n. 2
0
bool BuildNode::configureAttribute(const ConfigureContext& ctx, StringRef name,
                                   StringRef value) {
  if (name == "is-directory") {
    if (value == "true") {
      directory = true;
      virtualNode = false;
    } else if (value == "false") {
      directory = false;
    } else {
      ctx.error("invalid value: '" + value + "' for attribute '"
                + name + "'");
      return false;
    }
    return true;
  } else if (name == "is-virtual") {
    if (value == "true") {
      virtualNode = true;
      directory = false;
    } else if (value == "false") {
      virtualNode = false;
      commandTimestamp = false;
    } else {
      ctx.error("invalid value: '" + value + "' for attribute '"
                + name + "'");
      return false;
    }
    return true;
  } else if (name == "is-command-timestamp") {
    if (value == "true") {
      commandTimestamp = true;
      virtualNode = true;
      directory = false;
    } else if (value == "false") {
      commandTimestamp = false;
    } else {
      ctx.error("invalid value: '" + value + "' for attribute '"
                + name + "'");
      return false;
    }
    return true;
  } else if (name == "is-mutated") {
    if (value == "true") {
      mutated = true;
    } else if (value == "false") {
      mutated = false;
    } else {
      ctx.error("invalid value: '" + value + "' for attribute '"
                + name + "'");
      return false;
    }
    return true;
  }
    
  // We don't support any other custom attributes.
  ctx.error("unexpected attribute: '" + name + "'");
  return false;
}
Esempio n. 3
0
bool BuildNode::configureAttribute(
    const ConfigureContext& ctx, StringRef name,
    ArrayRef<std::pair<StringRef, StringRef>> values) {
  // We don't support any other custom attributes.
  ctx.error("unexpected attribute: '" + name + "'");
  return false;
}
Esempio n. 4
0
bool BuildNode::configureAttribute(const ConfigureContext& ctx, StringRef name,
                                   StringRef value) {
  if (name == "is-virtual") {
    if (value == "true") {
      virtualNode = true;
    } else if (value == "false") {
      virtualNode = false;
    } else {
      ctx.error("invalid value: '" + value + "' for attribute '"
                + name + "'");
      return false;
    }
    return true;
  }
    
  // We don't support any other custom attributes.
  ctx.error("unexpected attribute: '" + name + "'");
  return false;
}
bool ExternalCommand::configureAttribute(
    const ConfigureContext& ctx, StringRef name,
    ArrayRef<std::pair<StringRef, StringRef>> values) {
  ctx.error("unexpected attribute: '" + name + "'");
  return false;
}