Skip to content
This repository has been archived by the owner on Jul 30, 2024. It is now read-only.

Commit

Permalink
Merge remote-tracking branch 'origin/main'
Browse files Browse the repository at this point in the history
  • Loading branch information
AptiviCEO committed Feb 6, 2024
2 parents c05dab6 + fbbae25 commit fe70639
Show file tree
Hide file tree
Showing 16 changed files with 308 additions and 93 deletions.
3 changes: 0 additions & 3 deletions NativeLand/AssemblyAttributes.cs

This file was deleted.

57 changes: 0 additions & 57 deletions NativeLand/Exceptions.cs

This file was deleted.

44 changes: 44 additions & 0 deletions NativeLand/Exceptions/NoBinaryForPlatformException.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
//
// NativeLand Copyright (C) 2023-2024 Aptivi
//
// This file is part of NativeLand
//
// NativeLand is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// NativeLand is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY, without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
//

using System;

namespace NativeLand.Exceptions
{
/// <summary>
/// Thrown when there is no binary for current platform and bitness.
/// </summary>
public class NoBinaryForPlatformException : Exception
{
/// <inheritdoc />
public NoBinaryForPlatformException()
{
}

/// <inheritdoc />
public NoBinaryForPlatformException(string message) : base(message)
{
}

/// <inheritdoc />
public NoBinaryForPlatformException(string message, Exception innerException) : base(message, innerException)
{
}
}
}
44 changes: 44 additions & 0 deletions NativeLand/Exceptions/UnsupportedPlatformException.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
//
// NativeLand Copyright (C) 2023-2024 Aptivi
//
// This file is part of NativeLand
//
// NativeLand is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// NativeLand is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY, without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
//

using System;

namespace NativeLand.Exceptions
{
/// <summary>
/// Thrown when platform is not supported.
/// </summary>
public class UnsupportedPlatformException : Exception
{
/// <inheritdoc />
public UnsupportedPlatformException()
{
}

/// <inheritdoc />
public UnsupportedPlatformException(string message) : base(message)
{
}

/// <inheritdoc />
public UnsupportedPlatformException(string message, Exception innerException) : base(message, innerException)
{
}
}
}
21 changes: 20 additions & 1 deletion NativeLand/LibraryFile.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,23 @@
namespace NativeLand
//
// NativeLand Copyright (C) 2023-2024 Aptivi
//
// This file is part of NativeLand
//
// NativeLand is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// NativeLand is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY, without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
//

namespace NativeLand
{
/// <summary>
/// A class to store the information about native library file.
Expand Down
28 changes: 24 additions & 4 deletions NativeLand/LibraryItem.cs
Original file line number Diff line number Diff line change
@@ -1,12 +1,32 @@
//
// NativeLand Copyright (C) 2023-2024 Aptivi
//
// This file is part of NativeLand
//
// NativeLand is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// NativeLand is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY, without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
//

using NativeLand.Tools;
using System;
using System.Runtime.InteropServices;

namespace NativeLand
{
/// <summary>
/// Library binaries for specified platform and bitness.
/// </summary>
public class LibraryItem
/// <summary>
/// Library binaries for specified platform and bitness.
/// </summary>
public class LibraryItem
{
/// <summary>
/// Makes a new instance of this class
Expand Down
20 changes: 20 additions & 0 deletions NativeLand/LibraryItemInternal.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,28 @@
//
// NativeLand Copyright (C) 2023-2024 Aptivi
//
// This file is part of NativeLand
//
// NativeLand is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// NativeLand is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY, without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
//

using System;
using System.IO;
using System.Runtime.InteropServices;
using System.Security.Cryptography;
using Microsoft.Extensions.Logging;
using NativeLand.Tools;

namespace NativeLand
{
Expand Down
23 changes: 22 additions & 1 deletion NativeLand/LibraryManager.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,29 @@
using System;
//
// NativeLand Copyright (C) 2023-2024 Aptivi
//
// This file is part of NativeLand
//
// NativeLand is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// NativeLand is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY, without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
//

using System;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices;
using Microsoft.Extensions.Logging;
using NativeLand.Exceptions;
using NativeLand.Tools;

namespace NativeLand
{
Expand Down
8 changes: 8 additions & 0 deletions NativeLand/NativeLand.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
<PackageProjectUrl>https://github.com/Aptivi/NativeLand</PackageProjectUrl>
<PackageReadmeFile>README.md</PackageReadmeFile>
<RepositoryUrl>git://github.com/Aptivi/NativeLand.git</RepositoryUrl>
<PackageIcon>OfficialAppIcon-NativeLand-512.png</PackageIcon>
<RepositoryType>git</RepositoryType>
<PackageTags>hardware, information</PackageTags>
<DisableImplicitNamespaceImports>true</DisableImplicitNamespaceImports>
Expand Down Expand Up @@ -42,4 +43,11 @@
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="8.0.0" PrivateAssets="All" />
</ItemGroup>

<ItemGroup>
<None Include="OfficialAppIcon-NativeLand-512.png">
<Pack>True</Pack>
<PackagePath>\</PackagePath>
</None>
</ItemGroup>

</Project>
Binary file added NativeLand/OfficialAppIcon-NativeLand-512.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 0 additions & 21 deletions NativeLand/Platform.cs

This file was deleted.

22 changes: 22 additions & 0 deletions NativeLand/Properties/AssemblyAttributes.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
//
// NativeLand Copyright (C) 2023-2024 Aptivi
//
// This file is part of NativeLand
//
// NativeLand is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// NativeLand is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY, without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
//

using System.Runtime.CompilerServices;

[assembly: InternalsVisibleTo("UnitTests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100812e5231186da64504a543d5306da254e9062027fdaee10f569d93ecc1debc91770d1a077b762aea3ced57c09d9f033f9991960429980b625908628c80785a67a3b65bbb410c7623a0d7bbc1a9770b978358941714b5e2a806e5aa8fa58bb505f859be5fc3ebcce5b2c5d4c0820460c9d3e23cf66f3c00de5e0d154fec6a89b3")]
23 changes: 21 additions & 2 deletions NativeLand/PathHelper.cs → NativeLand/Tools/PathHelper.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,27 @@
//
// NativeLand Copyright (C) 2023-2024 Aptivi
//
// This file is part of NativeLand
//
// NativeLand is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// NativeLand is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY, without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
//

using System;
using System.IO;
using System.Reflection;

namespace NativeLand
namespace NativeLand.Tools
{
/// <summary>
/// Contains useful functions to get paths relative to target assembly.
Expand Down Expand Up @@ -38,7 +57,7 @@ public static string GetCurrentDirectory(this Assembly targetAssembly)
/// <param name="fileName">Right-hand part of the path.</param>
public static string CombineWithCurrentDirectory(this Assembly targetAssembly, string fileName)
{
string curDir = GetCurrentDirectory(targetAssembly);
string curDir = targetAssembly.GetCurrentDirectory();
return !string.IsNullOrEmpty(curDir) ? Path.Combine(curDir, fileName) : fileName;
}
}
Expand Down
Loading

0 comments on commit fe70639

Please sign in to comment.