You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cordova.apache.org by Andrew Lunny <al...@gmail.com> on 2012/02/09 01:07:07 UTC

Cordova command

Hi all,

Pat raised the issue/goal of a Cordova binary/command we may want to work
on in the near future (probably post 1.5.0, which looks to be a disruptive
release).

Some purposes of this single command:
- everything the bin directories for Android and iOS do (plus equivalents
for all platforms)
- everything the pluginstall script does and will do

Some outstanding questions:
- is this for developers of Cordova, developers using Cordova, or both?
- can/should it be used for custom builds of the native Cordova library?

One goal, based on out past experience with the `droidgap` Ruby script in
particular, should be to minimize external dependencies. I think most of us
are comfortable writing Node.js programs, and Node runs everywhere we want
to run, so I would expect this will be a Node program. For maximum usage,
we should minimize binary Node-add-on dependencies, particularly if they
depend on external libs in the compilation environment (I'm thinking of
libxmljs in particular).

I would like the program to be compiled into a single binary with Node and
NPM, so we can distribute it ourselves without worrying about the
end-user's environment. This is feasible now, but I believe there is
planned work in Node to turn it from feasible to easy.

If this will be for building Cordova (the library) as well, we should be
aware of the docs repo, which currently depends on perl, Ruby, and some
libraries for each of those platforms that have to be installed separately.
Not sure at this stage the best way to move forward on that front.

Hoping to hear what others think,
Andrew

Re: Cordova command

Posted by Patrick Mueller <pm...@gmail.com>.
On Thu, Feb 9, 2012 at 11:50, Joshua Marinacci <jo...@marinacci.org> wrote:

> BTW. are we planning on having the breaking changes in 1.5 or 2.0?  I'm
> finishing up my PhoneGap book and want to include the current status.
>

It would be nice to start laying out some proposed scheduling for this.
 But, I don't think we can guarantee anything, in terms of
dates/versions/project content.

Can be broken down into a description of where we want to be, and then the
steps to get there.  Steps might be:

- ship a static cordova.js built out of the CJS cordova modules
- allow users to interact w/module system - replace our AMD impl, add their
own modules and scripts, etc
- command-line tooling to interact w/module system and plugins
- etc

We might noodle on how long these might take and so on, but I think it
would be best to just target the "next release".  And seems like "static
cordova.js built out of the CJS cordova modules" would be a valid 1.5
release item.  Everything else: "some future release".  When 1.5 is in the
can, we figure out what in 1.6 (or whatever the next version is).

Figuring out when/if/how we break "compatibility" needs to be part of the
description of each step.

-- 
Patrick Mueller
http://muellerware.org

Re: Cordova command

Posted by Joshua Marinacci <jo...@marinacci.org>.
I love the idea. I've always felt that the different phone gap platforms were too isolated. Great for building an app for a single platform but once you decide to support two at once you have to start making a lot of build scripts.   There should really be one place you put your code and a command to build for a single platform, or all platforms, without copying or modifying your own code.  Write once, deploy everywhere should really be the goal.


BTW. are we planning on having the breaking changes in 1.5 or 2.0?  I'm finishing up my PhoneGap book and want to include the current status.

- Josh

On Feb 9, 2012, at 8:44 AM, Brian LeRoux wrote:

> getting warmer for sure, much of these scripts would just shell to
> bash, for most platforms we already have
> 
> - create
> - emulate
> - log
> - debug
> - test
> - autotest
> 
> another I'd like to see:
> 
> - release
> 
> not at all undoable. does beg the question: what is the structure of a
> phonegap project? I've advocated int he past it looks like this:
> 
> /
> |-plugins/
> |-tmp
> |  |-ios
> |  |-android
> |  |-bb
> |  |-wp
> |  |-webos
> |  |-symbian
> |  |-bada
> |  '-qt
> |
> '-www
> 
> ....which would make the pathing of things slightly different. Forces
> the idea of writing an app platform agnostic and teases out the cross
> platform rough spots quite nicely.
> 
> How are ppl feeling about this idea these days? Seemed like it was too
> big of a leap in the past.
> 
> 
> On Thu, Feb 9, 2012 at 5:28 AM, Patrick Mueller <pm...@gmail.com> wrote:
>> On Wed, Feb 8, 2012 at 19:55, Brian LeRoux <b...@brian.io> wrote:
>> 
>>> So, I've been on about having this and tools like this for some time.
>>> I think it'd be best if we continue w/ the intention of getting there
>>> by way of a set of small tools that are purpose built before composing
>>> into 'one tool to rule them all'.
>> 
>> 
>> In my head, the 'one tool' - `cordova` - is really just a shell for a bunch
>> of subcommands - much like git.
>> 
>>    cordova add-platform init
>>    cordova add-platform ios
>>    cordova add-platform android
>>    cordova remove-plugin cordova/camera
>>    cordova add-plugin phonegap-plugins/barcode-scanner
>>    vim .  # haha, no, really: bbedit .
>>    cordova build
>>    cordova open-ios-sim
>>    ....
>> 
>> command would be structured where every "subcommand" was a node module.  In
>> the backdrop, we end up with utility modules to massage platform files,
>> rebuild cordova.js, general file collectors, listers, copiers, etc, which
>> are used by the "subcommand" modules.
>> 
>> If you just change your wording a bit, it becomes:
>> 
>> I think it'd be best if we continue w/ the intention of getting there
>>> by way of a set of small modules that are purpose,composing them
>>> into 'one tool to rule them all'.
>> 
>> 
>> Sounds awesome!
>> 
>> Or maybe I'm not understanding your concerns.
>> 
>> --
>> Patrick Mueller
>> http://muellerware.org


Re: Cordova command

Posted by Brian LeRoux <b...@brian.io>.
> "we already have" - where?

https://github.com/cordova/cordova-android/tree/master/bin
https://github.com/cordova/cordova-android/tree/master/bin/templates/project/phonegap
https://github.com/cordova/cordova-ios/tree/master/bin
https://github.com/cordova/cordova-ios/tree/master/bin/templates/project

And in BB its in Ant scripts. I don't think the work has been done for
WP7, Bada, or webOS yet. Most of this stuff came from my, now
bitrotted, cordova project on github which prototyped literally
everything being discussed in this thread. We used it as a basis for
some projects at nitobi and it worked well.


>> does beg the question: what is the structure of a
>> phonegap project? I've advocated int he past it looks like this:
> +1.  I think we clearly need a "directory structure", and this seems like a
> good start
>
> Thinking that we should create a wiki page per proposals like this.


I will do this.

Re: Cordova command

Posted by Patrick Mueller <pm...@gmail.com>.
On Thu, Feb 9, 2012 at 11:44, Brian LeRoux <b...@brian.io> wrote:

> getting warmer for sure, much of these scripts would just shell to
> bash, for most platforms we already have
>
> - create
> ...
>

"we already have" - where?


> does beg the question: what is the structure of a
> phonegap project? I've advocated int he past it looks like this:
>
> /
> |-plugins/
> |-tmp
> |  |-ios
> |  |-android
> |  |-bb
> |  |-wp
> |  |-webos
> |  |-symbian
> |  |-bada
> |  '-qt
> |
> '-www
>
> ....
>
> How are ppl feeling about this idea these days? Seemed like it was too
> big of a leap in the past.
>

+1.  I think we clearly need a "directory structure", and this seems like a
good start

Thinking that we should create a wiki page per proposals like this.

-- 
Patrick Mueller
http://muellerware.org

Re: Cordova command

Posted by Filip Maj <fi...@adobe.com>.
>[Project structure]
>How are ppl feeling about this idea these days? Seemed like it was too
>big of a leap in the past.

Looks good to me.


