Method: Pod::Podfile::DSL#project

Defined in:
lib/cocoapods-core/podfile/dsl.rb

#project(path, build_configurations = {}) ⇒ void

This method returns an undefined value.

Specifies the Xcode project that contains the target that the Pods library should be linked with.


If none of the target definitions specify an explicit project and there is only one project in the same directory as the Podfile then that project will be used.

It is possible also to specify whether the build settings of your custom build configurations should be modelled after the release or the debug presets. To do so you need to specify a hash where the name of each build configuration is associated to either ‘:release` or `:debug`.

Examples:

Specifying the user project


# This Target can be found in a Xcode project called `FastGPS`
target 'MyGPSApp' do
  project 'FastGPS'
  ...
end

# Same Podfile, multiple Xcodeprojects
target 'MyNotesApp' do
  project 'FastNotes'
  ...
end

Using custom build configurations


project 'TestProject', 'Mac App Store' => :release, 'Test' => :debug

Parameters:

  • path (String)

    the path of the project to link with

  • build_configurations (Hash{String => symbol}) (defaults to: {})

    a hash where the keys are the name of the build configurations in your Xcode project and the values are Symbols that specify if the configuration should be based on the ‘:debug` or `:release` configuration. If no explicit mapping is specified for a configuration in your project, it will default to `:release`.



646
647
648
649
# File 'lib/cocoapods-core/podfile/dsl.rb', line 646

def project(path, build_configurations = {})
  current_target_definition.user_project_path = path
  current_target_definition.build_configurations = build_configurations
end