Well it's simple:

on iOS the defined target is config.xml but it actually is:
PROJECT_NAME/config.xml

We can't know your PROJECT_NAME ahead of time and therefore can't define it
in plugin.xml. plugman currently globs directories to find that config.xml
file. config.xml paths don't change on the other platforms
(res/xml/config.xml android and www/config.xml on bb). By explicit I mean
specifying what config file we need to modify and we could make a special
case for config.xml because we're already doing it for iOS.

-a


On Wed, Apr 24, 2013 at 10:40 AM, Michal Mocny <[email protected]> wrote:

> Okay I think I've done a reverse here.  The suggested global <config-file
> target="config.xml"> makes it look like target is a path, but it isn't.  If
> we can automatically automatically find the right config.xml, why do we
> need to be explicit about it path inside the platform specific settings?  I
> suggest making this consistant.
>
> Perhaps something like <config-file name="config.xml" path="HERE"> and path
> is either optional, or we support a special attribute (auto-path="true")?
>  Then, the same pattern can be used inside and outside of platform
> settings.
>
> -Michal
>
>
> On Wed, Apr 24, 2013 at 1:19 PM, Anis KADRI <[email protected]> wrote:
>
> > The config-file tag was not meant to be used by config.xml only. There
> > could be other platform-specific files to edit as well. Those file don't
> > have to be XML files either.
> >
> > That is why <access> elements are currently top level. <access> elements
> > should be the same on all platforms, yah ? Why would you discriminate
> one ?
> >
> > I don't mind having a top-level config-file but I would specify some sort
> > of target. It could just be target="config.xml" and then our
> configuration
> > code would determine where that file is depending on the platform. If
> only
> > for the sake of clarity. We could just assume that whatever top
> > level  config-file with no target specified has to be config.xml but
> > explicit is better than implicit in my opinion.
> >
> >
> > On Wed, Apr 24, 2013 at 9:29 AM, Andrew Grieve <[email protected]>
> > wrote:
> >
> > > Yeah, for things like whitelist and preferences this seems necessary
> :).
> > > Ship it!
> > >
> > >
> > > On Wed, Apr 24, 2013 at 12:27 PM, Michal Mocny <[email protected]>
> > > wrote:
> > >
> > > > I think "missing target" bugs would be masked if no-target applied to
> > > all.
> > > >  Platform specific changes applied to other platforms may usually be
> > > > harmlessly ignored and go unnoticed, but sometimes cause hard.
> > > >
> > > > Therefore, I would prefer a target="all" or target="common".
> > > >
> > > > I think its a good idea, though.
> > > >
> > > > -Michal
> > > >
> > > >
> > > > On Wed, Apr 24, 2013 at 12:17 PM, Filip Maj <[email protected]> wrote:
> > > >
> > > > > Here's another thought about the config-file changes.
> > > > >
> > > > > I noticed some of the plugins out there have <access> tags at the
> top
> > > > > level in a plugin's plugin.xml. At first I was like wtf that should
> > > exist
> > > > > under a <config-file> element, pointing to the config.xml for each
> > > > > platform. I realize now the problem with that, though, is that
> you'll
> > > > need
> > > > > one of these for each platform, because the target location of the
> > > > > config.xml is in different spots, I.e.:
> > > > >
> > > > > - Android: <config-file target="res/xml/config.xml"><access
> > > > > blah></config-file>
> > > > > - iOS: <config-file target="www/config.xml"><access
> > blah></config-file>
> > > > >
> > > > > - BlackBerry: <config-file target="www/config.xml"><access
> > > > > blah></config-file>
> > > > >
> > > > >
> > > > > Should we provide some way of modifying the config.xml, agnostic of
> > the
> > > > > platform, just for these cases where certain config.xml changes
> apply
> > > to
> > > > > all platforms? If so, how? A top-level <config-file> element
> (perhaps
> > > > with
> > > > > no target attrib)?
> > > > >
> > > > > On 4/23/13 7:28 PM, "Anis KADRI" <[email protected]> wrote:
> > > > >
> > > > > >It doesn't. All configuration edits should happen in prepare
> > > > > >(adding/removing xml fragments etc..).
> > > > > >
> > > > > >
> > > > > >On Tue, Apr 23, 2013 at 7:05 PM, Michal Mocny <
> [email protected]>
> > > > > wrote:
> > > > > >
> > > > > >> +1 move to prepare, however, why does this only apply to access
> > > tags?
> > > > > >>
> > > > > >>
> > > > > >> On Tue, Apr 23, 2013 at 7:16 PM, Filip Maj <[email protected]>
> wrote:
> > > > > >>
> > > > > >> > that¹s what I was thinking too
> > > > > >> >
> > > > > >> > On 4/23/13 4:13 PM, "Anis KADRI" <[email protected]>
> wrote:
> > > > > >> >
> > > > > >> > >On Tue, Apr 23, 2013 at 4:03 PM, Filip Maj <[email protected]>
> > > wrote:
> > > > > >> > >
> > > > > >> > >> One thing that I intentionally removed from platform-level
> > > > > >>`install`
> > > > > >> was
> > > > > >> > >> adding <access> tags to the config. I figure this should
> > > probably
> > > > > >>go
> > > > > >> > >>into
> > > > > >> > >> `prepare`. Thoughts?
> > > > > >> > >>
> > > > > >> > >
> > > > > >> > >In my opinion, this should be part of a configuration handler
> > > that
> > > > > >> should
> > > > > >> > >be called by 'prepare'.
> > > > > >> >
> > > > > >> >
> > > > > >>
> > > > >
> > > > >
> > > >
> > >
> >
>

Reply via email to