Program: 53161
Project: 53161
Buggy source:
private PBXNativeTarget generateBinaryTarget(PBXProject project,Optional<? extends TargetNode<? extends HasAppleBundleFields>> bundle,TargetNode<? extends CxxLibraryDescription.Arg> targetNode,ProductType productType,String productOutputFormat,Optional<Path> infoPlistOptional,boolean includeFrameworks,ImmutableSet<AppleResourceDescription.Arg> recursiveResources,ImmutableSet<AppleResourceDescription.Arg> directResources,ImmutableSet<AppleAssetCatalogDescription.Arg> recursiveAssetCatalogs,ImmutableSet<AppleAssetCatalogDescription.Arg> directAssetCatalogs,Optional<Iterable<PBXBuildPhase>> copyFilesPhases,Optional<TargetNode<AppleBundleDescription.Arg>> bundleLoaderNode) throws IOException {
  LOG.debug("String_Node_Str",targetNode);
  TargetNode<?> buildTargetNode=bundle.isPresent() ? bundle.get() : targetNode;
  final BuildTarget buildTarget=buildTargetNode.getBuildTarget();
  String productName=getProductName(buildTarget);
  CxxLibraryDescription.Arg arg=targetNode.getConstructorArg();
  NewNativeTargetProjectMutator mutator=new NewNativeTargetProjectMutator(pathRelativizer,sourcePathResolver);
  ImmutableSet<SourcePath> exportedHeaders=ImmutableSet.copyOf(getHeaderSourcePaths(arg.exportedHeaders));
  ImmutableSet<SourcePath> headers=ImmutableSet.copyOf(getHeaderSourcePaths(arg.headers));
  mutator.setTargetName(getXcodeTargetName(buildTarget)).setProduct(productType,productName,Paths.get(String.format(productOutputFormat,productName))).setSourcesWithFlags(ImmutableSet.copyOf(arg.srcs.get())).setPublicHeaders(exportedHeaders).setPrivateHeaders(headers).setPrefixHeader(arg.prefixHeader).setRecursiveResources(recursiveResources).setDirectResources(directResources);
  Optional<TargetNode<AppleNativeTargetDescriptionArg>> appleTargetNode=targetNode.castArg(AppleNativeTargetDescriptionArg.class);
  if (appleTargetNode.isPresent()) {
    AppleNativeTargetDescriptionArg appleArg=appleTargetNode.get().getConstructorArg();
    mutator=mutator.setExtraXcodeSources(ImmutableSet.copyOf(appleArg.extraXcodeSources.get()));
  }
  if (options.contains(Option.CREATE_DIRECTORY_STRUCTURE)) {
    mutator.setTargetGroupPath(FluentIterable.from(buildTarget.getBasePath()).transform(Functions.toStringFunction()).toList());
  }
  if (!recursiveAssetCatalogs.isEmpty()) {
    mutator.setRecursiveAssetCatalogs(recursiveAssetCatalogs);
  }
  if (!directAssetCatalogs.isEmpty()) {
    mutator.setDirectAssetCatalogs(directAssetCatalogs);
  }
  if (includeFrameworks) {
    ImmutableSet.Builder<FrameworkPath> frameworksBuilder=ImmutableSet.builder();
    frameworksBuilder.addAll(targetNode.getConstructorArg().frameworks.get());
    frameworksBuilder.addAll(targetNode.getConstructorArg().libraries.get());
    frameworksBuilder.addAll(collectRecursiveFrameworkDependencies(ImmutableList.of(targetNode)));
    mutator.setFrameworks(frameworksBuilder.build());
    mutator.setArchives(collectRecursiveLibraryDependencies(ImmutableList.of(targetNode)));
  }
  ImmutableList.Builder<TargetNode<?>> preScriptPhases=ImmutableList.builder();
  ImmutableList.Builder<TargetNode<?>> postScriptPhases=ImmutableList.builder();
  boolean skipRNBundle=ReactNativeFlavors.skipBundling(buildTargetNode.getBuildTarget());
  if (bundle.isPresent() && targetNode != bundle.get()) {
    collectBuildScriptDependencies(targetGraph.getAll(bundle.get().getDeclaredDeps()),preScriptPhases,postScriptPhases,skipRNBundle);
  }
  collectBuildScriptDependencies(targetGraph.getAll(targetNode.getDeclaredDeps()),preScriptPhases,postScriptPhases,skipRNBundle);
  mutator.setPreBuildRunScriptPhases(preScriptPhases.build());
  if (copyFilesPhases.isPresent()) {
    mutator.setCopyFilesPhases(copyFilesPhases.get());
  }
  mutator.setPostBuildRunScriptPhases(postScriptPhases.build());
  mutator.skipReactNativeBundle(skipRNBundle);
  if (skipRNBundle && reactNativeServer.isPresent()) {
    mutator.setAdditionalRunScripts(ImmutableList.of(projectFilesystem.resolve(reactNativeServer.get())));
  }
  NewNativeTargetProjectMutator.Result targetBuilderResult;
  try {
    targetBuilderResult=mutator.buildTargetAndAddToProject(project);
  }
 catch (  NoSuchBuildTargetException e) {
    throw new HumanReadableException(e);
  }
  PBXGroup targetGroup=targetBuilderResult.targetGroup;
  SourceTreePath buckFilePath=new SourceTreePath(PBXReference.SourceTree.SOURCE_ROOT,pathRelativizer.outputPathToBuildTargetPath(buildTarget).resolve(buildFileName),Optional.<String>absent());
  PBXFileReference buckReference=targetGroup.getOrCreateFileReferenceBySourceTreePath(buckFilePath);
  buckReference.setExplicitFileType(Optional.of("String_Node_Str"));
  ImmutableMap.Builder<String,String> extraSettingsBuilder=ImmutableMap.builder();
  extraSettingsBuilder.put("String_Node_Str",getProductName(buildTarget)).put("String_Node_Str",pathRelativizer.outputPathToBuildTargetPath(buildTarget).toString());
  if (bundleLoaderNode.isPresent()) {
    TargetNode<AppleBundleDescription.Arg> bundleLoader=bundleLoaderNode.get();
    String bundleLoaderProductName=getProductName(bundleLoader.getBuildTarget());
    String bundleName=bundleLoaderProductName + "String_Node_Str" + getExtensionString(bundleLoader.getConstructorArg().getExtension());
    String bundleLoaderOutputPath=Joiner.on('/').join(getTargetOutputPath(bundleLoader),bundleName,bundleLoaderProductName);
    extraSettingsBuilder.put("String_Node_Str",bundleLoaderOutputPath).put("String_Node_Str","String_Node_Str");
  }
  if (infoPlistOptional.isPresent()) {
    Path infoPlistPath=pathRelativizer.outputDirToRootRelative(infoPlistOptional.get());
    extraSettingsBuilder.put("String_Node_Str",infoPlistPath.toString());
  }
  Optional<SourcePath> prefixHeaderOptional=targetNode.getConstructorArg().prefixHeader;
  if (prefixHeaderOptional.isPresent()) {
    Path prefixHeaderRelative=sourcePathResolver.apply(prefixHeaderOptional.get());
    Path prefixHeaderPath=pathRelativizer.outputDirToRootRelative(prefixHeaderRelative);
    extraSettingsBuilder.put("String_Node_Str",prefixHeaderPath.toString());
    extraSettingsBuilder.put("String_Node_Str","String_Node_Str");
  }
  extraSettingsBuilder.put("String_Node_Str","String_Node_Str");
  ImmutableMap.Builder<String,String> defaultSettingsBuilder=ImmutableMap.builder();
  defaultSettingsBuilder.put("String_Node_Str",projectFilesystem.getRootPath().toAbsolutePath().normalize().toString());
  defaultSettingsBuilder.put("String_Node_Str",getProductName(buildTarget));
  if (bundle.isPresent()) {
    defaultSettingsBuilder.put("String_Node_Str",getExtensionString(bundle.get().getConstructorArg().getExtension()));
  }
  defaultSettingsBuilder.put("String_Node_Str",Joiner.on('/').join("String_Node_Str","String_Node_Str"));
  defaultSettingsBuilder.put("String_Node_Str","String_Node_Str");
  if (!bundle.isPresent() && (targetNode.getType().equals(AppleLibraryDescription.TYPE) || targetNode.getType().equals(CxxLibraryDescription.TYPE))) {
    defaultSettingsBuilder.put("String_Node_Str","String_Node_Str");
  }
  ImmutableMap.Builder<String,String> appendConfigsBuilder=ImmutableMap.builder();
  ImmutableSet<Path> recursiveHeaderMaps=collectRecursiveHeaderMaps(targetNode);
  ImmutableSet<Path> headerMapBases=recursiveHeaderMaps.isEmpty() ? ImmutableSet.<Path>of() : ImmutableSet.of(pathRelativizer.outputDirToRootRelative(BuckConstant.BUCK_OUTPUT_PATH));
  appendConfigsBuilder.put("String_Node_Str",Joiner.on(' ').join(Iterables.concat(recursiveHeaderMaps,headerMapBases))).put("String_Node_Str",Joiner.on(' ').join(collectRecursiveLibrarySearchPaths(ImmutableSet.of(targetNode)))).put("String_Node_Str",Joiner.on(' ').join(collectRecursiveFrameworkSearchPaths(ImmutableList.of(targetNode)))).put("String_Node_Str",Joiner.on(' ').join(Iterables.transform(Iterables.concat(targetNode.getConstructorArg().compilerFlags.get(),targetNode.getConstructorArg().preprocessorFlags.get(),collectRecursiveExportedPreprocessorFlags(ImmutableList.of(targetNode))),Escaper.BASH_ESCAPER))).put("String_Node_Str",Joiner.on(' ').join(Iterables.transform(MoreIterables.zipAndConcat(Iterables.cycle("String_Node_Str"),Iterables.concat(targetNode.getConstructorArg().linkerFlags.get(),collectRecursiveExportedLinkerFlags(ImmutableList.of(targetNode)))),Escaper.BASH_ESCAPER)));
  ImmutableMap<CxxSource.Type,ImmutableList<String>> langPreprocessorFlags=targetNode.getConstructorArg().langPreprocessorFlags.get();
  Sets.SetView<CxxSource.Type> unsupportedLangPreprocessorFlags=Sets.difference(langPreprocessorFlags.keySet(),SUPPORTED_LANG_PREPROCESSOR_FLAG_TYPES);
  if (!unsupportedLangPreprocessorFlags.isEmpty()) {
    throw new HumanReadableException("String_Node_Str" + "String_Node_Str",buildTarget,unsupportedLangPreprocessorFlags);
  }
  ImmutableSet.Builder<String> allCxxFlagsBuilder=ImmutableSet.builder();
  ImmutableList<String> cxxFlags=langPreprocessorFlags.get(CxxSource.Type.CXX);
  if (cxxFlags != null) {
    allCxxFlagsBuilder.addAll(cxxFlags);
  }
  ImmutableList<String> objcxxFlags=langPreprocessorFlags.get(CxxSource.Type.OBJCXX);
  if (objcxxFlags != null) {
    allCxxFlagsBuilder.addAll(objcxxFlags);
  }
  ImmutableSet<String> allCxxFlags=allCxxFlagsBuilder.build();
  if (!allCxxFlags.isEmpty()) {
    appendConfigsBuilder.put("String_Node_Str",Joiner.on(' ').join(allCxxFlags));
  }
  Optional<ImmutableSortedMap<String,ImmutableMap<String,String>>> configs=Optional.absent();
  if (appleTargetNode.isPresent()) {
    configs=appleTargetNode.get().getConstructorArg().configs;
  }
 else   if (targetNode.getType().equals(CxxLibraryDescription.TYPE)) {
    ImmutableMap<String,String> appendedConfig=appendConfigsBuilder.build();
    ImmutableMap<String,ImmutableMap<String,String>> defaultConfig=CxxPlatformXcodeConfigGenerator.getDefaultXcodeBuildConfigurationsFromCxxPlatform(defaultCxxPlatform,appendedConfig);
    configs=Optional.of(ImmutableSortedMap.copyOf(defaultConfig));
  }
 else {
    throw new HumanReadableException("String_Node_Str",targetNode);
  }
  PBXNativeTarget target=targetBuilderResult.target;
  setTargetBuildConfigurations(getConfigurationNameToXcconfigPath(buildTarget),target,project.getMainGroup(),configs.get(),extraSettingsBuilder.build(),defaultSettingsBuilder.build(),appendConfigsBuilder.build());
  if (appleTargetNode.isPresent()) {
    Path headerPathPrefix=AppleDescriptions.getHeaderPathPrefix(appleTargetNode.get().getConstructorArg(),targetNode.getBuildTarget());
    createHeaderSymlinkTree(sourcePathResolver,AppleDescriptions.convertAppleHeadersToPublicCxxHeaders(sourcePathResolver,headerPathPrefix,arg),AppleDescriptions.getPathToHeaderSymlinkTree(appleTargetNode.get(),HeaderVisibility.PUBLIC));
    createHeaderSymlinkTree(sourcePathResolver,AppleDescriptions.convertAppleHeadersToPrivateCxxHeaders(sourcePathResolver,headerPathPrefix,arg),AppleDescriptions.getPathToHeaderSymlinkTree(appleTargetNode.get(),HeaderVisibility.PRIVATE));
    addCoreDataModelsIntoTarget(appleTargetNode.get(),targetGroup);
  }
  return target;
}

Fixed version (ground truth):
private PBXNativeTarget generateBinaryTarget(PBXProject project,Optional<? extends TargetNode<? extends HasAppleBundleFields>> bundle,TargetNode<? extends CxxLibraryDescription.Arg> targetNode,ProductType productType,String productOutputFormat,Optional<Path> infoPlistOptional,boolean includeFrameworks,ImmutableSet<AppleResourceDescription.Arg> recursiveResources,ImmutableSet<AppleResourceDescription.Arg> directResources,ImmutableSet<AppleAssetCatalogDescription.Arg> recursiveAssetCatalogs,ImmutableSet<AppleAssetCatalogDescription.Arg> directAssetCatalogs,Optional<Iterable<PBXBuildPhase>> copyFilesPhases,Optional<TargetNode<AppleBundleDescription.Arg>> bundleLoaderNode) throws IOException {
  LOG.debug("String_Node_Str",targetNode);
  TargetNode<?> buildTargetNode=bundle.isPresent() ? bundle.get() : targetNode;
  final BuildTarget buildTarget=buildTargetNode.getBuildTarget();
  String productName=getProductName(buildTarget);
  CxxLibraryDescription.Arg arg=targetNode.getConstructorArg();
  NewNativeTargetProjectMutator mutator=new NewNativeTargetProjectMutator(pathRelativizer,sourcePathResolver);
  ImmutableSet<SourcePath> exportedHeaders=ImmutableSet.copyOf(getHeaderSourcePaths(arg.exportedHeaders));
  ImmutableSet<SourcePath> headers=ImmutableSet.copyOf(getHeaderSourcePaths(arg.headers));
  mutator.setTargetName(getXcodeTargetName(buildTarget)).setProduct(productType,productName,Paths.get(String.format(productOutputFormat,productName))).setSourcesWithFlags(ImmutableSet.copyOf(arg.srcs.get())).setPublicHeaders(exportedHeaders).setPrivateHeaders(headers).setPrefixHeader(arg.prefixHeader).setRecursiveResources(recursiveResources).setDirectResources(directResources);
  Optional<TargetNode<AppleNativeTargetDescriptionArg>> appleTargetNode=targetNode.castArg(AppleNativeTargetDescriptionArg.class);
  if (appleTargetNode.isPresent()) {
    AppleNativeTargetDescriptionArg appleArg=appleTargetNode.get().getConstructorArg();
    mutator=mutator.setExtraXcodeSources(ImmutableSet.copyOf(appleArg.extraXcodeSources.get()));
  }
  if (options.contains(Option.CREATE_DIRECTORY_STRUCTURE)) {
    mutator.setTargetGroupPath(FluentIterable.from(buildTarget.getBasePath()).transform(Functions.toStringFunction()).toList());
  }
  if (!recursiveAssetCatalogs.isEmpty()) {
    mutator.setRecursiveAssetCatalogs(recursiveAssetCatalogs);
  }
  if (!directAssetCatalogs.isEmpty()) {
    mutator.setDirectAssetCatalogs(directAssetCatalogs);
  }
  if (includeFrameworks) {
    ImmutableSet.Builder<FrameworkPath> frameworksBuilder=ImmutableSet.builder();
    frameworksBuilder.addAll(targetNode.getConstructorArg().frameworks.get());
    frameworksBuilder.addAll(targetNode.getConstructorArg().libraries.get());
    frameworksBuilder.addAll(collectRecursiveFrameworkDependencies(ImmutableList.of(targetNode)));
    mutator.setFrameworks(frameworksBuilder.build());
    mutator.setArchives(collectRecursiveLibraryDependencies(ImmutableList.of(targetNode)));
  }
  ImmutableList.Builder<TargetNode<?>> preScriptPhases=ImmutableList.builder();
  ImmutableList.Builder<TargetNode<?>> postScriptPhases=ImmutableList.builder();
  boolean skipRNBundle=ReactNativeFlavors.skipBundling(buildTargetNode.getBuildTarget());
  if (bundle.isPresent() && targetNode != bundle.get()) {
    collectBuildScriptDependencies(targetGraph.getAll(bundle.get().getDeclaredDeps()),preScriptPhases,postScriptPhases,skipRNBundle);
  }
  collectBuildScriptDependencies(targetGraph.getAll(targetNode.getDeclaredDeps()),preScriptPhases,postScriptPhases,skipRNBundle);
  mutator.setPreBuildRunScriptPhases(preScriptPhases.build());
  if (copyFilesPhases.isPresent()) {
    mutator.setCopyFilesPhases(copyFilesPhases.get());
  }
  mutator.setPostBuildRunScriptPhases(postScriptPhases.build());
  mutator.skipReactNativeBundle(skipRNBundle);
  if (skipRNBundle && reactNativeServer.isPresent()) {
    mutator.setAdditionalRunScripts(ImmutableList.of(projectFilesystem.resolve(reactNativeServer.get())));
  }
  NewNativeTargetProjectMutator.Result targetBuilderResult;
  try {
    targetBuilderResult=mutator.buildTargetAndAddToProject(project);
  }
 catch (  NoSuchBuildTargetException e) {
    throw new HumanReadableException(e);
  }
  PBXGroup targetGroup=targetBuilderResult.targetGroup;
  SourceTreePath buckFilePath=new SourceTreePath(PBXReference.SourceTree.SOURCE_ROOT,pathRelativizer.outputPathToBuildTargetPath(buildTarget).resolve(buildFileName),Optional.<String>absent());
  PBXFileReference buckReference=targetGroup.getOrCreateFileReferenceBySourceTreePath(buckFilePath);
  buckReference.setExplicitFileType(Optional.of("String_Node_Str"));
  ImmutableMap.Builder<String,String> extraSettingsBuilder=ImmutableMap.builder();
  extraSettingsBuilder.put("String_Node_Str",getProductName(buildTarget)).put("String_Node_Str",pathRelativizer.outputPathToBuildTargetPath(buildTarget).toString());
  if (bundleLoaderNode.isPresent()) {
    TargetNode<AppleBundleDescription.Arg> bundleLoader=bundleLoaderNode.get();
    String bundleLoaderProductName=getProductName(bundleLoader.getBuildTarget());
    String bundleName=bundleLoaderProductName + "String_Node_Str" + getExtensionString(bundleLoader.getConstructorArg().getExtension());
    String bundleLoaderOutputPath=Joiner.on('/').join(getTargetOutputPath(bundleLoader),bundleName,bundleLoaderProductName);
    extraSettingsBuilder.put("String_Node_Str",bundleLoaderOutputPath).put("String_Node_Str","String_Node_Str");
  }
  if (infoPlistOptional.isPresent()) {
    Path infoPlistPath=pathRelativizer.outputDirToRootRelative(infoPlistOptional.get());
    extraSettingsBuilder.put("String_Node_Str",infoPlistPath.toString());
  }
  Optional<SourcePath> prefixHeaderOptional=targetNode.getConstructorArg().prefixHeader;
  if (prefixHeaderOptional.isPresent()) {
    Path prefixHeaderRelative=sourcePathResolver.apply(prefixHeaderOptional.get());
    Path prefixHeaderPath=pathRelativizer.outputDirToRootRelative(prefixHeaderRelative);
    extraSettingsBuilder.put("String_Node_Str",prefixHeaderPath.toString());
    extraSettingsBuilder.put("String_Node_Str","String_Node_Str");
  }
  extraSettingsBuilder.put("String_Node_Str","String_Node_Str");
  ImmutableMap.Builder<String,String> defaultSettingsBuilder=ImmutableMap.builder();
  defaultSettingsBuilder.put("String_Node_Str",projectFilesystem.getRootPath().toAbsolutePath().normalize().toString());
  defaultSettingsBuilder.put("String_Node_Str",getProductName(buildTarget));
  if (bundle.isPresent()) {
    defaultSettingsBuilder.put("String_Node_Str",getExtensionString(bundle.get().getConstructorArg().getExtension()));
  }
  defaultSettingsBuilder.put("String_Node_Str",Joiner.on('/').join("String_Node_Str","String_Node_Str"));
  defaultSettingsBuilder.put("String_Node_Str","String_Node_Str");
  if (!bundle.isPresent() && (targetNode.getType().equals(AppleLibraryDescription.TYPE) || targetNode.getType().equals(CxxLibraryDescription.TYPE))) {
    defaultSettingsBuilder.put("String_Node_Str","String_Node_Str");
  }
  ImmutableMap.Builder<String,String> appendConfigsBuilder=ImmutableMap.builder();
  ImmutableSet<Path> recursiveHeaderMaps=collectRecursiveHeaderMaps(targetNode);
  ImmutableSet<Path> headerMapBases=recursiveHeaderMaps.isEmpty() ? ImmutableSet.<Path>of() : ImmutableSet.of(pathRelativizer.outputDirToRootRelative(BuckConstant.BUCK_OUTPUT_PATH));
  appendConfigsBuilder.put("String_Node_Str",Joiner.on(' ').join(Iterables.concat(recursiveHeaderMaps,headerMapBases))).put("String_Node_Str",Joiner.on(' ').join(collectRecursiveLibrarySearchPaths(ImmutableSet.of(targetNode)))).put("String_Node_Str",Joiner.on(' ').join(collectRecursiveFrameworkSearchPaths(ImmutableList.of(targetNode)))).put("String_Node_Str",Joiner.on(' ').join(Iterables.transform(Iterables.concat(targetNode.getConstructorArg().compilerFlags.get(),targetNode.getConstructorArg().preprocessorFlags.get(),collectRecursiveExportedPreprocessorFlags(ImmutableList.of(targetNode))),Escaper.BASH_ESCAPER))).put("String_Node_Str",Joiner.on(' ').join(Iterables.transform(MoreIterables.zipAndConcat(Iterables.cycle("String_Node_Str"),Iterables.concat(targetNode.getConstructorArg().linkerFlags.get(),collectRecursiveExportedLinkerFlags(ImmutableList.of(targetNode)))),Escaper.BASH_ESCAPER)));
  ImmutableMap<CxxSource.Type,ImmutableList<String>> langPreprocessorFlags=targetNode.getConstructorArg().langPreprocessorFlags.get();
  Sets.SetView<CxxSource.Type> unsupportedLangPreprocessorFlags=Sets.difference(langPreprocessorFlags.keySet(),SUPPORTED_LANG_PREPROCESSOR_FLAG_TYPES);
  if (!unsupportedLangPreprocessorFlags.isEmpty()) {
    throw new HumanReadableException("String_Node_Str" + "String_Node_Str",buildTarget,unsupportedLangPreprocessorFlags);
  }
  ImmutableSet.Builder<String> allCxxFlagsBuilder=ImmutableSet.builder();
  ImmutableList<String> cxxFlags=langPreprocessorFlags.get(CxxSource.Type.CXX);
  if (cxxFlags != null) {
    allCxxFlagsBuilder.addAll(cxxFlags);
  }
  ImmutableList<String> objcxxFlags=langPreprocessorFlags.get(CxxSource.Type.OBJCXX);
  if (objcxxFlags != null) {
    allCxxFlagsBuilder.addAll(objcxxFlags);
  }
  ImmutableSet<String> allCxxFlags=allCxxFlagsBuilder.build();
  if (!allCxxFlags.isEmpty()) {
    appendConfigsBuilder.put("String_Node_Str",Joiner.on(' ').join(allCxxFlags));
  }
  Optional<ImmutableSortedMap<String,ImmutableMap<String,String>>> configs=Optional.absent();
  if (appleTargetNode.isPresent()) {
    configs=appleTargetNode.get().getConstructorArg().configs;
  }
 else   if (targetNode.getType().equals(CxxLibraryDescription.TYPE)) {
    ImmutableMap<String,String> appendedConfig=appendConfigsBuilder.build();
    ImmutableMap<String,ImmutableMap<String,String>> defaultConfig=CxxPlatformXcodeConfigGenerator.getDefaultXcodeBuildConfigurationsFromCxxPlatform(defaultCxxPlatform,appendedConfig);
    configs=Optional.of(ImmutableSortedMap.copyOf(defaultConfig));
  }
 else {
    throw new HumanReadableException("String_Node_Str",targetNode);
  }
  PBXNativeTarget target=targetBuilderResult.target;
  setTargetBuildConfigurations(getConfigurationNameToXcconfigPath(buildTarget),target,project.getMainGroup(),configs.get(),extraSettingsBuilder.build(),defaultSettingsBuilder.build(),appendConfigsBuilder.build());
  Path headerPathPrefix=AppleDescriptions.getHeaderPathPrefix(arg,targetNode.getBuildTarget());
  createHeaderSymlinkTree(sourcePathResolver,AppleDescriptions.convertAppleHeadersToPublicCxxHeaders(sourcePathResolver,headerPathPrefix,arg),AppleDescriptions.getPathToHeaderSymlinkTree(targetNode,HeaderVisibility.PUBLIC));
  createHeaderSymlinkTree(sourcePathResolver,AppleDescriptions.convertAppleHeadersToPrivateCxxHeaders(sourcePathResolver,headerPathPrefix,arg),AppleDescriptions.getPathToHeaderSymlinkTree(targetNode,HeaderVisibility.PRIVATE));
  if (appleTargetNode.isPresent()) {
    addCoreDataModelsIntoTarget(appleTargetNode.get(),targetGroup);
  }
  return target;
}