Only Copy Platform Specific Native Binaries from NuGet

Feature Requests for GdPicture.NET.
Post Reply
accudave
Posts: 21
Joined: Tue May 12, 2015 6:07 pm

Only Copy Platform Specific Native Binaries from NuGet

Post by accudave » Wed Jun 01, 2022 4:44 pm

Is it possible to have the GdPicture.NET team update the GdPicture.targets file in the NuGet package to only deploy the native binaries for the correct target platforms of the project?

SQLite does this, here is their targets file.

Code: Select all

<?xml version="1.0" encoding="utf-8" ?>
<Project ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <ItemGroup Condition=" (Exists('packages.config') Or Exists('packages.$(MSBuildProjectName).config')) And '$(Platform)' == 'AnyCPU'">
    <Content Include="$(MSBuildThisFileDirectory)..\..\runtimes\win7-x86\native\*">
      <Link>x86\%(Filename)%(Extension)</Link>
      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
      <Visible>False</Visible>
    </Content>
    <Content Include="$(MSBuildThisFileDirectory)..\..\runtimes\win7-x64\native\*">
      <Link>x64\%(Filename)%(Extension)</Link>
      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
      <Visible>False</Visible>
    </Content>
  </ItemGroup>
  <ItemGroup Condition=" (Exists('packages.config') Or Exists('packages.$(MSBuildProjectName).config')) And '$(Platform)' == 'x86'">
    <Content Include="$(MSBuildThisFileDirectory)..\..\runtimes\win7-x86\native\*">
      <Link>%(Filename)%(Extension)</Link>
      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
      <Visible>False</Visible>
    </Content>
  </ItemGroup>
  <ItemGroup Condition=" (Exists('packages.config') Or Exists('packages.$(MSBuildProjectName).config')) And '$(Platform)' == 'x64'">
    <Content Include="$(MSBuildThisFileDirectory)..\..\runtimes\win7-x64\native\*">
      <Link>%(Filename)%(Extension)</Link>
      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
      <Visible>False</Visible>
    </Content>
  </ItemGroup>
</Project>
Currently I am maintaining our own GdPicture.NET NuGet packages because I have NuGet packages for each of the optional components (barcodes, TWAIN, OCR).

It would be great of GdPicture.NET to organize this as well and have the following NuGet packages:

GdPicture (install all required files)
GdPicture.Barcode
GdPicture.Twain
GdPicture.OCR

Where all of them install only the required platform binaries.

I'm am on the fence of whether I want to use the official GdPicture.NET NuGet package yet because of all the extra binaries it produces.

User avatar
Fabio
Posts: 173
Joined: Thu Aug 27, 2020 9:57 am

Re: Only Copy Platform Specific Native Binaries from NuGet

Post by Fabio » Fri Jun 03, 2022 3:39 pm

Hello there,

This would be a nice improvement of our NuGet mechanism.
I created a task for our developers for implementing it.
I will keep you updated about any news regarding this implementation.

Thank you very much for your feedback!

Best regards,
Fabio

Post Reply

Who is online

Users browsing this forum: Google [Bot] and 1 guest