Skip to content

Commit

Permalink
Replace .NET Standard 2.1 with .NET Core 3.1
Browse files Browse the repository at this point in the history
  • Loading branch information
ied206 committed Feb 14, 2022
1 parent d34f31e commit 6d7416d
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 13 deletions.
13 changes: 7 additions & 6 deletions ManagedWimLib/ManagedWimLib.csproj
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net451;netstandard2.0;netstandard2.1</TargetFrameworks>
<TargetFrameworks Condition="'$(OS)' != 'Windows_NT'">netstandard2.0;netstandard2.1</TargetFrameworks>
<TargetFrameworks>net451;netstandard2.0;netcoreapp3.1</TargetFrameworks>
<TargetFrameworks Condition="'$(OS)' != 'Windows_NT'">netstandard2.0;netcoreapp3.1</TargetFrameworks>
<PackageId>ManagedWimLib</PackageId>
<Title>ManagedWimLib</Title>
<LangVersion>latest</LangVersion>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<Version>2.3.1</Version>
<Version>2.4.0</Version>
<Authors>Eric Biggers, Hajin Jang</Authors>
<Company>Joveler</Company>
<Description>Native wimlib wrapper library for .NET.
Expand All @@ -17,7 +17,8 @@ Supports Windows, Linux and macOS.</Description>
<PackageProjectUrl>https://github.com/ied206/ManagedWimLib</PackageProjectUrl>
<PackageIcon>images\Logo.png</PackageIcon>
<RepositoryUrl>https://github.com/ied206/ManagedWimLib</RepositoryUrl>
<PackageReleaseNotes>- Official support for ARM64 macOS.</PackageReleaseNotes>
<PackageReleaseNotes>- Official support for ARM64 macOS.
- Replace .NET Standard 2.1 target with .NET Core 3.1.</PackageReleaseNotes>
<PackageTags>wim wimlib dism imagex archive native pinvoke interop</PackageTags>
</PropertyGroup>
<!-- PackageReference -->
Expand All @@ -36,8 +37,8 @@ Supports Windows, Linux and macOS.</Description>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>
<!-- Native Library for .NET Standard 2.0 & 2.1 -->
<ItemGroup Condition="'$(TargetFramework)' == 'netstandard2.0' or '$(TargetFramework)' == 'netstandard2.1'">
<!-- Native Library for .NET Standard 2.0 & .NET Core 3.1 -->
<ItemGroup Condition="'$(TargetFramework)' == 'netstandard2.0' or '$(TargetFramework)' == 'netcoreapp3.1'">
<None Include="runtimes\win-x86\native\*.dll">
<Link>runtimes\win-x86\native\%(FileName)%(Extension)</Link> <!-- Project Reference -->
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ ManagedWimLib can be installed via [nuget](https://www.nuget.org/packages/Manage

### Targeted .NET platforms

- .NET Standard 2.1 (.NET Core 3.0+)
- .NET Standard 2.0 (.NET Framework 4.6.1+, .NET Core 2.0+)
- .NET Core 3.1
- .NET Standard 2.0
- .NET Framework 4.5.1

If you need .NET Standard 1.3 support, use [1.2.x version](https://www.nuget.org/packages/ManagedWimLib/1.2.4) instead.<br>
Expand Down
12 changes: 7 additions & 5 deletions USAGE.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,12 @@ public static void InitNativeLibrary()
}
```

#### For .NET Standard 2.0+:
#### For .NET Standard 2.0+, NET Core 3.1+:

```cs
public static void InitNativeLibrary()
{
string libBaseDir = AppDomain.CurrentDomain.BaseDirectory;
string libDir = "runtimes";
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
libDir = Path.Combine(libDir, "win-");
Expand All @@ -66,13 +67,14 @@ public static void InitNativeLibrary()
}
libDir = Path.Combine(libDir, "native");

// macOS ARM64 requires native library path to be absolute path.
string libPath = null;
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
libPath = Path.Combine(libDir, "libwim-15.dll");
libPath = Path.Combine(libBaseDir, libDir, "libwim-15.dll");
else if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux))
libPath = Path.Combine(libDir, "libwim.so");
libPath = Path.Combine(libBaseDir, libDir, "libwim.so");
else if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX))
libPath = Path.Combine(libDir, "libwim.dylib");
libPath = Path.Combine(libBaseDir, libDir, "libwim.dylib");

if (libPath == null)
throw new PlatformNotSupportedException($"Unable to find native library.");
Expand Down Expand Up @@ -100,7 +102,7 @@ ManagedWimLib comes with sets of binaries of `wimlib 1.13.4`. They will be copie

- Create an empty file named `ManagedWimLib.Precompiled.Exclude` in the project directory to prevent a copy of the package-embedded binary.

#### For .NET Standard 2.0+
#### For .NET Standard 2.0, NET Core 3.1+

| Platform | Binary | License |
|----------------------|-----------------------------------------------------|----------------------|
Expand Down

0 comments on commit 6d7416d

Please sign in to comment.