예제 #1
0
void SBWorkspace::queueSchemes(const StringSet& schemeNames, const StringSet& configNames) {
    BuildSettings bs(NULL);
    bool isInteractive = bs.getValue("VSIMPORTER_INTERACTIVE") == "YES";

    // Get the specified schemes
    SchemeVec schemePtrs;
    if (schemeNames.empty()) {
        // Queue up all schemes
        schemePtrs.insert(schemePtrs.end(), m_schemes.begin(), m_schemes.end());
    } else {
        getSchemes(schemeNames, schemePtrs);
    }

    // Process all schemes
    for (auto scheme : schemePtrs) {
        // Process all build references in the scheme
        for (auto buildRef : scheme->getTargets()) {
            // Construct a path to the project specified by the BuildRef
            String projectPath = joinPaths(scheme->getContainerParentDir(), buildRef.container);

            // Find or create the project
            SBProject* targetProj = openProject(projectPath);

            // Create the target
            SBTarget* target = NULL;
            if (targetProj) {
                target = targetProj->queueTargetWithId(buildRef.id, &configNames);
            } else {
                SBLog::warning() << "Failed to open \"" << buildRef.container << "\" project referenced by \"" << scheme->getName()
                                 << "\" scheme. "
                                 << "Ignoring \"" << buildRef.targetName << "\" target." << std::endl;
            }

            // Mark target as having been explicitly queued up
            if (target) {
                target->markExplicit();
            }
        }
    }
}
예제 #2
0
void SBTarget::processDependencies()
{
  const BuildSettings& projBS = m_parentProject.getBuildSettings();

  const DependencyList& depsList = m_target->getDependencies();
  for (unsigned i = 0; i < depsList.size(); i++) {
    String errStr = "Failed to process PBXTargetDependency (" + depsList[i]->getId() + ") for \"" + getName() + "\" target. ";

    const PBXTarget* target = depsList[i]->getTarget();
    const PBXContainerItemProxy* targetProxy = depsList[i]->getTargetProxy();

    SBProject* targetProject = NULL;
    SBTarget* depTarget = NULL;
    if (target) {
      targetProject = &m_parentProject;
      depTarget = targetProject->queueTarget(target);
    } else if (targetProxy) {
      String targetId = targetProxy->getRemoteId();
      String projectPath = targetProxy->getPortalPath();
      String absProjectPath = projBS.expand(projectPath, PathValue);

      targetProject = SBWorkspace::get()->openProject(absProjectPath);
      if (targetProject)
        depTarget = targetProject->queueTargetWithId(targetId);
      else
        SBLog::warning() << errStr << "Unable to open referenced project path: " << projectPath << std::endl;
    } else {
      SBLog::warning() << errStr << "Missing remote target info." << std::endl;
    }

    if (targetProject && !depTarget)
      SBLog::warning() << errStr << "Unable to create dependency target in \"" << targetProject->getName() << "\" project." << std::endl;
  
    addDependency(depTarget);
  }
}