Closed JensMunkHansen closed 9 months ago
I figured it out, I encountered some weird renaming of the .so's.
few points:
Most name are derived from the CMake Project name or from DOTNET_PACKAGE
https://github.com/Mizux/dotnet-native/blob/c2cd57ef86cc158f47373f2c47eb96333e4e3d1b/CMakeLists.txt#L13
https://github.com/Mizux/dotnet-native/blob/c2cd57ef86cc158f47373f2c47eb96333e4e3d1b/cmake/dotnet.cmake#L22-L23
https://github.com/Mizux/dotnet-native/blob/c2cd57ef86cc158f47373f2c47eb96333e4e3d1b/cmake/dotnet.cmake#L45
https://github.com/Mizux/dotnet-native/blob/c2cd57ef86cc158f47373f2c47eb96333e4e3d1b/cmake/dotnet.cmake#L94
Assembly name for meta package is templated https://github.com/Mizux/dotnet-native/blob/c2cd57ef86cc158f47373f2c47eb96333e4e3d1b/dotnet/Mizux.DotnetNative.csproj.in#L8 https://github.com/Mizux/dotnet-native/blob/c2cd57ef86cc158f47373f2c47eb96333e4e3d1b/dotnet/Mizux.DotnetNative.csproj.in#L16
good point some assembly name for the runtime package are note "templated" https://github.com/Mizux/dotnet-native/blob/c2cd57ef86cc158f47373f2c47eb96333e4e3d1b/dotnet/Mizux.DotnetNative.runtime.csproj.in#L6 https://github.com/Mizux/dotnet-native/blob/c2cd57ef86cc158f47373f2c47eb96333e4e3d1b/dotnet/Mizux.DotnetNative.runtime.csproj.in#L15 note: this name is also use by SWIG when generating its wrapper: https://github.com/Mizux/dotnet-native/blob/c2cd57ef86cc158f47373f2c47eb96333e4e3d1b/Foo/dotnet/CMakeLists.txt#L4 So I should specify it in dotnet.cmake than passe it/use it here and there
On my way to make it more generic, the goal is for anyone to be able to change one or two name then everything just work
Hope you'll better understand how it works... On my way to reduce the Misux/DotnetNative string to 1 occurence if possible...
Thank you so much. I got it to work without hanging for connecting to nuget.org, also went through a bunch of renaming, but I got a little stuck when I encountered .so's being named DotNetNative and not dotnotnative, but that was due to NuGet being pulled from my local repo. I started out from scratch with cherry-picking and slowly found out why I need the different parts. A little easier to interate on a smaller problem. But, really nice that somebody is sharing an elegant use SWIG and C#. Used SWIG for almost two decades, but never with C#.
dotnet nuget locals all --clear
and cleaning ~/.dotnet/packs/
when testing is a life saver ;)
Not in any way a fan Microsoft, but in my current job it is a necessary evil. CMake, SWIG and other tooling can make life easier.
https://github.com/Mizux/dotnet-native/blob/bd8b83f3e6fe5610bd6b52bfaac6a992e5230cd8/CMakeLists.txt#L13-L14
note: project(Name
will generate the PROJECT_NAME
...
see: https://cmake.org/cmake/help/latest/command/project.html
Then generate the native library name from both variables... https://github.com/Mizux/dotnet-native/blob/bd8b83f3e6fe5610bd6b52bfaac6a992e5230cd8/cmake/dotnet.cmake#L99
You could consider renaming Mizux.DotnetNative.csproj
to CompanyName.DotnetNative.csproj
, if not you will get into some trouble.
CompanyName.ProjectName
of course and with/without runtime. The runtime in the test libraries, you have updated...
Hi Mizux
I tried to generalize your setup a bit fill out the missing parts of the
.csproj.in
packages. Something that I cannot get my head around are:I removed the NuGet repository to avoid uploading to
nuget.org
, such thatRestoreSources
only contains a local package dir. Do I need to upload stuff or can I use a local directory?I can build everything but not execute the C# tests. It insists on naming stuff
Mizux
andDotNetNative
but only runtime.