Closed jsakamoto closed 4 years ago
Looks really good!
I'll check out the branch and do a bit of a sanity check - but I think everything is in order 👍
I'm appreciating spending your time on this pull request! And thanks once more for your great works!
I had a few issues running tests - but that was more to do with the dev machine I was working on at the time.
It all looks good as is - will merge.
Thanks for the PR, and all related information 👍
Hi, Thank you for your great works.
At first, excuse me that I send a pull request including many differences to you without any consultation, any notice.
Motivation
I want to use this library on my .NET Core 3.1 application by package referencing from nuget.org.
However, those NuGet packages that I can get from the above URL doesn't contain a binary suitable for the .NET Core app. It just only contains binaries for .NET Framework 4.0 and .NET Framework 4.5.
I was searching inside of your GitHub repository, and I found that the repository contains the .NET Standard edition project file. I found also .nuspec files are there, but those .nuspec files don't contain descriptions of .NET Standard edition binary files.
So I want to help you to publish a newer version of these libraries that contain .NET Standard edition binaries, therefore I decided to send this pull request for you.
Technical Background
Recently, we can use an "SDK style" project file to developing any C# programming even though class libraries.
May be already you know, an SDK style project file allows us to make multi-targeting frameworks class library easier.
We have to do that is just listing the target framework's TFM (Target Framework Moniker) inside a
<TargetFrameworks>
element in a project file, like this.And, an SDK style project file also allows us to create a NuGet package file without .nuspec file.
I used these technics, I succeeded that updating these libraries' projects to include not only .NET4.0 and 4.5 but also .NET Standard. Furthermore, those project files can be creatable a NuGet package by a single click on VisualStudio GUI.
Before and after of this pull request
By using the "SDK style" project file, I integrated many project files (Shared project file, and project files for each of frameworks) and nuspec file into a single "SDK style" project file.
fig.1 Before
fig.2 After
I applyed this change to
AudioSwitcher.AudioApi
andAudioSwitcher.AudioApi.CoreAudio
.(I didn't apply this change to
AudioSwitcher.Scripting.JavaScript
.)To create a NuGet package on Visual Studio, right-click the project in solution explorer window to open a context menu, and just click
[Pack]
menu item in the context menu.fig.3 Manipulating Visual Studio to create the NuGet package
After click
[Pack]
menu item, a NuGet package file will be generated in the output folder. (such as "./bin/Debug", "./bin/Relese")fig.4 The output folder and the generated NuGet package file
The internal structure of the generated NuGet package file includes binaries for each target framework and includes information of dependencies for each target framework.
fig.5 Showing the internal structure of the generated NuGet package via "NuGet package Explorer"
To change the version number of the NuGet package, open .csproj file in an editor and edit the value of
<Version>
element.fig.6 Editing the package version in the .csproj file
I didn't touch any C# source codes, so all unit test cases were passed after these project structure's changes.
fig.7 The results of unit testing
Important Notice
I couldn't build with the "Release" configuration due to I don't have the credential information for using "api.pfx".
fig.8 A screen shot of build errors list
Conclusion
I can imagine that you will surprise due to receive a many-change lines pull request. But I hope please don't be afraid it because quite a few changes in this pull request is just changing project reference, like from "AudioSwitcher.AudioApi (NETStandard2.0).csproj" to "AudioSwitcher.AudioApi.csproj".
I will not mind if this pull request is rejected if the NuGet package becomes including .NET Standard binary in another way.
Because I hope that you and everyone who are .NET Core app developers become happy by the NuGet packages will include .NET Standard binary, regardless of how or who is implemented.
Anyway, thank you for your great works, and thank you for reading this long pull request message form me.