[jira] [Commented] (CB-12838) Order of plugins in config.xml modified during build
[ https://issues.apache.org/jira/browse/CB-12838?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16129489#comment-16129489 ] ASF GitHub Bot commented on CB-12838: - Github user asfgit closed the pull request at: https://github.com/apache/cordova-lib/pull/574 > Order of plugins in config.xml modified during build > > > Key: CB-12838 > URL: https://issues.apache.org/jira/browse/CB-12838 > Project: Apache Cordova > Issue Type: Bug > Components: cordova-cli >Affects Versions: cordova@7.0.0 > Environment: Mac OS 10.12.4, Cordova 7.0.1 >Reporter: Anton Weber >Assignee: Audrey So >Priority: Minor > Labels: android, cordova-8.0.0, ios, reproduced, triaged > > Running cordova build android or cordova build ios changes the order in which > plugins are listed in the config.xml (arranging them alphabetically). > This causes problems when manually resolving dependencies, e.g. when > installing a specific version of a dependency first by having it higher up in > the list. > Example: > Original config.xml content: > ... > > > > > > ... > After cordova build: > ... > > > > > > ... -- This message was sent by Atlassian JIRA (v6.4.14#64029) - To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org For additional commands, e-mail: issues-h...@cordova.apache.org
[jira] [Commented] (CB-12838) Order of plugins in config.xml modified during build
[ https://issues.apache.org/jira/browse/CB-12838?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16129487#comment-16129487 ] ASF subversion and git services commented on CB-12838: -- Commit e4c216e20cb879bcf0b4e7127b9b3f8a1b79c875 in cordova-lib's branch refs/heads/master from [~auso] [ https://git-wip-us.apache.org/repos/asf?p=cordova-lib.git;h=e4c216e ] CB-12838 : prevented sorting and aphabetizing platforms and plugins in pkgjson and config > Order of plugins in config.xml modified during build > > > Key: CB-12838 > URL: https://issues.apache.org/jira/browse/CB-12838 > Project: Apache Cordova > Issue Type: Bug > Components: cordova-cli >Affects Versions: cordova@7.0.0 > Environment: Mac OS 10.12.4, Cordova 7.0.1 >Reporter: Anton Weber >Assignee: Audrey So >Priority: Minor > Labels: android, cordova-8.0.0, ios, reproduced, triaged > > Running cordova build android or cordova build ios changes the order in which > plugins are listed in the config.xml (arranging them alphabetically). > This causes problems when manually resolving dependencies, e.g. when > installing a specific version of a dependency first by having it higher up in > the list. > Example: > Original config.xml content: > ... > > > > > > ... > After cordova build: > ... > > > > > > ... -- This message was sent by Atlassian JIRA (v6.4.14#64029) - To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org For additional commands, e-mail: issues-h...@cordova.apache.org
[jira] [Commented] (CB-12838) Order of plugins in config.xml modified during build
[ https://issues.apache.org/jira/browse/CB-12838?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16129259#comment-16129259 ] ASF GitHub Bot commented on CB-12838: - Github user audreyso commented on the issue: https://github.com/apache/cordova-lib/pull/574 Thanks @stevengill ! I will merge it in today! > Order of plugins in config.xml modified during build > > > Key: CB-12838 > URL: https://issues.apache.org/jira/browse/CB-12838 > Project: Apache Cordova > Issue Type: Bug > Components: cordova-cli >Affects Versions: cordova@7.0.0 > Environment: Mac OS 10.12.4, Cordova 7.0.1 >Reporter: Anton Weber >Assignee: Audrey So >Priority: Minor > Labels: android, cordova-8.0.0, ios, reproduced, triaged > > Running cordova build android or cordova build ios changes the order in which > plugins are listed in the config.xml (arranging them alphabetically). > This causes problems when manually resolving dependencies, e.g. when > installing a specific version of a dependency first by having it higher up in > the list. > Example: > Original config.xml content: > ... > > > > > > ... > After cordova build: > ... > > > > > > ... -- This message was sent by Atlassian JIRA (v6.4.14#64029) - To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org For additional commands, e-mail: issues-h...@cordova.apache.org
[jira] [Commented] (CB-12838) Order of plugins in config.xml modified during build
[ https://issues.apache.org/jira/browse/CB-12838?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16129252#comment-16129252 ] ASF GitHub Bot commented on CB-12838: - Github user stevengill commented on the issue: https://github.com/apache/cordova-lib/pull/574 LGTM > Order of plugins in config.xml modified during build > > > Key: CB-12838 > URL: https://issues.apache.org/jira/browse/CB-12838 > Project: Apache Cordova > Issue Type: Bug > Components: cordova-cli >Affects Versions: cordova@7.0.0 > Environment: Mac OS 10.12.4, Cordova 7.0.1 >Reporter: Anton Weber >Assignee: Audrey So >Priority: Minor > Labels: android, cordova-8.0.0, ios, reproduced, triaged > > Running cordova build android or cordova build ios changes the order in which > plugins are listed in the config.xml (arranging them alphabetically). > This causes problems when manually resolving dependencies, e.g. when > installing a specific version of a dependency first by having it higher up in > the list. > Example: > Original config.xml content: > ... > > > > > > ... > After cordova build: > ... > > > > > > ... -- This message was sent by Atlassian JIRA (v6.4.14#64029) - To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org For additional commands, e-mail: issues-h...@cordova.apache.org
[jira] [Commented] (CB-12838) Order of plugins in config.xml modified during build
[ https://issues.apache.org/jira/browse/CB-12838?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16124202#comment-16124202 ] ASF GitHub Bot commented on CB-12838: - Github user audreyso commented on a diff in the pull request: https://github.com/apache/cordova-lib/pull/574#discussion_r132795105 --- Diff: src/cordova/restore-util.js --- @@ -341,19 +340,29 @@ function installPluginsFromConfigXML (args) { fs.writeFileSync(pkgJsonPath, JSON.stringify(pkgJson, null, 2), 'utf8'); } } -// Write config.xml (only if plugins exist in package.json). +// Write to config.xml (only if it is different from package.json in content) comboPluginIdArray.forEach(function (plugID) { +var configXMLPlugin = cfg.getPlugin(plugID); if (pluginIdConfig.indexOf(plugID) < 0) { pluginIdConfig.push(plugID); -} -cfg.removePlugin(plugID); -if (mergedPluginSpecs[plugID]) { +if (mergedPluginSpecs[plugID]) { +cfg.removePlugin(plugID); +cfg.addPlugin({name: plugID, spec: mergedPluginSpecs[plugID]}, comboObject[plugID]); +modifiedConfigXML = true; +} else { +cfg.removePlugin(plugID); +cfg.addPlugin({name: plugID}, comboObject[plugID]); +modifiedConfigXML = true; +} + +// Write only if the plugin variables or specs are different from pkgJson +} else if (((pluginIdConfig.indexOf(plugID) > 0) && (mergedPluginSpecs[plugID]) && +((configXMLPlugin.variables !== comboObject[plugID]))) || +((mergedPluginSpecs[plugID] !== configXMLPlugin.spec) || --- End diff -- Yes, exactly! Also rebased and updated based on feedback. Let me know if there's anything else! > Order of plugins in config.xml modified during build > > > Key: CB-12838 > URL: https://issues.apache.org/jira/browse/CB-12838 > Project: Apache Cordova > Issue Type: Bug > Components: cordova-cli >Affects Versions: cordova@7.0.0 > Environment: Mac OS 10.12.4, Cordova 7.0.1 >Reporter: Anton Weber >Assignee: Audrey So >Priority: Minor > Labels: android, cordova-8.0.0, ios, reproduced, triaged > > Running cordova build android or cordova build ios changes the order in which > plugins are listed in the config.xml (arranging them alphabetically). > This causes problems when manually resolving dependencies, e.g. when > installing a specific version of a dependency first by having it higher up in > the list. > Example: > Original config.xml content: > ... > > > > > > ... > After cordova build: > ... > > > > > > ... -- This message was sent by Atlassian JIRA (v6.4.14#64029) - To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org For additional commands, e-mail: issues-h...@cordova.apache.org
[jira] [Commented] (CB-12838) Order of plugins in config.xml modified during build
[ https://issues.apache.org/jira/browse/CB-12838?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16124035#comment-16124035 ] ASF GitHub Bot commented on CB-12838: - Github user stevengill commented on a diff in the pull request: https://github.com/apache/cordova-lib/pull/574#discussion_r132781446 --- Diff: src/cordova/restore-util.js --- @@ -341,19 +340,29 @@ function installPluginsFromConfigXML (args) { fs.writeFileSync(pkgJsonPath, JSON.stringify(pkgJson, null, 2), 'utf8'); } } -// Write config.xml (only if plugins exist in package.json). +// Write to config.xml (only if it is different from package.json in content) comboPluginIdArray.forEach(function (plugID) { +var configXMLPlugin = cfg.getPlugin(plugID); if (pluginIdConfig.indexOf(plugID) < 0) { pluginIdConfig.push(plugID); -} -cfg.removePlugin(plugID); -if (mergedPluginSpecs[plugID]) { +if (mergedPluginSpecs[plugID]) { +cfg.removePlugin(plugID); +cfg.addPlugin({name: plugID, spec: mergedPluginSpecs[plugID]}, comboObject[plugID]); +modifiedConfigXML = true; +} else { +cfg.removePlugin(plugID); +cfg.addPlugin({name: plugID}, comboObject[plugID]); +modifiedConfigXML = true; +} + +// Write only if the plugin variables or specs are different from pkgJson +} else if (((pluginIdConfig.indexOf(plugID) > 0) && (mergedPluginSpecs[plugID]) && +((configXMLPlugin.variables !== comboObject[plugID]))) || +((mergedPluginSpecs[plugID] !== configXMLPlugin.spec) || --- End diff -- so to confirm, either `((pluginIdConfig.indexOf(plugID) > 0) && (mergedPluginSpecs[plugID]) &&(configXMLPlugin.variables !== comboObject[plugID]))` or `((mergedPluginSpecs[plugID] !== configXMLPlugin.spec) || (configXMLPlugin.variables !== comboObject[plugID]))` need to be true > Order of plugins in config.xml modified during build > > > Key: CB-12838 > URL: https://issues.apache.org/jira/browse/CB-12838 > Project: Apache Cordova > Issue Type: Bug > Components: cordova-cli >Affects Versions: cordova@7.0.0 > Environment: Mac OS 10.12.4, Cordova 7.0.1 >Reporter: Anton Weber >Assignee: Audrey So >Priority: Minor > Labels: android, cordova-8.0.0, ios, reproduced, triaged > > Running cordova build android or cordova build ios changes the order in which > plugins are listed in the config.xml (arranging them alphabetically). > This causes problems when manually resolving dependencies, e.g. when > installing a specific version of a dependency first by having it higher up in > the list. > Example: > Original config.xml content: > ... > > > > > > ... > After cordova build: > ... > > > > > > ... -- This message was sent by Atlassian JIRA (v6.4.14#64029) - To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org For additional commands, e-mail: issues-h...@cordova.apache.org
[jira] [Commented] (CB-12838) Order of plugins in config.xml modified during build
[ https://issues.apache.org/jira/browse/CB-12838?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16124036#comment-16124036 ] ASF GitHub Bot commented on CB-12838: - Github user stevengill commented on a diff in the pull request: https://github.com/apache/cordova-lib/pull/574#discussion_r132780476 --- Diff: src/cordova/restore-util.js --- @@ -341,19 +340,29 @@ function installPluginsFromConfigXML (args) { fs.writeFileSync(pkgJsonPath, JSON.stringify(pkgJson, null, 2), 'utf8'); } } -// Write config.xml (only if plugins exist in package.json). +// Write to config.xml (only if it is different from package.json in content) comboPluginIdArray.forEach(function (plugID) { +var configXMLPlugin = cfg.getPlugin(plugID); if (pluginIdConfig.indexOf(plugID) < 0) { pluginIdConfig.push(plugID); -} -cfg.removePlugin(plugID); -if (mergedPluginSpecs[plugID]) { +if (mergedPluginSpecs[plugID]) { +cfg.removePlugin(plugID); +cfg.addPlugin({name: plugID, spec: mergedPluginSpecs[plugID]}, comboObject[plugID]); +modifiedConfigXML = true; +} else { +cfg.removePlugin(plugID); +cfg.addPlugin({name: plugID}, comboObject[plugID]); +modifiedConfigXML = true; +} + +// Write only if the plugin variables or specs are different from pkgJson +} else if (((pluginIdConfig.indexOf(plugID) > 0) && (mergedPluginSpecs[plugID]) && --- End diff -- so this if statement, `(pluginIdConfig.indexOf(plugID) > 0)`, what if `plugID` is in the 0th index? I think you want `>=` > Order of plugins in config.xml modified during build > > > Key: CB-12838 > URL: https://issues.apache.org/jira/browse/CB-12838 > Project: Apache Cordova > Issue Type: Bug > Components: cordova-cli >Affects Versions: cordova@7.0.0 > Environment: Mac OS 10.12.4, Cordova 7.0.1 >Reporter: Anton Weber >Assignee: Audrey So >Priority: Minor > Labels: android, cordova-8.0.0, ios, reproduced, triaged > > Running cordova build android or cordova build ios changes the order in which > plugins are listed in the config.xml (arranging them alphabetically). > This causes problems when manually resolving dependencies, e.g. when > installing a specific version of a dependency first by having it higher up in > the list. > Example: > Original config.xml content: > ... > > > > > > ... > After cordova build: > ... > > > > > > ... -- This message was sent by Atlassian JIRA (v6.4.14#64029) - To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org For additional commands, e-mail: issues-h...@cordova.apache.org
[jira] [Commented] (CB-12838) Order of plugins in config.xml modified during build
[ https://issues.apache.org/jira/browse/CB-12838?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16124034#comment-16124034 ] ASF GitHub Bot commented on CB-12838: - Github user stevengill commented on a diff in the pull request: https://github.com/apache/cordova-lib/pull/574#discussion_r132780726 --- Diff: src/cordova/restore-util.js --- @@ -341,19 +340,29 @@ function installPluginsFromConfigXML (args) { fs.writeFileSync(pkgJsonPath, JSON.stringify(pkgJson, null, 2), 'utf8'); } } -// Write config.xml (only if plugins exist in package.json). +// Write to config.xml (only if it is different from package.json in content) comboPluginIdArray.forEach(function (plugID) { +var configXMLPlugin = cfg.getPlugin(plugID); if (pluginIdConfig.indexOf(plugID) < 0) { pluginIdConfig.push(plugID); -} -cfg.removePlugin(plugID); -if (mergedPluginSpecs[plugID]) { +if (mergedPluginSpecs[plugID]) { +cfg.removePlugin(plugID); +cfg.addPlugin({name: plugID, spec: mergedPluginSpecs[plugID]}, comboObject[plugID]); +modifiedConfigXML = true; +} else { +cfg.removePlugin(plugID); +cfg.addPlugin({name: plugID}, comboObject[plugID]); +modifiedConfigXML = true; +} + +// Write only if the plugin variables or specs are different from pkgJson +} else if (((pluginIdConfig.indexOf(plugID) > 0) && (mergedPluginSpecs[plugID]) && +((configXMLPlugin.variables !== comboObject[plugID]))) || --- End diff -- I think you have an extra bracket around this one > Order of plugins in config.xml modified during build > > > Key: CB-12838 > URL: https://issues.apache.org/jira/browse/CB-12838 > Project: Apache Cordova > Issue Type: Bug > Components: cordova-cli >Affects Versions: cordova@7.0.0 > Environment: Mac OS 10.12.4, Cordova 7.0.1 >Reporter: Anton Weber >Assignee: Audrey So >Priority: Minor > Labels: android, cordova-8.0.0, ios, reproduced, triaged > > Running cordova build android or cordova build ios changes the order in which > plugins are listed in the config.xml (arranging them alphabetically). > This causes problems when manually resolving dependencies, e.g. when > installing a specific version of a dependency first by having it higher up in > the list. > Example: > Original config.xml content: > ... > > > > > > ... > After cordova build: > ... > > > > > > ... -- This message was sent by Atlassian JIRA (v6.4.14#64029) - To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org For additional commands, e-mail: issues-h...@cordova.apache.org
[jira] [Commented] (CB-12838) Order of plugins in config.xml modified during build
[ https://issues.apache.org/jira/browse/CB-12838?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16085912#comment-16085912 ] ASF GitHub Bot commented on CB-12838: - GitHub user audreyso opened a pull request: https://github.com/apache/cordova-lib/pull/574 CB-12838 : prevented sorting and alphabetizing platforms and plugins i… …n pkgJson and config ### Platforms affected ### What does this PR do? Prevents modifying/alphabetizing platforms and plugins in config ### What testing has been done on this change? ### Checklist - [X] [Reported an issue](http://cordova.apache.org/contribute/issues.html) in the JIRA database - [X] Commit message follows the format: "CB-3232: (android) Fix bug with resolving file paths", where CB- is the JIRA ID & "android" is the platform affected. - [X] Added automated test coverage as appropriate for this change. You can merge this pull request into a Git repository by running: $ git pull https://github.com/audreyso/cordova-lib CB-12838 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/cordova-lib/pull/574.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #574 commit 083deef9ce70afe8455a36f49ddccf0b093558f8 Author: Audrey SoDate: 2017-07-12T00:21:41Z CB-12838 : prevented sorting and aphabetizing platforms and plugins in pkgjson and config > Order of plugins in config.xml modified during build > > > Key: CB-12838 > URL: https://issues.apache.org/jira/browse/CB-12838 > Project: Apache Cordova > Issue Type: Bug > Components: cordova-cli >Affects Versions: cordova@7.0.0 > Environment: Mac OS 10.12.4, Cordova 7.0.1 >Reporter: Anton Weber >Priority: Minor > Labels: android, cordova-8.0.0, ios, reproduced, triaged > > Running cordova build android or cordova build ios changes the order in which > plugins are listed in the config.xml (arranging them alphabetically). > This causes problems when manually resolving dependencies, e.g. when > installing a specific version of a dependency first by having it higher up in > the list. > Example: > Original config.xml content: > ... > > > > > > ... > After cordova build: > ... > > > > > > ... -- This message was sent by Atlassian JIRA (v6.4.14#64029) - To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org For additional commands, e-mail: issues-h...@cordova.apache.org
[jira] [Commented] (CB-12838) Order of plugins in config.xml modified during build
[ https://issues.apache.org/jira/browse/CB-12838?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16048322#comment-16048322 ] Grant Patterson commented on CB-12838: -- This is also a big headache for version control: when the order of config.xml elements change, the file appears modified when it has not substantively changed. > Order of plugins in config.xml modified during build > > > Key: CB-12838 > URL: https://issues.apache.org/jira/browse/CB-12838 > Project: Apache Cordova > Issue Type: Bug > Components: cordova-cli >Affects Versions: cordova@7.0.0 > Environment: Mac OS 10.12.4, Cordova 7.0.1 >Reporter: Anton Weber >Priority: Minor > Labels: android, ios > > Running cordova build android or cordova build ios changes the order in which > plugins are listed in the config.xml (arranging them alphabetically). > This causes problems when manually resolving dependencies, e.g. when > installing a specific version of a dependency first by having it higher up in > the list. > Example: > Original config.xml content: > ... > > > > > > ... > After cordova build: > ... > > > > > > ... -- This message was sent by Atlassian JIRA (v6.4.14#64029) - To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org For additional commands, e-mail: issues-h...@cordova.apache.org