You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cordova.apache.org by Michal Mocny <mm...@google.com> on 2015/01/09 19:47:58 UTC

Automatically installing missing platforms from cli

I'd like to have cordova-cli automatically install missing platforms when
it is obvious that the platform is required.  i.e.:

> cordova create Foo && cd Foo
> cordova run ios

..should just `cordova platform add ios` automatically.

It appears that this was already added to phonegap-cli.  Would Adobe mind
donating this to cordova-cli, or is it different enough for me to just
start from scratch?  Should be easy, but don't want to duplicate effort.

Filed: https://issues.apache.org/jira/browse/CB-8283

-Michal

Re: Automatically installing missing platforms from cli

Posted by Jay Proulx <jp...@adobe.com>.
I still think the solution is to get cordova to carry the load, any
required tasks should be performed automatically, just like building a
missing platform :)

Jay Proulx | computer scientist | aem engineering | office: 613.940.4052 |
mobile: 613 866 0732 | adobe systems




On 2015-01-09, 2:29 PM, "Michal Mocny" <mm...@chromium.org> wrote:

>Thanks Michael!  Thats appreciated.
>
>Jay, I think a combination of cordova-browser + the save/restore work is
>the answer for you.
>
>On Fri, Jan 9, 2015 at 2:13 PM, Michael Brooks <mb...@adobe.com> wrote:
>
>> Hey Michal,
>>
>> I'd be happy to add this feature to the cordova-cli! It's a feature that
>> I've wanted since day 1, which is why it was added the phonegap-cli at
>>the
>> very beginning. And by donating the implementation to the cordova-cli,
>>it
>> will remove a lot of work-around logic from the phonegap-cli. Simpler is
>> better.
>>
>> I'll set aside time early next week to add this feature to the
>>cordova-cli,
>> then follow up with a pull request for review.
>>
>> Cheers,
>> Michael
>>
>> On Fri, Jan 9, 2015 at 10:47 AM, Michal Mocny <mm...@google.com> wrote:
>>
>> > I'd like to have cordova-cli automatically install missing platforms
>>when
>> > it is obvious that the platform is required.  i.e.:
>> >
>> > > cordova create Foo && cd Foo
>> > > cordova run ios
>> >
>> > ..should just `cordova platform add ios` automatically.
>> >
>> > It appears that this was already added to phonegap-cli.  Would Adobe
>>mind
>> > donating this to cordova-cli, or is it different enough for me to just
>> > start from scratch?  Should be easy, but don't want to duplicate
>>effort.
>> >
>> > Filed: https://issues.apache.org/jira/browse/CB-8283
>> >
>> > -Michal
>> >
>>


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org


Re: Automatically installing missing platforms from cli

Posted by Michal Mocny <mm...@chromium.org>.
Thanks Michael!  Thats appreciated.

Jay, I think a combination of cordova-browser + the save/restore work is
the answer for you.

On Fri, Jan 9, 2015 at 2:13 PM, Michael Brooks <mb...@adobe.com> wrote:

> Hey Michal,
>
> I'd be happy to add this feature to the cordova-cli! It's a feature that
> I've wanted since day 1, which is why it was added the phonegap-cli at the
> very beginning. And by donating the implementation to the cordova-cli, it
> will remove a lot of work-around logic from the phonegap-cli. Simpler is
> better.
>
> I'll set aside time early next week to add this feature to the cordova-cli,
> then follow up with a pull request for review.
>
> Cheers,
> Michael
>
> On Fri, Jan 9, 2015 at 10:47 AM, Michal Mocny <mm...@google.com> wrote:
>
> > I'd like to have cordova-cli automatically install missing platforms when
> > it is obvious that the platform is required.  i.e.:
> >
> > > cordova create Foo && cd Foo
> > > cordova run ios
> >
> > ..should just `cordova platform add ios` automatically.
> >
> > It appears that this was already added to phonegap-cli.  Would Adobe mind
> > donating this to cordova-cli, or is it different enough for me to just
> > start from scratch?  Should be easy, but don't want to duplicate effort.
> >
> > Filed: https://issues.apache.org/jira/browse/CB-8283
> >
> > -Michal
> >
>

Re: Automatically installing missing platforms from cli

Posted by Michael Brooks <mb...@adobe.com>.
Hey Michal,

I'd be happy to add this feature to the cordova-cli! It's a feature that
I've wanted since day 1, which is why it was added the phonegap-cli at the
very beginning. And by donating the implementation to the cordova-cli, it
will remove a lot of work-around logic from the phonegap-cli. Simpler is
better.

I'll set aside time early next week to add this feature to the cordova-cli,
then follow up with a pull request for review.

Cheers,
Michael

On Fri, Jan 9, 2015 at 10:47 AM, Michal Mocny <mm...@google.com> wrote:

> I'd like to have cordova-cli automatically install missing platforms when
> it is obvious that the platform is required.  i.e.:
>
> > cordova create Foo && cd Foo
> > cordova run ios
>
> ..should just `cordova platform add ios` automatically.
>
> It appears that this was already added to phonegap-cli.  Would Adobe mind
> donating this to cordova-cli, or is it different enough for me to just
> start from scratch?  Should be easy, but don't want to duplicate effort.
>
> Filed: https://issues.apache.org/jira/browse/CB-8283
>
> -Michal
>

Re: Automatically installing missing platforms from cli

Posted by Jay Proulx <jp...@adobe.com>.
+1 to this and anything required to run the application.

Without plugins cordova projects could simply run in Safari, so if copying
icons, splash screens, creating platforms, and installing plugins are
required to actually compile and run the application then they should all
happen automatically.

If cordova knows that your application will fail without all of the above,
then it should throw an error and stop the build.

I¹d like to see this happen, but would be interested in hearing feedback
if this could possibly cause problems.

Jay Proulx | computer scientist | aem engineering | office: 613.940.4052 |
mobile: 613 866 0732 | adobe systems




On 2015-01-09, 1:47 PM, "Michal Mocny" <mm...@google.com> wrote:

>I'd like to have cordova-cli automatically install missing platforms when
>it is obvious that the platform is required.  i.e.:
>
>> cordova create Foo && cd Foo
>> cordova run ios
>
>..should just `cordova platform add ios` automatically.
>
>It appears that this was already added to phonegap-cli.  Would Adobe mind
>donating this to cordova-cli, or is it different enough for me to just
>start from scratch?  Should be easy, but don't want to duplicate effort.
>
>Filed: https://issues.apache.org/jira/browse/CB-8283
>
>-Michal


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org


Re: Automatically installing missing platforms from cli

Posted by Andrew Grieve <ag...@chromium.org>.
Terence - reading your email it's not clear to me what you're in favour of.
Enforce explicit command for creating platform == simplicity, or "cordova
run android" adding platform if not present == simplicity?



On Thu, Jan 15, 2015 at 12:24 PM, Terence M. Bandoian <te...@tmbsw.com>
wrote:

> For users, particularly those that don't use Cordova every day, I'd prefer
> a straightforward set of primitives with minimal side effects that don't
> require recollection of much beyond the names of the primitives.
>
> From a development standpoint, my impression is that Cordova is already
> complex enough that it's difficult to move from one release to another
> without breaking something.
>
> Simplicity is good.
>
> -Terence
>
>
>
>
> On 1/12/2015 1:19 PM, Michael Brooks wrote:
>
>> By the sounds of it, the Cordova team is not in agreement on whether we
>> should auto-add platforms with the Cordova CLI.
>>
>> My two cents is: Fil Maj and I created the Cordova CLI to be an explicit
>> CLI tool that produced parseable output for programmatic consumption. It's
>> a tool for distributions to use. The PhoneGap CLI, on the other hand, is a
>> simple CLI that helps the user and produced human-readable output. It's a
>> tool for human use. That said, this philosophy has been long lost - the
>> Cordova CLI is absolutely awful at programmatic usage.
>>
>> The implementation is trivial but this discussion is important. As a team,
>> the Cordova contributors need to decide what they want. The worse thing
>> that can happen is for this feature to be force pushed into `master`
>> without a positive consensus.
>>
>>
>> On Mon, Jan 12, 2015 at 9:02 AM, Andrew Grieve <ag...@chromium.org>
>> wrote:
>>
>>  On Sun, Jan 11, 2015 at 11:40 PM, Terence M. Bandoian <terence@tmbsw.com
>>> >
>>> wrote:
>>>
>>>  Creating directories and downloading and installing files is a lot of
>>>> "magic" that may not be desired. Here's another Git example:
>>>>
>>>>  Compiling on android downloads & creates a bunch of files, but it  is
>>> what
>>> you want it to do. When would this not be desired? It's an easily
>>> undo-able
>>> operation.
>>>
>>> With git, it's actually really important that you know what each command
>>> does. With cordova, I don't think it's as important that you understand
>>> how
>>> it works. You can get by with the fact that it does work.
>>>
>>>
>>>
>>>  $ git commit -m "commit test."
>>>> On branch development
>>>> Changes not staged for commit:
>>>>          modified:   html/data/topics.json
>>>>          modified:   html/topics.html
>>>>
>>>> no changes added to commit
>>>>
>>>> $ git status
>>>> On branch development
>>>> Changes not staged for commit:
>>>>    (use "git add <file>..." to update what will be committed)
>>>>    (use "git checkout -- <file>..." to discard changes in working
>>>>
>>> directory)
>>>
>>>>          modified:   html/data/topics.json
>>>>          modified:   html/topics.html
>>>>
>>>> no changes added to commit (use "git add" and/or "git commit -a")
>>>>
>>>> On a related note, is there a diagram somewhere of all the cordova-cli
>>>> commands and their associated options?
>>>>
>>>> -Terence
>>>>
>>>>
>>>>
>>>> On 1/10/2015 7:38 PM, Andrew Grieve wrote:
>>>>
>>>>  "cordova run" already builds before running (unless you add --nobuild).
>>>>>
>>>> I
>>>
>>>> think it'd be pretty annoying if we had run fail with a "you need to
>>>>>
>>>> build
>>>
>>>> first" kind of message.
>>>>>
>>>>> In my mind, cordova-cli's purpose is to add magic. Otherwise, you would
>>>>> just use plugman+platform scripts (and yes, some people do and that is
>>>>> okay).
>>>>>
>>>>> I think it would be awesome if you could clone a project, type "cordova
>>>>> run
>>>>> ios" and have it do everything necessary to run the app (install,
>>>>> build,
>>>>> and deploy).
>>>>>
>>>>>
>>>>>
>>>>> On Fri, Jan 9, 2015 at 8:13 PM, Jesse <pu...@gmail.com> wrote:
>>>>>
>>>>>   what does `cordova run ios` do in windows?
>>>>>
>>>>>> or:
>>>>>> `cordova run wp8` in mac?
>>>>>>
>>>>>> Note that recent changes allow you to `platform add ios` in windows,
>>>>>>
>>>>> but
>>>
>>>> run will always be an error.
>>>>>> Personally, I am with Terrance on this. Magic should be used very
>>>>>> carefully.
>>>>>>
>>>>>> --------------
>>>>>> $ git on up
>>>>>> git: 'on' is not a git command. See 'git --help'.
>>>>>>
>>>>>> Did you mean one of these?
>>>>>>           clone
>>>>>>           log
>>>>>>           notes
>>>>>>           svn
>>>>>>
>>>>>>
>>>>>>
>>>>>> @purplecabbage
>>>>>> risingj.com
>>>>>>
>>>>>> On Fri, Jan 9, 2015 at 4:53 PM, Terence M. Bandoian <
>>>>>> terence@tmbsw.com
>>>>>> wrote:
>>>>>>
>>>>>>   Seems to me that:
>>>>>>
>>>>>>>       cordova run ios
>>>>>>>
>>>>>>> should do just that.  If the platform has not been added, I'd suggest
>>>>>>>
>>>>>>>  that
>>>>>>
>>>>>>  it fail with an informative message that could include the command to
>>>>>>> run
>>>>>>> to resolve the problem (similar to Git bash).  At this level,
>>>>>>> deducing
>>>>>>>
>>>>>>>  the
>>>>>>
>>>>>>  user's intentions has the potential to get messy in a hurry both in
>>>>>>>
>>>>>> the
>>>
>>>> code and for the user.
>>>>>>>
>>>>>>> -Terence Bandoian
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> On 1/9/2015 12:47 PM, Michal Mocny wrote:
>>>>>>>
>>>>>>>   I'd like to have cordova-cli automatically install missing
>>>>>>> platforms
>>>>>>> when
>>>>>>> it is obvious that the platform is required.  i.e.:
>>>>>>>
>>>>>>>>    cordova create Foo && cd Foo
>>>>>>>>
>>>>>>>>  cordova run ios
>>>>>>>>>
>>>>>>>>>   ..should just `cordova platform add ios` automatically.
>>>>>>>>>
>>>>>>>> It appears that this was already added to phonegap-cli.  Would Adobe
>>>>>>>>
>>>>>>>>  mind
>>>>>>> donating this to cordova-cli, or is it different enough for me to
>>>>>>> just
>>>>>>>
>>>>>>>> start from scratch?  Should be easy, but don't want to duplicate
>>>>>>>> effort.
>>>>>>>>
>>>>>>>> Filed: https://issues.apache.org/jira/browse/CB-8283
>>>>>>>>
>>>>>>>> -Michal
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>  ------------------------------------------------------------
>>> ---------
>>>
>>>> To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
>>>>>>> For additional commands, e-mail: dev-help@cordova.apache.org
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>  ------------------------------------------------------------
>>>> ---------
>>>> To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
>>>> For additional commands, e-mail: dev-help@cordova.apache.org
>>>>
>>>>
>>>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
> For additional commands, e-mail: dev-help@cordova.apache.org
>
>

Re: Automatically installing missing platforms from cli

Posted by "Terence M. Bandoian" <te...@tmbsw.com>.
For users, particularly those that don't use Cordova every day, I'd 
prefer a straightforward set of primitives with minimal side effects 
that don't require recollection of much beyond the names of the primitives.

 From a development standpoint, my impression is that Cordova is already 
complex enough that it's difficult to move from one release to another 
without breaking something.

Simplicity is good.

-Terence



On 1/12/2015 1:19 PM, Michael Brooks wrote:
> By the sounds of it, the Cordova team is not in agreement on whether we
> should auto-add platforms with the Cordova CLI.
>
> My two cents is: Fil Maj and I created the Cordova CLI to be an explicit
> CLI tool that produced parseable output for programmatic consumption. It's
> a tool for distributions to use. The PhoneGap CLI, on the other hand, is a
> simple CLI that helps the user and produced human-readable output. It's a
> tool for human use. That said, this philosophy has been long lost - the
> Cordova CLI is absolutely awful at programmatic usage.
>
> The implementation is trivial but this discussion is important. As a team,
> the Cordova contributors need to decide what they want. The worse thing
> that can happen is for this feature to be force pushed into `master`
> without a positive consensus.
>
>
> On Mon, Jan 12, 2015 at 9:02 AM, Andrew Grieve <ag...@chromium.org> wrote:
>
>> On Sun, Jan 11, 2015 at 11:40 PM, Terence M. Bandoian <te...@tmbsw.com>
>> wrote:
>>
>>> Creating directories and downloading and installing files is a lot of
>>> "magic" that may not be desired. Here's another Git example:
>>>
>> Compiling on android downloads & creates a bunch of files, but it  is what
>> you want it to do. When would this not be desired? It's an easily undo-able
>> operation.
>>
>> With git, it's actually really important that you know what each command
>> does. With cordova, I don't think it's as important that you understand how
>> it works. You can get by with the fact that it does work.
>>
>>
>>
>>> $ git commit -m "commit test."
>>> On branch development
>>> Changes not staged for commit:
>>>          modified:   html/data/topics.json
>>>          modified:   html/topics.html
>>>
>>> no changes added to commit
>>>
>>> $ git status
>>> On branch development
>>> Changes not staged for commit:
>>>    (use "git add <file>..." to update what will be committed)
>>>    (use "git checkout -- <file>..." to discard changes in working
>> directory)
>>>          modified:   html/data/topics.json
>>>          modified:   html/topics.html
>>>
>>> no changes added to commit (use "git add" and/or "git commit -a")
>>>
>>> On a related note, is there a diagram somewhere of all the cordova-cli
>>> commands and their associated options?
>>>
>>> -Terence
>>>
>>>
>>>
>>> On 1/10/2015 7:38 PM, Andrew Grieve wrote:
>>>
>>>> "cordova run" already builds before running (unless you add --nobuild).
>> I
>>>> think it'd be pretty annoying if we had run fail with a "you need to
>> build
>>>> first" kind of message.
>>>>
>>>> In my mind, cordova-cli's purpose is to add magic. Otherwise, you would
>>>> just use plugman+platform scripts (and yes, some people do and that is
>>>> okay).
>>>>
>>>> I think it would be awesome if you could clone a project, type "cordova
>>>> run
>>>> ios" and have it do everything necessary to run the app (install, build,
>>>> and deploy).
>>>>
>>>>
>>>>
>>>> On Fri, Jan 9, 2015 at 8:13 PM, Jesse <pu...@gmail.com> wrote:
>>>>
>>>>   what does `cordova run ios` do in windows?
>>>>> or:
>>>>> `cordova run wp8` in mac?
>>>>>
>>>>> Note that recent changes allow you to `platform add ios` in windows,
>> but
>>>>> run will always be an error.
>>>>> Personally, I am with Terrance on this. Magic should be used very
>>>>> carefully.
>>>>>
>>>>> --------------
>>>>> $ git on up
>>>>> git: 'on' is not a git command. See 'git --help'.
>>>>>
>>>>> Did you mean one of these?
>>>>>           clone
>>>>>           log
>>>>>           notes
>>>>>           svn
>>>>>
>>>>>
>>>>>
>>>>> @purplecabbage
>>>>> risingj.com
>>>>>
>>>>> On Fri, Jan 9, 2015 at 4:53 PM, Terence M. Bandoian <terence@tmbsw.com
>>>>> wrote:
>>>>>
>>>>>   Seems to me that:
>>>>>>       cordova run ios
>>>>>>
>>>>>> should do just that.  If the platform has not been added, I'd suggest
>>>>>>
>>>>> that
>>>>>
>>>>>> it fail with an informative message that could include the command to
>>>>>> run
>>>>>> to resolve the problem (similar to Git bash).  At this level, deducing
>>>>>>
>>>>> the
>>>>>
>>>>>> user's intentions has the potential to get messy in a hurry both in
>> the
>>>>>> code and for the user.
>>>>>>
>>>>>> -Terence Bandoian
>>>>>>
>>>>>>
>>>>>>
>>>>>> On 1/9/2015 12:47 PM, Michal Mocny wrote:
>>>>>>
>>>>>>   I'd like to have cordova-cli automatically install missing platforms
>>>>>> when
>>>>>> it is obvious that the platform is required.  i.e.:
>>>>>>>    cordova create Foo && cd Foo
>>>>>>>
>>>>>>>> cordova run ios
>>>>>>>>
>>>>>>>>   ..should just `cordova platform add ios` automatically.
>>>>>>> It appears that this was already added to phonegap-cli.  Would Adobe
>>>>>>>
>>>>>> mind
>>>>>> donating this to cordova-cli, or is it different enough for me to just
>>>>>>> start from scratch?  Should be easy, but don't want to duplicate
>>>>>>> effort.
>>>>>>>
>>>>>>> Filed: https://issues.apache.org/jira/browse/CB-8283
>>>>>>>
>>>>>>> -Michal
>>>>>>>
>>>>>>>
>>>>>>>
>> ---------------------------------------------------------------------
>>>>>> To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
>>>>>> For additional commands, e-mail: dev-help@cordova.apache.org
>>>>>>
>>>>>>
>>>>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
>>> For additional commands, e-mail: dev-help@cordova.apache.org
>>>
>>>


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org


