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 B6C37112C3 for ; Wed, 13 Aug 2014 22:27:21 +0000 (UTC) Received: (qmail 22395 invoked by uid 500); 13 Aug 2014 22:27:21 -0000 Delivered-To: apmail-cordova-dev-archive@cordova.apache.org Received: (qmail 22354 invoked by uid 500); 13 Aug 2014 22:27:21 -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 22326 invoked by uid 99); 13 Aug 2014 22:27:20 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 13 Aug 2014 22:27:20 +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.213.175 as permitted sender) Received: from [209.85.213.175] (HELO mail-ig0-f175.google.com) (209.85.213.175) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 13 Aug 2014 22:26:54 +0000 Received: by mail-ig0-f175.google.com with SMTP id uq10so11775957igb.8 for ; Wed, 13 Aug 2014 15:26:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=OQaRNz+17ladB/KV8TelAh8s77W9nmvDpKalBAvZAdg=; b=M7Ne+OOaIewAhvuv0sVuuzBhvP6XbLcX4W/HEovOpycblnlMoqDEb9s4BhsBsXB68V Ot2iG9m0XhxoTOo/VjefgKs3+b2t4a2EI3zmySbnYbuDrIefS3pEpfbPXCzjkPnq4Y0S gZCsahVtPfEv6OCYo32zRFP9f44nC5rUKbVeO45m8/wS5sEBCVeHR/Yv3rNzpo2Wgchv 1CidmxXb6WuhIeBMzm6okozrCU8AJWU9hBsHL309ZWu3C8Fyv6Hy5Zzl6joZ12hvFlwV uhFswZNKS/rLU3cb2cck6Lj0DRuMLpvavyADqqiZwrlUr+baTm8CaSPw+IpuhK/Sbgh5 qq3g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-type; bh=OQaRNz+17ladB/KV8TelAh8s77W9nmvDpKalBAvZAdg=; b=NVdPrD+TZvrGTOzd62cUVNgZm/zBr4V4TcCui2tpQkJYEhgSpHiq4LmhTOn/m1qlKG DGMdp3KWklKREUdloQkZj84JLEg0npF5wltWUhkNzCVUbWV9KyH1D/PB2OZnO2ZLL4Uo B5/HdigMolqP5b/qZAaSw2w4Twfb8hwEtUvDVpBYAFjIxXGXhkaLXEijr/zkLrpf7oiI xm4oVBfY5I4vDUqzI/q0BHceywKBG5H8lm2M+PiLzZtODyTrqFMryO7M3iPn38CPt7O9 kjrNERsWU9Qjk0oSLOpqyt8zcTh2Do+Y+aZB73xEg0Z4j/FPiranXbDTsG4+4o9UIsj4 Ty9w== X-Gm-Message-State: ALoCoQllXAhDpM0Q8/a8ENFH3y7zjebP9baEwzGdikYLzRUdfGUk9GttsCnjAnfbfmlgKqpv0/Yo X-Received: by 10.43.107.133 with SMTP id dy5mr6534871icc.14.1407968812969; Wed, 13 Aug 2014 15:26:52 -0700 (PDT) MIME-Version: 1.0 Received: by 10.64.243.10 with HTTP; Wed, 13 Aug 2014 15:26:31 -0700 (PDT) In-Reply-To: <85A3E123BABF314D9D3656D0B418125643E0E4D8@FMSMSX103.amr.corp.intel.com> References: <85A3E123BABF314D9D3656D0B418125643E0E4D8@FMSMSX103.amr.corp.intel.com> From: Michal Mocny Date: Wed, 13 Aug 2014 18:26:31 -0400 Message-ID: Subject: Re: cordova plugin save To: "Treggiari, Leo" Cc: "dev@cordova.apache.org" Content-Type: multipart/alternative; boundary=001a11338c28f3cfa605008a4830 X-Virus-Checked: Checked by ClamAV on apache.org --001a11338c28f3cfa605008a4830 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On Wed, Aug 13, 2014 at 6:07 PM, Treggiari, Leo wrote: > Hi Michal, > > > > Thanks for your answers. They were quite helpful. I have a few > follow-ups. > > > > With your answers, and references, and I found > https://wiki.apache.org/cordova/ConfigurationFiles, > > I have a better understanding of the existing metadata files. > > > > However there seem to be quite a few of them and I=E2=80=99m not yet sur= e about > where different types of information should go. > > > > https://wiki.apache.org/cordova/ConfigurationFiles goes into the answers > I=E2=80=99m looking for, except it just seems to be documenting the curre= nt > situation. > > - What types of metadata are there? > > - Where is each type saved? > > - Who owns each type and can change it? > I think we are figuring this out ourselves. There are differing opinions. Thanks for speaking up and voicing yours. > > > Here are my thoughts: > > > > - =E2=80=9CApp=E2=80=9D (or =E2=80=9CProject=E2=80=9D) metadata defines e= verything about the =E2=80=9Capp=E2=80=9D that > should be shared by all developers who want to develop/build the app. In > the case of Cordova CLI, this is primarily a =E2=80=9Cbuild recipe=E2=80= =9D. I.e. with > this metadata (plus given proper =E2=80=9Cworkspace=E2=80=9D (or =E2=80= =9Cenvironment=E2=80=9D) setup), > anyone can build the same app. Tooling (e.g. Cordova CLI) or IDEs would > normally be used to maintain some/all of this metadata. For example, > Cordova CLI may handle the plugins and platforms but document how to add > icons and splash screens to the app using this metadata file. An IDE mig= ht > manage all of that inside the IDE itself. The newly proposed metadata fo= r > specifying project directory structure would be part of this metadata. > Personally, this is exactly my mental model as well. But its > > > - =E2=80=9CWorkspace=E2=80=9D (or =E2=80=9CEnvironment=E2=80=9D or =E2=80= =9CProject specific user settings=E2=80=9D) > metadata describe the settings that a user (or tools on the user=E2=80=99= s behalf) > have to make to set up an environment for developing/building the app. > E.g. the location of native SDKs. > Ditto. > > > In general, different tooling/IDEs could have different rules regarding > who creates these metadata files and who is allowed to edit them and how. > > > > Is app config.xml intended to be the =E2=80=9CApp=E2=80=9D metadata file? > Yes. Though it should be noted that most everyone would rather there was a different file for this. config.xml is based on a deprecated proposal for app metadata (widget spec). There are several new app manifest formats roaming around, most based on json. However, I think we will likely use what we already have for the foreseeable future since we're already spending way too much time on tooling and changing this is not worthwhile bang-for-buck. > Is .cordova/config.json intended to be the =E2=80=9CWorkspace=E2=80=9D m= etadata file? > I think so. I'm less sure about how everyone feels about this file, but its likely that we will stick with what we have. Its also possible that IDE's/downstream tooling can just use some internal settings representation since most the the config.json values can be passed in to the CLI through the command line or node interface. > > > > - Aside from the initial create script that sets name etc, the > > > plugin/platform save command is the first tooling command to edit the > file > > > directly (I think?). > > > > I don=E2=80=99t understand why =E2=80=98cordova plugin/platform add/remov= e=E2=80=99 would not > modify app config.xml, but now =E2=80=98cordova plugin/platform save=E2= =80=99 would. Or is > that really the distinction between the 2? And how does that list of > plugins interact with what the user may have added themselves to config.x= ml? > I think this was Andrew's point and Gorkems original intention. We agree that `plugin add/remove` should update the list. The save/restore was just a non-intrusive way to experiment for now. > > > Thanks, > All good questions raised, with few definitive answers. It sounds like you're all caught up to the rest of us, though! > Leo > > > > > A few answers: > > > - There is no spec, since this is an "experimental" feature we aren't > > > ourselves sure yet how it will look when complete. That was the point > of > > > recent threads. > > > - The file belongs to the app / user, not to the workspace / tooling. > > > - Aside from the initial create script that sets name etc, the > > > plugin/platform save command is the first tooling command to edit the > file > > > directly (I think?). > > > - You can read more here: > > > https://cordova.apache.org/docs/en/edge/config_ref_index.md.html > > > - The top level "app" config.xml is not platform specific, but you can > have > > > platform specific settings in there by using the tag > > > - It is specific to cordova CLI. Each platform has another, different > > > config.xml (we usually call it the "platform" config.xml) which is > created > > > during cordova prepare, and thats what edited with non cli workflow. > > > - Phonegap workflow (also chrome cordova (cca) and likely others) is > > > compatible with cordova config.xml, but those often also add extensions > to > > > the options > > > - "project-level" (I call this "workspace") metadata should *not* go in= to > > > app config.xml. We already have another file, .cordova/config.json for > > > those. However, the list of plugins that your app needs is arguably no= t > a > > > property of a workspace, but truly a property of your application. Dit= to > > > for platforms (to a lesser extent). > > > > > > I'm not so sure what the proposal is for removing plugins/ directory, I > > > don't think there is anything concrete for that, it was just ramblings = of > > > various contributors ;) > > > > > > -Michal > > > > > > > > > On Wed, Aug 13, 2014 at 2:41 PM, Treggiari, Leo > > > > wrote: > > > > > >> I'm new to this mailing list. I work on the Intel(r) XDK which is > another > > >> IDE which supports the creation of hybrid apps using Cordova plugins. > > >> > > >> I'm having trouble figuring out what the proposed 'cordova plugin save= ' > > >> command does. Is there an up-to-date 'spec' that explains the goals o= f > the > > >> command and the implementation? > > >> > > >> A couple of things that I have read in the mailing list concern me. > > >> > > >> There is mention of saving information in config.xml. The usage of > > >> config.xml is somewhat of a mystery to me: > > >> - Who owns the file? Does the user own and edit it? Do certain > Cordova > > >> CLI commands edit it? What are the valid entries? > > >> - Is it treated differently by different platform builds - e.g. iOS v= s. > > >> Android? Is it treated differently by Cordova CLI vs. other Cordova > IDEs > > >> which directly use Cordova CLI or not - e.g. PhoneGap build? > > >> - If Cordova CLI wants to store 'project-level' metadata, is this a > good > > >> place to put it? If the answer to the first question above is not wel= l > > >> defined, or the answer to the second question is that different 'thing= s' > > >> are using it differently, then config.xml may not be a good place to b= e > > >> putting new metadata. > > >> > > >> There is a mention of plugin "restoring" and making the plugins > directory > > >> optional. This relates to the issue of plugin 'versions'. Now, when = a > > >> user executes 'cordova plugin add', plugin sources are fetched and the > > >> version of the plugin that was added is fixed until the user explicitl= y > > >> removes and re-adds it. Is 'cordova plugin save' & 'restore' > suggesting a > > >> new version management model? E.g. if I add a plugin without a specif= ic > > >> version suffix and 'restore' it later, I may not get the same version, > > >> right? > > >> > > >> If there is a 'spec', I should be able to answer these questions mysel= f. > > >> > > >> Thanks, > > >> Leo Treggiari > > > --001a11338c28f3cfa605008a4830--