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 6059E106B2 for ; Fri, 6 Sep 2013 03:19:56 +0000 (UTC) Received: (qmail 14221 invoked by uid 500); 6 Sep 2013 03:19:56 -0000 Delivered-To: apmail-cordova-dev-archive@cordova.apache.org Received: (qmail 13962 invoked by uid 500); 6 Sep 2013 03:19:54 -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 13954 invoked by uid 99); 6 Sep 2013 03:19:53 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 06 Sep 2013 03:19:53 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of iclelland@google.com designates 209.85.219.53 as permitted sender) Received: from [209.85.219.53] (HELO mail-oa0-f53.google.com) (209.85.219.53) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 06 Sep 2013 03:19:46 +0000 Received: by mail-oa0-f53.google.com with SMTP id k18so3287823oag.26 for ; Thu, 05 Sep 2013 20:19:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:content-type; bh=/lb83YodkzuPHoJwhoGjU2YovebQfmfNyyXDy4QL108=; b=IljcfXzbBbipGuJweUy7tKH5ar2abOCib+bFpCrEHWfZ+4JOd3xTRxWmvB5m+rs2sD 466CXegXX0CRPkLUmcZHWI7EDEhFmSvDedbTix4EfQQfv99a6rvkvz/tE1B7Op9S1kom Leii4d+4SYmrgIMWCe/hAlsJu9bhzVdA4mNJBgsvJ+tyOWX5CoTyGpcdG09Zcmys5v2U YHkUNyyO8shdMB865ZZ97tBjVW5sfAbhpFZSyUhDV082N8+ftDhKA2gfgY6BbmXuws75 bBOTbhWKQ+2NGxXkIbW0C5jJm4aP+fFPSy1lmiE2kMPvrPITEvySionOXEN15UUkDkwr YfDA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:content-type; bh=/lb83YodkzuPHoJwhoGjU2YovebQfmfNyyXDy4QL108=; b=heUM5D2jejQmv/WaBAOYK9kiGX+CPbPtgDO+ymxteC26oTJOBNwCreHB9uZnQ6cXb8 iwy64j7MBqziVwsqQqNyylklD6D/qFfbw5Y7NA79e7NrZQJg2WP6jPpJO/SyIywadBaJ GRZ2v/BgnuCOCcSmyavvNET1dlFznRoME97yk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:content-type; bh=/lb83YodkzuPHoJwhoGjU2YovebQfmfNyyXDy4QL108=; b=JCBWwv0mq0rwWVuDDidaMaWD0+c3A+AJClgbrt3ozAjiI1O95QltzW9ZgQZVQ2TfHL eSQBMjbLhLUzYX3FxZIpC43ciIYAHPEdOs/HQ0OP99tKA4dn4g45JpAJWTrGxvheiX6z gniUoXX6ZyD1DgchHPor7yx4B/5VB9F2rKHexT5j+/oHRBEN50dTZZOxeufDzjOKRbCa 1lVvJnJ6bHo8uJB0u7gm2Wjbbmv2Tnopqcq8i12Ul1k6vYqlc8X1lcJPjCFEwuqKBRBC FFZ+YIZEY/vmMm8ZBaLGCF6Nk9Afu3UGqDdGPsXa+nLdB9Zq6ViXvdXSI50vj6hW70bv 1ORA== X-Gm-Message-State: ALoCoQk2XrxTR3/kVoNVNcDVjKuieQfRB4PfXZ+2zC6vI2rUOP04mmND0+OYKrL3E+5cyh0umTcInEgE+emaxs9N9d/ShXSBvewgFR+9ZKvRgAduXd5EKP/6JTDI6QxcAAVVuMRZ9ULftFTPpe7C+AEzrO8vJbzf174znUS850QqOSFuc/BdSElqHE2r3ZRpwsk+Lt02+Bk9ttzrQAHZ1cLUsPb94VbZBg== X-Received: by 10.60.117.225 with SMTP id kh1mr197086oeb.15.1378437565820; Thu, 05 Sep 2013 20:19:25 -0700 (PDT) MIME-Version: 1.0 Sender: iclelland@google.com Received: by 10.182.102.73 with HTTP; Thu, 5 Sep 2013 20:19:04 -0700 (PDT) In-Reply-To: <05A23401-4C21-41A1-AAC3-3BA626006581@gmail.com> References: <05A23401-4C21-41A1-AAC3-3BA626006581@gmail.com> From: Ian Clelland Date: Thu, 5 Sep 2013 23:19:04 -0400 X-Google-Sender-Auth: LrPiWiUEDlzTgnrm9vesSXiSYDQ Message-ID: Subject: Re: config.xml as a build artifact for less suffering and easier upgrades To: "dev@cordova.apache.org" Content-Type: multipart/alternative; boundary=047d7b3a9a7c74c7df04e5ae81fe X-Virus-Checked: Checked by ClamAV on apache.org --047d7b3a9a7c74c7df04e5ae81fe Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On Thu, Sep 5, 2013 at 5:16 PM, James Jong wrote: > defaults.xml - Is that only used by CLI? And not used by bin/create > scripts? > It was bit unclear to me from the description since both were mentioned > regarding the 2 xml files. > Yes, that's the idea. If you're using the bin/create scripts, then there is a complete "config.xml" file in the template that will be used for your new app. This is for strict backwards compatibility with anyone's workflow that doesn't currently include CLI. If you are using CLI, then we will construct a new config.xml file for you instead, from three sources: defaults.xml, which specifies all of the platform defaults; the various plugin.xml files, and your app's config.xml file. The end-result should be the same, but you have a clear place to override the defaults for your app that lives outside of your platforms directory, and the cordova team has a clear place to set those same defaults. Ian > > The new CLI prepare flow makes sense to me. > > -James Jong > > On Sep 5, 2013, at 2:21 PM, Michal Mocny wrote: > > > We briefly discussed JSON and the two thoughts were: > > > > (1) We like it, but really what does it buy us? > > (2) This change is at the moment 100% compatible with all current > workflows > > (including upgrades from 3.0->3.1), and we think that's important for > > headache-less adoption. JSON would obviously not be. > > > > > > Regarding where to store the defaults, we had thought it would be a fil= e > > bundled with the platform, perhaps in bin/templates? > > > > -Michal > > > > > > On Thu, Sep 5, 2013 at 12:38 PM, Brian LeRoux wrote: > > > >> The logic flow is much safer in this method. Where do you think > default.xml > >> should live? (Maybe it doesn't have to exist and defaults can just be > vars > >> in the logic that does the processing?) > >> > >> Is this our opportunity to move to JSON? > >> > >> > >> On Thu, Sep 5, 2013 at 8:21 AM, Braden Shepherdson >>> wrote: > >> > >>> config.xml as a build artifact for less suffering and easier upgrades > >>> Terminology > >>> > >>> - > >>> > >>> =E2=80=9Cplatform config.xml=E2=80=9D refers to the platform-specif= ic config.xml > >> files, > >>> eg. platforms/android/res/xml/config.xml. This is the final file re= ad > >> by > >>> Cordova at runtime. > >>> - > >>> > >>> =E2=80=9Capp config.xml=E2=80=9D refers to the top-level config.xml= found in > >>> www/config.xml. > >>> > >>> Why the current situation is suffering > >>> > >>> - > >>> > >>> Chiefly, the platforms/foo/.../config.xml files are both the input > and > >>> output of munging by Plugman and the user. This sucks. It makes > >>> automatic upgrades difficult because everybody has a customized > >>> config.xml > >>> file in their platforms. It also makes plugin rm harder and less > >> robust > >>> in > >>> CLI than it needs to be. > >>> - > >>> > >>> Currently only some tags in the app config.xml are actually honoure= d. > >>> Others are ignored, and this has tripped up our users. > >>> > >>> > >>> Goals > >>> > >>> - > >>> > >>> bin/create workflow is unchanged. > >>> - > >>> > >>> Final content of the platform config.xml file is unchanged, though > the > >>> method of building it in the CLI can change. > >>> - > >>> > >>> CLI workflow is unchanged, in terms of what a user types. > >>> - > >>> > >>> platform config.xml stops being both input and output under CLI. Le= ss > >>> munging, and easier upgrades. In short, platform config.xml files > >> become > >>> build artifacts. > >>> > >>> What we propose to do about it > >>> > >>> - > >>> > >>> First, adjust the platform template (used by bin/create) to contain > >> two > >>> files: > >>> - > >>> > >>> defaults.xml, which is versioned, immutable, and tucked away > >>> somewhere (only CLI accesses it) and contains only the > >>> Cordova-specified > >>> platform defaults, such as the preferences, any default > >>> whitelist entries, > >>> etc. It does NOT contain any , or other such tags= . > >>> - > >>> > >>> platform config.xml, which is the same as it currently is, a > >> complete > >>> config.xml for the HelloWorld app. This means behavior is > unchanged > >>> for people who are not using CLI. Plugman still munges this file > >> and > >>> outputs back to it, same as now. > >>> - > >>> > >>> Second, adjust the CLI=E2=80=99s cordova create template so that it= s > top-level > >>> app config.xml contains , , , etc. - tags th= e > >>> user is likely to edit. > >>> - > >>> > >>> Third, modify the CLI so that the new cordova prepare flow is: > >>> - > >>> > >>> Delete the old platform config.xml. > >>> - > >>> > >>> Copy the defaults.xml to config.xml. > >>> - > >>> > >>> Re-run the Plugman config munging for every plugin, modifying th= e > >>> fresh platform config.xml. (The order here is deliberately > >> undefined; > >>> plugins should already not be relying on this.) > >>> - > >>> > >>> Run the config munging for the app=E2=80=99s config.xml as well. > >>> - > >>> > >>> This results in a freshly built, build-artifact platform > >> config.xml. > >>> Users should not be editing it; their top-level app config.xml > >>> has the last > >>> word and will override any settings the defaults or plugins migh= t > >>> make. > >>> - > >>> > >>> Note that this means we shouldn=E2=80=99t be needlessly setti= ng > defaults > >>> in the app config.xml, since this might prevent plugins from > >>> changing > >>> things that need changing. > >>> - > >>> > >>> Fourth, extend the app config.xml format so that it can have > >>> tags, like a plugin.xml. > >>> - > >>> > >>> Into this it can put platform-specific things like splashscreens= , > >>> preferences and other things, rather than mixing these together = in > >>> the > >>> config. > >>> - > >>> > >>> In particular, it can have tags in the usual forma= t > >>> > >> > > --047d7b3a9a7c74c7df04e5ae81fe--