Re: Automatically installing missing platforms from cli

Posted by Jesse <pu...@gmail.com>.
This is becoming too much discussion for this feature.

Andrew, I agree that the consequence of a magical git command is
potentially much worse than accidentally adding a cordova platform.
The only downside I see is if you pay for network data.

My criteria for choosing a feature includes evaluating how often I
think this might happen. I expect this is a very rare occurrence.

If people want this feature then by all means go for it, I am not
blocking, just discussing. Personally I don't feel the additional
bugs, code to support, and added complexity is worth the feature. I
would put this in the category of 'wouldn't it be cool if ...'

Michael, thanks for the history. cordova-cli is now a user facing
tool, and is the only way that we (as cordova-pmc) push users to build
projects.
We cannot depend on the existence of third party tools to nicefy our
workflow. This is a bigger discussion than this lone feature though.





> On Jan 12, 2015, at 11:33 AM, Josh Soref <js...@blackberry.com> wrote:
>
> Michael Brooks wrote:
>> By the sounds of it, the Cordova team is not in agreement on whether we
>> should auto-add platforms with the Cordova CLI.
>
> Seems like a reasonable summary
>
>> My two cents is: Fil Maj and I created the Cordova CLI to be an explicit
>> CLI tool that produced parseable output for programmatic consumption. It's
>> a tool for distributions to use.
>
> Good to know
>
>> The PhoneGap CLI, on the other hand,
>> is a simple CLI that helps the user and produced human-readable output.
>> It's a tool for human use.
>
> As a point of reference (which supports derivatives doing other things,
> but doesn't have any impact on what cordova-cli should do),
> webworks auto adds blackberry10 when you run `webworks create directory`
>
>
>> That said, this philosophy has been long lost - the
>> Cordova CLI is absolutely awful at programmatic usage.
>
> Yeah, we've mostly switched to using cordova-lib instead, and probably
> places where we still use cordova-cli (as opposed to just falling through
> to it) are bugs.
>
>> The implementation is trivial but this discussion is important.
>
> Agreed
>
>> As a team, the Cordova contributors need to decide what they want.
>> The worse thing that can happen is for this feature to be force pushed
>> into
>> `master` without a positive consensus.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org


Re: Automatically installing missing platforms from cli

Posted by Josh Soref <js...@blackberry.com>.
Michael Brooks wrote:
>By the sounds of it, the Cordova team is not in agreement on whether we
>should auto-add platforms with the Cordova CLI.

Seems like a reasonable summary

>My two cents is: Fil Maj and I created the Cordova CLI to be an explicit
>CLI tool that produced parseable output for programmatic consumption. It's
>a tool for distributions to use.

Good to know

>The PhoneGap CLI, on the other hand,
>is a simple CLI that helps the user and produced human-readable output.
>It's a tool for human use.

As a point of reference (which supports derivatives doing other things,
but doesn't have any impact on what cordova-cli should do),
webworks auto adds blackberry10 when you run `webworks create directory`


>That said, this philosophy has been long lost - the
>Cordova CLI is absolutely awful at programmatic usage.

Yeah, we've mostly switched to using cordova-lib instead, and probably
places where we still use cordova-cli (as opposed to just falling through
to it) are bugs.

>The implementation is trivial but this discussion is important.

Agreed

> As a team, the Cordova contributors need to decide what they want.
>The worse thing that can happen is for this feature to be force pushed
>into
> `master` without a positive consensus.

Re: Automatically installing missing platforms from cli

Posted by Michael Brooks <mi...@michaelbrooks.ca>.
By the sounds of it, the Cordova team is not in agreement on whether we
should auto-add platforms with the Cordova CLI.

My two cents is: Fil Maj and I created the Cordova CLI to be an explicit
CLI tool that produced parseable output for programmatic consumption. It's
a tool for distributions to use. The PhoneGap CLI, on the other hand, is a
simple CLI that helps the user and produced human-readable output. It's a
tool for human use. That said, this philosophy has been long lost - the
Cordova CLI is absolutely awful at programmatic usage.

The implementation is trivial but this discussion is important. As a team,
the Cordova contributors need to decide what they want. The worse thing
that can happen is for this feature to be force pushed into `master`
without a positive consensus.


On Mon, Jan 12, 2015 at 9:02 AM, Andrew Grieve <ag...@chromium.org> wrote:

> On Sun, Jan 11, 2015 at 11:40 PM, Terence M. Bandoian <te...@tmbsw.com>
> wrote:
>
> > Creating directories and downloading and installing files is a lot of
> > "magic" that may not be desired. Here's another Git example:
> >
>
> Compiling on android downloads & creates a bunch of files, but it  is what
> you want it to do. When would this not be desired? It's an easily undo-able
> operation.
>
> With git, it's actually really important that you know what each command
> does. With cordova, I don't think it's as important that you understand how
> it works. You can get by with the fact that it does work.
>
>
>
> >
> > $ git commit -m "commit test."
> > On branch development
> > Changes not staged for commit:
> >         modified:   html/data/topics.json
> >         modified:   html/topics.html
> >
> > no changes added to commit
> >
> > $ git status
> > On branch development
> > Changes not staged for commit:
> >   (use "git add <file>..." to update what will be committed)
> >   (use "git checkout -- <file>..." to discard changes in working
> directory)
> >
> >         modified:   html/data/topics.json
> >         modified:   html/topics.html
> >
> > no changes added to commit (use "git add" and/or "git commit -a")
> >
> > On a related note, is there a diagram somewhere of all the cordova-cli
> > commands and their associated options?
> >
> > -Terence
> >
> >
> >
> > On 1/10/2015 7:38 PM, Andrew Grieve wrote:
> >
> >> "cordova run" already builds before running (unless you add --nobuild).
> I
> >> think it'd be pretty annoying if we had run fail with a "you need to
> build
> >> first" kind of message.
> >>
> >> In my mind, cordova-cli's purpose is to add magic. Otherwise, you would
> >> just use plugman+platform scripts (and yes, some people do and that is
> >> okay).
> >>
> >> I think it would be awesome if you could clone a project, type "cordova
> >> run
> >> ios" and have it do everything necessary to run the app (install, build,
> >> and deploy).
> >>
> >>
> >>
> >> On Fri, Jan 9, 2015 at 8:13 PM, Jesse <pu...@gmail.com> wrote:
> >>
> >>  what does `cordova run ios` do in windows?
> >>> or:
> >>> `cordova run wp8` in mac?
> >>>
> >>> Note that recent changes allow you to `platform add ios` in windows,
> but
> >>> run will always be an error.
> >>> Personally, I am with Terrance on this. Magic should be used very
> >>> carefully.
> >>>
> >>> --------------
> >>> $ git on up
> >>> git: 'on' is not a git command. See 'git --help'.
> >>>
> >>> Did you mean one of these?
> >>>          clone
> >>>          log
> >>>          notes
> >>>          svn
> >>>
> >>>
> >>>
> >>> @purplecabbage
> >>> risingj.com
> >>>
> >>> On Fri, Jan 9, 2015 at 4:53 PM, Terence M. Bandoian <terence@tmbsw.com
> >
> >>> wrote:
> >>>
> >>>  Seems to me that:
> >>>>
> >>>>      cordova run ios
> >>>>
> >>>> should do just that.  If the platform has not been added, I'd suggest
> >>>>
> >>> that
> >>>
> >>>> it fail with an informative message that could include the command to
> >>>> run
> >>>> to resolve the problem (similar to Git bash).  At this level, deducing
> >>>>
> >>> the
> >>>
> >>>> user's intentions has the potential to get messy in a hurry both in
> the
> >>>> code and for the user.
> >>>>
> >>>> -Terence Bandoian
> >>>>
> >>>>
> >>>>
> >>>> On 1/9/2015 12:47 PM, Michal Mocny wrote:
> >>>>
> >>>>  I'd like to have cordova-cli automatically install missing platforms
> >>>>>
> >>>> when
> >>>
> >>>> it is obvious that the platform is required.  i.e.:
> >>>>>
> >>>>>   cordova create Foo && cd Foo
> >>>>>
> >>>>>> cordova run ios
> >>>>>>
> >>>>>>  ..should just `cordova platform add ios` automatically.
> >>>>>
> >>>>> It appears that this was already added to phonegap-cli.  Would Adobe
> >>>>>
> >>>> mind
> >>>
> >>>> donating this to cordova-cli, or is it different enough for me to just
> >>>>> start from scratch?  Should be easy, but don't want to duplicate
> >>>>> effort.
> >>>>>
> >>>>> Filed: https://issues.apache.org/jira/browse/CB-8283
> >>>>>
> >>>>> -Michal
> >>>>>
> >>>>>
> >>>>>
> ---------------------------------------------------------------------
> >>>> To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
> >>>> For additional commands, e-mail: dev-help@cordova.apache.org
> >>>>
> >>>>
> >>>>
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
> > For additional commands, e-mail: dev-help@cordova.apache.org
> >
> >
>

Re: Automatically installing missing platforms from cli

Posted by Andrew Grieve <ag...@chromium.org>.
On Sun, Jan 11, 2015 at 11:40 PM, Terence M. Bandoian <te...@tmbsw.com>
wrote:

> Creating directories and downloading and installing files is a lot of
> "magic" that may not be desired. Here's another Git example:
>

Compiling on android downloads & creates a bunch of files, but it  is what
you want it to do. When would this not be desired? It's an easily undo-able
operation.

With git, it's actually really important that you know what each command
does. With cordova, I don't think it's as important that you understand how
it works. You can get by with the fact that it does work.



>
> $ git commit -m "commit test."
> On branch development
> Changes not staged for commit:
>         modified:   html/data/topics.json
>         modified:   html/topics.html
>
> no changes added to commit
>
> $ git status
> On branch development
> Changes not staged for commit:
>   (use "git add <file>..." to update what will be committed)
>   (use "git checkout -- <file>..." to discard changes in working directory)
>
>         modified:   html/data/topics.json
>         modified:   html/topics.html
>
> no changes added to commit (use "git add" and/or "git commit -a")
>
> On a related note, is there a diagram somewhere of all the cordova-cli
> commands and their associated options?
>
> -Terence
>
>
>
> On 1/10/2015 7:38 PM, Andrew Grieve wrote:
>
>> "cordova run" already builds before running (unless you add --nobuild). I
>> think it'd be pretty annoying if we had run fail with a "you need to build
>> first" kind of message.
>>
>> In my mind, cordova-cli's purpose is to add magic. Otherwise, you would
>> just use plugman+platform scripts (and yes, some people do and that is
>> okay).
>>
>> I think it would be awesome if you could clone a project, type "cordova
>> run
>> ios" and have it do everything necessary to run the app (install, build,
>> and deploy).
>>
>>
>>
>> On Fri, Jan 9, 2015 at 8:13 PM, Jesse <pu...@gmail.com> wrote:
>>
>>  what does `cordova run ios` do in windows?
>>> or:
>>> `cordova run wp8` in mac?
>>>
>>> Note that recent changes allow you to `platform add ios` in windows, but
>>> run will always be an error.
>>> Personally, I am with Terrance on this. Magic should be used very
>>> carefully.
>>>
>>> --------------
>>> $ git on up
>>> git: 'on' is not a git command. See 'git --help'.
>>>
>>> Did you mean one of these?
>>>          clone
>>>          log
>>>          notes
>>>          svn
>>>
>>>
>>>
>>> @purplecabbage
>>> risingj.com
>>>
>>> On Fri, Jan 9, 2015 at 4:53 PM, Terence M. Bandoian <te...@tmbsw.com>
>>> wrote:
>>>
>>>  Seems to me that:
>>>>
>>>>      cordova run ios
>>>>
>>>> should do just that.  If the platform has not been added, I'd suggest
>>>>
>>> that
>>>
>>>> it fail with an informative message that could include the command to
>>>> run
>>>> to resolve the problem (similar to Git bash).  At this level, deducing
>>>>
>>> the
>>>
>>>> user's intentions has the potential to get messy in a hurry both in the
>>>> code and for the user.
>>>>
>>>> -Terence Bandoian
>>>>
>>>>
>>>>
>>>> On 1/9/2015 12:47 PM, Michal Mocny wrote:
>>>>
>>>>  I'd like to have cordova-cli automatically install missing platforms
>>>>>
>>>> when
>>>
>>>> it is obvious that the platform is required.  i.e.:
>>>>>
>>>>>   cordova create Foo && cd Foo
>>>>>
>>>>>> cordova run ios
>>>>>>
>>>>>>  ..should just `cordova platform add ios` automatically.
>>>>>
>>>>> It appears that this was already added to phonegap-cli.  Would Adobe
>>>>>
>>>> mind
>>>
>>>> donating this to cordova-cli, or is it different enough for me to just
>>>>> start from scratch?  Should be easy, but don't want to duplicate
>>>>> effort.
>>>>>
>>>>> Filed: https://issues.apache.org/jira/browse/CB-8283
>>>>>
>>>>> -Michal
>>>>>
>>>>>
>>>>>  ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
>>>> For additional commands, e-mail: dev-help@cordova.apache.org
>>>>
>>>>
>>>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
> For additional commands, e-mail: dev-help@cordova.apache.org
>
>

Re: Automatically installing missing platforms from cli

Posted by "Terence M. Bandoian" <te...@tmbsw.com>.
Creating directories and downloading and installing files is a lot of 
"magic" that may not be desired. Here's another Git example:

$ git commit -m "commit test."
On branch development
Changes not staged for commit:
         modified:   html/data/topics.json
         modified:   html/topics.html

no changes added to commit

$ git status
On branch development
Changes not staged for commit:
   (use "git add <file>..." to update what will be committed)
   (use "git checkout -- <file>..." to discard changes in working directory)

         modified:   html/data/topics.json
         modified:   html/topics.html

no changes added to commit (use "git add" and/or "git commit -a")

On a related note, is there a diagram somewhere of all the cordova-cli 
commands and their associated options?

-Terence


On 1/10/2015 7:38 PM, Andrew Grieve wrote:
> "cordova run" already builds before running (unless you add --nobuild). I
> think it'd be pretty annoying if we had run fail with a "you need to build
> first" kind of message.
>
> In my mind, cordova-cli's purpose is to add magic. Otherwise, you would
> just use plugman+platform scripts (and yes, some people do and that is
> okay).
>
> I think it would be awesome if you could clone a project, type "cordova run
> ios" and have it do everything necessary to run the app (install, build,
> and deploy).
>
>
>
> On Fri, Jan 9, 2015 at 8:13 PM, Jesse <pu...@gmail.com> wrote:
>
>> what does `cordova run ios` do in windows?
>> or:
>> `cordova run wp8` in mac?
>>
>> Note that recent changes allow you to `platform add ios` in windows, but
>> run will always be an error.
>> Personally, I am with Terrance on this. Magic should be used very
>> carefully.
>>
>> --------------
>> $ git on up
>> git: 'on' is not a git command. See 'git --help'.
>>
>> Did you mean one of these?
>>          clone
>>          log
>>          notes
>>          svn
>>
>>
>>
>> @purplecabbage
>> risingj.com
>>
>> On Fri, Jan 9, 2015 at 4:53 PM, Terence M. Bandoian <te...@tmbsw.com>
>> wrote:
>>
>>> Seems to me that:
>>>
>>>      cordova run ios
>>>
>>> should do just that.  If the platform has not been added, I'd suggest
>> that
>>> it fail with an informative message that could include the command to run
>>> to resolve the problem (similar to Git bash).  At this level, deducing
>> the
>>> user's intentions has the potential to get messy in a hurry both in the
>>> code and for the user.
>>>
>>> -Terence Bandoian
>>>
>>>
>>>
>>> On 1/9/2015 12:47 PM, Michal Mocny wrote:
>>>
>>>> I'd like to have cordova-cli automatically install missing platforms
>> when
>>>> it is obvious that the platform is required.  i.e.:
>>>>
>>>>   cordova create Foo && cd Foo
>>>>> cordova run ios
>>>>>
>>>> ..should just `cordova platform add ios` automatically.
>>>>
>>>> It appears that this was already added to phonegap-cli.  Would Adobe
>> mind
>>>> donating this to cordova-cli, or is it different enough for me to just
>>>> start from scratch?  Should be easy, but don't want to duplicate effort.
>>>>
>>>> Filed: https://issues.apache.org/jira/browse/CB-8283
>>>>
>>>> -Michal
>>>>
>>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
>>> For additional commands, e-mail: dev-help@cordova.apache.org
>>>
>>>


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org


Re: Automatically installing missing platforms from cli

Posted by Andrew Grieve <ag...@chromium.org>.
"cordova run" already builds before running (unless you add --nobuild). I
think it'd be pretty annoying if we had run fail with a "you need to build
first" kind of message.

In my mind, cordova-cli's purpose is to add magic. Otherwise, you would
just use plugman+platform scripts (and yes, some people do and that is
okay).

I think it would be awesome if you could clone a project, type "cordova run
ios" and have it do everything necessary to run the app (install, build,
and deploy).



On Fri, Jan 9, 2015 at 8:13 PM, Jesse <pu...@gmail.com> wrote:

> what does `cordova run ios` do in windows?
> or:
> `cordova run wp8` in mac?
>
> Note that recent changes allow you to `platform add ios` in windows, but
> run will always be an error.
> Personally, I am with Terrance on this. Magic should be used very
> carefully.
>
> --------------
> $ git on up
> git: 'on' is not a git command. See 'git --help'.
>
> Did you mean one of these?
>         clone
>         log
>         notes
>         svn
>
>
>
> @purplecabbage
> risingj.com
>
> On Fri, Jan 9, 2015 at 4:53 PM, Terence M. Bandoian <te...@tmbsw.com>
> wrote:
>
> > Seems to me that:
> >
> >     cordova run ios
> >
> > should do just that.  If the platform has not been added, I'd suggest
> that
> > it fail with an informative message that could include the command to run
> > to resolve the problem (similar to Git bash).  At this level, deducing
> the
> > user's intentions has the potential to get messy in a hurry both in the
> > code and for the user.
> >
> > -Terence Bandoian
> >
> >
> >
> > On 1/9/2015 12:47 PM, Michal Mocny wrote:
> >
> >> I'd like to have cordova-cli automatically install missing platforms
> when
> >> it is obvious that the platform is required.  i.e.:
> >>
> >>  cordova create Foo && cd Foo
> >>> cordova run ios
> >>>
> >> ..should just `cordova platform add ios` automatically.
> >>
> >> It appears that this was already added to phonegap-cli.  Would Adobe
> mind
> >> donating this to cordova-cli, or is it different enough for me to just
> >> start from scratch?  Should be easy, but don't want to duplicate effort.
> >>
> >> Filed: https://issues.apache.org/jira/browse/CB-8283
> >>
> >> -Michal
> >>
> >>
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
> > For additional commands, e-mail: dev-help@cordova.apache.org
> >
> >
>

Re: Automatically installing missing platforms from cli

Posted by Jesse <pu...@gmail.com>.
what does `cordova run ios` do in windows?
or:
`cordova run wp8` in mac?

Note that recent changes allow you to `platform add ios` in windows, but
run will always be an error.
Personally, I am with Terrance on this. Magic should be used very carefully.

--------------
$ git on up
git: 'on' is not a git command. See 'git --help'.

Did you mean one of these?
        clone
        log
        notes
        svn



@purplecabbage
risingj.com

On Fri, Jan 9, 2015 at 4:53 PM, Terence M. Bandoian <te...@tmbsw.com>
wrote:

> Seems to me that:
>
>     cordova run ios
>
> should do just that.  If the platform has not been added, I'd suggest that
> it fail with an informative message that could include the command to run
> to resolve the problem (similar to Git bash).  At this level, deducing the
> user's intentions has the potential to get messy in a hurry both in the
> code and for the user.
>
> -Terence Bandoian
>
>
>
> On 1/9/2015 12:47 PM, Michal Mocny wrote:
>
>> I'd like to have cordova-cli automatically install missing platforms when
>> it is obvious that the platform is required.  i.e.:
>>
>>  cordova create Foo && cd Foo
>>> cordova run ios
>>>
>> ..should just `cordova platform add ios` automatically.
>>
>> It appears that this was already added to phonegap-cli.  Would Adobe mind
>> donating this to cordova-cli, or is it different enough for me to just
>> start from scratch?  Should be easy, but don't want to duplicate effort.
>>
>> Filed: https://issues.apache.org/jira/browse/CB-8283
>>
>> -Michal
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
> For additional commands, e-mail: dev-help@cordova.apache.org
>
>

Automatically installing missing platforms from cli

Posted by "Terence M. Bandoian" <te...@tmbsw.com>.
Seems to me that:

     cordova run ios

should do just that.  If the platform has not been added, I'd suggest 
that it fail with an informative message that could include the command 
to run to resolve the problem (similar to Git bash).  At this level, 
deducing the user's intentions has the potential to get messy in a hurry 
both in the code and for the user.

-Terence Bandoian


On 1/9/2015 12:47 PM, Michal Mocny wrote:
> I'd like to have cordova-cli automatically install missing platforms when
> it is obvious that the platform is required.  i.e.:
>
>> cordova create Foo && cd Foo
>> cordova run ios
> ..should just `cordova platform add ios` automatically.
>
> It appears that this was already added to phonegap-cli.  Would Adobe mind
> donating this to cordova-cli, or is it different enough for me to just
> start from scratch?  Should be easy, but don't want to duplicate effort.
>
> Filed: https://issues.apache.org/jira/browse/CB-8283
>
> -Michal
>


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org