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 EDCB7CF2E for ; Mon, 9 Sep 2013 13:49:17 +0000 (UTC) Received: (qmail 81475 invoked by uid 500); 9 Sep 2013 13:49:17 -0000 Delivered-To: apmail-cordova-dev-archive@cordova.apache.org Received: (qmail 81449 invoked by uid 500); 9 Sep 2013 13:49:17 -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 81441 invoked by uid 99); 9 Sep 2013 13:49:16 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 09 Sep 2013 13:49:16 +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 mmocny@google.com designates 209.85.214.181 as permitted sender) Received: from [209.85.214.181] (HELO mail-ob0-f181.google.com) (209.85.214.181) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 09 Sep 2013 13:49:09 +0000 Received: by mail-ob0-f181.google.com with SMTP id dn14so5789109obc.26 for ; Mon, 09 Sep 2013 06:48:48 -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=GZanCUj9uT6ZR23RxI6kj47N+aaSzo8NJ19jU6cdZBA=; b=j1OllW0blrmhErQcgzCyyFn4ynmDSljYcOJks+GQbhm+FJTVE7IU5UFMP4HyLR4Qe8 zY2LDFRmiIg7BYzdCnCtgYOpDl678H0PLaVfXwfgUDXGAqv22+0uteLASKO8zLuR6/5W ncJ6kuJ1jd/sLjnRx66KCqYInPAE4Q2zeDnwwEdNzGsHLHy4ZW+Q8J9DGrZ3O+ZXEZKa Qg9Sx1k6c5LctSpsLJTY2rUsIVLIp6UXr2yYfmMDoqhCbFQUSLzMWTPuyaO6wUmGmsnd aVgMA/MtWhWVeL5ppXjWEpRXO9Kz8DIsaZJZD4eMF8vL2MoI4wVpzO/Kddq9oyiNE5Ye RwWg== 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=GZanCUj9uT6ZR23RxI6kj47N+aaSzo8NJ19jU6cdZBA=; b=TA9Dvx9BlwuUtudeIyDQyaTccmHrgw0j5Nxa2qE+IVgnErRh7wgb9kHCR93GdHuvcu 7nAwiIrxN5XGHv8xpoFOANKx/JGp/8icSMjdJ3ORxyoBkxVvb3rw49n3ZQ4uDLqQkYlk Gpsb+zYt1hIWEmoNgwyrnA7rCP6LLztgQeTU8= 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=GZanCUj9uT6ZR23RxI6kj47N+aaSzo8NJ19jU6cdZBA=; b=jZhLjKB/5zi+9HWCgvNBHdmLw8iAWWSnlbAYcxQZ3YCBS4fwMd8JhtqUz5ErkTOVVr 2sdPvZkvyT3an4OXQ6awL5v1UJydvasIvb+Ybudm4jMztPc46AX+5ggD8HiwNYiISE5D ZuDnnwboXkpwX0yevjSyg6KdJeT8OgSCHo2zSCU5KRWsWS4iglrwOlfUITciKffDGOa/ Jkw+nHUIBwIPZGXBnUzV5xRZ+DS5kmj73La1bNTuiSsiTPrTyZgIg4qNHKuDvEG1wK6U fg3m2UUDhnHUDjHg31yPHLMLxaHs4kd8P341REY800iWlD8w+AdoYXqdFeSBhDgM5ulE OjdA== X-Gm-Message-State: ALoCoQkvV5SLxiWXQu9WuZf+JXBt7YbyzKSvcHwaY5ntWN0KyXqMi38DQ2WA3sliBylUX7bgm//bu/1QbP3v4v4yn8qaBhDiohqabrYXCkVRWhKaBr/wtAcou9WhcTFIfaAKxySI3yRsfZixDrQ9ALkqjFgUY75DoknqT2+N+208vxdtrvuoLHeOEPQ2g/gQgg+N6RFdZF4T+huKAfjPTosHORx2yyzgsw== X-Received: by 10.60.78.227 with SMTP id e3mr11202714oex.5.1378734527884; Mon, 09 Sep 2013 06:48:47 -0700 (PDT) MIME-Version: 1.0 Sender: mmocny@google.com Received: by 10.182.139.100 with HTTP; Mon, 9 Sep 2013 06:48:27 -0700 (PDT) In-Reply-To: References: <05A23401-4C21-41A1-AAC3-3BA626006581@gmail.com> <596B0F9A-5423-410B-A79E-894005CB30FA@gmail.com> From: Michal Mocny Date: Mon, 9 Sep 2013 09:48:27 -0400 X-Google-Sender-Auth: 87Nvd-v-OVzpDYCjb8FJbq3eiT0 Message-ID: Subject: Re: config.xml as a build artifact for less suffering and easier upgrades To: dev Content-Type: multipart/alternative; boundary=089e0111bca4c6469b04e5f3a5b7 X-Virus-Checked: Checked by ClamAV on apache.org --089e0111bca4c6469b04e5f3a5b7 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable If you would use a different helloworld app template (which is now possible to specify in both CLI and old workflow), then the pre-generatred platform config.xml template would likely be the wrong one, and thus this bundling for self documentation would be a disservice. I don't see very much value in documentation for bundling the config.xml inside the platform template (when do we suspect users look at that file, as apposed to whats actually generated inside their project?). Users can read what is generated after adding a platform for their specific app using their chosen flow. I think that since bin/create can mush defaults.xml with app.xml for both flows, it should. On Mon, Sep 9, 2013 at 9:21 AM, Ian Clelland wrote= : > On Mon, Sep 9, 2013 at 8:45 AM, Braden Shepherdson >wrote: > > > The defaults.xml is only part of the CLI workflow, yes. It has no > relevance > > if you're not using CLI. BUT there is a complete config.xml in the > > bin/create template, and it can of course have the same values as you > would > > get from an unchanged CLI project (defaults.xml + app.xml). The > > configuration values you get from the templates should be the same in > both > > cases, I agree completely. > > > > Yes, I think it's definitely achievable to have the complete template > config.xml be exactly what you would get (modulo whitespace / comments / > etc) from installing the same sample app on the same platform with CLI. > > If we can maintain that standard, then the various files become almost > self-documenting; its easy to look at the final config.xml file in the > template to see how the pieces should fit together, and work out where ea= ch > of the tags originally came from. > > It might be worth trying to generate the template config.xml *using* cli, > just to maintain the correspondence between them. > > Ian > > > > Braden > > > > > > On Sun, Sep 8, 2013 at 5:28 AM, James Jong wrote= : > > > > > Andrew - what I was thinking was pretty much what Michal wrote below. > > > Perhaps it was my interpretation of the original note but I thought > > > defaults was to be applied only in the CLI workflow. > > > > > > -James Jong > > > > > > On Sep 7, 2013, at 1:05 PM, Michal Mocny wrote: > > > > > > > With this proposal as it stands, I think that is already true (at > least > > > for > > > > the initial contents, obviously user can make edits later). > > > > > > > > Ie, defaults.xml + app.xml =3D initial config.xml for both cases, w= hich > > use > > > > the same helloworld template's app.xml. > > > > > > > > If there are specific differences to the default values that we wan= t, > > we > > > > maybe will want to use a different app.xml for each, but defaults.x= ml > > > > should be tied to a platform-version not to a workflow. > > > > > > > > -Michal > > > > > > > > > > > > On Sat, Sep 7, 2013 at 7:56 AM, Andrew Grieve > > > wrote: > > > > > > > >> James - that's a nice goal, but I don't think it's feasible. Did y= ou > > > have a > > > >> way to do that in mind? > > > >> > > > >> > > > >> On Fri, Sep 6, 2013 at 10:31 PM, James Jong > > > wrote: > > > >> > > > >>> I would like to see the defaults be applied in all cases. For > > > >>> consistency, less confusion, and easier documentation. If we add > or > > > >> change > > > >>> the defaults in a release, both workflows should get it. In my > mind, > > > the > > > >>> CLI platform config.xml should be equivalent to the bin/create on= e. > > > >>> > > > >>> -James Jong > > > >>> > > > >>> On Sep 6, 2013, at 11:06 AM, Michal Mocny > > wrote: > > > >>> > > > >>>> I thought we were adding support for the last bit (ie, app gener= ic > > not > > > >>>> platform specific preferences) to "app.xml" which the helloworld > > > >> template > > > >>>> should ship with and bin/create should apply. > > > >>>> > > > >>>> -Michal > > > >>>> > > > >>>> > > > >>>> > > > >>>> On Fri, Sep 6, 2013 at 10:52 AM, Ian Clelland < > > iclelland@chromium.org > > > >>>> wrote: > > > >>>> > > > >>>>> The template version needs to be a complete config file for the > > > sample > > > >>> app, > > > >>>>> though. You should be able to run bin/create and then build the > > > Hello, > > > >>>>> Cordova app immediately. > > > >>>>> > > > >>>>> defaults.xml is supposed to be stripped right down to just the > > > >>>>> platform-specific options which, in theory, shouldn't need to b= e > > > >>> specified > > > >>>>> by every app. > > > >>>>> > > > >>>>> At least that's how it works in my head :) The distinction may = be > > > less > > > >>>>> important than I'm imagining. > > > >>>>> > > > >>>>> Ian > > > >>>>> > > > >>>>> > > > >>>>> On Fri, Sep 6, 2013 at 9:08 AM, Michal Mocny < > mmocny@chromium.org> > > > >>> wrote: > > > >>>>> > > > >>>>>> If the content or format of defaults.xml and the initial > > config.xml > > > >>> will > > > >>>>> be > > > >>>>>> different then we should ship both -- but I don't think they > will > > > be, > > > >>> so > > > >>>>> I > > > >>>>>> think we just ship the template with a defaults file. > > > >>>>>> > > > >>>>>> -Michal > > > >>>>>> > > > >>>>>> > > > >>>>>> On Thu, Sep 5, 2013 at 11:19 PM, Ian Clelland < > > > >> iclelland@chromium.org > > > >>>>>>> wrote: > > > >>>>>> > > > >>>>>>> On Thu, Sep 5, 2013 at 5:16 PM, James Jong < > wjamesjong@gmail.com > > > > > > >>>>> 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 wer= e > > > >>>>> 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 use= d > > 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 al= l > 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 thos= e > > 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 > > > >>>>>>> file > > > >>>>>>>>> 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 < > > > >>>>>>> braden@chromium.org > > > >>>>>>>>>>> wrote: > > > >>>>>>>>>> > > > >>>>>>>>>>> config.xml as a build artifact for less suffering and > easier > > > >>>>>> upgrades > > > >>>>>>>>>>> Terminology > > > >>>>>>>>>>> > > > >>>>>>>>>>> - > > > >>>>>>>>>>> > > > >>>>>>>>>>> =93platform config.xml=94 refers to the platform-specific > > > >>>>> config.xml > > > >>>>>>>>>> files, > > > >>>>>>>>>>> eg. platforms/android/res/xml/config.xml. This is the fin= al > > > >>>>> file > > > >>>>>>> read > > > >>>>>>>>>> by > > > >>>>>>>>>>> Cordova at runtime. > > > >>>>>>>>>>> - > > > >>>>>>>>>>> > > > >>>>>>>>>>> =93app config.xml=94 refers to the top-level config.xml f= ound > 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 a= nd > > > >>>>> less > > > >>>>>>>>>> robust > > > >>>>>>>>>>> in > > > >>>>>>>>>>> CLI than it needs to be. > > > >>>>>>>>>>> - > > > >>>>>>>>>>> > > > >>>>>>>>>>> Currently only some tags in the app config.xml are actual= ly > > > >>>>>>> honoured. > > > >>>>>>>>>>> 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 unchange= d, > > > >>>>>> 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 und= er > > > >>>>> CLI. > > > >>>>>>> Less > > > >>>>>>>>>>> munging, and easier upgrades. In short, platform config.x= ml > > > >>>>> 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 tucke= d > > away > > > >>>>>>>>>>> somewhere (only CLI accesses it) and contains only the > > > >>>>>>>>>>> Cordova-specified > > > >>>>>>>>>>> platform defaults, such as the preferences, any defaul= t > > > >>>>>>>>>>> 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=92s cordova create template so tha= t > its > > > >>>>>>>> top-level > > > >>>>>>>>>>> app config.xml contains , , , etc.= - > > > >>>>> tags > > > >>>>>>> the > > > >>>>>>>>>>> user is likely to edit. > > > >>>>>>>>>>> - > > > >>>>>>>>>>> > > > >>>>>>>>>>> Third, modify the CLI so that the new cordova prepare flo= w > > is: > > > >>>>>>>>>>> - > > > >>>>>>>>>>> > > > >>>>>>>>>>> Delete the old platform config.xml. > > > >>>>>>>>>>> - > > > >>>>>>>>>>> > > > >>>>>>>>>>> Copy the defaults.xml to config.xml. > > > >>>>>>>>>>> - > > > >>>>>>>>>>> > > > >>>>>>>>>>> Re-run the Plugman config munging for every plugin, > > > >>>>> modifying > > > >>>>>>> the > > > >>>>>>>>>>> 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=92s config.xml as w= ell. > > > >>>>>>>>>>> - > > > >>>>>>>>>>> > > > >>>>>>>>>>> This results in a freshly built, build-artifact platfo= rm > > > >>>>>>>>>> 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 > > > >>>>>>> might > > > >>>>>>>>>>> make. > > > >>>>>>>>>>> - > > > >>>>>>>>>>> > > > >>>>>>>>>>> Note that this means we shouldn=92t be needlessly > setting > > > >>>>>>>> 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 > > > >>>>>>> format > > > >>>>>>>>>>> > > > >>>>>>>>>> > > > >>>>>>>> > > > >>>>>>>> > > > >>>>>>> > > > >>>>>> > > > >>>>> > > > >>> > > > >>> > > > >> > > > > > > > > > --089e0111bca4c6469b04e5f3a5b7--