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 AB19A104E5 for ; Thu, 5 Sep 2013 18:21:52 +0000 (UTC) Received: (qmail 76107 invoked by uid 500); 5 Sep 2013 18:21:52 -0000 Delivered-To: apmail-cordova-dev-archive@cordova.apache.org Received: (qmail 76064 invoked by uid 500); 5 Sep 2013 18:21:51 -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 76051 invoked by uid 99); 5 Sep 2013 18:21:51 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 05 Sep 2013 18:21:51 +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 (athena.apache.org: domain of mmocny@google.com designates 209.85.214.180 as permitted sender) Received: from [209.85.214.180] (HELO mail-ob0-f180.google.com) (209.85.214.180) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 05 Sep 2013 18:21:47 +0000 Received: by mail-ob0-f180.google.com with SMTP id v19so2341701obq.39 for ; Thu, 05 Sep 2013 11:21:26 -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=BMkyIsmVaNgVK+IxM60WZ8GmsQRPFzDGS+Ta8x227Bo=; b=f4KG4XYmTVq5JJRENB+S5gDfItH+mRLHAjOGueSvZy16XjmWhzO8cA+fPTsCbTIqYo 23ae3jwyqw0poQFrHgec0MATrQ0M2R3UY5xDD46Yqu0Rx62YHiTHvWr72yHJBJYE3kH/ Gp9stPJzHrMIZChX4D8VpOvtFhsOhdCphJThnzKRlpabusbSFp1mUvjkP4GVZb0TWGTw QgNyt3umsN7QEAXtF8bOMH5aFgpEZp/v+aPEhNESbgWQaSGUkebxoolWrrFfuktZFPte oCvrxtJvGCh9ZM4fDy7d6IFHhlALimRUSmyWAb+SfvruCsLVHxivqBIGGDONIRwVIPqC cJIA== 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=BMkyIsmVaNgVK+IxM60WZ8GmsQRPFzDGS+Ta8x227Bo=; b=Wf54WNRWlbK7zngkI2sFO+TDzw9zTwb1iVwXnglMaYcfjFJ0Jo4BtFO9VhqkqksBry x0l02gm9uHBQRTf9HzVIpquyeSyfCr5DSo2vZaohumkLXpf9y0Fdi4G1954HGOXQOA1z 8poUd4QI53SM35IMTOMk9ytD/YsotkoifzilA= 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=BMkyIsmVaNgVK+IxM60WZ8GmsQRPFzDGS+Ta8x227Bo=; b=Ic/dBNHiUM+b6FUL0pNc+aftW9RuPZL97GElSPlSVJcpf7qYBMhTlO5oSl9ng7zAl4 ufq8NRoe/WCo1x20rEfGVJJ3oyZjZLKPxxsBvdKuquZWaELpcrTRC+akgAJkJ8zA12r2 QYrVlSRJjuHhEk9EC5UaDWReto8fnIOIgShpZ6hhgCtIema3rqfkLD9M+UiP/uc1jywo C7BFbAA5mrL1przl7DmIbc+sykARer+FQdfkicpJgyhq5p+x1mv1lpuyYIuX5ks3dqMu KPDSklJxaiY8hS6VvYd/+NNWcpV1yz7V4cFg6hYYdRYrwN1W8EV3Fodjio/7h3bPQdd9 Smhw== X-Gm-Message-State: ALoCoQmJxNINIH7frt1Ubi9hQe21wJI6pCm9+XbpAc1aeVzCHyDosczEYanKuntxEdA3vcWyc6LWb+Aicifz4DRWPIRdmbzTYGS+Oi1IkBxqUioPf15+I4OR0xSImJNv+FjxpFzkVHqJjzI+8itSLFUeCcrOD3Y+MFyh0D9nzmjJsDhJ4KjEpbO0iFSja8vrWJUXCH2esviPcjLgImJRTpuC7SBVnTiPdw== X-Received: by 10.182.230.135 with SMTP id sy7mr7357243obc.24.1378405286223; Thu, 05 Sep 2013 11:21:26 -0700 (PDT) MIME-Version: 1.0 Sender: mmocny@google.com Received: by 10.182.139.100 with HTTP; Thu, 5 Sep 2013 11:21:06 -0700 (PDT) In-Reply-To: References: From: Michal Mocny Date: Thu, 5 Sep 2013 14:21:06 -0400 X-Google-Sender-Auth: _DT8ZYOGUM-LybnK4M533UG5kD8 Message-ID: Subject: Re: config.xml as a build artifact for less suffering and easier upgrades To: dev Content-Type: multipart/alternative; boundary=001a11c33676714c4b04e5a6fdbd X-Virus-Checked: Checked by ClamAV on apache.org --001a11c33676714c4b04e5a6fdbd Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable 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.x= ml > should live? (Maybe it doesn't have to exist and defaults can just be var= s > 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 > > > > - > > > > =93platform config.xml=94 refers to the platform-specific config.xml > files, > > eg. platforms/android/res/xml/config.xml. This is the final file rea= d > by > > Cordova at runtime. > > - > > > > =93app config.xml=94 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 a= nd > > 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 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 unchanged, though t= he > > 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. Les= s > > 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 unchang= ed > > 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 that its top-l= evel > > app config.xml contains , , , etc. - tags the > > 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 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 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 might > > make. > > - > > > > Note that this means we shouldn=92t be needlessly setting defa= ults > > 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 i= n > > the > > config. > > - > > > > In particular, it can have tags in the usual format > > > --001a11c33676714c4b04e5a6fdbd--