[ 
https://issues.apache.org/jira/browse/CB-10326?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15115151#comment-15115151
 ] 

ASF GitHub Bot commented on CB-10326:
-------------------------------------

Github user biasmv commented on the pull request:

    https://github.com/apache/cordova-windows/pull/139#issuecomment-174499126
  
    @sgrebnov: I've verified that it's still possible to have files in non-root 
folder locations. I've inserted the following into my project (which is 
essentially what would be generated by resource-file with the patch):
    
    ```
    <Content Include="file.txt">
       <Link>somesubdirectory/file.txt</Link>
       <CopyToOutputDirectory>Always</CopyToOutputDirectory>
    </Content>
    ```
    
    The file is correctly placed in somesubdirectory and not the output 
directory root folder. So the patch does not prevent the resource element to be 
used that way.
    
    The suggested use of the target attribute would still mean that the files 
land in different locations depending on the architecture. I'd need to change 
the C# library to somehow load the unmanaged dll from from a different 
location, depending on what device it's running on. I'd prefer if I could just 
copy the file with the correct architecture to the output directory without 
having to do any runtime checks.
    
    Also, since I'm referencing the file from the appxmanifest as part of an 
extension (see the original ticket 
https://issues.apache.org/jira/browse/CB-10326), I'd need to change the path in 
the appxmanifest depending on the architecture currently being built. 



> don't copy resource-file files at plugin install time
> -----------------------------------------------------
>
>                 Key: CB-10326
>                 URL: https://issues.apache.org/jira/browse/CB-10326
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: Windows
>            Reporter: Marco Biasini
>
> 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>



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to