-
Notifications
You must be signed in to change notification settings - Fork 341
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
Add possibility for Podfile.local #14
Conversation
We agree that this situation should be improved, but we’re not yet clear on the exact path. Our internal discussion on the topic can be summed up as follows: What we need is a way to override the source location for a requirement in the Podfile, but without affecting files that could be checked-in into SCM. E.g. Podfile, Podfile.lock, and everything in the Pods directory. In your current PR, the Podfile.lock file would still get modified, so you can’t have it in SCM without affecting other users of the repo. We would love more input, especially from a working solution. Taking that into account, I would suggest you make use of the fact that a Podfile is a Ruby source file and add logic for your specific situation there. Once you have something that has been demonstrated to work in your company’s setup for a while, we can then discuss further based on a working solution, instead of all theoretical issues. As a start, here’s a very contrived example on how to do what your PR does from the Podfile: if File.exist?('Podfile.local')
eval(File.read('Podfile.local'))
else
# normal definitions used by everyone else
end Keep in mind that with Ruby it is possible to monkey-patch everything at runtime, so it should all be possible from your Podfile. |
Another area of improvement is that it shadows the Podfile, when the user wants just indicate that he would like to use only certain dependencies from a local source. |
Another addendum: in Bundler you can specify an alternate Gemfile with the env var |
Sorry just for clarification. In the core project there is no link to the Podfile.lock. So I have to change that with the corresponding patch in Cocoapods. Am I right? |
I would like to help, but I think in our situation we need to also create a local ".lock" file. Because we do not want to commit local configurations to out vcs. Because it is possible that 4 internal developers and one freelancer work on the same project. All should start with the Podfile from the server. And if I understand it right, also the Podfile.lock should be inside the server repo. So now all five developers have the same standard configuration. Now developer A starts to change also local library code of library B and developer C starts working on library A. So either developer A nor developer C should send any Podfile specific changes to the server. So in out case it would be better if for example developer A could use something like this: Thanks in advance |
Great.
The solution proposed in this pull would shadow the Podfile and the Podfile.lock and thus offers little benefit to keep those file dirty in git (see temporarily ignoring files). Moreover, it would be great to get this feature right from the start, as changing implementation later on would create issues. In my opinion we should allow to specify that the source used by some Pods should point to a custom path/repo. This can be done by introducing another config file and/or a dedicated command as Bundler does. Bundler implementation moreover is more robust because it updates the Lockfile (which is under source control) to store the last SHA of the specified repo. This greatly limits the risk that the installation performed by other clients would use a different version of the modified Pods. For example, taking into account two devs (
With the solution of Bundler, the Lockfile would point to the last commit of lib |
Moving to CocoaPods/CocoaPods#1010 |
This is great!!!!
|
The present discussion about this is here: CocoaPods/CocoaPods#1482 |
We wanna have a local developer only Podfile to handle for example this case:
Normally all developers should use the project specific Podfile which is in our git repo. But if a single developer now wants to work on a dependency of that project, we wanna create a "local" Podfile which is include in the .gitignore. In this local Podfile the developer can then for example specify something like this:
pod "blabla", :local => '......'