apache/cordova-cli — pull request #3 by geekpunk (2013-02-12 03:43:23+00:00)
Title: addition of merges functionality

merges functionality which allows for merging in www content per
platform. For more detail see the following email thread with
brian.leroux@gmail.com
-----------------
Dude, first thing I have to say that I love this, I think its a really
great addition, and will clean up project code a tonne. Some
feedback/queries:

- don't like the folder name. Its precious, I know, but I think we can
some up w/ some better than isn't camel cased. www-overrides or maybe
just "clobbers" or "merges" seems more descriptive to me (in my ideal
fantasy world platforms wouldn't even be in revision control and would
be a build artifact. we're not there yet obviously!)

- if I have something in the overrides folder that IS NOT in the www
equiv would it just get copied/merged in? seems this would be so but
this isn't clear

This def belongs in the cordova-cli project. What I also like is that
we could really start envisioning more shim type code working here.
(For cases like Chrome Packaged Apps or what have you.)

On Sun, Feb 10, 2013 at 3:22 AM, Michael Wolf
wrote:
Awesome. Its funny you mention the platform name, when I first did
this in our build system I ended up following the iOS pattern of doing
like ~platform name like they do ~iphone or ~ipad. However it just
became a pain as you had to change file names and more importantly it
confused as to what was purely in browser versus what would go into the
platform builds. So what I ended up having us do was have an overrides
folder that just has the same file structure of the www such that you
just copy over and what evers in the overrides folder overwrites the
www file which had been copied in. see below as an example. Anywho…
happy to contribute is this the map git
https://github.com/apache/cordova-cli ?

mw

On 2/9/13 5:52 AM, "Brian LeRoux" wrote:

I love this idea. A much older prototype of the CLI stuff had some
smarts that when it detected a file with a platform name in the string
it copied it only to that platform.

Do a pull request and link in this thread for discussion. I think it
would be a great addition to the workflow.

On Fri, Feb 8, 2013 at 6:15 PM, Michael Wolf
wrote:
Hey Man:

I have been loving the updates in the phone gap cli. Have a feature Id
love
to add, its something which I had in our internal cynergy build scripts
to
support building for multiple platforms at once and mocking in, in
browser.
The idea is a platform overrides folder, which will override
css/js/html/images etc when deployed to a specific platform. For
example
images you want to replace on android but not iOS, or js code you want
to
mock in browser, but then replace w/ a real implementation when
building for
android/ios, or instead of writing conditional platform logic for a fix
in
iOS or android you replace the actual js file on each platform. This
is a
strategy which we have used on our projects since the early halo days,
and
it has helped a lot in simplifying production code…. Particualry when
you
try and build for a common base between say something for ios/android
and
windows phone. Anywho….

I have an implantation working in the cordova cli node scripts. How
might I
go about swinging this idea by team, more than happy to add the feature.

mw