test/com/facebook/buck/features/apple/projectV2/ProjectGeneratorTest.java
/**
   * The project configurations should have named entries corresponding to every existing target
   * configuration for targets in the project.
   */
The project configurations should have named entries corresponding to every existing target
configuration for targets in the project.
The project configurations should have named entries corresponding to every existing target configuration for targets in the project .
@Test
  public void generatedProjectConfigurationListIsUnionOfAllTargetConfigurations()
      throws IOException {
    BuildTarget buildTarget1 = BuildTargetFactory.newInstance(rootPath, "//foo", "rule1");
    TargetNode<?> node1 =
        AppleLibraryBuilder.createBuilder(buildTarget1)
            .setConfigs(
                ImmutableSortedMap.of(
                    "Conf1", ImmutableMap.of(),
                    "Conf2", ImmutableMap.of()))
            .build();
    BuildTarget buildTarget2 = BuildTargetFactory.newInstance(rootPath, "//foo", "rule2");
    TargetNode<?> node2 =
        AppleLibraryBuilder.createBuilder(buildTarget2)
            .setConfigs(
                ImmutableSortedMap.of(
                    "Conf2", ImmutableMap.of(),
                    "Conf3", ImmutableMap.of()))
            .build();
    ProjectGenerator projectGenerator = createProjectGenerator(ImmutableSet.of(node1, node2));
    projectGenerator.createXcodeProjects();
    PBXProject generatedProject = projectGenerator.getGeneratedProject();
    Map<String, XCBuildConfiguration> configurations =
        generatedProject.getBuildConfigurationList().getBuildConfigurationsByName().asMap();
    assertThat(configurations, hasKey("Conf1"));
    assertThat(configurations, hasKey("Conf2"));
    assertThat(configurations, hasKey("Conf3"));
  }
@ Test public void generatedProjectConfigurationListIsUnionOfAllTargetConfigurations ( ) throws IOException { BuildTarget buildTarget1 = BuildTargetFactory . newInstance ( rootPath , "//foo" , "rule1" ) ; TargetNode < ? > node1 = AppleLibraryBuilder . createBuilder ( buildTarget1 ) . setConfigs ( ImmutableSortedMap . of ( "Conf1" , ImmutableMap . of ( ) , "Conf2" , ImmutableMap . of ( ) ) ) . build ( ) ; BuildTarget buildTarget2 = BuildTargetFactory . newInstance ( rootPath , "//foo" , "rule2" ) ; TargetNode < ? > node2 = AppleLibraryBuilder . createBuilder ( buildTarget2 ) . setConfigs ( ImmutableSortedMap . of ( "Conf2" , ImmutableMap . of ( ) , "Conf3" , ImmutableMap . of ( ) ) ) . build ( ) ; ProjectGenerator projectGenerator = createProjectGenerator ( ImmutableSet . of ( node1 , node2 ) ) ; projectGenerator . createXcodeProjects ( ) ; PBXProject generatedProject = projectGenerator . getGeneratedProject ( ) ; Map < String , XCBuildConfiguration > configurations = generatedProject . getBuildConfigurationList ( ) . getBuildConfigurationsByName ( ) . asMap ( ) ; assertThat ( configurations , hasKey ( "Conf1" ) ) ; assertThat ( configurations , hasKey ( "Conf2" ) ) ; assertThat ( configurations , hasKey ( "Conf3" ) ) ; }
The project configurations should have named entries corresponding to every existing target
 configuration for targets in the project.
The project configurations should have named entries corresponding to every existing target configuration for targets in the project .