Open rainersigwald opened 6 years ago
Thanks @rainersigwald
Look at https://docs.microsoft.com/en-us/nuget/create-packages/supporting-multiple-target-frameworks to understand how to create package which targets multi tfms or multi runtimes. It also has bunch of end-to-end examples to create UWP libraries for different tfms/ rids which should also help understand better.
@jainaashish Okey, that documentation is really bad. The doc tell how should look like the nupkg. But they dont tell how to do it via a *.csproj
.
The way to do it is like this for example:
<Content CopyToOutputDirectory="PreserveNewest"
Include="runtimes/linux-arm/native/**/*"
Pack="true"
PackagePath="runtimes/linux-arm/native/"/>
But my real interest is how to do the following:
dotnet publish
| No RID defined -> All runtimes are published
dotnet publish -r <rid>
| RID defined -> Just valid RIDs runtimes are published.
So, how are the runtimes folder extracted? Is there a better way I can pack this runtimes inside a *.nupkg? How are handled the runtimes folder at runtime?
From @deinok on November 3, 2018 16:54
Hi, I'm searching the internet for this information, trying to reproduce what other libs, etc.. But I can't find a way to do the following:
Imagine that I want to create library for https://github.com/intel-iot-devkit/mraa So I create a netstandard2.0 called
Mraa.runtime.linux-arm
that just have a a folder like thisruntimes/linux-arm/native/
and inside that folder I put the generated libmraa.so for linux-armInside
Mraa.runtime.linux-arm.csproj
is something like this:But due the fact that I have to support diferent RIDs I create a
Mraa.runtime.linux-x64
with the same aproach but forlinux-x64
, and the list could continuate for diferent RIDsNow, I create a
Mraa.runtimes
that just referenciate all the specific RIDs, like this:What I'm doing wrong? I expect that when working with OS Any and Arch Any, unpack everything. If publish with Os Any and Arch Any, unpack everything. If a project have just unpack that required runtimes.
If publish with --runtime linux-arm just publish the linux-arm .so
Also, can I pack inside
runtime/<rid>/native/
executable files, like .exe, .py, .ps1, .cmd, .sh?Can somebody point me to a standard documentation, or a convention?
Copied from original issue: Microsoft/msbuild#3909