Commit ad131f94 authored by Fabio Pelosin's avatar Fabio Pelosin

[Project] Store Pods support files inside their group

parent 62aecc4e
...@@ -6,18 +6,12 @@ To install or update CocoaPods see this [guide](http://docs.cocoapods.org/guides ...@@ -6,18 +6,12 @@ To install or update CocoaPods see this [guide](http://docs.cocoapods.org/guides
###### Enhancements ###### Enhancements
* Create all necessary build configurations for *Pods.xcodeproj* at the project level. If the user’s project has more than just *Debug* and *Release* build configurations, they may be explicitly specified in the Podfile:
`xcodeproj 'MyApp', 'App Store' => :release, 'Debug' => :debug, 'Release' => :release`
If build configurations aren’t specified in the Podfile then they will be automatically picked from the user’s project in *Release* mode.
These changes will ensure that the `libPods.a` static library is not stripped for all configurations, as explained in [#1217](https://github.com/CocoaPods/CocoaPods/pull/1217).
[Cédric Luthi](https://github.com/0xced)
[#1294](https://github.com/CocoaPods/CocoaPods/issues/1294)
* Added `pod init` command which generates a Podfile according to the * Added `pod init` command which generates a Podfile according to the
targets of the project stored in the working directory and to the templates targets of the project stored in the working directory and to the templates
stored in the `~/.cocoapods/templates` folder. Tow templates are supported: stored in the `~/.cocoapods/templates` folder. Tow templates are supported:
- the `Podfile.default` template for regular targets. - the `Podfile.default` template for regular targets.
- and the `Podfile.test` template for test targets. - and the `Podfile.test` template for test targets.
[Ian Ynda-Hummel](https://github.com/ianyh) [Ian Ynda-Hummel](https://github.com/ianyh)
[#1106](https://github.com/CocoaPods/CocoaPods/issues/1106) [#1106](https://github.com/CocoaPods/CocoaPods/issues/1106)
[#1045](https://github.com/CocoaPods/CocoaPods/issues/1045) [#1045](https://github.com/CocoaPods/CocoaPods/issues/1045)
...@@ -30,6 +24,16 @@ To install or update CocoaPods see this [guide](http://docs.cocoapods.org/guides ...@@ -30,6 +24,16 @@ To install or update CocoaPods see this [guide](http://docs.cocoapods.org/guides
[readme](https://github.com/0xced/xcproj). [readme](https://github.com/0xced/xcproj).
[Cédric Luthi](https://github.com/0xced) [Cédric Luthi](https://github.com/0xced)
[#1275](https://github.com/CocoaPods/CocoaPods/issues/1275) [#1275](https://github.com/CocoaPods/CocoaPods/issues/1275)
* Rationalized and cleaned up Pods project group structure and path specification.
* Create all necessary build configurations for *Pods.xcodeproj* at the project level. If the user’s project has more than just *Debug* and *Release* build configurations, they may be explicitly specified in the Podfile:
`xcodeproj 'MyApp', 'App Store' => :release, 'Debug' => :debug, 'Release' => :release`
If build configurations aren’t specified in the Podfile then they will be automatically picked from the user’s project in *Release* mode.
These changes will ensure that the `libPods.a` static library is not stripped for all configurations, as explained in [#1217](https://github.com/CocoaPods/CocoaPods/pull/1217).
[Cédric Luthi](https://github.com/0xced)
[#1294](https://github.com/CocoaPods/CocoaPods/issues/1294)
###### Bug Fixes ###### Bug Fixes
...@@ -39,6 +43,12 @@ To install or update CocoaPods see this [guide](http://docs.cocoapods.org/guides ...@@ -39,6 +43,12 @@ To install or update CocoaPods see this [guide](http://docs.cocoapods.org/guides
[Cédric Luthi](https://github.com/0xced) [Cédric Luthi](https://github.com/0xced)
[#1268](https://github.com/CocoaPods/CocoaPods/issues/1268) [#1268](https://github.com/CocoaPods/CocoaPods/issues/1268)
* CoreData versioned models are now properly handled respecting the contents of
the `.xccurrentversion` file.
[#1288](https://github.com/CocoaPods/CocoaPods/issues/1288),
[Xcodeproj#83](https://github.com/CocoaPods/Xcodeproj/pull/83)
[Ashton-W](https://github.com/Ashton-W)
## 0.23.0 ## 0.23.0
......
...@@ -17,7 +17,7 @@ GIT ...@@ -17,7 +17,7 @@ GIT
GIT GIT
remote: https://github.com/CocoaPods/Xcodeproj.git remote: https://github.com/CocoaPods/Xcodeproj.git
revision: c7f6420dd3d0f1a5e3ab3f4983500d5076f85f28 revision: 74a73481a7573c8eea28c1feaa0480882522fa53
branch: paths-refactor branch: paths-refactor
specs: specs:
xcodeproj (0.9.0) xcodeproj (0.9.0)
......
...@@ -15,7 +15,7 @@ module Pod ...@@ -15,7 +15,7 @@ module Pod
add_target add_target
add_files_to_build_phases add_files_to_build_phases
add_resources_bundle_targets add_resources_bundle_targets
create_suport_files_group # create_suport_files_group
create_xcconfig_file create_xcconfig_file
create_prefix_header create_prefix_header
create_dummy_source create_dummy_source
...@@ -179,6 +179,20 @@ module Pod ...@@ -179,6 +179,20 @@ module Pod
flags * " " flags * " "
end end
# Adds a reference to the given file in the support group of this target.
#
# @param [Pathname] path
# The path of the file to which the reference should be added.
#
# @return [PBXFileReference] the file reference of the added file.
#
def add_file_to_support_group(path)
pod_name = library.pod_name
group = project.group_for_spec(pod_name, :support_files)
group.hierarchy_path
group.new_file(path)
end
#-----------------------------------------------------------------------# #-----------------------------------------------------------------------#
end end
......
...@@ -62,7 +62,10 @@ module Pod ...@@ -62,7 +62,10 @@ module Pod
parent_group = development ? development_pods : pods parent_group = development ? development_pods : pods
source_tree = absolute ? :absolute : :group source_tree = absolute ? :absolute : :group
parent_group.new_group(pod_name, path, source_tree) group = parent_group.new_group(pod_name, path, source_tree)
support_files_group = group.new_group(SPEC_SUBGROUPS[:support_files])
support_files_group.source_tree = 'SOURCE_ROOT'
group
end end
# @return [Array<PBXGroup>] Returns all the group of the Pods. # @return [Array<PBXGroup>] Returns all the group of the Pods.
......
...@@ -33,7 +33,7 @@ module Pod ...@@ -33,7 +33,7 @@ module Pod
it "adds file references for the support files of the target" do it "adds file references for the support files of the target" do
@installer.install! @installer.install!
@project.support_files_group @project.support_files_group
group = @project.support_files_group['Pods-BananaLib'] group = @project['Pods/BananaLib/Support Files']
group.children.map(&:display_name).sort.should == [ group.children.map(&:display_name).sort.should == [
"Pods-BananaLib-Private.xcconfig", "Pods-BananaLib-Private.xcconfig",
"Pods-BananaLib-dummy.m", "Pods-BananaLib-dummy.m",
......
...@@ -31,23 +31,26 @@ module Pod ...@@ -31,23 +31,26 @@ module Pod
describe "#add_pod_group" do describe "#add_pod_group" do
before do
@path = config.sandbox.pod_dir('BananaLib')
end
it "adds the group for a Pod" do it "adds the group for a Pod" do
path = config.sandbox.pod_dir('BananaLib') group = @project.add_pod_group('BananaLib', @path)
group = @project.add_pod_group('BananaLib', path)
group.parent.should == @project.pods group.parent.should == @project.pods
group.name.should == 'BananaLib' group.name.should == 'BananaLib'
end end
it "adds the group for a development Pod" do it "adds the group for a development Pod" do
path = config.sandbox.pod_dir('BananaLib') path = config.sandbox.pod_dir('BananaLib')
group = @project.add_pod_group('BananaLib', path, true) group = @project.add_pod_group('BananaLib', @path, true)
group.parent.should == @project.development_pods group.parent.should == @project.development_pods
group.name.should == 'BananaLib' group.name.should == 'BananaLib'
end end
it "configures the path of a new Pod group" do it "configures the path of a new Pod group" do
path = config.sandbox.pod_dir('BananaLib') path = config.sandbox.pod_dir('BananaLib')
group = @project.add_pod_group('BananaLib', path) group = @project.add_pod_group('BananaLib', @path)
group.source_tree.should == '<group>' group.source_tree.should == '<group>'
group.path.should == 'BananaLib' group.path.should == 'BananaLib'
Pathname.new(group.path).should.be.relative Pathname.new(group.path).should.be.relative
...@@ -55,16 +58,22 @@ module Pod ...@@ -55,16 +58,22 @@ module Pod
it "configures the path of a new Pod group as absolute if requested" do it "configures the path of a new Pod group as absolute if requested" do
path = config.sandbox.pod_dir('BananaLib') path = config.sandbox.pod_dir('BananaLib')
group = @project.add_pod_group('BananaLib', path, false, true) group = @project.add_pod_group('BananaLib', @path, false, true)
group.source_tree.should == '<absolute>' group.source_tree.should == '<absolute>'
group.path.should == path.to_s group.path.should == @path.to_s
Pathname.new(group.path).should.be.absolute Pathname.new(group.path).should.be.absolute
end end
it "creates a support file group relative to the project" do
group = @project.add_pod_group('BananaLib', @path, false, true)
group['Support Files'].source_tree.should == 'SOURCE_ROOT'
group['Support Files'].path.should.be.nil
end
end end
#----------------------------------------# #----------------------------------------#
describe "#add_pod_group" do describe "#pod_groups" do
before do before do
@project.add_pod_group('BananaLib', config.sandbox.pod_dir('BananaLib')) @project.add_pod_group('BananaLib', config.sandbox.pod_dir('BananaLib'))
......
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