Proposal for simpler nuget native libraries inside manage projects

Topics: General
Jun 11, 2013 at 10:22 AM
Thanks to Daniel, I think I've now got the key parts of what I need in order to include ARM/x86/x64 variants of my Managed assemblies inside a nuget package - see the steps in https://github.com/slodge/MvvmCross/issues/307 engineered from the approach in http://nuget.org/packages/microsoft.bcl.compression

However... this approach is very complicated and it feels like it goes against the very heart of nuget's simplicity and beauty

I'm worried that the complexity of writing and maintaining native folders, targets files and ps1 scripts will discourage developers from bothering with optimise their assemblies for native platforms - and indeed might put them off supporting WinStore altogether.

For native platforms, I would prefer a much simpler approach. Something like a nuspec file which allowed entries like:
   lib/netcore45#x86/Cirrious.MvvmCross.Plugins.Sqlite.WinRT.dll
   lib/netcore45#x64/Cirrious.MvvmCross.Plugins.Sqlite.WinRT.dll
   lib/netcore45#ARM/Cirrious.MvvmCross.Plugins.Sqlite.WinRT.dll
Which could then be used to generate a block something like that
<Choose>
 <When Condition=" '$(Platform)' == 'ARM' ">
  <ItemGroup>
    <Reference Include="Cirrious.MvvmCross.Plugins.Sqlite.WinRT.dll">
      <HintPath>..\..\packages\...\x86\Cirrious.MvvmCross.Plugins.Sqlite.WinRT.dll</HintPath>
    </Reference>
  </ItemGroup>
 </When>
</Choose>
<Choose>
 <When Condition=" '$(Platform)' == 'x64' ">
  <ItemGroup>
    <Reference Include="Cirrious.MvvmCross.Plugins.Sqlite.WinRT.dll">
      <HintPath>..\..\packages\...\x64\Cirrious.MvvmCross.Plugins.Sqlite.WinRT.dll</HintPath>
    </Reference>
  </ItemGroup>
 </When>
</Choose>
<Choose>
 <When Condition=" '$(Platform)' == 'x86' ">
  <ItemGroup>
    <Reference Include="Cirrious.MvvmCross.Plugins.Sqlite.WinRT.dll">
      <HintPath>..\..\packages\...\x86\Cirrious.MvvmCross.Plugins.Sqlite.WinRT.dll</HintPath>
    </Reference>
  </ItemGroup>
 </When>
</Choose> 
I know this has been discussed before... and I realise that I now have a way forwards so I should stop complaining... but I'd like to at least propose putting this or something forwards for consideration.

Thanks for all the hard work the @nuget team do ... sorry for being such a complainer :)

Stuart
Jun 25, 2013 at 6:03 PM
Interesting idea with the # sign. I'm curious, what's the idea behind the # sign instead of lib/netcore45/x64?