src/com/facebook/buck/features/apple/projectV2/WorkspaceAndProjectGenerator.java
/**
   * Add a workspace scheme for each extension bundled with the source target of the workspace.
   *
   * @param projectGraph
   * @param schemeName
   * @param schemeArguments
   * @param schemeConfigsBuilder
   * @param schemeNameToSrcTargetNodeBuilder
   */
Add a workspace scheme for each extension bundled with the source target of the workspace.
Add a workspace scheme for each extension bundled with the source target of the workspace .
private static void addWorkspaceExtensionSchemes(
      TargetGraph projectGraph,
      String schemeName,
      XcodeWorkspaceConfigDescriptionArg schemeArguments,
      ImmutableMap.Builder<String, XcodeWorkspaceConfigDescriptionArg> schemeConfigsBuilder,
      ImmutableSetMultimap.Builder<String, Optional<TargetNode<?>>>
          schemeNameToSrcTargetNodeBuilder) {
    if (!schemeArguments.getSrcTarget().isPresent()) {
      return;
    }
    LOG.debug("Potentially adding extension schemes for %s", schemeName);
    BuildTarget sourceBuildTarget = schemeArguments.getSrcTarget().get();
    TargetNode<?> sourceTargetNode = projectGraph.get(sourceBuildTarget);
    Set<BuildTarget> sourceTargetBuildDeps = sourceTargetNode.getBuildDeps();
    ImmutableSet<BuildTarget> implicitSchemeBuildTargets =
        sourceTargetBuildDeps.stream()
            .filter(t -> shouldIncludeImplicitExtensionSchemeForTargetNode(projectGraph.get(t)))
            .collect(ImmutableSet.toImmutableSet());
    implicitSchemeBuildTargets.forEach(
        (buildTarget -> {
          String extensionSchemeName = schemeName + "+" + buildTarget.getShortName();
          TargetNode<?> targetNode = projectGraph.get(buildTarget);
          schemeConfigsBuilder.put(
              extensionSchemeName, createImplicitExtensionWorkspaceArgs(buildTarget));
          schemeNameToSrcTargetNodeBuilder.put(extensionSchemeName, Optional.of(sourceTargetNode));
          schemeNameToSrcTargetNodeBuilder.put(extensionSchemeName, Optional.of(targetNode));
        }));
  }
private static void addWorkspaceExtensionSchemes ( TargetGraph projectGraph , String schemeName , XcodeWorkspaceConfigDescriptionArg schemeArguments , ImmutableMap . Builder < String , XcodeWorkspaceConfigDescriptionArg > schemeConfigsBuilder , ImmutableSetMultimap . Builder < String , Optional < TargetNode < ? > > > schemeNameToSrcTargetNodeBuilder ) { if ( ! schemeArguments . getSrcTarget ( ) . isPresent ( ) ) { return ; } LOG . debug ( "Potentially adding extension schemes for %s" , schemeName ) ; BuildTarget sourceBuildTarget = schemeArguments . getSrcTarget ( ) . get ( ) ; TargetNode < ? > sourceTargetNode = projectGraph . get ( sourceBuildTarget ) ; Set < BuildTarget > sourceTargetBuildDeps = sourceTargetNode . getBuildDeps ( ) ; ImmutableSet < BuildTarget > implicitSchemeBuildTargets = sourceTargetBuildDeps . stream ( ) . filter ( t -> shouldIncludeImplicitExtensionSchemeForTargetNode ( projectGraph . get ( t ) ) ) . collect ( ImmutableSet . toImmutableSet ( ) ) ; implicitSchemeBuildTargets . forEach ( ( buildTarget -> { String extensionSchemeName = schemeName + "+" + buildTarget . getShortName ( ) ; TargetNode < ? > targetNode = projectGraph . get ( buildTarget ) ; schemeConfigsBuilder . put ( extensionSchemeName , createImplicitExtensionWorkspaceArgs ( buildTarget ) ) ; schemeNameToSrcTargetNodeBuilder . put ( extensionSchemeName , Optional . of ( sourceTargetNode ) ) ; schemeNameToSrcTargetNodeBuilder . put ( extensionSchemeName , Optional . of ( targetNode ) ) ; } ) ) ; }
Add a workspace scheme for each extension bundled with the source target of the workspace.
Add a workspace scheme for each extension bundled with the source target of the workspace .
// Filter all of the source target's deps to find the bundled extensions that get an implicit // scheme. // Create scheme for each bundled extension to allow Xcode to automatically begin debugging them // when this scheme it selected.