New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Generate nuget package for System.Device.Gpio #28
Conversation
I love taking advantage of the reference assemblies to provide multiple implementations. Imagine there are two devices (such as OrangePi or RasperryPi) supporting a different pull-up resistor configuration. Both can run Ubuntu, so I can't differentiate the GPIO library by RIDs. I would post this in the nuget repo, but it would be hard to explain as this example perfectly match on hardware libraries (but I have other non-hw scenarios in mind). |
For physical devices, like RaspberryPi or Hummingboards, what we are doing is that the Linux implementation contains those different drivers that are tied to different boards. We also have some default constructors that depending on the board you are running on, it will get you the driver that best applies, but this can only be done at runtime, so it can't be a NuGet feature. |
@joperezr I get your point, but I still see a value in taking a different implementation depending on a value specified in the referencing project. This could avoid a lot of pre-processor directives in the final app. |
<PackageTags>.NET Core GPIO Pins BCM2835 Raspberry Pi IoT</PackageTags> | ||
</PropertyGroup> | ||
|
||
<Import Project="..\..\Directory.Build.props" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We typically import this one at the beginning to respect the sdk convention in hierarchy
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The problem is that that one will import the arcade sdk, which will set the Version of the package, so I want to set Major and Minor version first.
<Project> | ||
<!-- Packaging related properties --> | ||
<PropertyGroup> | ||
<MajorVersion>0</MajorVersion> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are you planning on sharing a version across packages?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is to set the package version. It will also set the Assembly version for now but that is fine because I also want that to be 0.1.0.0. Once we ship a different version of assembly this will change.
<!-- Only produce reference assembly in one of our inner builds --> | ||
<ProduceReferenceAssembly Condition="'$(TargetsWindows)' == 'true'">true</ProduceReferenceAssembly> | ||
<TargetRefPath>$(OutputPath)$(TargetFramework)\$(MSBuildProjectName).dll</TargetRefPath> | ||
<IsPackable>true</IsPackable> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought you had to set a IncludeBuildOutput property and set it to false so that it doesn't include it in the package.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That is set in the Directory.Build.props of this project. I wanted to move all the packaging related things over there, except for this property so that when we look at the project we know that this project will generate a package.
cc: @ericstj @safern
These changes will add the required targets in order to produce a package for System.Device.Gpio. For now, it will have the following layout:
We will also need to eventually add one more asset
lib/netstandard2.0/SYstem.Device.Gpio.dll
to be a turd assembly so that we do in fact support netstandard2.0