Edit: CI build is working now. Next step is to update the native libs to HDF5 1.10.5.1 to allow the tests to pass. The problem was the native lib path finding mechanism. Hopefully we'll find a generic solution for this with .NET Core 3.
This pull request is related to #127 and should not be merged since it simply deletes all files and replaces them with a new project structure. Instead its purpose is to show how a pure and minimalistic .NET Standard project structure could look like.
Credits go to @surban, from whom I borrowed some code for this PR.
In PR #127, I suggested to create a second .csproj file for .NET Standard builds of HDF.PInvoke. I prepared a PR for this (and the discussion tomorrow), but in the end I found it a little confusing to mix both project styles. My intention was to show how an absolute minimum solution for .NET Standard could look like. Therefore, I finally came up with the following:
I create a new repository and added the original repository as submodule to get access to all original files. You can find the suggested projecte strucuture >here<.
I put a Directory.Build.props into the root folder to centralize common properties. This file specifies all NuGet relevant data (like version and author) and redirects all output data (bin and debug folder) to the top level folder artifacts. This folder appears after the first build and also contains the generated NuGet package.
A few words to the other elements:
The runtimes folder contains the OS specific native DLLs and libs.
The src folder contains all projects (currently only one :-)
The submodules folder contains the HDF.PInvoke submodule.
The test folder contains the unit tests and NuGet tests.
appveyor.yml uses Powershell Core commands to build and test the solution on Windows and Linux (OSX support is hopefully coming soon)
The rest should be self explaining.
The contents of the .csproj files could be reduced to a minimum using wildcards to include the source located in the submodule.
The NuGet package is generated on each build and put into the ./artifacts/packages folder
Three files were replaced (Constants.cs, H5DLLImporter.cs, NativeDependencies.cs) since they were partially incompatible with .NET Standard. Thus, there is now a modified copy of them in ./src/HDF.PInvoke.NETStandard/.
I was able to build the solution and run all tests successfully locally on my PC. Unfortunately the tests are not working on AppVeyor but I think it is only a small bug which I could not find today.
Hopefully I could help with this sample implementation. Maybe it a good idea to keep HDF.PInvoke untouched and have a second repository for .NET Standard development instead. With the submodule included, there is only a minimum of code duplication which can be reduced to zero with a few simple modifications in the original repository.
Note: The native libs are simply copied from @surban and are not the newest version. This means that some unit tests cannot pass. I guess getting the native libs automatically during the build will be the biggest discussion point.
Edit: CI build is working now. Next step is to update the native libs to HDF5 1.10.5.1 to allow the tests to pass. The problem was the native lib path finding mechanism. Hopefully we'll find a generic solution for this with .NET Core 3.
This pull request is related to #127 and should not be merged since it simply deletes all files and replaces them with a new project structure. Instead its purpose is to show how a pure and minimalistic .NET Standard project structure could look like.
Credits go to @surban, from whom I borrowed some code for this PR.
In PR #127, I suggested to create a second .csproj file for .NET Standard builds of HDF.PInvoke. I prepared a PR for this (and the discussion tomorrow), but in the end I found it a little confusing to mix both project styles. My intention was to show how an absolute minimum solution for .NET Standard could look like. Therefore, I finally came up with the following:
artifacts
. This folder appears after the first build and also contains the generated NuGet package.runtimes
folder contains the OS specific native DLLs and libs.src
folder contains all projects (currently only one :-)submodules
folder contains the HDF.PInvoke submodule.test
folder contains the unit tests and NuGet tests.appveyor.yml
usesPowershell Core
commands to build and test the solution on Windows and Linux (OSX support is hopefully coming soon)./artifacts/packages
folderConstants.cs
,H5DLLImporter.cs
,NativeDependencies.cs
) since they were partially incompatible with .NET Standard. Thus, there is now a modified copy of them in./src/HDF.PInvoke.NETStandard/
.I was able to build the solution and run all tests successfully locally on my PC. Unfortunately the tests are not working on AppVeyor but I think it is only a small bug which I could not find today.
Hopefully I could help with this sample implementation. Maybe it a good idea to keep HDF.PInvoke untouched and have a second repository for .NET Standard development instead. With the submodule included, there is only a minimum of code duplication which can be reduced to zero with a few simple modifications in the original repository.
Note: The native libs are simply copied from @surban and are not the newest version. This means that some unit tests cannot pass. I guess getting the native libs automatically during the build will be the biggest discussion point.