My team and I have developed a Chrome extension which we are now porting into Firefox. The two versions share enough of a code base that it would be redundant to manage to separate depos. In fact theoretically the difference is within a few files and folder structure (once we unglue a lot of the platform specific code from the internals).
The Chrome extension houses all the files in the root directory, because all Chrome needs is the manifest file and the files can be located anywhere. This is different from the FireFox plugin, because FireFox requires a specific folder structure and where the files are located.
I haven't really found any discussions dealing specifically with managing multiple versions of the same project, yet maintaining a common shared code base. If you know of any articles/discussions, please let me know!
The structure for our Chrome extension is:
Root
[House Extension Scripts]
however the firefox requires the following structure:
Root
|-Data
|-[Houses Page Injected Scripts]
|-Lib
|-[Houses Plugin Side Scripts]
|-package.json
which makes merging and maintaining a common code base a little tricky. In those case Root in Chrome and Data in Firefox contain mostly common files (with a few exception). I am not sure how to do this in Git. In Perforce you can select which folders get merged into which folders. So I would merge the a common Dev
folder into the root
of the chrome extension folder and into the data
folder of the FireFox plugin.
In my mind, the Git branching structure would be something like this:
Firefox-Master/-----------------|-------------------------|---
/ ↗ ↗
Firefox-Dev /-------------|---|--------|-------|---------|---
/ ↗ ↗ ↘
Dev -----------------|-------------|----------|-----------
\ ↘ ↗ ↘
Chrome-Dev \ ------------|---|----|---------------|----|----
\ ↘ ↘
Chrome-Master \-----------------|------------------------|----
where the Dev
branch houses the common code base. Each plugin has it's own dev folder, because each version needs it's own seperate code files to work. If there is something that get's developed in the FireFox-Dev
branch that can be incorportated into Chrome, it will first be merged into Dev
and then Dev
will be merged into the Chrome-Dev
branch. Each Master
is independent as it is treated as a "release" branch.
I am wondering how this is managed on projects that have products ported across multiple platforms. For instance the Linux kernel for x86 and ARM must have a similar issue.
The biggest hurdle here is the fact that both require a different folder structure. I am wondering how this issue is tackled using Git. I want to be able to develop in one branch and be able to merge any non-platform specific code into the other versions while maintaining their unique folder structures.
Please let me know if this is a vague question and if I need to update any of the graph to be more clear. Any help is greatly appreciated!