Browse files

Merge branch 'podspec'

* podspec:
  [Podfile#podspec] Changelog and added disabled tests.
  [Podfile] Added Podfile#podspec.

Conflicts:
	CHANGELOG.md
  • Loading branch information...
2 parents c2688f8 + 2501e0d commit 068d803d4944e30c5fdae8484f72c4d4b8d59b2a @fabiopelosin fabiopelosin committed Aug 22, 2012
Showing with 34 additions and 0 deletions.
  1. +1 −0 CHANGELOG.md
  2. +20 −0 lib/cocoapods/podfile.rb
  3. +13 −0 spec/unit/podfile_spec.rb
View
1 CHANGELOG.md
@@ -3,6 +3,7 @@
###### Enhancements
+- Add Podfile `podspec` which allows to use the dependencies of a podspec file. [#162](https://github.com/CocoaPods/CocoaPods/issues/162)
- Check if any of the build settings defined in the xcconfig files is overridden. [#92](https://github.com/CocoaPods/CocoaPods/issues/92)
- The Linter now checks that there are no compiler flags that disable warnings.
View
20 lib/cocoapods/podfile.rb
@@ -403,6 +403,26 @@ def pod(*name_and_version_requirements, &block)
@target_definition.target_dependencies << Dependency.new(*name_and_version_requirements, &block)
end
+ # Use the dependencies of a podspec file.
+ #
+ def podspec(options = nil)
+ if options && path = options[:path]
+ path = File.extname(path) == '.podspec' ? path : "#{path}.podspec"
+ file = Pathname.new(File.expand_path(path))
+ elsif options && name = options[:name]
+ name = File.extname(name) == '.podspec' ? name : "#{name}.podspec"
+ file = config.project_root + name
+ else
+ file = config.project_root.glob('*.podspec').first
+ end
+
+ spec = Specification.from_file(file)
+ spec.activate_platform(@target_definition.platform)
+ deps = spec.recursive_subspecs.push(spec).map {|specification| specification.external_dependencies }
+ deps = deps.flatten.uniq
+ @target_definition.target_dependencies.concat(deps)
+ end
+
def dependency(*name_and_version_requirements, &block)
warn "[DEPRECATED] `dependency' is deprecated (use `pod')"
pod(*name_and_version_requirements, &block)
View
13 spec/unit/podfile_spec.rb
@@ -330,6 +330,19 @@
end
end
end
+ describe "concerning the podspec method" do
+ xit "it can use use the dependencies of a podspec" do
+
+ end
+
+ xit "it allows to specify the name of a podspec" do
+
+ end
+
+ xit "it allows to specify the path of a podspec" do
+
+ end
+ end
describe "concerning validations" do

0 comments on commit 068d803

Please sign in to comment.