Re: Cordova command

Posted by Brian LeRoux <b...@brian.io>.
getting warmer for sure, much of these scripts would just shell to
bash, for most platforms we already have

- create
- emulate
- log
- debug
- test
- autotest

another I'd like to see:

- release

not at all undoable. does beg the question: what is the structure of a
phonegap project? I've advocated int he past it looks like this:

/
|-plugins/
|-tmp
|  |-ios
|  |-android
|  |-bb
|  |-wp
|  |-webos
|  |-symbian
|  |-bada
|  '-qt
|
'-www

....which would make the pathing of things slightly different. Forces
the idea of writing an app platform agnostic and teases out the cross
platform rough spots quite nicely.

How are ppl feeling about this idea these days? Seemed like it was too
big of a leap in the past.


On Thu, Feb 9, 2012 at 5:28 AM, Patrick Mueller <pm...@gmail.com> wrote:
> On Wed, Feb 8, 2012 at 19:55, Brian LeRoux <b...@brian.io> wrote:
>
>> So, I've been on about having this and tools like this for some time.
>> I think it'd be best if we continue w/ the intention of getting there
>> by way of a set of small tools that are purpose built before composing
>> into 'one tool to rule them all'.
>
>
> In my head, the 'one tool' - `cordova` - is really just a shell for a bunch
> of subcommands - much like git.
>
>    cordova add-platform init
>    cordova add-platform ios
>    cordova add-platform android
>    cordova remove-plugin cordova/camera
>    cordova add-plugin phonegap-plugins/barcode-scanner
>    vim .  # haha, no, really: bbedit .
>    cordova build
>    cordova open-ios-sim
>    ....
>
> command would be structured where every "subcommand" was a node module.  In
> the backdrop, we end up with utility modules to massage platform files,
> rebuild cordova.js, general file collectors, listers, copiers, etc, which
> are used by the "subcommand" modules.
>
> If you just change your wording a bit, it becomes:
>
> I think it'd be best if we continue w/ the intention of getting there
>> by way of a set of small modules that are purpose,composing them
>> into 'one tool to rule them all'.
>
>
> Sounds awesome!
>
> Or maybe I'm not understanding your concerns.
>
> --
> Patrick Mueller
> http://muellerware.org

Re: Cordova command

Posted by Patrick Mueller <pm...@gmail.com>.
On Wed, Feb 8, 2012 at 19:55, Brian LeRoux <b...@brian.io> wrote:

> So, I've been on about having this and tools like this for some time.
> I think it'd be best if we continue w/ the intention of getting there
> by way of a set of small tools that are purpose built before composing
> into 'one tool to rule them all'.


In my head, the 'one tool' - `cordova` - is really just a shell for a bunch
of subcommands - much like git.

    cordova add-platform init
    cordova add-platform ios
    cordova add-platform android
    cordova remove-plugin cordova/camera
    cordova add-plugin phonegap-plugins/barcode-scanner
    vim .  # haha, no, really: bbedit .
    cordova build
    cordova open-ios-sim
    ....

command would be structured where every "subcommand" was a node module.  In
the backdrop, we end up with utility modules to massage platform files,
rebuild cordova.js, general file collectors, listers, copiers, etc, which
are used by the "subcommand" modules.

If you just change your wording a bit, it becomes:

I think it'd be best if we continue w/ the intention of getting there
> by way of a set of small modules that are purpose,composing them
> into 'one tool to rule them all'.


Sounds awesome!

Or maybe I'm not understanding your concerns.

-- 
Patrick Mueller
http://muellerware.org

Re: Cordova command

Posted by Brian LeRoux <b...@brian.io>.
So, I've been on about having this and tools like this for some time.
I think it'd be best if we continue w/ the intention of getting there
by way of a set of small tools that are purpose built before composing
into 'one tool to rule them all'.


On Wed, Feb 8, 2012 at 4:41 PM, Patrick Mueller <pm...@gmail.com> wrote:
> On Wed, Feb 8, 2012 at 19:07, Andrew Lunny <al...@gmail.com> wrote:
>
>> Some outstanding questions:
>
> - is this for developers of Cordova, developers using Cordova, or both?
>>
>
> Primary audience I was considering was "developers using Cordova"
>
> - can/should it be used for custom builds of the native Cordova library?
>>
>
> Sure.  For my app, I may not want to pay the size penalty for "built-in"
> plugins I'm not using.  OTOH, this may be a topic for "advanced users".
>  Which may also mean "no one will ever use it". :-)
>
>
>> One goal, based on out past experience with the `droidgap` Ruby script in
>> particular, should be to minimize external dependencies. I think most of us
>> are comfortable writing Node.js programs, and Node runs everywhere we want
>> to run, so I would expect this will be a Node program. For maximum usage,
>> we should minimize binary Node-add-on dependencies, particularly if they
>> depend on external libs in the compilation environment (I'm thinking of
>> libxmljs in particular).
>>
>
> +1
>
>
>> I would like the program to be compiled into a single binary with Node and
>> NPM, so we can distribute it ourselves without worrying about the
>> end-user's environment. This is feasible now, but I believe there is
>> planned work in Node to turn it from feasible to easy.
>>
>
> Neat.  Can you point to some links on this topic?
>
> If this will be for building Cordova (the library) as well, we should be
>> aware of the docs repo, which currently depends on perl, Ruby, and some
>> libraries for each of those platforms that have to be installed separately.
>> Not sure at this stage the best way to move forward on that front.
>>
>
> Rebuilding the docs doesn't sound like something a user would do.  I'd like
> to have a single command for the users to use - `cordova` that does most of
> what they need to do.  Things users never need to do, like rebuilding the
> docs, don't need to be supported by that command.  No problem having a
> single `cordova-dev` command though, that might have a mountain of pre-reqs
> :-)
>
> --
> Patrick Mueller
> http://muellerware.org

Re: Cordova command

Posted by Patrick Mueller <pm...@gmail.com>.
On Wed, Feb 8, 2012 at 19:07, Andrew Lunny <al...@gmail.com> wrote:

> Some outstanding questions:

- is this for developers of Cordova, developers using Cordova, or both?
>

Primary audience I was considering was "developers using Cordova"

- can/should it be used for custom builds of the native Cordova library?
>

Sure.  For my app, I may not want to pay the size penalty for "built-in"
plugins I'm not using.  OTOH, this may be a topic for "advanced users".
 Which may also mean "no one will ever use it". :-)


> One goal, based on out past experience with the `droidgap` Ruby script in
> particular, should be to minimize external dependencies. I think most of us
> are comfortable writing Node.js programs, and Node runs everywhere we want
> to run, so I would expect this will be a Node program. For maximum usage,
> we should minimize binary Node-add-on dependencies, particularly if they
> depend on external libs in the compilation environment (I'm thinking of
> libxmljs in particular).
>

+1


> I would like the program to be compiled into a single binary with Node and
> NPM, so we can distribute it ourselves without worrying about the
> end-user's environment. This is feasible now, but I believe there is
> planned work in Node to turn it from feasible to easy.
>

Neat.  Can you point to some links on this topic?

If this will be for building Cordova (the library) as well, we should be
> aware of the docs repo, which currently depends on perl, Ruby, and some
> libraries for each of those platforms that have to be installed separately.
> Not sure at this stage the best way to move forward on that front.
>

Rebuilding the docs doesn't sound like something a user would do.  I'd like
to have a single command for the users to use - `cordova` that does most of
what they need to do.  Things users never need to do, like rebuilding the
docs, don't need to be supported by that command.  No problem having a
single `cordova-dev` command though, that might have a mountain of pre-reqs
:-)

-- 
Patrick Mueller
http://muellerware.org