Return-Path: X-Original-To: apmail-cordova-dev-archive@www.apache.org Delivered-To: apmail-cordova-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 9780310F78 for ; Tue, 11 Jun 2013 00:06:32 +0000 (UTC) Received: (qmail 41727 invoked by uid 500); 11 Jun 2013 00:06:32 -0000 Delivered-To: apmail-cordova-dev-archive@cordova.apache.org Received: (qmail 41704 invoked by uid 500); 11 Jun 2013 00:06:32 -0000 Mailing-List: contact dev-help@cordova.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cordova.apache.org Delivered-To: mailing list dev@cordova.apache.org Received: (qmail 41696 invoked by uid 99); 11 Jun 2013 00:06:32 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 11 Jun 2013 00:06:32 +0000 X-ASF-Spam-Status: No, hits=-1.3 required=5.0 tests=FRT_ADOBE2,RCVD_IN_DNSWL_MED,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of fil@adobe.com designates 64.18.1.23 as permitted sender) Received: from [64.18.1.23] (HELO exprod6og109.obsmtp.com) (64.18.1.23) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 11 Jun 2013 00:06:25 +0000 Received: from outbound-smtp-2.corp.adobe.com ([193.104.215.16]) by exprod6ob109.postini.com ([64.18.5.12]) with SMTP ID DSNKUbZp6liDK3F/v+FbIwMjwBEz0bL53Hdp@postini.com; Mon, 10 Jun 2013 17:06:05 PDT Received: from inner-relay-2.corp.adobe.com (inner-relay-2.adobe.com [153.32.1.52]) by outbound-smtp-2.corp.adobe.com (8.12.10/8.12.10) with ESMTP id r5B061AI020222 for ; Mon, 10 Jun 2013 17:06:01 -0700 (PDT) Received: from nacas03.corp.adobe.com (nacas03.corp.adobe.com [10.8.189.121]) by inner-relay-2.corp.adobe.com (8.12.10/8.12.10) with ESMTP id r5B060w7014609 for ; Mon, 10 Jun 2013 17:06:00 -0700 (PDT) Received: from nambxv01a.corp.adobe.com ([10.8.189.95]) by nacas03.corp.adobe.com ([10.8.189.121]) with mapi; Mon, 10 Jun 2013 17:06:00 -0700 From: Filip Maj To: "dev@cordova.apache.org" Date: Mon, 10 Jun 2013 17:05:53 -0700 Subject: Re: CLI lazy loading of libraries Thread-Topic: CLI lazy loading of libraries Thread-Index: Ac5mN3SZoIBPCzr7TcuFtXibvK5QLg== Message-ID: In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: user-agent: Microsoft-MacOutlook/14.3.4.130416 acceptlanguage: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Virus-Checked: Checked by ClamAV on apache.org Alright, first pass of the lazy loading of libs is up on the "lazy" branch. https://git-wip-us.apache.org/repos/asf?p=3Dcordova-cli.git;a=3Dshortlog;h= =3Drefs /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" 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]=20 >https://github.com/mwbrooks/phonegap-cli/tree/master/spec/common/config > > >On Fri, Jun 7, 2013 at 2:38 PM, Filip Maj 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" 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] >> > >>=20 >>https://git-wip-us.apache.org/repos/asf?p=3Dcordova-android.git;a=3Dsnaps= hot; >>h >> >=3D2.8.0;sf=3Dtgz >> > >> > >> >On Fri, Jun 7, 2013 at 7:41 AM, Michal Mocny >>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=3D >>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 < >> braden@chromium.org >> >> >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 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 >> >> > > >> >> > > >> >> > >> >> >> >>