Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

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

Closes #105, #121, #215.
  • Loading branch information...
commit 81d3550d719cc7595e9322ee4c6dc2c2ef73893f 1 parent a0a15cc
@alloy alloy authored
View
12 CHANGELOG.md
@@ -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
View
1  lib/cocoapods/installer.rb
@@ -25,6 +25,7 @@ def lock_file
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)
View
2  lib/cocoapods/podfile.rb
@@ -29,7 +29,7 @@ def path
end
def project
- Xcodeproj::Project.new(path) if path
+ Xcodeproj::Project.new(path) if path && path.exist?
end
def build_configurations
View
9 spec/unit/installer/target_installer_spec.rb
@@ -32,7 +32,13 @@ def do_install!
@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 @@ def do_install!
@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")
View
15 spec/unit/installer_spec.rb
@@ -15,11 +15,12 @@
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 @@
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
Please sign in to comment.
Something went wrong with that request. Please try again.