Skip to content
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

Workflow for building Frameworks to distribute #1

Open
sirghi opened this issue Oct 14, 2019 · 6 comments
Open

Workflow for building Frameworks to distribute #1

sirghi opened this issue Oct 14, 2019 · 6 comments

Comments

@sirghi
Copy link

sirghi commented Oct 14, 2019

More of a question - is there a workflow one can use this plugin to build a framework A with its source code, alongside dependency B, and pack it into one single framework that can be shipped standalone?

@biocross
Copy link

@sirghi Interesting! One way I think of is using a sample project (like this repo's example project) and defining a MergeFile like:

group 'MyStandaloneFramework'
    has_dependencies!  # Only add this if A depends on B
    pod 'FrameworkA'
    pod 'DependencyB'
end

and then run pod install.

This'll merge the pods and put the merged framework in the MergedPods/MyStandaloneFramework directory, which you can then package and ship.

@sirghi
Copy link
Author

sirghi commented Nov 7, 2019

Hi @biocross, sorry for the late reply. So I setup a sample project here. It has FrameworkA which is dependent on the Apollo pod. If you try to bundle exec pod install you should get a "File name too long" error that seems to be of a recursive nature. If you can get to the bottom of the problem, I'd be grateful.

Also, spotted the following secondary issues/uncertainties:

  1. This is a theoretical one. In the above example, with has_dependencies!, in case FrameworkA depends on DependencyB, I assume FrameworkA'a podspec will specify that (like in my case). So I don't see why we'd specify both in the MergeFile.
  2. The podspec is one level higher compared to the MergeFile, but I had to put ../.. in the MergeFile for it to be found.
  3. The MergeFile doesn't support comments. pod installing fails if it does.

Cheers

@sirghi
Copy link
Author

sirghi commented Nov 19, 2019

The error I get is:

File name too long @ rb_file_s_lstat - ../../Example/MergeCache/Pods/FrameworkA/Example/MergeCache/Pods/FrameworkA/Example/MergeCache/Pods/FrameworkA/Example/MergeCache/Pods/FrameworkA/Example/MergeCache/Pods/FrameworkA/Example/MergeCache/Pods/FrameworkA/Example/MergeCache/Pods/FrameworkA/Example/MergeCache/Pods/FrameworkA/Example/MergeCache/Pods/FrameworkA/Example/MergeCache/Pods/FrameworkA/Example/MergeCache/Pods/FrameworkA/Example/MergeCache/Pods/FrameworkA/Example/MergeCache/Pods/FrameworkA/Example/MergeCache/Pods/FrameworkA/Example/MergeCache/Pods/FrameworkA/Example/MergeCache/Pods/FrameworkA/Example/MergeCache/Pods/FrameworkA/Example/MergeCache/Pods/FrameworkA/Example/MergeCache/Pods/FrameworkA/Example/MergeCache/Pods/FrameworkA/Example/MergeCache/Pods/FrameworkA/Example/MergeCache/Pods/FrameworkA/Example/MergeCache/Pods/FrameworkA/Example/MergeCache/Pods/FrameworkA/Example/MergeCache/Pods/FrameworkA/Example/MergeCache/Pods/FrameworkA/Example/MergeCache/Pods/FrameworkA/Example/MergeCache/Pods/Target Support Files/Pods-Dummy/Pods-Dummy-umbrella.h

Any help appreciated

@biocross
Copy link

@sirghi Thank you for providing an Example project. I was able to reproduce the issue, and found the root cause. The recursive copy is happening because of the the pod you're trying to merge is local.

When a pod is specified with a :path attribute in the MergeFile, the plugin creates a copy of the directory at that path for merging; simply to avoid modifying the original source at that path. In your case, the path not only contains your dependency FrameworkA, but also the folder where the actual merge is happening. This leads to the MergeCache directory recursively copying itself.

A simple fix to this problem is to keep FrameworkA.podspec and it's sources in a folder that is at the same directory as the MergeFile.

@biocross
Copy link

biocross commented Nov 20, 2019

Also thanks for reporting the additional issues:

  1. I completely agree what you've mentioned should be the case, but the plugin at this time does not read the dependencies in the podspec, hence all the dependencies need to be manually specified. I plan to make this automatic in the near future (PRs welcome!), but there's edge cases like subspecs to take care of.
  2. You're absolutely right, and this seems to be a bug: The plugin should account for this in :pathed pods in the MergeFile. I'll fix this.
  3. Yep that's correct. I've also mentioned this in the README now.

@sirghi
Copy link
Author

sirghi commented Nov 22, 2019

Thanks @biocross for the detailed answers.

On the main problem, I tried that, but the thing is, the plugin asks for the MergeFile be in the same place as the Podfile. After moving both I still have the same error. Asking for your further assistance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants