>> At one point, something was also responsible for preventing the Apple platforms from downloading on non Apple >> platforms, but I think I took away that part of the equation :).
I believe the `hostos` property of each platform definition is meant to prevent attempts to download/install cordova-ios on windows, and cordova-wp8 on mac-os. I think that is the only check that the cli check_requirements should perform. ie. if there is no way it could ever work, prevent it, otherwise let the platform scripts to the detailed analysis. @purplecabbage risingj.com On Thu, Jun 26, 2014 at 7:15 PM, Carlos Santana <csantan...@gmail.com> wrote: > +1 I think was the agreement last time was discussed. > > The goal should be to delegate platform checks to the individual platforms. > Same goes for other platform commands the platform should check. > > For example ios create, the create command should check for the minimum > requirements for create. Same for ios run it should check for the > requirements for the run command in this case "ios-deploy" and so on for > every main command. > > --Carlos > > On Thursday, June 26, 2014, Josh Soref <jso...@blackberry.com> wrote: > > > Andrew wrote: > > > Android and iOS have empty functions for check_requirements(), > > > and I think that's the right way to go. Never really discussed it on > > list though, > > > so wanted to share why I think this. > > > > > > > the motivation was to run some checks *before* downloading the > platform. > > > > At one point, something was also responsible for preventing the Apple > > platforms from downloading on non Apple platforms, but I think I took > away > > that part of the equation :). > > > > > > > It turned out that downloading platforms is not very expensive, > > > > > and having the platform requirements check code both in the platform > > > > > (where it is needed) and in CLI (copy & paste job), wasn't adding much > > value. > > > > > > > So... Platforms changed to lazy-loading first, then calling out to the > > > > check() within the downloaded platform. > > > > yep > > > > > > > Now, since platforms scripts all work without CLI, it's important that > > > > commands like `create` call check_requirements themselves before running, > > > > > > yep > > > > > and as far as I'm away, most platforms do this. So... now we've got the > > > same check() function being called twice. First by > > > > > CLI's check_requirements(), then by the create() script itself. > > > > yep > > > > > > > So, I think the best thing to do is just delete check_requirements() > > from > CLI and expect that the platform scripts do some checks > themselves. > > > > I guess I'm not opposed, this cleans up some code that I've been trying > to > > manipulate in various ways. > > > > The blackberry10 implementation more or less is such that check_reqs > calls > > init, and pretty much everything else in blackberry10 also calls init, > and > > the actual requirement checking is done in init. > > > > My experience w/ Android is that `cordova platform add android` generally > > fails because android/ant aren't in the user's PATH, and it doesn't > really > > enforce it well (I'm trying to be polite with this understatement). > > > > So, +1. > > > > > -- > Carlos Santana > <csantan...@gmail.com> >