Everything about Nuget packages
Lua version 5.4.4 has been released.
For now, I stayed with AppVeyor to build the actual binaries. Because, it was a one-click change. But, I am thinking of changing to github actions with one of the next udpates. Not sure. Maybe I won’t. Never change a running system, right.
This was interesting, because it was the first nuget package update on my new computer. A test, whether or not I included all required files in the repository. And the test was a success. The update was easy, just like planned.
Somehow, I never liked GetOpt. I am not convinced by all details of GFlags as well. But, it is the better option than whipping up some CmdLine parser myself.
For the nuget package I focused only on the thread-safe static library. If you need another variant, feel free to reuse my AppVeyor artifacts. Those include basically everything.
As usual, the package code is free: https://bitbucket.org/sgrottel_nuget/gflags_nuget
The community for native library nugets seems not very active. I assume most people use cmake, and have to use some extra scripting for some platform dependent package management, or something. I don’t know. I still like nuget a lot. And so, without further ado: my new Nuget package for LibYAML.
As usual, package code is free: https://bitbucket.org/sgrottel_nuget/libyaml-nuget
Previously, I wrote about using one global msbuild xml file to override nuget package content for local development. While this does work, it comes with a warning if multiple packages use this mechanism:
***Test\packages\***.0.7.1-prerelease-\build\native\***.targets(7,5): warning MSB4011: "***Test\packagesoverride.xml.user" cannot be imported again. It was already imported at "***Test\packages\***.0.7.1-prerelease-\build\native\***.targets (6,3)". This is most likely a build authoring error. This subsequent import will be ignored. [***Test\***Test.vcxproj]
While this is not realy a problem, it is a warning. And I don’t like warning. I like my projects to build entirly without warnings.
A soltion for this comes from classic c++ programming: use an include guard. These are the changes required:
packagesoverride.xml.user must define a default variable. I named it
<?xml version="1.0" encoding="utf-8"?> <Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <PropertyGroup> <HAS_packagesoverride>True</HAS_packagesoverride> <NugetDevPackageTest_testLib_DevDir>C:\Dev\SomeProject\Dir</NugetDevPackageTest_testLib_DevDir> </PropertyGroup> </Project>
And now importing this xml in the nuget packages’ target files can this for this variable to avoid multiple import:
<?xml version="1.0" encoding="utf-8"?> <Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" InitialTargets="FaroMorfCopySymbols"> <!-- Import override settings, if they exist --> <ImportGroup> <Import Condition="Exists('$(SolutionDir)packagesoverride.xml.user') and '$(HAS_packagesoverride)' != 'True'" Project="$(SolutionDir)packagesoverride.xml.user" /> </ImportGroup> <!-- ... -->