New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
undefined method `target_definitions' #161
Comments
You need to create a Podfile which contains something like: platform :ios
dependency 'OCMockito' I didn’t think we still supported looked for podspec files from |
Oh. I had the impression that |
That used to be the case, but that has been deprecated, because it meant that the Pod::Specification class had to know about all the attributes a Pod::Podfile knows of (and then you would still have to specify the platform somewhere), so that will not return. |
Do you recommend integrating the |
I recommend to include it. This way people can easily install directly from your repo and you can easily keep it up-to-date for the state of the repo. |
Last question: if the |
In the Podfile you only need to specify the libs you want to use directly, the specifications themselves will add their own dependencies. I.e. if you have this in your Podfile: platform :ios
dependency 'OCMockito' Then it will in fact install OCMockito and OCHamcrest. |
I.e. in the podspec you specify the libs needed by your lib, so that the user does not have to think about this, but only depend on your lib. |
I think you misunderstood my question. I now have added both a |
Ah, I see. So, a Here are examples of libPusher: |
There is no redundancy. In my example I only have a dependency on OCMockito, not OCHamcrest. But because OCMockito’s pod spec has a dependency on OCHamcrest, they will both get installed. |
I was speaking of the redundancy between a lib's platform :ios
dependency 'OCHamcrest' and that same lib's Pod::Spec.new do |s|
# ...
s.dependency 'OCHamcrest' # that redundancy
end |
Let’s start over, because I don’t know where your Podfile example came from :) Why exactly do you have a Podfile in OCMockito’s repo? Just to test that it works with an example app in the repo? Because the only thing CocoaPods needs in a library’s repo is a podspec. |
I'm confused too. Here is my reasoning and steps I took:
|
Can you give me the link to your project (if it's online)? That might make it easier for me to see what's going on and point to files/lines.
This should work. After installing the dependencies you should have a structure like:
Yes, but if you only want to do a quick compile test, then you throw away the Podfile afterwards, you do not add it to the repo.
So to conclude, under normal circumstances (and I think that that is yours) you do not add a Podfile to a repo and/or keep it around. You only use it to test that the podspec builds. |
I got that working now! I was missing this OCHamcrest dependency in my project's Podfile. Facepalm.
And if I want to make my library project open source later on, and distribute it with CocoaPods. Does that case warrant a Podfile in the repo? |
No. A Podfile is never required for distribution through CocoaPods. A Podfile is purely to consume what CocoaPods distributes for use in your local project. Having said that, your local project does not have to be an application, it can also be a library, like in your case. In such cases, you can have a Podfile in the repo, but it is only used to get the dependencies of you library so you can work on the library itself. So I think what confused you, was that you have to specify OCHamcrest in the podspec for users of your library and again in the Podfile to be able to work on the library itself. In the future we’ll add something to the Podfile class which will read the podspec and include its dependencies so that you don’t have to do this anymore. Anyways, is it all working for you now? :) |
You perfectly dissipated all my confusions! I'm glad to hear that Podfiles will read podspecs to include dependencies. It would help. Thanks for taking the time to help me out! |
Add GRMustache podspec.
I'm getting this error returned from
pod install
on a fork ofOCMockito
where I added aspecfile
:And the specfile:
The text was updated successfully, but these errors were encountered: