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

Don't copy `resource-file` files at plugin install time

    XMLWordPrintableJSON

    Details

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

      Description

      I just came across the newly added resource-file support for phonegap for windows. I've tried to use it for adding native dlls dependencies to the application. I couldn't completely get it to work with the current version.

      I'd like to propose a small change which would make the resource-file tag more powerful and shouldn't impact existing users:

      Judging from the source code, the file is copied to the target when the plugin is installed. I'd propose not to copy to the target but to point the include parameter to the existing file. This allows use-cases where a different .dll has to be copied based on the architecture of the project, .e.g.

      <resource-file src="x86/foo.dll" arch="x86" />
      <resource-file src="arm/foo.dll" arch="arm" />
      <resource-file src="x64/foo.dll" arch="x64" />

      This should generate code like this for each resource-file entry:

      <ItemGroup>
      <Content Condition="'$(Platform)'=='x86'" Include="x86/foo.dll">
      <Link>foo.dll</Link>
      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
      </Content>
      </ItemGroup>

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              biasmv Marco Biasini
            • Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: