mxcl / Cake

A delicious, quality‑of‑life supplement for your app‑development toolbox.
Apache License 2.0
537 stars 15 forks source link

How to share Modules between multiple projects #58

Open hiroshihorie opened 5 years ago

hiroshihorie commented 5 years ago

Sorry this must be a really basic question, but once i've built Modules (custom frameworks etc.), i would like to share them with my other projects.

What is the best practice to do this with Cake ?

mxcl commented 5 years ago

There are several ways you could mean “share” could you be more specific?

gcox commented 5 years ago

I was thinking earlier that it would be nice to have a menu option for exporting a module into a new 'Caked' project so you could easily make it stand alone for sharing between separate projects or making a new open source project from that module.

mxcl commented 5 years ago

If you want a module in another Cake project, you can just copy the folder, no need to have menu items.

gcox commented 5 years ago

True. I still haven't gotten used to how simple Cake makes this sort of thing.

hiroshihorie commented 5 years ago

Thank you for your reply. Since the Sources.Model folder is a folder reference (blue folder), somehow i thought adding (drag & drop) the same module folder to another Cake project's Sources.Module will reference the same module, so then I can edit the source code of the same module from both projects. But what seems to happen is that Cake copies the code instead, so when i edit the code, i also need to copy it back to the other project.

If you want a module in another Cake project, you can just copy the folder, no need to have menu items.

Yes, still copying back to other project(s) anytime there is modifications would be required. Perhaps sharing the module across multiple projects was not the intended use case but i just had expectations that Cake will also handle this since it is already handling modules well.

I'm new to modules and I must be doing something wrong or this is not what Cake is for.

Thanks for Cake!

mxcl commented 5 years ago

To share modules across multiple projects you would need to convert it to a Swift package.

In theory we could support local file references as dependencies though. I have no particular motivation for this personally so cannot envisage the design very well.

hiroshihorie commented 5 years ago

I understand you don't have motivation for this personally. Thank you for your reply and hard work.

mxcl commented 5 years ago

Well, I'm not saying I don’t want this feature, merely that I have not needed it (yet) so I do not have a good idea for how it would work. I'd welcome discussion.