Merges folder for different platform

Hi there,

I have created an app for windows phone 8 and android which is working fine on the both platform.

But for that I have created two different projects, now I want to merge both the project into one so that I can keep one project for both the platform.

I read somewhere that we can use merges folder for that.But not able to found any proper documentation for that.

Can some please explain me how to do this merge.

Thanks :smile:

Do not know what you really searching for but to find out differences in a whole folder you can use WinMerge on windows and Meld on linux systems.

Open both folders and you will get a diff…

Do not know why it should be an ionic issue,. if the problem is to merge the codebase?

@bengtler I think @shashikant is talking about merges folder which available in ionic folder structure which is used to add different platform files…

Hey guys, soooo I think that there is some confusion as to what the merges folder can do.

So the merge folder is a cordova folder used to dynamically add files to a platforms www folder.

So say you have a css/js file that will be different for android and ios ( or in @shashikant situation, WP8 and android). So to combine two different projects, that is two different CLI created directories, merges wouldn’t be able to do this.

The best and probably best way would be to make a new project and set up project folder with the CLI, and just migrate your code over.

Hope this helps

And the code merging could be done with a DiffTool like winmerge or meld :slight_smile:

*so close

@shashikant

How to use:
Add wp8 and android platforms to project after that you will get empty folders for respective platforms in merges directory.

  • write separate css / js or any file with same exact name which are platform specific
  • Within “merges/wp8” directory create same folder structure as its in your project for those particular files ( do not create unwanted folder structures)
  • paste platform specific files into that directory (make sure they have same exact names and extensions ) and you are done.

When and why :
You use Merges when you want platform specific elements or design.
Personally I use only for changes in platform specific CSS but keeping track of it is really hectic and absolutely insane if you have a large project.

It should be used only if you have few files to be dynamically loaded.

If you don’t specify platform specific files cordova will render default files.In @shashikant 's case just add platform specific files either for android or wp8.

Hope this helps.

Thanks for reply…

Hi I have an issue that is related to this.
I’d like to add an .htaccess file only the browser platform (web).
I created my merged/browser/.htaccess file and I ran ionic build browser, but the zip I find in platforms/browser/build doesn’t contains my .htaccess
what am I doing wrong?
Thanks!

Thanks for the info. Was wondering how to apply the merges folder thingy.