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 2C9E819B1D for ; Tue, 19 Apr 2016 23:55:19 +0000 (UTC) Received: (qmail 61101 invoked by uid 500); 19 Apr 2016 23:55:13 -0000 Delivered-To: apmail-cordova-dev-archive@cordova.apache.org Received: (qmail 61059 invoked by uid 500); 19 Apr 2016 23:55:13 -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 61048 invoked by uid 99); 19 Apr 2016 23:55:13 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 19 Apr 2016 23:55:13 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 62141DFC70; Tue, 19 Apr 2016 23:55:13 +0000 (UTC) From: rakatyal To: dev@cordova.apache.org Reply-To: dev@cordova.apache.org References: In-Reply-To: Subject: [GitHub] cordova-windows pull request: CB-11066 Remove uap prefixed capabil... Content-Type: text/plain Message-Id: <20160419235513.62141DFC70@git1-us-west.apache.org> Date: Tue, 19 Apr 2016 23:55:13 +0000 (UTC) Github user rakatyal commented on a diff in the pull request: https://github.com/apache/cordova-windows/pull/168#discussion_r60332098 --- 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 elements were previously + // added and schedule removal of corresponding elements + if (remove && file === 'package.windows10.appxmanifest') { --- End diff -- Couldn't we have added this condition to the existing apply_file_munge instead of writing an override? --- 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