Nuget copy native Linux targeted library

This commit is contained in:
code liturgy 2022-11-28 17:41:46 +00:00
parent 1f7bbff842
commit be2366eb83
7 changed files with 48 additions and 13 deletions

9
Directory.Build.props Normal file
View File

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<PackageReference Include="Nerdbank.GitVersioning">
<Version>3.4.22</Version>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
</ItemGroup>
</Project>

13
Sharp.Augeas/.nuspec Normal file
View File

@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
<metadata>
<id>Example</id>
<version>1.0.0</version>
<authors>Example</authors>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<description>Example</description>
</metadata>
<files>
<file src="libclAugeas.so" target="Platform\libclAugeas.so" />
</files>
</package>

View File

@ -9,6 +9,14 @@ namespace Sharp.Augeas
[SuppressUnmanagedCodeSecurity]
public static unsafe class AugeasExtern
{
/// <summary>
/// Used by DllImport to load the native library
/// </summary>
///
private const string _libName = "clAugeas";
[DllImport(_libName)]
public static extern IntPtr init_aug(AugSettings settings, int flags);
@ -18,10 +26,6 @@ namespace Sharp.Augeas
[DllImport(_libName)]
public static extern void free_str(IntPtr str);
/// <summary>
/// Used by DllImport to load the native library
/// </summary>
private const string _libName = "clAugeas";
/// <summary>Test calling</summary>
[DllImport(_libName)]

View File

@ -5,19 +5,28 @@
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>disable</Nullable>
<DockerDefaultTargetOS>Linux</DockerDefaultTargetOS>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<RootNamespace>Sharp.Augeas</RootNamespace>
<PackageProjectUrl>https://git.codeliturgy.com/P0/Sharp.Augeas</PackageProjectUrl>
<PackageVersion>$(Version)</PackageVersion>
<PublishRepositoryUrl>true</PublishRepositoryUrl>
<RepositoryUrl>https://git.codeliturgy.com/P0/Sharp.Augeas</RepositoryUrl>
</PropertyGroup>
<ItemGroup>
<ContentWithTargetPath Include="root\**">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<TargetPath>root\%(RecursiveDir)\%(Filename)%(Extension)</TargetPath>
</ContentWithTargetPath>
<PackageReference Update="Nerdbank.GitVersioning">
<Version>3.5.109</Version>
</PackageReference>
</ItemGroup>
<ItemGroup>
<Content Include="./Platform/Linux/libclAugeas.so">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<PackageReference Update="Nerdbank.GitVersioning">
<Version>3.5.109</Version>
</PackageReference>
</ItemGroup>
<ItemGroup>
<Content Include="libclAugeas.so">
<Pack>true</Pack>
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
</ItemGroup>
</Project>

BIN
Sharp.Augeas/libclAugeas.so Executable file

Binary file not shown.

View File

@ -1,6 +1,6 @@
{
"$schema": "https://raw.githubusercontent.com/dotnet/Nerdbank.GitVersioning/master/src/NerdBank.GitVersioning/version.schema.json",
"version": "0.9",
"version": "1.1",
"semVer1NumericIdentifierPadding": 1,
"publicReleaseRefSpec": [
"^refs/heads/master$",