module Xcodeproj::Project::ProjectHelper

def self.new_resources_bundle(project, name, platform, product_group)

Returns:
  • (PBXNativeTarget) - the target.

Parameters:
  • product_group (PBXGroup) --
  • platform (Symbol) --
  • name (String) --
  • project (Project) --
def self.new_resources_bundle(project, name, platform, product_group)
  # Target
  target = project.new(PBXNativeTarget)
  project.targets << target
  target.name = name
  target.product_name = name
  target.product_type = Constants::PRODUCT_TYPE_UTI[:bundle]
  # Configuration List
  cl = project.new(XCConfigurationList)
  cl.default_configuration_is_visible = '0'
  cl.default_configuration_name = 'Release'
  release_conf = project.new(XCBuildConfiguration)
  release_conf.name = 'Release'
  release_conf.build_settings = common_build_settings(nil, platform, nil, target.product_type)
  debug_conf = project.new(XCBuildConfiguration)
  debug_conf.name = 'Debug'
  debug_conf.build_settings = common_build_settings(nil, platform, nil, target.product_type)
  cl.build_configurations << release_conf
  cl.build_configurations << debug_conf
  target.build_configuration_list = cl
  # Product
  product = product_group.new_bundle(name)
  target.product_reference = product
  # Build phases
  build_phases_for_target_type(:bundle).each { |phase| target.build_phases << project.new(phase) }
  target
end