You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cordova.apache.org by Ray Camden <ra...@adobe.com> on 2014/07/21 19:34:04 UTC

When is .cordova created?

(This question feels like it *should* be appropriate here, but if I should raise it on the PG Google group, I will.)

I recently released a Brackets extension that wrapped calls to the Cordova CLI. I wrote some simple logic to handle checking if a folder is a Cordova project. I simply looked for a subdirectory called .cordova.

But a user told me the extension wasn't correctly seeing a Cordova project and when I tested, it looks like the default cordova create command will not make the folder. It only exists (so far in my testing) if I create a new project and use --copy-from.

Is there a reason why .cordova doesn't always exist? 

Worse comes to worse, I may just use some logic to see if platforms, plugins, and www exist as subdirectories.

Re: When is .cordova created?

Posted by Gorkem Ercan <go...@gmail.com>.
Eclipse Thym searches for config.xml and www to identify cordova
projects. config.xml can be either on the root of the project or in the
www folder.
--
Gorkem

On Mon, Jul 21, 2014 at 07:00:48PM +0000, Ray Camden wrote:
> Thanks all for the replies. For now, I'm simply going to look for the common subdirectories (hook, plugins, platforms, and www) as a means of sniffing if the project is a Cordova project.
> ________________________________________
> From: mmocny@google.com <mm...@google.com> on behalf of Michal Mocny <mm...@chromium.org>
> Sent: Monday, July 21, 2014 1:42 PM
> To: dev
> Subject: Re: When is .cordova created?
> 
> That directory is optional.  It will only exist if you have non standard
> config options.  When using --link-to and --copy-from, we set the config
> option { "lib": { "www": { "uri": ..., link: true/false } } }.  We also set
> config settings for e.g. Custom platform paths and plugin search paths.

RE: When is .cordova created?

Posted by Ray Camden <ra...@adobe.com>.
Thanks all for the replies. For now, I'm simply going to look for the common subdirectories (hook, plugins, platforms, and www) as a means of sniffing if the project is a Cordova project.
________________________________________
From: mmocny@google.com <mm...@google.com> on behalf of Michal Mocny <mm...@chromium.org>
Sent: Monday, July 21, 2014 1:42 PM
To: dev
Subject: Re: When is .cordova created?

That directory is optional.  It will only exist if you have non standard
config options.  When using --link-to and --copy-from, we set the config
option { "lib": { "www": { "uri": ..., link: true/false } } }.  We also set
config settings for e.g. Custom platform paths and plugin search paths.

Re: When is .cordova created?

Posted by Michal Mocny <mm...@chromium.org>.
That directory is optional.  It will only exist if you have non standard
config options.  When using --link-to and --copy-from, we set the config
option { "lib": { "www": { "uri": ..., link: true/false } } }.  We also set
config settings for e.g. Custom platform paths and plugin search paths.

Since Mark added the ability to specify search path from the command line,
and to add platforms by path directly, there are fewer and fewer reasons to
have a custom cordova config file.  (Also, do we really even needed the
lib.www.url setting saved in there when using --link-to/--copy-from?).
 Theres even an autoPersist setting which specifies if config file changes
should apply temporarily or be written out to disk.

There's also the question of how cordova config files *should* look like in
the future (see app config.xml vs platform config.xml vs
.cordova/config.json vs app manifest.json), or even what it means to be a
cordova workspace (see gulp/grunt workflow suggestions).

So, while I see the value of having one file that guarantees marking a
cordova project, I'm hesitant to mandate the existence of the .cordova
folder.  Up till now, we've been using
`cordovaLib.cordova.findProjectRoot()` to find the root of a cordova
project.  That helper should probably be improved a bit, but its worked
well enough in practice.  Its probably a good candidate for breaking out
into its own node package.

-Michal


On Mon, Jul 21, 2014 at 1:41 PM, Shazron <sh...@gmail.com> wrote:

> My guess is ever since hooks were moved out of .cordova to hooks/ the
> creation of .cordova by default wasn't removed also when using
> --copy-from.
>
> On Mon, Jul 21, 2014 at 10:34 AM, Ray Camden <ra...@adobe.com> wrote:
> > (This question feels like it *should* be appropriate here, but if I
> should raise it on the PG Google group, I will.)
> >
> > I recently released a Brackets extension that wrapped calls to the
> Cordova CLI. I wrote some simple logic to handle checking if a folder is a
> Cordova project. I simply looked for a subdirectory called .cordova.
> >
> > But a user told me the extension wasn't correctly seeing a Cordova
> project and when I tested, it looks like the default cordova create command
> will not make the folder. It only exists (so far in my testing) if I create
> a new project and use --copy-from.
> >
> > Is there a reason why .cordova doesn't always exist?
> >
> > Worse comes to worse, I may just use some logic to see if platforms,
> plugins, and www exist as subdirectories.
>

Re: When is .cordova created?

Posted by Shazron <sh...@gmail.com>.
My guess is ever since hooks were moved out of .cordova to hooks/ the
creation of .cordova by default wasn't removed also when using
--copy-from.

On Mon, Jul 21, 2014 at 10:34 AM, Ray Camden <ra...@adobe.com> wrote:
> (This question feels like it *should* be appropriate here, but if I should raise it on the PG Google group, I will.)
>
> I recently released a Brackets extension that wrapped calls to the Cordova CLI. I wrote some simple logic to handle checking if a folder is a Cordova project. I simply looked for a subdirectory called .cordova.
>
> But a user told me the extension wasn't correctly seeing a Cordova project and when I tested, it looks like the default cordova create command will not make the folder. It only exists (so far in my testing) if I create a new project and use --copy-from.
>
> Is there a reason why .cordova doesn't always exist?
>
> Worse comes to worse, I may just use some logic to see if platforms, plugins, and www exist as subdirectories.