Alright, first pass of the lazy loading of libs is up on the "lazy" branch.

https://git-wip-us.apache.org/repos/asf?p=cordova-cli.git;a=shortlog;h=refs
/heads/lazy


I think the un-gziping/taring is a little brittle.. My code was able to
extract the lib + add a cordova-android project successfully but I tried
the same thing with iOS and the extraction failed D;

Anywho, if anyone else wants to play around with it go for it. I will be
iterating on this branch for most of this week to get it up to par. Once I
deem its ready I'll report back to this thread.

On 6/7/13 2:46 PM, "Michael Brooks" <[email protected]> wrote:

>1. Awesome
>
>2. Very similar logic exists in the phonegap-cli [1] [2]. Since this logic
>is being used by phonegap-cli, node-phonegap-build, and cordova-cli, we
>could extract it out to a new NPM module called cordova-config.
>
>3. Additionally, PhoneGap will want to load its own Hello World app
>instead
>of the Cordova Hello World app. So, it would be nice to accomodate this
>situation gracefully. Do Chrome Apps have any odd requirements?
>
>[1]
>https://github.com/mwbrooks/phonegap-cli/blob/master/lib/common/config.js
>[2] 
>https://github.com/mwbrooks/phonegap-cli/tree/master/spec/common/config
>
>
>On Fri, Jun 7, 2013 at 2:38 PM, Filip Maj <[email protected]> wrote:
>
>> Cool, thanks Mike, I'll use the gitweb approach to download libraries.
>>
>> And re #2: fair enough, I'll add that bit of logic to the "find the root
>> of a cordova project" utility function.
>>
>> As for the hooks, I am still mulling over different approaches. One
>> scenario that us Adobe folk want to support for PhoneGap is redirecting
>> any adds/builds for particular platforms that are not supported on a
>> user's machine to PhoneGap Build. For example, if a user's machine was
>>not
>> setup for iOS development (say, a Windows machine), the PhoneGap CLI not
>> only needs to know when a particular event happens, but also needs to be
>> able to stop the Cordova CLI from proceeding with the event - something
>> akin to e.preventDefault() in DOM events.
>>
>> I'm not sure of any npm libraries out there that have a similar eventing
>> system in place but I will do some research and see if there is any
>>prior
>> art out there.
>>
>> If anyone on the list has any ideas, I'm all ears :)
>>
>> On 13-06-07 10:07 AM, "Michael Brooks" <[email protected]> wrote:
>>
>> >1. The Apache GitWeb implementation allows us to download a tar.gz of
>>any
>> >hash or tag. Using this will allow us to download any platform release.
>> >Here is an example of how to download cordova-android 2.8.0 [1]. I
>>think
>> >this is better than downloading the entire release, because
>>lazy-loading
>> >is
>> >meant to only grab what's needed. It's also a better choice than
>>GitHub's
>> >downloads because Apache's mirroring is sometimes unreliable.
>> >
>> >2. We should use $HOME/.cordova/ There is no reason to invent
>> >yet-another-name for the Cordova configuration directory. When a
>> >".cordova/" is found the $HOME directory, it is considered a global
>> >configuration directory and not a Cordova project. We can use
>> >$HOME/.cordova/lib/cordova-android to store the lazy-loaded libraries.
>>I
>> >chose "lib/" instead of "platforms/" because we will also be
>>lazy-loading
>> >resources such as the Hello World app and someday perhaps even ios-sim.
>> >
>> >3. Sure, the hooks sound good.
>> >
>> >[1]
>> >
>> 
>>https://git-wip-us.apache.org/repos/asf?p=cordova-android.git;a=snapshot;
>>h
>> >=2.8.0;sf=tgz
>> >
>> >
>> >On Fri, Jun 7, 2013 at 7:41 AM, Michal Mocny <[email protected]>
>>wrote:
>> >
>> >> Glad to see movement on this.
>> >>
>> >> Few suggestions:
>> >> - use $HOME/.cordova-config/libs  <-- this gives us a folder to put
>> >>other
>> >> stuff into later, without littering $HOME with .cordova-this and
>> >> .cordova-that
>> >> - I would love to have the ability to use different cordova-lib
>>versions
>> >> within any project easily.  Changing the before-hook or adjusting the
>> >>libs
>> >> folder sound like global operations.  Can we support --libs-dir=
>>command
>> >> line flag to cordova-cli?  This should only need to be specified on
>> >>create.
>> >>
>> >> -Michal
>> >>
>> >>
>> >> On Fri, Jun 7, 2013 at 10:07 AM, Braden Shepherdson <
>> [email protected]
>> >> >wrote:
>> >>
>> >> > The Apache Way of having source release bundles is important and we
>> >> follow
>> >> > it. But we can download content for CLI from wherever we please.
>>We're
>> >> > currently downloading the libs from npm, getting the code from npm
>>and
>> >> the
>> >> > libs from Github doesn't change much.
>> >> >
>> >> > This is $HOME, as in /Users/me or /home/me or
>>C:\Users\me\Application
>> >> Data
>> >> > or whatever it is on Windows? SGTM.
>> >> >
>> >> > The before hook should have the ability to substitute their own
>>copy
>> >>of
>> >> the
>> >> > libs from somewhere else, ideally a git URL/directory and revision.
>> >>This
>> >> > way it would be trivial to point CLI at master versions of
>>platforms.
>> >> >
>> >> > Braden
>> >> >
>> >> >
>> >> > On Fri, Jun 7, 2013 at 3:58 AM, Filip Maj <[email protected]> wrote:
>> >> >
>> >> > > One of the last key outstanding tasks for the CLI is lazy
>>loading of
>> >> > > platform libraries [1].
>> >> > >
>> >> > > I want to start tackling that tomorrow. I have a few
>> >>points/questions
>> >> to
>> >> > > bring up and wanted to share my vision of the implementation,
>>give
>> >> folks
>> >> > > an opportunity to comment.
>> >> > >
>> >> > > - where to download the source from?
>> >> Archive.apache.org/dist/cordovaseems
>> >> > > to have all of our releases, but each zip file contains ALL
>> >>platforms,
>> >> > not
>> >> > > individual ones. Github.com, on the other hand, DOES offer
>> >>per-platform
>> >> > > downloads, for e.g. [2].
>> >> > > - storing the location in HOME/.cordova-libs cool with people? I
>> >>want
>> >> to
>> >> > > avoid naming the folder .cordova since that is already used on a
>> >> > > per-project basis to identify the root of a cordova-cli-created
>> >>project
>> >> > (a
>> >> > > la git).
>> >> > > - I am thinking of exposing hooks/events for this
>> >> > (before_library_download
>> >> > > and after_library_download is my initial thought, which get
>>passed
>> >>in
>> >> > > platform and version as event parameters/data).
>> >> > >
>> >> > > Comments/suggestions welcome. Thanks!
>> >> > >
>> >> > > Fil
>> >> > >
>> >> > > [1] https://issues.apache.org/jira/browse/CB-3306
>> >> > > [2] https://github.com/apache/cordova-android/archive/2.8.0.zip
>> >> > >
>> >> > >
>> >> >
>> >>
>>
>>

Reply via email to