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 1F590F5E5 for ; Fri, 22 Mar 2013 21:38:59 +0000 (UTC) Received: (qmail 22030 invoked by uid 500); 22 Mar 2013 21:38:58 -0000 Delivered-To: apmail-cordova-dev-archive@cordova.apache.org Received: (qmail 21981 invoked by uid 500); 22 Mar 2013 21:38:58 -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 21972 invoked by uid 99); 22 Mar 2013 21:38:58 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 22 Mar 2013 21:38:58 +0000 X-ASF-Spam-Status: No, hits=-2.3 required=5.0 tests=RCVD_IN_DNSWL_MED,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of fil@adobe.com designates 64.18.1.185 as permitted sender) Received: from [64.18.1.185] (HELO exprod6og103.obsmtp.com) (64.18.1.185) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 22 Mar 2013 21:38:52 +0000 Received: from outbound-smtp-1.corp.adobe.com ([192.150.11.134]) by exprod6ob103.postini.com ([64.18.5.12]) with SMTP ID DSNKUUzPWEe/ZYdimYukf3NXxkJfIw0sWdm1@postini.com; Fri, 22 Mar 2013 14:38:32 PDT Received: from inner-relay-4.eur.adobe.com (inner-relay-4.adobe.com [193.104.215.14]) by outbound-smtp-1.corp.adobe.com (8.12.10/8.12.10) with ESMTP id r2MLZN1v025945 for ; Fri, 22 Mar 2013 14:35:24 -0700 (PDT) Received: from nahub02.corp.adobe.com (nahub02.corp.adobe.com [10.8.189.98]) by inner-relay-4.eur.adobe.com (8.12.10/8.12.9) with ESMTP id r2MLc6XO010470 for ; Fri, 22 Mar 2013 14:38:25 -0700 (PDT) Received: from nambxv01a.corp.adobe.com ([10.8.189.95]) by nahub02.corp.adobe.com ([10.8.189.98]) with mapi; Fri, 22 Mar 2013 14:38:23 -0700 From: Filip Maj To: "dev@cordova.apache.org" Date: Fri, 22 Mar 2013 14:38:19 -0700 Subject: Re: Platform-level command line scripts ;) Thread-Topic: Platform-level command line scripts ;) Thread-Index: Ac4nRZRk1gdovng6RHmHEDXftsn0qw== 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.2.130206 acceptlanguage: en-US Content-Type: text/plain; charset="Windows-1252" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Virus-Checked: Checked by ClamAV on apache.org Hai gaiz! Main contention between the two "camps" in this debate is four vs eight scripts.. But Brian points out that refactoring smaller bits of functionality into their own script allows us to "have our cake and eat it too". This, in turn, results in four + (a subset of the 8) =3D 10 scripts i= n total.. Which is an argument for just starting with smaller more discrete scripts to begin with, lol. How about this as a middle ground: - under /cordova/ we have the four scripts Anis/Andrew recommend: clean, log, build and run. These call into various scripts under cordova/lib, such as.. - under /cordova/lib we have the ~6 scripts I recommended: build-debug, build-release, start-emulator, deploy-device, deploy-emulator, and possibly a list-devices one as well. The final point is nailing what `run` does, step-by-step. Paraphrasing Anis: If device(s) connected: * Pick device (ignore emulators). * Prompt, timeout and pick first one (5 to 10 seconds) if multiple devices are connected (ignore emulators). If device(s) not connected: * Emulator if it is running * Prompt, timeout and pick first one (5 to 10 seconds) if multiple emulators are running. * Start emulator. If you have multiple ones set up (Android's case), prompt, timeout and launch first one (5 to 10 seconds). Yes/no/discuss. Let's try to get to a consensus :) On 3/21/13 5:29 PM, "Brian LeRoux" wrote: >I knew you'd bring that up! We'll talk more tmrw. > >On Thu, Mar 21, 2013 at 4:40 PM, Anis KADRI wrote: >> =8Aor you can have functions do discrete actions like so: >> >>=20 >>https://git-wip-us.apache.org/repos/asf?p=3Dcordova-android.git;a=3Dblob;= f=3Dbi >>n/templates/cordova/cordova;h=3D1945a4c45f835a6eab3836c4154e518b902d88c6;= hb >>=3DHEAD >> >> =8Ainstead of creating more inodes. >> >> >> On Thu, Mar 21, 2013 at 4:30 PM, Brian LeRoux wrote: >> >>> > You could make more scripts as helper scripts, but I still think >>>that it >>> > will be confusing if a user types "ls" and sees a large number of >>> scripts, >>> > having to guess what each of them does. >>> >>> Put them in a subdir called ./lib and be done w/ it. >>> >>> >>> > I don't think having more scripts will make it more likely that the >>> scripts >>> > will be consistent across platforms. >>> >>> Ah, but having smaller responsibilities for a module of code makes it >>> more testable in discreet form making it easier to confirm said >>> suspicions. >>>