cordova-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michal Mocny <mmo...@chromium.org>
Subject Re: Behavior of --copy-from
Date Tue, 19 May 2015 16:07:58 GMT
Just checked:
https://github.com/apache/cordova-lib/blob/master/cordova-lib/src/cordova/create.js#L179

Seems config.xml isn't required.  We import the nested www/ if it exists,
and same for config.xml merges and hooks.

I would not expect any files/folders outside of www to be copied, dotfiles
or not.

If this isn't desired behaviour, we need a feature request.

On Tue, May 19, 2015 at 12:01 PM, Michal Mocny <mmocny@chromium.org> wrote:

> The *intention* of copy-from / link-to is to import either (a) a web
> project, or (b) another cordova project.
>
> We used to check for (b) I think by the existence of a config.xml and
> www/ (note: double check config.xml is required).  If that check passes, we
> copy those two nested contents only (I think) directly into the root of
> your new project.
>
> If the check failed, we would copy the entire folder into the www/ of the
> new project.
>
> There's some bug since you should get a valid cordova project no matter
> what the contents of the import (with caveats of importing invalid
> config.xml or bad apps).
>
> -Michal
>
> On Tue, May 19, 2015 at 7:12 AM, Raymond Camden <raymondcamden@gmail.com>
> wrote:
>
>> I definitely can't recreate the "end up with a folder that isn't a
>> project" but --copy-from does seem to ignore files it doesn't
>> recognize. I filed a bug for it.
>>
>> On Tue, May 19, 2015 at 6:07 AM, Raymond Camden <raymondcamden@gmail.com>
>> wrote:
>> > No, what seems to happen to me is:
>> >
>> > If I copy-from a directory that has a www folder in it, then it is
>> > treated as the *root* of the new project and a proper Cordova folder
>> > is not created.
>> >
>> > If I copy-from a dir that does NOT have a www folder in it, it is
>> > treated as the www folder of a new project.
>> >
>> > Nope, I lie. Ok, so this is weirder than I imagined.
>> >
>> > I made a new folder called "testwithwww". It has a file called
>> > something.txt and a folder called www with an index.html.
>> >
>> > I sourced a new project with it. My www folder copied fine, but
>> > something.txt was completely ignored. It did, however, make a proper
>> > Cordova project.
>> >
>> > So this is a bit different from what I saw earlier where my first test
>> > created something that wasn't a project, but it definitely failed to
>> > copy a file over.
>> >
>> >
>> >
>> >
>> > On Tue, May 19, 2015 at 2:18 AM, Dmitry Blotsky <dblotsky@microsoft.com>
>> wrote:
>> >> Hi Raymond,
>> >>
>> >> The semantics of “--copy-from” are: copy the passed path in place of
>> the new project's “www” directory, which “cordova create” seems to obey.
Is
>> that not what happened in your case? However, the failure to copy over
>> paths that start with “.” looks like a bug to me. Unless someone says
>> otherwise, feel totally free file a bug in JIRA.
>> >>
>> >> Kindly,
>> >> Dmitry
>> >>
>> >> On May 17, 2015, at 7:56 AM, Raymond Camden <raymondcamden@gmail.com
>> <mailto:raymondcamden@gmail.com>> wrote:
>> >>
>> >> Well shoot - as a follow up - if I make a new Cordova project, lets
>> >> call it testsource2, and then copy .settings to it, and then follow up
>> >> by making a new project that uses copy-from pointing to testsource2,
>> >> the CLI isn't copying the .settings directory. That is a bug for sure,
>> >> right?
>> >>
>> >> On Sun, May 17, 2015 at 9:51 AM, Raymond Camden <
>> raymondcamden@gmail.com<mailto:raymondcamden@gmail.com>> wrote:
>> >> I thought I remember seeing a thread on this, but GMail is being a bit
>> >> cranky about how I search today.
>> >>
>> >> I had thought that if you used --copy-from and the directory you used
>> >> included www itself, then the folders would be copied over to a new
>> >> project and merged in with normal default items.
>> >>
>> >> I just tested with a folder that had 2 items: A .settings directory
>> >> and a www directory. While the CLI reported no issues, it did not
>> >> create a proper Cordova project. It literally just copied .settings
>> >> and www, but didn't do anything else to create a proper Cordova
>> >> project.
>> >>
>> >> So I'm guessing that the expectation is that if you do not use a
>> >> folder meant to be www, then your source directory should contain
>> >> everything required for a proper Cordova project. But that's not
>> >> forward-proof though. Imagine if Cordova 6 changes the project
>> >> structure a bit so that a Foo folder is required, then I wouldn't be
>> >> able to use my source dir w/o changing it. (Which, ok, probably won't
>> >> happen.)
>> >>
>> >> So is this expected? Is this ok with others? Should I file a ER
>> >> perhaps to make --copy-from in this situation add the rest of the
>> >> project assets?
>> >>
>> >> --
>> >>
>> ===========================================================================
>> >> Raymond Camden, Developer Advocate for MobileFirst at IBM
>> >>
>> >> Email : raymondcamden@gmail.com<mailto:raymondcamden@gmail.com>
>> >> Blog : www.raymondcamden.com<http://www.raymondcamden.com>
>> >> Twitter: raymondcamden
>> >>
>> >>
>> >>
>> >> --
>> >>
>> ===========================================================================
>> >> Raymond Camden, Developer Advocate for MobileFirst at IBM
>> >>
>> >> Email : raymondcamden@gmail.com<mailto:raymondcamden@gmail.com>
>> >> Blog : www.raymondcamden.com<http://www.raymondcamden.com/>
>> >> Twitter: raymondcamden
>> >>
>> >> ---------------------------------------------------------------------
>> >> To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org<mailto:
>> dev-unsubscribe@cordova.apache.org>
>> >> For additional commands, e-mail: dev-help@cordova.apache.org<mailto:
>> dev-help@cordova.apache.org>
>> >>
>> >
>> >
>> >
>> > --
>> >
>> ===========================================================================
>> > Raymond Camden, Developer Advocate for MobileFirst at IBM
>> >
>> > Email : raymondcamden@gmail.com
>> > Blog : www.raymondcamden.com
>> > Twitter: raymondcamden
>>
>>
>>
>> --
>>
>> ===========================================================================
>> Raymond Camden, Developer Advocate for MobileFirst at IBM
>>
>> Email : raymondcamden@gmail.com
>> Blog : www.raymondcamden.com
>> Twitter: raymondcamden
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
>> For additional commands, e-mail: dev-help@cordova.apache.org
>>
>>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message