So, what would be better? On Tuesday, March 26, 2013, Giorgio Natili wrote:
> The naming convention seems confusing also to me especially on big > projects. > > On 3/25/13 10:46 PM, "Brian LeRoux" <b...@brian.io <javascript:;>> wrote: > > >I'm apprehensive about returning to a naming convention. In a larger > >app this would lead to a very cluttered dir. > > > >The other consideration for ./merges are other assets: icons, and > >splashscreens. (Which would then require 2x or something for > >retina/hdpi situations.) > > > > > > > >On Mon, Mar 25, 2013 at 2:34 PM, Michael Brooks > ><mich...@michaelbrooks.ca <javascript:;>> wrote: > >> Just like to provide an alternative suggestion to the merges/ directory > >>and > >> here everyone's thoughts. > >> > >> While doing client work at Nitobi, each of our build scripts had similar > >> functionality to merging platform-specific web assets. Below, I'll > >>describe > >> what I've experienced and make a suggestion on an improvement. > >> > >> 1. Separate Merges Directory > >> > >> app > >> |__ merges/ > >> | |__ android/ > >> |__ www/ > >> > >> In the above structure, the android/ directory is a mirror of the www/ > >> directory. When a file exists in the android/ directory, it will replace > >> the file in the www/. > >> > >> I believe this is how the merges/ directory in `cordova-cli` works. > >> > >> I've experienced two main problems with this approach: > >> > >> - difficult to keep track of what files are replaced, since you need to > >> cross-reference between directories > >> - too easy to start developing in the merges/android/ directory instead > >>of > >> www/ > >> > >> 2. Unified Merges Approach > >> > >> app > >> |__ www/ > >> |__ index.html > >> |__ myfile.js > >> |__ myfile.android.js > >> |__ myfolder/ > >> |__ myfolder.android/ > >> > >> I've had much greater success with this approach. > >> > >> When a file ends with a dot platform (optional extension) name (e.g. > >> myfile.android.js), it will be renamed to remove the platform name (e.g. > >> myfile.js). This will work on both files and directories. > >> > >> This makes it extremely easy to keep track of what files and directories > >> are generic or platform specific. I haven't actually noticed any > >>downside > >> to this approach and I used it for 2 years. > >> > >> Thoughts? > >> Michael > > >