void XCScheme::parseBuildAction(const pugi::xml_node& node, const ErrorReporter& reporter)
{
  // Get the BuildableReference node
  BuildRef br;
  const pugi::xml_node brNode = node.first_child();
  
  // Get the product name
  getXMLProperty(brNode, "BuildableName", br.productName, VALUE_REQUIRED, reporter);
  
  // Get the target name
  getXMLProperty(brNode, "BlueprintName", br.targetName, VALUE_REQUIRED, reporter);
  
  // Get the container (project) for the target
  getXMLProperty(brNode, "ReferencedContainer", br.container, VALUE_REQUIRED, reporter);
  br.container = br.container.substr(10);
  
  // Get target id
  getXMLProperty(brNode, "BlueprintIdentifier", br.id, VALUE_REQUIRED, reporter);
  
  // Check that all fields were read
  if (br.productName.empty() || br.targetName.empty() ||
      br.container.empty() || br.id.empty()) {
    reporter.reportError("BuildableReference is incomplete.");
    return;
  }

  // Get the value of buildForArchiving
  String shouldArchive;
  getXMLProperty(node, "buildForArchiving", shouldArchive, VALUE_REQUIRED, reporter);
  if (shouldArchive == "YES") {
    m_targets.push_back(br);
  } else {
    SBLog::info() << "Ignoring BuildableReference to \"" << br.targetName << "\" target because it is not archivable." << std::endl;
  }
}
Esempio n. 2
0
void getXMLProperty(const pugi::xml_node& node, const String& propName, String& ret, GetterBehavior opt, const ErrorReporter& reporter)
{
  const pugi::xml_attribute attrib = node.attribute(propName.c_str());

  if (attrib)
    ret = attrib.value();
  else if (opt == VALUE_REQUIRED)
    reporter.reportError("Failed reading \"" + propName + "\" property.");
}