Commit e44f1013 authored by Samuel E. Giddins's avatar Samuel E. Giddins

Merge pull request #3627 from CocoaPods/seg-lib-create-args

[Create] Allow passing additional args to the configure script
parents e0e3b73f d47a2f26
...@@ -13,6 +13,18 @@ To install release candidates run `[sudo] gem install cocoapods --pre` ...@@ -13,6 +13,18 @@ To install release candidates run `[sudo] gem install cocoapods --pre`
[Samuel Giddins](https://github.com/segiddins) [Samuel Giddins](https://github.com/segiddins)
[#3542](https://github.com/CocoaPods/CocoaPods/issues/3542) [#3542](https://github.com/CocoaPods/CocoaPods/issues/3542)
* Supports running pre-install hooks in plugins. This happens before the resolver
does its work, and offers easy access to the sandbox, podfile and lockfile via a
`PreInstallHooksContext` object. This also renames the post-install hooks from `HooksContext`
to `PostInstallHooksContext`.
[Orta Therox](https://github.com/orta)
[#3540](https://github.com/CocoaPods/cocoapods/issues/3409)
* Allow passing additional arguments to `pod lib create`, which then get passed
as-is to the `configure` scripts.
[Samuel Giddins](https://github.com/segiddins)
[#2160](https://github.com/CocoaPods/CocoaPods/issues/2160)
##### Bug Fixes ##### Bug Fixes
* Public headers of vendored frameworks are now automatically linked in * Public headers of vendored frameworks are now automatically linked in
...@@ -39,13 +51,6 @@ To install release candidates run `[sudo] gem install cocoapods --pre` ...@@ -39,13 +51,6 @@ To install release candidates run `[sudo] gem install cocoapods --pre`
[Samuel Giddins](https://github.com/segiddins) [Samuel Giddins](https://github.com/segiddins)
[cocoapods-try#31](https://github.com/CocoaPods/cocoapods-try/issues/31) [cocoapods-try#31](https://github.com/CocoaPods/cocoapods-try/issues/31)
* Supports running pre-install hooks in plugins. This happens before the resolver
does its work, and offers easy access to the sandbox, podfile and lockfile via a
`PreInstallHooksContext` object. This also renames the post-install hooks from `HooksContext`
to `PostInstallHooksContext`.
[Orta Therox](https://github.com/orta)
[cocoapods#3540](https://github.com/CocoaPods/cocoapods/issues/3409)
##### Bug Fixes ##### Bug Fixes
* `pod repo push` will now find and push JSON podspecs. * `pod repo push` will now find and push JSON podspecs.
......
GIT GIT
remote: https://github.com/CocoaPods/CLAide.git remote: https://github.com/CocoaPods/CLAide.git
revision: f75b6d84d898a0a61f87bd48bab87d794a91ee86 revision: 37aeefd6b4475f1920a41ea0e02386cf6d76d235
branch: master branch: master
specs: specs:
claide (0.8.1) claide (0.8.1)
......
...@@ -18,13 +18,20 @@ module Pod ...@@ -18,13 +18,20 @@ module Pod
self.arguments = [ self.arguments = [
CLAide::Argument.new('NAME', true), CLAide::Argument.new('NAME', true),
CLAide::Argument.new('TEMPLATE_URL', false),
] ]
def self.options
[
['--template-url=URL', 'The URL of the git repo containing a ' \
'compatible template'],
].concat(super)
end
def initialize(argv) def initialize(argv)
@name = argv.shift_argument @name = argv.shift_argument
@template_url = argv.shift_argument @template_url = argv.option('template-url', TEMPLATE_REPO)
super super
@additional_args = argv.remainder!
end end
def validate! def validate!
...@@ -72,7 +79,7 @@ module Pod ...@@ -72,7 +79,7 @@ module Pod
UI.section("Configuring #{@name} template.") do UI.section("Configuring #{@name} template.") do
Dir.chdir(@name) do Dir.chdir(@name) do
if File.exist?('configure') if File.exist?('configure')
system("./configure #{@name}") system('./configure', @name, *@additional_args)
else else
UI.warn 'Template does not have a configure file.' UI.warn 'Template does not have a configure file.'
end end
......
...@@ -25,13 +25,13 @@ module Pod ...@@ -25,13 +25,13 @@ module Pod
run_command('lib', 'create', 'TestPod') run_command('lib', 'create', 'TestPod')
end end
it 'configures the template after cloning it passing the name of the Pod as the argument' do it 'configures the template after cloning it passing the name of the Pod and any other args as the argument' do
@sut.any_instance.stubs(:clone_template) @sut.any_instance.stubs(:clone_template)
dir = SpecHelper.temporary_directory + 'TestPod' dir = SpecHelper.temporary_directory + 'TestPod'
dir.mkpath dir.mkpath
File.stubs(:exist?).with('configure').returns(true) File.stubs(:exist?).with('configure').returns(true)
@sut.any_instance.expects(:system).with('./configure TestPod').once @sut.any_instance.expects(:system).with('./configure', 'TestPod', 'foo').once
run_command('lib', 'create', 'TestPod') run_command('lib', 'create', 'TestPod', 'foo', '--verbose')
end end
it 'should show link to new pod guide after creation' do it 'should show link to new pod guide after creation' do
...@@ -48,7 +48,7 @@ module Pod ...@@ -48,7 +48,7 @@ module Pod
it 'should use the given template URL' do it 'should use the given template URL' do
template_url = 'https://github.com/custom/template.git' template_url = 'https://github.com/custom/template.git'
@sut.any_instance.expects(:git!).with(['clone', template_url, 'TestPod']).once @sut.any_instance.expects(:git!).with(['clone', template_url, 'TestPod']).once
run_command('lib', 'create', 'TestPod', template_url) run_command('lib', 'create', 'TestPod', "--template-url=#{template_url}")
end end
it 'should use the default URL if no template URL is given' do it 'should use the default URL if no template URL is given' do
......
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