Uploaded image for project: 'Apache Cordova'
  1. Apache Cordova
  2. CB-10832

Allow XML tags to make arbitrary edits to other XML files after prepare in config.xml

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Open
    • Major
    • Resolution: Unresolved
    • None
    • None
    • cordova-cli
    • All

    Description

      MSBuild has a facility to update the value of an XML tag in any XML file during the build process through an XMLUpdate task, which is configured by any xmlupdate element such as:

      <XmlUpdate Prefix="n"
      Namespace="http://schemas.microsoft.com/developer/msbuild/2003"
      XPath="/n:Project/n:PropertyGroup/n:TestUpdate"
      XmlFileName="Subversion.proj"
      Value="Test from $(MSBuildProjectFile)"/>

      It also has an optional delete attribute to specify the element/attribute is deleted, but the MSBuild implementation lacks an Add attribute which should be present for a complete implementation.

      I propose adding the same function to Cordova's prepare function. <xmlupdate> tags could be placed directly in the root node of the configuration, or more likely in a <platform> section.

      This would allow configuration of all items in the various platform's manifest files to be created/updated/deleted for the cases where there is not specialized code in "cordova prepare" to populate them.

      Source code for the MSBuild implementation is here:

      https://github.com/loresoft/msbuildtasks/blob/master/Source/MSBuild.Community.Tasks/XmlUpdate.cs

      Attachments

        Activity

          People

            Unassigned Unassigned
            paul.hickman Paul Hickman
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: