Commit 81d3550d authored by Eloy Duran's avatar Eloy Duran

Actually add the user's build configurations to Pods.xcodeproj.

Closes #105, #121, #215.
parent a0a15ccc
......@@ -19,7 +19,7 @@ link_with ['MyAppTarget', 'MyOtherAppTarget']
dependency 'JSONKit'
target :test, :exclusive => true do
xcodeproj 'TestProject'
xcodeproj 'TestProject', 'Test' => :debug
link_with 'TestRunnerTarget'
dependency 'Kiwi'
end
......@@ -42,6 +42,16 @@ need to specify the target to link with.
See [#76](https://github.com/CocoaPods/CocoaPods/issues/76) for more info.
Finally, CocoaPods will add build configurations to the Pods project for all
configurations in the other projects in the workspace. By default the
configurations are based on the `Release` configuration, to base them on the
`Debug` configuration you will have to explicitely specify them as can be seen
above in the following line:
```ruby
xcodeproj 'TestProject', 'Test' => :debug
```
### Documentation
......
......@@ -25,6 +25,7 @@ module Pod
def project
return @project if @project
@project = Pod::Project.new
@project.user_build_configurations = @podfile.user_build_configurations
activated_pods.each do |pod|
# Add all source files to the project grouped by pod
group = @project.add_pod_group(pod.name)
......
......@@ -29,7 +29,7 @@ module Pod
end
def project
Xcodeproj::Project.new(path) if path
Xcodeproj::Project.new(path) if path && path.exist?
end
def build_configurations
......
......@@ -32,7 +32,13 @@ describe Pod::Installer::TargetInstaller do
@project.targets.count.should == 1
@project.targets.first.name.should == @target_definition.label
end
it "adds the user's build configurations to the target" do
@project.user_build_configurations = { 'Debug' => :debug, 'Release' => :release, 'AppStore' => :release, 'Test' => :debug }
do_install!
@project.targets.first.build_configurations.map(&:name).sort.should == %w{ AppStore Debug Release Test }
end
it 'adds each pod to the static library target' do
@pods[0].expects(:add_to_target).with(instance_of(Xcodeproj::Project::Object::PBXNativeTarget))
do_install!
......@@ -48,7 +54,6 @@ describe Pod::Installer::TargetInstaller do
@installer.xcconfig.to_hash['HEADER_SEARCH_PATHS'].should.include("\"#{@sandbox.header_search_paths.join('" "')}\"")
end
it 'does not add the -fobjc-arc to OTHER_LDFLAGS by default as Xcode 4.3.2 does not support it' do
do_install!
@installer.xcconfig.to_hash['OTHER_LDFLAGS'].split(" ").should.not.include("-fobjc-arc")
......
......@@ -15,11 +15,12 @@ describe "Pod::Installer" do
describe ", by default," do
before do
@xcconfig = Pod::Installer.new(Pod::Podfile.new do
podfile = Pod::Podfile.new do
platform :ios
xcodeproj 'MyProject'
dependency 'JSONKit'
end).target_installers.first.xcconfig.to_hash
end
@xcconfig = Pod::Installer.new(podfile).target_installers.first.xcconfig.to_hash
end
it "sets the header search paths where installed Pod headers can be found" do
......@@ -59,4 +60,14 @@ describe "Pod::Installer" do
installer = Pod::Installer.new(podfile)
installer.target_installers.map(&:target_definition).map(&:name).should == [:not_empty]
end
it "adds the user's build configurations" do
path = fixture('SampleProject/SampleProject.xcodeproj')
podfile = Pod::Podfile.new do
platform :ios
xcodeproj path, 'App Store' => :release
end
installer = Pod::Installer.new(podfile)
installer.project.build_configurations.map(&:name).sort.should == ['App Store', 'Debug', 'Release', 'Test']
end
end
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment