Commit 72dd54bb authored by Fabio Pelosin's avatar Fabio Pelosin

Merge branch 'add_podfile' into 0.17

* add_podfile:
  [Project] Use the relative path for the Podfile.
  [Project] Add the Podfile to the Pods project.

Conflicts:
	lib/cocoapods/project.rb
	spec/unit/project_spec.rb
parents 9ba06f2c ca2bbbda
...@@ -175,6 +175,7 @@ ...@@ -175,6 +175,7 @@
- The subversion downloader now does an export instead of a checkout, which - The subversion downloader now does an export instead of a checkout, which
makes it play nicer with SCMs that store metadata in each directory. makes it play nicer with SCMs that store metadata in each directory.
[#245](https://github.com/CocoaPods/CocoaPods/issues/245) [#245](https://github.com/CocoaPods/CocoaPods/issues/245)
- Now the Podfile is added to the Pods project for convenient editing.
###### Bug fixes ###### Bug fixes
......
...@@ -11,11 +11,15 @@ require 'xcodeproj' ...@@ -11,11 +11,15 @@ require 'xcodeproj'
module Pod module Pod
class Project < Xcodeproj::Project class Project < Xcodeproj::Project
include Config::Mixin
attr_reader :support_files_group attr_reader :support_files_group
def initialize(*) def initialize(*)
super super
podfile_path = config.project_podfile.relative_path_from(config.project_pods_root).to_s
podfile_ref = new_file(podfile_path)
podfile_ref.xc_language_specification_identifier = 'xcode.lang.ruby'
new_group('Pods') new_group('Pods')
@support_files_group = new_group('Targets Support Files') @support_files_group = new_group('Targets Support Files')
@user_build_configurations = [] @user_build_configurations = []
......
...@@ -5,6 +5,14 @@ describe 'Pod::Project' do ...@@ -5,6 +5,14 @@ describe 'Pod::Project' do
@project = Pod::Project.new @project = Pod::Project.new
end end
it "adds the Podfile configured as a Ruby file" do
f = @project['Podfile']
f.name.should == 'Podfile'
f.source_tree.should == 'SOURCE_ROOT'
f.xc_language_specification_identifier.should == 'xcode.lang.ruby'
f.path.should == '../Podfile'
end
it "adds a group to the `Pods' group" do it "adds a group to the `Pods' group" do
group = @project.add_spec_group('JSONKit', @project.pods) group = @project.add_spec_group('JSONKit', @project.pods)
@project.pods.children.should.include?(group) @project.pods.children.should.include?(group)
......
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