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

plugin.xml 'resource-file' does not copy file to target for Windows

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: Master
    • Fix Version/s: None
    • Component/s: cordova-windows
    • Labels:
    • Environment:

      Windows 8/Windows10

      Description

      From plugin.xml:

      <resource-file src="windows/shared/myprops.properties" target="myprops.properties"/>

      <resource-file> does not copy the file from src to target anymore. It used to, but was changed. This creates a couple of issues since I expect it to be in the application, but it technically isn't. This means that I cannot update the file that doesn't exist and very much limits the functionality of <resource-file> (Also the documentation is wrong for Windows since it doesn't copy any files). Visual Studio also only shows the file from the src path. This doesn't make much sense since that file wouldn't be in the application.

      The expected behavior should be if the target is specified, <resource-file> should copy the file to the target location. In turn, Visual Studio should show the target file instead of the src file because the target is part of the application whereas the src file is not.

      This used to be expected behavior, but was changed as a result of CB-10326. The intention of that issue is limited to use cases of only having the src attribute, ignoring the possibility that we would want to update files in the target instead (which imo makes more sense). Resource files are not all .dll files, so it's not very user friendly to limit the <resource-file> tag to handling just those kinds of files.

      Proposed changes in JsprojManager.js and PluginHandler.js:
      If target attribute is specified, copy the file to the target and point the Include attribute to the path of the target.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                ktop500 Karen Tran
                Reporter:
                ktop500 Karen Tran
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: