cordova-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vladimir-kotikov <...@git.apache.org>
Subject [GitHub] cordova-windows pull request: CB-11066 Remove uap prefixed capabil...
Date Wed, 20 Apr 2016 09:00:39 GMT
Github user vladimir-kotikov commented on a diff in the pull request:

    https://github.com/apache/cordova-windows/pull/168#discussion_r60372887
  
    --- Diff: template/cordova/lib/ConfigChanges.js ---
    @@ -0,0 +1,85 @@
    +/*
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
    + *
    + *   http://www.apache.org/licenses/LICENSE-2.0
    + *
    + * Unless required by applicable law or agreed to in writing,
    + * software distributed under the License is distributed on an
    + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
    + * KIND, either express or implied.  See the License for the
    + * specific language governing permissions and limitations
    + * under the License.
    + *
    +*/
    +
    +var util = require('util');
    +var CommonMunger = require('cordova-common').ConfigChanges.PlatformMunger;
    +
    +function PlatformMunger(platform, project_dir, platformJson, pluginInfoProvider) {
    +    CommonMunger.apply(this, arguments);
    +}
    +
    +util.inherits(PlatformMunger, CommonMunger);
    +
    +/**
    + * This is an override of apply_file_munge method from cordova-common's PlatformMunger
class.
    + * In addition to parent's method logic also removes capabilities with 'uap:' prefix
that were
    + * added by AppxManifest class
    + *
    + * @param {String}  file   A file name to apply munge to
    + * @param {Object}  munge  Serialized changes that need to be applied to the file
    + * @param {Boolean} [remove=false] Flag that specifies whether the changes
    + *   need to be removed or added to the file
    + */
    +PlatformMunger.prototype.apply_file_munge = function (file, munge, remove) {
    +    // Call parent class' method
    +    PlatformMunger.super_.prototype.apply_file_munge.call(this, file, munge, remove);
    +
    +    // CB-11066 If this is a windows10 manifest and we're removing the changes
    +    // then we also need to check if there are <Capability> elements were previously
    +    // added and schedule removal of corresponding <uap:Capability> elements
    +    if (remove && file === 'package.windows10.appxmanifest') {
    --- End diff --
    
    This is possible but IMO the idea of cordova-common was to contain a platform-agnostic
code, which platforms might reuse in a way that they want to. The disadvantage of putting
platform-specific code in common is that we'll need to release common first before releasing
platform to make fix available in next version. Keeping platform-specific code directly inside
of the platform allows us not to rely on `common` release cycle


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org


Mime
View raw message