From 213fe8632936a97ad1a34f2abfd84e2e191fc441 Mon Sep 17 00:00:00 2001 From: Sam Therapy Date: Fri, 19 May 2023 20:54:08 +0200 Subject: [PATCH] refactor: Put FFI in its own project Signed-off-by: Sam Therapy --- .editorconfig | 123 ++++++++++++++++++ GNUmakefile | 54 ++------ README.md | 2 +- Xdg.Net.sln | 14 +- src/Xdg.Benchmarks/Program.fs | 2 +- src/Xdg.Benchmarks/Xdg.Benchmarks.fsproj | 2 +- .../BaseDirectory.cs | 2 +- src/Xdg.Directories.FFI/GNUmakefile | 65 +++++++++ .../FFI => Xdg.Directories.FFI}/Helpers.cs | 2 +- .../FFI => Xdg.Directories.FFI}/Other.cs | 2 +- src/Xdg.Directories.FFI/README.md | 20 +++ .../UserDirectory.cs | 2 +- .../Xdg.Directories.FFI.csproj | 49 +++++++ .../FFI => Xdg.Directories.FFI}/include/xdg.h | 0 .../FFI => Xdg.Directories.FFI}/xdg.pc | 0 src/Xdg.Directories/BaseDirectory.cs | 2 +- src/Xdg.Directories/GNUmakefile | 17 --- src/Xdg.Directories/Helpers.cs | 2 +- src/Xdg.Directories/Other.cs | 2 +- src/Xdg.Directories/UserDirectory.cs | 2 +- src/Xdg.Directories/Usings.cs | 2 +- src/Xdg.Directories/Xdg.Directories.csproj | 48 ++----- src/Xdg.Directories/docs/BaseDirectory.xml | 2 +- src/Xdg.Directories/docs/Other.xml | 2 +- src/Xdg.Directories/docs/UserDirectory.xml | 2 +- src/Xdg.Directories/packages.lock.json | 4 +- .../Directories/BaseDirectory_test.cs | 4 +- src/Xdg.Testing/Directories/HelperMethods.cs | 4 +- src/Xdg.Testing/Directories/Other_test.cs | 4 +- .../Directories/UserDirectory_test.cs | 4 +- src/Xdg.Testing/Xdg.Testing.csproj | 1 + 31 files changed, 318 insertions(+), 123 deletions(-) create mode 100644 .editorconfig rename src/{Xdg.Directories/FFI => Xdg.Directories.FFI}/BaseDirectory.cs (98%) create mode 100644 src/Xdg.Directories.FFI/GNUmakefile rename src/{Xdg.Directories/FFI => Xdg.Directories.FFI}/Helpers.cs (95%) rename src/{Xdg.Directories/FFI => Xdg.Directories.FFI}/Other.cs (93%) create mode 100644 src/Xdg.Directories.FFI/README.md rename src/{Xdg.Directories/FFI => Xdg.Directories.FFI}/UserDirectory.cs (98%) create mode 100644 src/Xdg.Directories.FFI/Xdg.Directories.FFI.csproj rename src/{Xdg.Directories/FFI => Xdg.Directories.FFI}/include/xdg.h (100%) rename src/{Xdg.Directories/FFI => Xdg.Directories.FFI}/xdg.pc (100%) delete mode 100644 src/Xdg.Directories/GNUmakefile diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..ce17088 --- /dev/null +++ b/.editorconfig @@ -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 \ No newline at end of file diff --git a/GNUmakefile b/GNUmakefile index 66101a8..427cf4f 100644 --- a/GNUmakefile +++ b/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 \ No newline at end of file + make -C src/Xdg.Directories.FFI uninstall + +.PHONY: clean +clean: + make -C src/Xdg.Directories.FFI clean diff --git a/README.md b/README.md index cf50f6c..423c1c3 100644 --- a/README.md +++ b/README.md @@ -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) \ No newline at end of file diff --git a/Xdg.Net.sln b/Xdg.Net.sln index 9c84f7d..626058b 100644 --- a/Xdg.Net.sln +++ b/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 diff --git a/src/Xdg.Benchmarks/Program.fs b/src/Xdg.Benchmarks/Program.fs index 4489179..f29dfc5 100644 --- a/src/Xdg.Benchmarks/Program.fs +++ b/src/Xdg.Benchmarks/Program.fs @@ -1,4 +1,4 @@ -open BenchmarkDotNet.Attributes +open BenchmarkDotNet.Attributes open BenchmarkDotNet.Running open BenchmarkDotNet.Jobs open Xdg.Directories; diff --git a/src/Xdg.Benchmarks/Xdg.Benchmarks.fsproj b/src/Xdg.Benchmarks/Xdg.Benchmarks.fsproj index 230b189..7acd980 100644 --- a/src/Xdg.Benchmarks/Xdg.Benchmarks.fsproj +++ b/src/Xdg.Benchmarks/Xdg.Benchmarks.fsproj @@ -1,4 +1,4 @@ - + Exe diff --git a/src/Xdg.Directories/FFI/BaseDirectory.cs b/src/Xdg.Directories.FFI/BaseDirectory.cs similarity index 98% rename from src/Xdg.Directories/FFI/BaseDirectory.cs rename to src/Xdg.Directories.FFI/BaseDirectory.cs index a89cfa7..90b1bac 100644 --- a/src/Xdg.Directories/FFI/BaseDirectory.cs +++ b/src/Xdg.Directories.FFI/BaseDirectory.cs @@ -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; diff --git a/src/Xdg.Directories.FFI/GNUmakefile b/src/Xdg.Directories.FFI/GNUmakefile new file mode 100644 index 0000000..0b9bbeb --- /dev/null +++ b/src/Xdg.Directories.FFI/GNUmakefile @@ -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 \ No newline at end of file diff --git a/src/Xdg.Directories/FFI/Helpers.cs b/src/Xdg.Directories.FFI/Helpers.cs similarity index 95% rename from src/Xdg.Directories/FFI/Helpers.cs rename to src/Xdg.Directories.FFI/Helpers.cs index 3446867..e9f5a9b 100644 --- a/src/Xdg.Directories/FFI/Helpers.cs +++ b/src/Xdg.Directories.FFI/Helpers.cs @@ -1,4 +1,4 @@ -#if NET7_0_OR_GREATER +#if NET7_0_OR_GREATER using System.Runtime.InteropServices; namespace Xdg.Directories.FFI; diff --git a/src/Xdg.Directories/FFI/Other.cs b/src/Xdg.Directories.FFI/Other.cs similarity index 93% rename from src/Xdg.Directories/FFI/Other.cs rename to src/Xdg.Directories.FFI/Other.cs index c0c3ecf..adca544 100644 --- a/src/Xdg.Directories/FFI/Other.cs +++ b/src/Xdg.Directories.FFI/Other.cs @@ -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; diff --git a/src/Xdg.Directories.FFI/README.md b/src/Xdg.Directories.FFI/README.md new file mode 100644 index 0000000..71f1d61 --- /dev/null +++ b/src/Xdg.Directories.FFI/README.md @@ -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#? \ No newline at end of file diff --git a/src/Xdg.Directories/FFI/UserDirectory.cs b/src/Xdg.Directories.FFI/UserDirectory.cs similarity index 98% rename from src/Xdg.Directories/FFI/UserDirectory.cs rename to src/Xdg.Directories.FFI/UserDirectory.cs index 37d9c8f..bfbd96c 100644 --- a/src/Xdg.Directories/FFI/UserDirectory.cs +++ b/src/Xdg.Directories.FFI/UserDirectory.cs @@ -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; diff --git a/src/Xdg.Directories.FFI/Xdg.Directories.FFI.csproj b/src/Xdg.Directories.FFI/Xdg.Directories.FFI.csproj new file mode 100644 index 0000000..bb2502f --- /dev/null +++ b/src/Xdg.Directories.FFI/Xdg.Directories.FFI.csproj @@ -0,0 +1,49 @@ + + + + net7.0 + enable + enable + libxdg + README.md + + + + True + True + Link + + false + false + true + false + true + true + Size + + + + + + + + + + + PreserveNewest + include\%(Filename)%(Extension) + + + + + PreserveNewest + %(Filename)%(Extension) + + + + + + + + diff --git a/src/Xdg.Directories/FFI/include/xdg.h b/src/Xdg.Directories.FFI/include/xdg.h similarity index 100% rename from src/Xdg.Directories/FFI/include/xdg.h rename to src/Xdg.Directories.FFI/include/xdg.h diff --git a/src/Xdg.Directories/FFI/xdg.pc b/src/Xdg.Directories.FFI/xdg.pc similarity index 100% rename from src/Xdg.Directories/FFI/xdg.pc rename to src/Xdg.Directories.FFI/xdg.pc diff --git a/src/Xdg.Directories/BaseDirectory.cs b/src/Xdg.Directories/BaseDirectory.cs index 73731ed..f08a5ab 100644 --- a/src/Xdg.Directories/BaseDirectory.cs +++ b/src/Xdg.Directories/BaseDirectory.cs @@ -1,4 +1,4 @@ -namespace Xdg.Directories; +namespace Xdg.Directories; /// public static class BaseDirectory diff --git a/src/Xdg.Directories/GNUmakefile b/src/Xdg.Directories/GNUmakefile deleted file mode 100644 index 7e46d2e..0000000 --- a/src/Xdg.Directories/GNUmakefile +++ /dev/null @@ -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 \ No newline at end of file diff --git a/src/Xdg.Directories/Helpers.cs b/src/Xdg.Directories/Helpers.cs index a485b85..b6c277e 100644 --- a/src/Xdg.Directories/Helpers.cs +++ b/src/Xdg.Directories/Helpers.cs @@ -1,4 +1,4 @@ -using System.Runtime.InteropServices; +using System.Runtime.InteropServices; namespace Xdg.Directories; static internal class Helpers diff --git a/src/Xdg.Directories/Other.cs b/src/Xdg.Directories/Other.cs index be335f1..64201d2 100644 --- a/src/Xdg.Directories/Other.cs +++ b/src/Xdg.Directories/Other.cs @@ -1,4 +1,4 @@ -namespace Xdg.Directories; +namespace Xdg.Directories; /// public static class Other diff --git a/src/Xdg.Directories/UserDirectory.cs b/src/Xdg.Directories/UserDirectory.cs index b052a5d..e368e6c 100644 --- a/src/Xdg.Directories/UserDirectory.cs +++ b/src/Xdg.Directories/UserDirectory.cs @@ -1,4 +1,4 @@ -namespace Xdg.Directories; +namespace Xdg.Directories; /// public static class UserDirectory diff --git a/src/Xdg.Directories/Usings.cs b/src/Xdg.Directories/Usings.cs index 434d765..16e5d50 100644 --- a/src/Xdg.Directories/Usings.cs +++ b/src/Xdg.Directories/Usings.cs @@ -1 +1 @@ -global using static System.Environment; \ No newline at end of file +global using static System.Environment; \ No newline at end of file diff --git a/src/Xdg.Directories/Xdg.Directories.csproj b/src/Xdg.Directories/Xdg.Directories.csproj index af3b0f9..ee08fd8 100644 --- a/src/Xdg.Directories/Xdg.Directories.csproj +++ b/src/Xdg.Directories/Xdg.Directories.csproj @@ -1,4 +1,4 @@ - + true @@ -34,40 +34,21 @@ preview.0 - - True - True - Link - - false - false - true - false - true - true - Size - - - - - - + 9999 - + 9999 - + 9999 - + 9999 + + False + @@ -78,25 +59,12 @@ True \ - - - - - PreserveNewest - include\%(Filename)%(Extension) - - - - PreserveNewest - %(Filename)%(Extension) - - all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/src/Xdg.Directories/docs/BaseDirectory.xml b/src/Xdg.Directories/docs/BaseDirectory.xml index 1cd6a5a..a5ef53f 100644 --- a/src/Xdg.Directories/docs/BaseDirectory.xml +++ b/src/Xdg.Directories/docs/BaseDirectory.xml @@ -1,4 +1,4 @@ - + diff --git a/src/Xdg.Directories/docs/Other.xml b/src/Xdg.Directories/docs/Other.xml index b0d240f..601dadf 100644 --- a/src/Xdg.Directories/docs/Other.xml +++ b/src/Xdg.Directories/docs/Other.xml @@ -1,4 +1,4 @@ - + diff --git a/src/Xdg.Directories/docs/UserDirectory.xml b/src/Xdg.Directories/docs/UserDirectory.xml index 9e30412..65fe26d 100644 --- a/src/Xdg.Directories/docs/UserDirectory.xml +++ b/src/Xdg.Directories/docs/UserDirectory.xml @@ -1,4 +1,4 @@ - + diff --git a/src/Xdg.Directories/packages.lock.json b/src/Xdg.Directories/packages.lock.json index 6b9081d..d8ac3ef 100644 --- a/src/Xdg.Directories/packages.lock.json +++ b/src/Xdg.Directories/packages.lock.json @@ -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": {} } } \ No newline at end of file diff --git a/src/Xdg.Testing/Directories/BaseDirectory_test.cs b/src/Xdg.Testing/Directories/BaseDirectory_test.cs index 6b5ec70..c652ec8 100644 --- a/src/Xdg.Testing/Directories/BaseDirectory_test.cs +++ b/src/Xdg.Testing/Directories/BaseDirectory_test.cs @@ -1,4 +1,6 @@ -namespace Xdg.Directories.Testing.Directories; +using Xdg.Directories; + +namespace Xdg.Testing.Directories; [TestClass] public class BaseDirectory_Test diff --git a/src/Xdg.Testing/Directories/HelperMethods.cs b/src/Xdg.Testing/Directories/HelperMethods.cs index fcd8c34..7c16ac5 100644 --- a/src/Xdg.Testing/Directories/HelperMethods.cs +++ b/src/Xdg.Testing/Directories/HelperMethods.cs @@ -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) diff --git a/src/Xdg.Testing/Directories/Other_test.cs b/src/Xdg.Testing/Directories/Other_test.cs index 6fcc752..569eefd 100644 --- a/src/Xdg.Testing/Directories/Other_test.cs +++ b/src/Xdg.Testing/Directories/Other_test.cs @@ -1,4 +1,6 @@ -namespace Xdg.Directories.Testing.Directories; +using Xdg.Directories; + +namespace Xdg.Testing.Directories; [TestClass] public class Other_Test diff --git a/src/Xdg.Testing/Directories/UserDirectory_test.cs b/src/Xdg.Testing/Directories/UserDirectory_test.cs index c612792..1b468ce 100644 --- a/src/Xdg.Testing/Directories/UserDirectory_test.cs +++ b/src/Xdg.Testing/Directories/UserDirectory_test.cs @@ -1,4 +1,6 @@ -namespace Xdg.Directories.Testing.Directories; +using Xdg.Directories; + +namespace Xdg.Testing.Directories; [TestClass] public class UserDirectory_Test diff --git a/src/Xdg.Testing/Xdg.Testing.csproj b/src/Xdg.Testing/Xdg.Testing.csproj index 46fe915..b27015e 100644 --- a/src/Xdg.Testing/Xdg.Testing.csproj +++ b/src/Xdg.Testing/Xdg.Testing.csproj @@ -8,6 +8,7 @@ false true false + True