refactor: Put FFI in its own project
Signed-off-by: Sam Therapy <sam@samtherapy.net>
This commit is contained in:
parent
c79eb124a9
commit
213fe86329
31 changed files with 318 additions and 123 deletions
123
.editorconfig
Normal file
123
.editorconfig
Normal file
|
@ -0,0 +1,123 @@
|
|||
|
||||
[*.{cs,vb}]
|
||||
#### Naming styles ####
|
||||
|
||||
# Naming rules
|
||||
|
||||
dotnet_naming_rule.interface_should_be_begins_with_i.severity = suggestion
|
||||
dotnet_naming_rule.interface_should_be_begins_with_i.symbols = interface
|
||||
dotnet_naming_rule.interface_should_be_begins_with_i.style = begins_with_i
|
||||
|
||||
dotnet_naming_rule.types_should_be_pascal_case.severity = suggestion
|
||||
dotnet_naming_rule.types_should_be_pascal_case.symbols = types
|
||||
dotnet_naming_rule.types_should_be_pascal_case.style = pascal_case
|
||||
|
||||
dotnet_naming_rule.non_field_members_should_be_pascal_case.severity = suggestion
|
||||
dotnet_naming_rule.non_field_members_should_be_pascal_case.symbols = non_field_members
|
||||
dotnet_naming_rule.non_field_members_should_be_pascal_case.style = pascal_case
|
||||
|
||||
# Symbol specifications
|
||||
|
||||
dotnet_naming_symbols.interface.applicable_kinds = interface
|
||||
dotnet_naming_symbols.interface.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
|
||||
dotnet_naming_symbols.interface.required_modifiers =
|
||||
|
||||
dotnet_naming_symbols.types.applicable_kinds = class, struct, interface, enum
|
||||
dotnet_naming_symbols.types.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
|
||||
dotnet_naming_symbols.types.required_modifiers =
|
||||
|
||||
dotnet_naming_symbols.non_field_members.applicable_kinds = property, event, method
|
||||
dotnet_naming_symbols.non_field_members.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
|
||||
dotnet_naming_symbols.non_field_members.required_modifiers =
|
||||
|
||||
# Naming styles
|
||||
|
||||
dotnet_naming_style.begins_with_i.required_prefix = I
|
||||
dotnet_naming_style.begins_with_i.required_suffix =
|
||||
dotnet_naming_style.begins_with_i.word_separator =
|
||||
dotnet_naming_style.begins_with_i.capitalization = pascal_case
|
||||
|
||||
dotnet_naming_style.pascal_case.required_prefix =
|
||||
dotnet_naming_style.pascal_case.required_suffix =
|
||||
dotnet_naming_style.pascal_case.word_separator =
|
||||
dotnet_naming_style.pascal_case.capitalization = pascal_case
|
||||
|
||||
dotnet_naming_style.pascal_case.required_prefix =
|
||||
dotnet_naming_style.pascal_case.required_suffix =
|
||||
dotnet_naming_style.pascal_case.word_separator =
|
||||
dotnet_naming_style.pascal_case.capitalization = pascal_case
|
||||
dotnet_style_coalesce_expression = true:suggestion
|
||||
dotnet_style_null_propagation = true:suggestion
|
||||
dotnet_style_prefer_is_null_check_over_reference_equality_method = true:suggestion
|
||||
dotnet_style_prefer_auto_properties = true:warning
|
||||
dotnet_style_operator_placement_when_wrapping = beginning_of_line
|
||||
tab_width = 4
|
||||
indent_size = 4
|
||||
end_of_line = crlf
|
||||
dotnet_style_object_initializer = true:suggestion
|
||||
dotnet_style_prefer_simplified_boolean_expressions = true:suggestion
|
||||
dotnet_style_collection_initializer = true:suggestion
|
||||
dotnet_style_prefer_conditional_expression_over_return = true:silent
|
||||
dotnet_style_prefer_conditional_expression_over_assignment = true:silent
|
||||
dotnet_style_prefer_inferred_tuple_names = true:suggestion
|
||||
dotnet_style_explicit_tuple_names = true:suggestion
|
||||
dotnet_style_prefer_compound_assignment = true:suggestion
|
||||
dotnet_style_prefer_inferred_anonymous_type_member_names = true:suggestion
|
||||
dotnet_style_namespace_match_folder = true:suggestion
|
||||
dotnet_style_prefer_simplified_interpolation = true:suggestion
|
||||
dotnet_style_readonly_field = true:suggestion
|
||||
dotnet_style_predefined_type_for_locals_parameters_members = true:silent
|
||||
dotnet_style_predefined_type_for_member_access = true:silent
|
||||
dotnet_style_require_accessibility_modifiers = for_non_interface_members:silent
|
||||
dotnet_style_allow_multiple_blank_lines_experimental = false:silent
|
||||
dotnet_style_allow_statement_immediately_after_block_experimental = false:silent
|
||||
dotnet_code_quality_unused_parameters = all:warning
|
||||
dotnet_style_parentheses_in_arithmetic_binary_operators = always_for_clarity:silent
|
||||
dotnet_style_parentheses_in_other_binary_operators = always_for_clarity:silent
|
||||
dotnet_style_parentheses_in_relational_binary_operators = always_for_clarity:silent
|
||||
dotnet_style_parentheses_in_other_operators = never_if_unnecessary:silent
|
||||
|
||||
[*.cs]
|
||||
csharp_using_directive_placement = outside_namespace:silent
|
||||
csharp_prefer_simple_using_statement = true:suggestion
|
||||
csharp_prefer_braces = when_multiline:silent
|
||||
csharp_style_namespace_declarations = file_scoped:suggestion
|
||||
csharp_style_prefer_method_group_conversion = true:silent
|
||||
csharp_style_prefer_top_level_statements = true:suggestion
|
||||
csharp_style_expression_bodied_methods = when_on_single_line:silent
|
||||
csharp_style_expression_bodied_constructors = when_on_single_line:silent
|
||||
csharp_style_expression_bodied_operators = when_on_single_line:silent
|
||||
csharp_style_expression_bodied_properties = true:silent
|
||||
csharp_style_expression_bodied_indexers = true:silent
|
||||
csharp_style_expression_bodied_accessors = true:silent
|
||||
csharp_style_expression_bodied_lambdas = true:silent
|
||||
csharp_style_expression_bodied_local_functions = when_on_single_line:silent
|
||||
csharp_indent_labels = one_less_than_current
|
||||
csharp_style_throw_expression = true:suggestion
|
||||
csharp_style_prefer_null_check_over_type_check = true:suggestion
|
||||
csharp_prefer_simple_default_expression = true:suggestion
|
||||
csharp_style_prefer_local_over_anonymous_function = true:suggestion
|
||||
csharp_style_prefer_index_operator = true:suggestion
|
||||
csharp_style_implicit_object_creation_when_type_is_apparent = true:suggestion
|
||||
csharp_style_prefer_range_operator = true:suggestion
|
||||
csharp_style_prefer_tuple_swap = true:suggestion
|
||||
csharp_style_prefer_utf8_string_literals = true:suggestion
|
||||
csharp_style_deconstructed_variable_declaration = true:suggestion
|
||||
csharp_style_inlined_variable_declaration = true:suggestion
|
||||
csharp_style_unused_value_expression_statement_preference = discard_variable:silent
|
||||
csharp_style_unused_value_assignment_preference = discard_variable:suggestion
|
||||
csharp_prefer_static_local_function = true:suggestion
|
||||
csharp_style_prefer_readonly_struct = true:suggestion
|
||||
csharp_style_prefer_readonly_struct_member = true:suggestion
|
||||
csharp_style_allow_embedded_statements_on_same_line_experimental = true:silent
|
||||
csharp_style_allow_blank_lines_between_consecutive_braces_experimental = false:silent
|
||||
csharp_style_allow_blank_line_after_colon_in_constructor_initializer_experimental = false:silent
|
||||
csharp_style_allow_blank_line_after_token_in_conditional_expression_experimental = true:silent
|
||||
csharp_style_allow_blank_line_after_token_in_arrow_expression_clause_experimental = true:silent
|
||||
csharp_style_conditional_delegate_call = true:suggestion
|
||||
csharp_style_prefer_switch_expression = true:suggestion
|
||||
csharp_style_pattern_matching_over_is_with_cast_check = true:suggestion
|
||||
csharp_style_prefer_pattern_matching = true:silent
|
||||
csharp_style_pattern_matching_over_as_with_null_check = true:suggestion
|
||||
csharp_style_prefer_not_pattern = true:suggestion
|
||||
csharp_style_prefer_extended_property_pattern = true:suggestion
|
54
GNUmakefile
54
GNUmakefile
|
@ -1,52 +1,18 @@
|
|||
DOTNET ?= dotnet
|
||||
NETVERSION ?= net7.0
|
||||
PUBFLAGS ?= --framework $(NETVERSION) -c Release -p GeneratePackageOnBuild=false -p PublishAot=true -p AssemblyName=libxdg
|
||||
|
||||
ifeq ($(OS),Windows_NT)
|
||||
OSFLAG += win
|
||||
ifeq ($(PROCESSOR_ARCHITEW6432),AMD64)
|
||||
:= $(OSFLAG)-x64
|
||||
else
|
||||
ifeq ($(PROCESSOR_ARCHITECTURE),AMD64)
|
||||
:= $(OSFLAG)-x64
|
||||
endif
|
||||
ifeq ($(PROCESSOR_ARCHITECTURE),x86)
|
||||
:= $(OSFLAG)-x86
|
||||
endif
|
||||
endif
|
||||
else
|
||||
UNAME_S := $(shell uname -s)
|
||||
ifeq ($(UNAME_S),Linux)
|
||||
OSFLAG += linux
|
||||
endif
|
||||
ifeq ($(UNAME_S),Darwin)
|
||||
OSFLAG += osx
|
||||
endif
|
||||
UNAME_M := $(shell uname -m)
|
||||
ifeq ($(UNAME_M),x86_64)
|
||||
OSFLAG := $(OSFLAG)-x64
|
||||
endif
|
||||
ifeq ($(UNAME_M),x86)
|
||||
OSFLAG := $(OSFLAG)-x86
|
||||
endif
|
||||
ifeq ($(UNAME_M),arm64)
|
||||
OSFLAG := $(OSFLAG)-arm64
|
||||
endif
|
||||
ifeq ($(UNAME_M),arm)
|
||||
OSFLAG := $(OSFLAG)-arm
|
||||
endif
|
||||
endif
|
||||
|
||||
PUBFLAGS += -r $(OSFLAG)
|
||||
|
||||
publish: src/Xdg.Directories/bin/Release/$(NETVERSION)/$(OSFLAG)/publish
|
||||
|
||||
src/Xdg.Directories/bin/Release/$(NETVERSION)/$(OSFLAG)/publish:
|
||||
dotnet publish ./src/Xdg.Directories $(PUBFLAGS)
|
||||
.PHONY: publish
|
||||
publish:
|
||||
make DOTNET=$(DOTNET) NETVERSION=$(NETVERSION) -C src/Xdg.Directories.FFI publish
|
||||
|
||||
.PHONY: install
|
||||
install: publish
|
||||
make NETVERSION=$(NETVERSION) -C src/Xdg.Directories install
|
||||
make DOTNET=$(DOTNET) NETVERSION=$(NETVERSION) -C src/Xdg.Directories.FFI install
|
||||
|
||||
.PHONY: uninstall
|
||||
uninstall:
|
||||
make -C src/Xdg.Directories uninstall
|
||||
make -C src/Xdg.Directories.FFI uninstall
|
||||
|
||||
.PHONY: clean
|
||||
clean:
|
||||
make -C src/Xdg.Directories.FFI clean
|
||||
|
|
|
@ -62,7 +62,7 @@ dotnet add package Xdg.Directories
|
|||
```
|
||||
|
||||
### Native Library
|
||||
TODO: add documentation and examples for making and consuming the native library
|
||||
[View the README here](./src/Xdg.Directories.FFI/README.md)
|
||||
|
||||
## License
|
||||
[MIT](./LICENSE)
|
14
Xdg.Net.sln
14
Xdg.Net.sln
|
@ -1,4 +1,4 @@
|
|||
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio Version 17
|
||||
VisualStudioVersion = 17.5.33627.172
|
||||
|
@ -9,6 +9,14 @@ Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "Xdg.Benchmarks", "src\Xdg.B
|
|||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Xdg.Testing", "src\Xdg.Testing\Xdg.Testing.csproj", "{F5B4B166-F5F9-4D47-B426-CDA907C8B3E5}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Xdg.Directories.FFI", "src\Xdg.Directories.FFI\Xdg.Directories.FFI.csproj", "{7261AAFC-65AE-4456-BB9B-5AAC17B89B28}"
|
||||
EndProject
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{5A43E4AC-06BD-4311-AF36-616FE7C938CD}"
|
||||
ProjectSection(SolutionItems) = preProject
|
||||
.editorconfig = .editorconfig
|
||||
GNUmakefile = GNUmakefile
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
|
@ -27,6 +35,10 @@ Global
|
|||
{F5B4B166-F5F9-4D47-B426-CDA907C8B3E5}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{F5B4B166-F5F9-4D47-B426-CDA907C8B3E5}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{F5B4B166-F5F9-4D47-B426-CDA907C8B3E5}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{7261AAFC-65AE-4456-BB9B-5AAC17B89B28}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{7261AAFC-65AE-4456-BB9B-5AAC17B89B28}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{7261AAFC-65AE-4456-BB9B-5AAC17B89B28}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{7261AAFC-65AE-4456-BB9B-5AAC17B89B28}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
open BenchmarkDotNet.Attributes
|
||||
open BenchmarkDotNet.Attributes
|
||||
open BenchmarkDotNet.Running
|
||||
open BenchmarkDotNet.Jobs
|
||||
open Xdg.Directories;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<OutputType>Exe</OutputType>
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#if NET7_0_OR_GREATER
|
||||
#if NET7_0_OR_GREATER
|
||||
#pragma warning disable CA1031 // General exceptions needed for handling errors
|
||||
using System.Runtime.InteropServices;
|
||||
|
65
src/Xdg.Directories.FFI/GNUmakefile
Normal file
65
src/Xdg.Directories.FFI/GNUmakefile
Normal file
|
@ -0,0 +1,65 @@
|
|||
PREFIX ?= /usr/local
|
||||
LIB ?= lib64
|
||||
DOTNET ?= dotnet
|
||||
NETVERSION ?= net7.0
|
||||
PUBFLAGS ?= --framework $(NETVERSION) -c Release -p PublishAot=true
|
||||
|
||||
ifeq ($(OS),Windows_NT)
|
||||
OSFLAG += win
|
||||
ifeq ($(PROCESSOR_ARCHITEW6432),AMD64)
|
||||
OSFLAG := $(OSFLAG)-x64
|
||||
else
|
||||
ifeq ($(PROCESSOR_ARCHITECTURE),AMD64)
|
||||
OSFLAG := $(OSFLAG)-x64
|
||||
endif
|
||||
ifeq ($(PROCESSOR_ARCHITECTURE),x86)
|
||||
OSFLAG := $(OSFLAG)-x86
|
||||
endif
|
||||
endif
|
||||
else
|
||||
UNAME_S := $(shell uname -s)
|
||||
ifeq ($(UNAME_S),Linux)
|
||||
OSFLAG += linux
|
||||
endif
|
||||
ifeq ($(UNAME_S),Darwin)
|
||||
OSFLAG += osx
|
||||
endif
|
||||
UNAME_M := $(shell uname -m)
|
||||
ifeq ($(UNAME_M),x86_64)
|
||||
OSFLAG := $(OSFLAG)-x64
|
||||
endif
|
||||
ifeq ($(UNAME_M),x86)
|
||||
OSFLAG := $(OSFLAG)-x86
|
||||
endif
|
||||
ifeq ($(UNAME_M),arm64)
|
||||
OSFLAG := $(OSFLAG)-arm64
|
||||
endif
|
||||
ifeq ($(UNAME_M),arm)
|
||||
OSFLAG := $(OSFLAG)-arm
|
||||
endif
|
||||
endif
|
||||
|
||||
PUBFLAGS += -r $(OSFLAG)
|
||||
BASE ?= bin/Release/$(NETVERSION)/$(OSFLAG)/publish
|
||||
|
||||
publish: bin/Release/$(NETVERSION)/$(OSFLAG)/publish
|
||||
|
||||
bin/Release/$(NETVERSION)/$(OSFLAG)/publish:
|
||||
dotnet publish $(PUBFLAGS)
|
||||
|
||||
.PHONY: install
|
||||
install:
|
||||
sed -i 's|prefix=.*|prefix=$(PREFIX)|' $(BASE)/xdg.pc
|
||||
install -Dm755 $(BASE)/libxdg.so $(PREFIX)/$(LIB)
|
||||
install -Dm644 $(BASE)/xdg.pc $(PREFIX)/$(LIB)/pkgconfig
|
||||
install -Dm644 $(BASE)/include/xdg.h $(PREFIX)/include
|
||||
|
||||
.PHONY: uninstall
|
||||
uninstall:
|
||||
rm $(PREFIX)/$(LIB)/libxdg.so
|
||||
rm $(PREFIX)/$(LIB)/pkgconfig/xdg.pc
|
||||
rm $(PREFIX)/include/xdg.h
|
||||
|
||||
.PHONY: clean
|
||||
clean:
|
||||
rm -rf bin obj
|
|
@ -1,4 +1,4 @@
|
|||
#if NET7_0_OR_GREATER
|
||||
#if NET7_0_OR_GREATER
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace Xdg.Directories.FFI;
|
|
@ -1,4 +1,4 @@
|
|||
#if NET7_0_OR_GREATER
|
||||
#if NET7_0_OR_GREATER
|
||||
#pragma warning disable CA1031 // General exceptions needed for handling errors
|
||||
using System.Runtime.InteropServices;
|
||||
|
20
src/Xdg.Directories.FFI/README.md
Normal file
20
src/Xdg.Directories.FFI/README.md
Normal file
|
@ -0,0 +1,20 @@
|
|||
# FFI
|
||||
Here lies the code that is used for the C FFI.
|
||||
This is not meant to be used by .NET but rather by any language that can interface with C.
|
||||
|
||||
## Building
|
||||
To build the library for production, use the included `gmake` file.
|
||||
```sh
|
||||
make
|
||||
sudo make install
|
||||
```
|
||||
|
||||
## TODO
|
||||
- [x] pkg-config file
|
||||
- [x] Makefile
|
||||
- [ ] manpage, probably make it with scdoc?
|
||||
- maybe use pandoc instead?
|
||||
- [ ] Examples
|
||||
- Maybe some bindings for other languages as a POC?
|
||||
- [ ] Tests
|
||||
- Test from C or C#?
|
|
@ -1,4 +1,4 @@
|
|||
#if NET7_0_OR_GREATER
|
||||
#if NET7_0_OR_GREATER
|
||||
#pragma warning disable CA1031 // General exceptions needed for handling errors
|
||||
using System.Runtime.InteropServices;
|
||||
|
49
src/Xdg.Directories.FFI/Xdg.Directories.FFI.csproj
Normal file
49
src/Xdg.Directories.FFI/Xdg.Directories.FFI.csproj
Normal file
|
@ -0,0 +1,49 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net7.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
<AssemblyName>libxdg</AssemblyName>
|
||||
<PackageReadmeFile>README.md</PackageReadmeFile>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Label="NativeAOT">
|
||||
<PublishAot>True</PublishAot>
|
||||
<StripSymbols>True</StripSymbols>
|
||||
<TrimMode>Link</TrimMode>
|
||||
|
||||
<RootAllApplicationAssemblies>false</RootAllApplicationAssemblies>
|
||||
<IlcGenerateStackTraceData>false</IlcGenerateStackTraceData>
|
||||
<IlcDisableUnhandledExceptionExperience>true</IlcDisableUnhandledExceptionExperience>
|
||||
<IlcGenerateCompleteTypeMetadata>false</IlcGenerateCompleteTypeMetadata>
|
||||
<IlcTrimMetadata>true</IlcTrimMetadata>
|
||||
<IlcFoldIdenticalMethodBodies>true</IlcFoldIdenticalMethodBodies>
|
||||
<IlcOptimizationPreference>Size</IlcOptimizationPreference>
|
||||
|
||||
<!-- The holy grail of size reduction - would cut the library's size in half, but doesn't
|
||||
work -->
|
||||
<!--<IlcDisableReflection>true</IlcDisableReflection>-->
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Xdg.Directories\Xdg.Directories.csproj" />
|
||||
|
||||
<None Remove="include\xdg.h" />
|
||||
<None Include="include\xdg.h">
|
||||
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
|
||||
<Link>include\%(Filename)%(Extension)</Link>
|
||||
</None>
|
||||
|
||||
<None Remove="xdg.pc" />
|
||||
<None Include="xdg.pc">
|
||||
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
|
||||
<Link>%(Filename)%(Extension)</Link>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<InternalsVisibleTo Include="Xdg.Testing" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
|
@ -1,4 +1,4 @@
|
|||
namespace Xdg.Directories;
|
||||
namespace Xdg.Directories;
|
||||
|
||||
/// <include file='docs/BaseDirectory.xml' path='docs/BaseDirectory'/>
|
||||
public static class BaseDirectory
|
||||
|
|
|
@ -1,17 +0,0 @@
|
|||
PREFIX ?= /usr/local
|
||||
LIB ?= lib64
|
||||
BASE ?= bin/Release/$(NETVERSION)/linux-x64/publish
|
||||
|
||||
|
||||
.PHONY: install
|
||||
install:
|
||||
sed -i 's|prefix=.*|prefix=$(PREFIX)|' $(BASE)/xdg.pc
|
||||
install -Dm755 $(BASE)/libxdg.so $(PREFIX)/$(LIB)
|
||||
install -Dm644 $(BASE)/xdg.pc $(PREFIX)/$(LIB)/pkgconfig
|
||||
install -Dm644 $(BASE)/include/xdg.h $(PREFIX)/include
|
||||
|
||||
.PHONY: uninstall
|
||||
uninstall:
|
||||
rm $(PREFIX)/$(LIB)/libxdg.so
|
||||
rm $(PREFIX)/$(LIB)/pkgconfig/xdg.pc
|
||||
rm $(PREFIX)/include/xdg.h
|
|
@ -1,4 +1,4 @@
|
|||
using System.Runtime.InteropServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace Xdg.Directories;
|
||||
static internal class Helpers
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
namespace Xdg.Directories;
|
||||
namespace Xdg.Directories;
|
||||
|
||||
/// <include file='docs/Other.xml' path='docs/Other'/>
|
||||
public static class Other
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
namespace Xdg.Directories;
|
||||
namespace Xdg.Directories;
|
||||
|
||||
/// <include file='docs/UserDirectory.xml' path='docs/UserDirectory'/>
|
||||
public static class UserDirectory
|
||||
|
|
|
@ -1 +1 @@
|
|||
global using static System.Environment;
|
||||
global using static System.Environment;
|
|
@ -1,4 +1,4 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<PropertyGroup Condition="'$(CI)' == 'true'">
|
||||
<ContinuousIntegrationBuild>true</ContinuousIntegrationBuild>
|
||||
</PropertyGroup>
|
||||
|
@ -34,40 +34,21 @@
|
|||
<MinVerDefaultPreReleaseIdentifiers>preview.0</MinVerDefaultPreReleaseIdentifiers>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Label="NativeAOT">
|
||||
<PublishAot>True</PublishAot>
|
||||
<StripSymbols>True</StripSymbols>
|
||||
<TrimMode>Link</TrimMode>
|
||||
|
||||
<RootAllApplicationAssemblies>false</RootAllApplicationAssemblies>
|
||||
<IlcGenerateStackTraceData>false</IlcGenerateStackTraceData>
|
||||
<IlcDisableUnhandledExceptionExperience>true</IlcDisableUnhandledExceptionExperience>
|
||||
<IlcGenerateCompleteTypeMetadata>false</IlcGenerateCompleteTypeMetadata>
|
||||
<IlcTrimMetadata>true</IlcTrimMetadata>
|
||||
<IlcFoldIdenticalMethodBodies>true</IlcFoldIdenticalMethodBodies>
|
||||
<IlcOptimizationPreference>Size</IlcOptimizationPreference>
|
||||
|
||||
<!-- The holy grail of size reduction - would cut the library's size in half, but doesn't
|
||||
work -->
|
||||
<!--<IlcDisableReflection>true</IlcDisableReflection>-->
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup
|
||||
Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Debug|net7.0|AnyCPU'">
|
||||
<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Debug|net7.0|AnyCPU'">
|
||||
<WarningLevel>9999</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup
|
||||
Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Release|net7.0|AnyCPU'">
|
||||
<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Release|net7.0|AnyCPU'">
|
||||
<WarningLevel>9999</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup
|
||||
Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Debug|netstandard2.0|AnyCPU'">
|
||||
<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Debug|netstandard2.0|AnyCPU'">
|
||||
<WarningLevel>9999</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup
|
||||
Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Release|netstandard2.0|AnyCPU'">
|
||||
<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Release|netstandard2.0|AnyCPU'">
|
||||
<WarningLevel>9999</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<IsPublishable>False</IsPublishable>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup Label="Extra files">
|
||||
<None Include="..\..\LICENSE" Visible="false">
|
||||
|
@ -78,25 +59,12 @@
|
|||
<Pack>True</Pack>
|
||||
<PackagePath>\</PackagePath>
|
||||
</None>
|
||||
|
||||
<!--FFI-->
|
||||
<None Remove="FFI\include\xdg.h" />
|
||||
<None Include="FFI\include\xdg.h">
|
||||
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
|
||||
<Link>include\%(Filename)%(Extension)</Link>
|
||||
</None>
|
||||
<None Remove="FFI\xdg.pc" />
|
||||
<None Include="FFI\xdg.pc">
|
||||
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
|
||||
<Link>%(Filename)%(Extension)</Link>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup Label="NuGet Packages">
|
||||
<PackageReference Include="Microsoft.SourceLink.Gitea" Version="1.1.1" PrivateAssets="All" />
|
||||
<SourceLinkGiteaHost Include="git.froth.zone" />
|
||||
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.1.1" PrivateAssets="All" />
|
||||
|
||||
<PackageReference Include="MinVer" Version="4.3.0">
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<docs>
|
||||
<BaseDirectory>
|
||||
<summary>
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<docs>
|
||||
<Other>
|
||||
<summary>
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<docs>
|
||||
<UserDirectory>
|
||||
<summary>
|
||||
|
|
|
@ -53,6 +53,7 @@
|
|||
"contentHash": "WMcGpWKrmJmzrNeuaEb23bEMnbtR/vLmvZtkAP5qWu7vQsY59GqfRJd65sFpBszbd2k/bQ8cs8eWawQKAabkVg=="
|
||||
}
|
||||
},
|
||||
".NETStandard,Version=v2.0/linux-x64": {},
|
||||
"net7.0": {
|
||||
"Microsoft.SourceLink.Gitea": {
|
||||
"type": "Direct",
|
||||
|
@ -90,6 +91,7 @@
|
|||
"resolved": "1.1.1",
|
||||
"contentHash": "WMcGpWKrmJmzrNeuaEb23bEMnbtR/vLmvZtkAP5qWu7vQsY59GqfRJd65sFpBszbd2k/bQ8cs8eWawQKAabkVg=="
|
||||
}
|
||||
}
|
||||
},
|
||||
"net7.0/linux-x64": {}
|
||||
}
|
||||
}
|
|
@ -1,4 +1,6 @@
|
|||
namespace Xdg.Directories.Testing.Directories;
|
||||
using Xdg.Directories;
|
||||
|
||||
namespace Xdg.Testing.Directories;
|
||||
|
||||
[TestClass]
|
||||
public class BaseDirectory_Test
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
using System.Runtime.InteropServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace Xdg.Directories.Testing.Directories;
|
||||
namespace Xdg.Testing.Directories;
|
||||
internal static class Helper
|
||||
{
|
||||
public static void Prepare(string Env, string? EnvValue, string OS)
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
namespace Xdg.Directories.Testing.Directories;
|
||||
using Xdg.Directories;
|
||||
|
||||
namespace Xdg.Testing.Directories;
|
||||
|
||||
[TestClass]
|
||||
public class Other_Test
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
namespace Xdg.Directories.Testing.Directories;
|
||||
using Xdg.Directories;
|
||||
|
||||
namespace Xdg.Testing.Directories;
|
||||
|
||||
[TestClass]
|
||||
public class UserDirectory_Test
|
||||
|
|
|
@ -8,6 +8,7 @@
|
|||
<IsPackable>false</IsPackable>
|
||||
<IsTestProject>true</IsTestProject>
|
||||
<IsPublishable>false</IsPublishable>
|
||||
<EnforceCodeStyleInBuild>True</EnforceCodeStyleInBuild>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
|
Loading…
Reference in a new issue