Add native and utils projects

This commit is contained in:
2024-09-03 19:21:23 -03:00
parent 5ed285c0bc
commit d3a5e754fe
12 changed files with 163 additions and 1 deletions

View File

@ -1,12 +1,16 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tribufu.Sdk", "src\Tribufu.Sdk\Tribufu.Sdk.csproj", "{C66D6B57-324D-EAF2-3B65-75C9A7C35054}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tribufu.Native", "src\Tribufu.Native\Tribufu.Native.csproj", "{C66D6B57-324D-EAF2-3B65-75C9A7C35054}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tribufu.Serialization", "src\Tribufu.Serialization\Tribufu.Serialization.csproj", "{322FE36B-9E9B-9E66-678F-36C4D3BAC0CE}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tribufu.Serialization.Newtonsoft", "src\Tribufu.Serialization.Newtonsoft\Tribufu.Serialization.Newtonsoft.csproj", "{B7019B7B-A352-86BD-CCB6-747FB8661927}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tribufu", "src\Tribufu\Tribufu.csproj", "{7B7890D8-863A-4F1D-98C0-4B7D8C46CB52}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tribufu.Utils", "src\Tribufu.Utils\Tribufu.Utils.csproj", "{8F16FBBB-199E-4EE3-BFF3-31DD6F84DCD0}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@ -25,6 +29,14 @@ Global
{B7019B7B-A352-86BD-CCB6-747FB8661927}.Debug|Any CPU.Build.0 = Debug|Any CPU
{B7019B7B-A352-86BD-CCB6-747FB8661927}.Release|Any CPU.ActiveCfg = Release|Any CPU
{B7019B7B-A352-86BD-CCB6-747FB8661927}.Release|Any CPU.Build.0 = Release|Any CPU
{7B7890D8-863A-4F1D-98C0-4B7D8C46CB52}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{7B7890D8-863A-4F1D-98C0-4B7D8C46CB52}.Debug|Any CPU.Build.0 = Debug|Any CPU
{7B7890D8-863A-4F1D-98C0-4B7D8C46CB52}.Release|Any CPU.ActiveCfg = Release|Any CPU
{7B7890D8-863A-4F1D-98C0-4B7D8C46CB52}.Release|Any CPU.Build.0 = Release|Any CPU
{8F16FBBB-199E-4EE3-BFF3-31DD6F84DCD0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{8F16FBBB-199E-4EE3-BFF3-31DD6F84DCD0}.Debug|Any CPU.Build.0 = Debug|Any CPU
{8F16FBBB-199E-4EE3-BFF3-31DD6F84DCD0}.Release|Any CPU.ActiveCfg = Release|Any CPU
{8F16FBBB-199E-4EE3-BFF3-31DD6F84DCD0}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE

View File

@ -0,0 +1,28 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<PackageId>Tribufu.Native</PackageId>
<Version>0.1.0</Version>
<Description>Tribufu Native Interop</Description>
<Authors>Tribufu</Authors>
<Company>Tribufu</Company>
<PackageReadmeFile>README.md</PackageReadmeFile>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<Copyright>Copyright (c) Tribufu. All Rights Reserved.</Copyright>
<RepositoryType>git</RepositoryType>
<RepositoryUrl>https://github.com/Tribufu/TribufuNet</RepositoryUrl>
</PropertyGroup>
<PropertyGroup>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<TargetFrameworks>netstandard2.0;net45;net5.0</TargetFrameworks>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
</PropertyGroup>
<ItemGroup>
<None Include="..\..\vendor\windows-aarch64\tribufu_sdk.dll" Pack="true" PackagePath="runtimes\win-arm64\native\" />
<None Include="..\..\vendor\windows-i686\tribufu_sdk.dll" Pack="true" PackagePath="runtimes\win-x86\native\" />
<None Include="..\..\vendor\windows-x86_64\tribufu_sdk.dll" Pack="true" PackagePath="runtimes\win-x64\native\" />
</ItemGroup>
<ItemGroup>
<None Include="README.md" Pack="true" PackagePath="\" />
</ItemGroup>
</Project>

View File

@ -0,0 +1,13 @@
// Copyright (c) Tribufu. All Rights Reserved.
// SPDX-License-Identifier: MIT
using System.Runtime.InteropServices;
namespace Tribufu.Native
{
public class TribufuNative
{
[DllImport("tribufu_sdk")]
public static extern void tribufu_sdk_shutdown();
}
}

View File

@ -0,0 +1 @@
# Tribufu

View File

@ -0,0 +1,25 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<PackageId>Tribufu.Utils</PackageId>
<Version>0.1.0</Version>
<Description>Tribufu Utils</Description>
<Authors>Tribufu</Authors>
<Company>Tribufu</Company>
<PackageReadmeFile>README.md</PackageReadmeFile>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<Copyright>Copyright (c) Tribufu. All Rights Reserved.</Copyright>
<RepositoryType>git</RepositoryType>
<RepositoryUrl>https://github.com/Tribufu/TribufuNet</RepositoryUrl>
</PropertyGroup>
<PropertyGroup>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<TargetFrameworks>net5.0</TargetFrameworks>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
</PropertyGroup>
<ItemGroup>
</ItemGroup>
<ItemGroup>
<None Include="README.md" Pack="true" PackagePath="\" />
</ItemGroup>
</Project>

View File

@ -0,0 +1,79 @@
// Copyright (c) Tribufu. All Rights Reserved.
// SPDX-License-Identifier: MIT
using System;
using System.IO;
using System.Runtime.InteropServices;
namespace Tribufu.Utils
{
public static class TribufuAppContext
{
public static string GetBaseDirectory()
{
string defaultBaseDirectory = AppContext.BaseDirectory;
string baseDirectory;
if (defaultBaseDirectory.Contains("Debug") || defaultBaseDirectory.Contains("Release"))
{
baseDirectory = Path.Combine(defaultBaseDirectory, "..", "..", "..", "..", "..");
}
else
{
baseDirectory = Path.Combine(defaultBaseDirectory, "..", "..");
}
baseDirectory = Path.GetFullPath(baseDirectory);
return baseDirectory;
}
public static string GetBinDirectory()
{
var binDirectory = Path.Combine(GetBaseDirectory(), "bin");
switch (RuntimeInformation.RuntimeIdentifier)
{
case "win-x64":
binDirectory = Path.Combine(binDirectory, "windows-x86_64");
break;
case "osx-x64":
binDirectory = Path.Combine(binDirectory, "mac-x86_64");
break;
case "linux-x64":
binDirectory = Path.Combine(binDirectory, "linux-x86_64");
break;
default:
binDirectory = Path.Combine(binDirectory, "dotnet");
break;
}
return binDirectory;
}
public static string GetConfigDirectory()
{
return Path.Combine(GetBaseDirectory(), "config");
}
public static string GetAssetsDirectory()
{
return Path.Combine(GetBaseDirectory(), "assets");
}
public static string GetSavedDirectory()
{
return Path.Combine(GetBaseDirectory(), "saved");
}
public static string GetCacheDirectory()
{
return Path.Combine(GetSavedDirectory(), "cache");
}
public static string GetLogsDirectory()
{
return Path.Combine(GetSavedDirectory(), "logs");
}
}
}

1
src/Tribufu/README.md Normal file
View File

@ -0,0 +1 @@
# Tribufu

View File

@ -17,6 +17,9 @@
<TargetFrameworks>netstandard2.0;net45;net5.0</TargetFrameworks>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\Tribufu.Native\Tribufu.Native.csproj" />
</ItemGroup>
<ItemGroup>
<None Include="README.md" Pack="true" PackagePath="\" />
</ItemGroup>

BIN
vendor/windows-aarch64/tribufu_sdk.dll vendored Normal file

Binary file not shown.

BIN
vendor/windows-i686/tribufu_sdk.dll vendored Normal file

Binary file not shown.

BIN
vendor/windows-x86_64/tribufu_sdk.dll vendored Normal file

Binary file not shown.