Skip to content

Commit a3caca2

Browse files
Pedro JesusPedro Jesus
authored andcommitted
init
0 parents  commit a3caca2

File tree

11 files changed

+1017
-0
lines changed

11 files changed

+1017
-0
lines changed

.editorconfig

Lines changed: 197 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,197 @@
1+
2+
# Suppress: EC112
3+
# top-most EditorConfig file
4+
root = true
5+
6+
# Default settings:
7+
# A newline ending every file
8+
# Use 4 spaces as indentation
9+
[*]
10+
insert_final_newline = false
11+
indent_style = space
12+
indent_size = 4
13+
14+
# Code files
15+
[*.{cs,csx,vb,vbx}]
16+
indent_style = tab
17+
indent_size = 4
18+
dotnet_style_operator_placement_when_wrapping = beginning_of_line
19+
tab_width = 4
20+
end_of_line = crlf
21+
dotnet_style_coalesce_expression = true:suggestion
22+
dotnet_style_null_propagation = true:suggestion
23+
dotnet_style_prefer_is_null_check_over_reference_equality_method = true:suggestion
24+
dotnet_style_prefer_auto_properties = true:silent
25+
dotnet_style_object_initializer = true:suggestion
26+
dotnet_style_collection_initializer = true:suggestion
27+
dotnet_style_prefer_simplified_boolean_expressions = true:suggestion
28+
dotnet_style_prefer_conditional_expression_over_assignment = true:silent
29+
dotnet_style_prefer_conditional_expression_over_return = true:silent
30+
dotnet_style_explicit_tuple_names = true:suggestion
31+
dotnet_style_prefer_inferred_tuple_names = true:suggestion
32+
dotnet_style_prefer_inferred_anonymous_type_member_names = true:suggestion
33+
dotnet_style_prefer_compound_assignment = true:suggestion
34+
dotnet_style_prefer_simplified_interpolation = true:suggestion
35+
dotnet_style_prefer_collection_expression = when_types_loosely_match:suggestion
36+
dotnet_style_namespace_match_folder = true:suggestion
37+
dotnet_style_readonly_field = true:suggestion
38+
dotnet_style_predefined_type_for_locals_parameters_members = true:silent
39+
dotnet_style_predefined_type_for_member_access = true:silent
40+
dotnet_style_require_accessibility_modifiers = omit_if_default:error
41+
42+
# Code files
43+
[*.sln]
44+
indent_size = 4
45+
46+
# Xml project files
47+
[*.{csproj,vbproj,vcxproj,vcxproj.filters,proj,projitems,shproj}]
48+
indent_size = 2
49+
50+
# Xml config files
51+
[*.{props,targets,ruleset,config,nuspec,resx,vsixmanifest,vsct}]
52+
indent_size = 2
53+
54+
# JSON files
55+
[*.json]
56+
indent_size = 2
57+
58+
# XML files
59+
[*.xml]
60+
indent_size = 2
61+
62+
[*.cs]
63+
64+
# Organize usings
65+
dotnet_sort_system_directives_first = true
66+
67+
# IDE0160: Use file scoped namespace
68+
csharp_style_namespace_declarations = file_scoped:error
69+
70+
# CS4014: Because this call is not awaited, execution of the current method continues before the call is completed
71+
dotnet_diagnostic.CS4014.severity = error
72+
73+
# CS2012: ValueTask instances returned from member invocations are intended to be directly awaited. Attempts to consume a ValueTask multiple times or to directly access one's result before it's known to be completed may result in an exception or corruption. Ignoring such a ValueTask is likely an indication of a functional bug and may degrade performance.
74+
dotnet_diagnostic.CS2012.severity = error
75+
76+
# CS1998 : This async method lacks 'await' operators and will run synchronously. Consider using the 'await' operator to await non-blocking API calls, or 'await Task.Run(...)' to do CPU-bound work on a background thread.
77+
dotnet_diagnostic.CS1998.severity = error
78+
79+
# Remove explicit default access modifiers
80+
dotnet_style_require_accessibility_modifiers = omit_if_default:error
81+
82+
# CA1063: Implement IDisposable Correctly
83+
dotnet_diagnostic.CA1063.severity = error
84+
85+
# CA1001: Type owns disposable field(s) but is not disposable
86+
dotnet_diagnostic.CA1001.severity = error
87+
88+
# Add braces (IDE0011)
89+
csharp_prefer_braces = false:warning
90+
dotnet_diagnostic.IDE0011.severity = none
91+
92+
# Pattern matching
93+
dotnet_style_object_initializer = true:suggestion
94+
dotnet_style_collection_initializer = true:suggestion
95+
dotnet_style_coalesce_expression = true:suggestion
96+
dotnet_style_null_propagation = true:suggestion
97+
dotnet_style_explicit_tuple_names = true:suggestion
98+
dotnet_style_prefer_is_null_check_over_reference_equality_method=true:suggestion
99+
100+
csharp_style_pattern_matching_over_is_with_cast_check = true:suggestion
101+
csharp_style_pattern_matching_over_as_with_null_check = true:suggestion
102+
csharp_style_inlined_variable_declaration = true:suggestion
103+
csharp_style_throw_expression = true:suggestion
104+
csharp_style_conditional_delegate_call = true:suggestion
105+
106+
# Collection Expressions
107+
dotnet_style_prefer_collection_expression = when_types_loosely_match:suggestion
108+
109+
# Naming rules
110+
111+
dotnet_diagnostic.IDE1006.severity = suggestion
112+
113+
## Public Fields are kept Pascal Case
114+
dotnet_naming_symbols.public_symbols.applicable_kinds = field
115+
dotnet_naming_symbols.public_symbols.applicable_accessibilities = public, internal
116+
117+
dotnet_naming_style.first_word_upper_case_style.capitalization = first_word_upper
118+
119+
dotnet_naming_rule.public_members_must_be_capitalized.symbols = public_symbols
120+
dotnet_naming_rule.public_members_must_be_capitalized.style = first_word_upper_case_style
121+
dotnet_naming_rule.public_members_must_be_capitalized.severity = suggestion
122+
123+
## Instance fields are camelCase
124+
dotnet_naming_rule.instance_fields_should_be_camel_case.severity = error
125+
dotnet_naming_rule.instance_fields_should_be_camel_case.symbols = instance_fields
126+
dotnet_naming_rule.instance_fields_should_be_camel_case.style = instance_field_style
127+
128+
dotnet_naming_symbols.instance_fields.applicable_kinds = field
129+
130+
dotnet_naming_style.instance_field_style.capitalization = camel_case
131+
dotnet_naming_style.instance_field_style.required_prefix =
132+
133+
## Static fields are camelCase
134+
dotnet_naming_rule.static_fields_should_be_camel_case.severity = error
135+
dotnet_naming_rule.static_fields_should_be_camel_case.symbols = static_fields
136+
dotnet_naming_rule.static_fields_should_be_camel_case.style = instance_field_style
137+
138+
dotnet_naming_symbols.static_fields.applicable_kinds = field
139+
dotnet_naming_symbols.static_fields.required_modifiers = static
140+
dotnet_naming_symbols.static_fields.applicable_accessibilities = private, protected, protected_internal, private_protected
141+
142+
dotnet_naming_style.static_field_style.capitalization = camel_case
143+
dotnet_naming_style.static_field_style.required_prefix =
144+
145+
# Modifier preferences
146+
csharp_prefer_static_local_function = true:suggestion
147+
csharp_preferred_modifier_order = public,private,protected,internal,static,extern,new,virtual,abstract,sealed,override,readonly,unsafe,volatile,async:error
148+
149+
# CA1822: Member does not access instance data and can be marked as static
150+
dotnet_diagnostic.CA1822.severity = suggestion
151+
152+
# CA1050: Declare types in namespaces
153+
dotnet_diagnostic.CA1050.severity = error
154+
155+
# CA2016: Forward the 'cancellationToken' parameter methods that take one
156+
dotnet_diagnostic.CA2016.severity = error
157+
158+
# CA1068: CancellationToken parameters must come last
159+
dotnet_diagnostic.CA1068.severity = error
160+
161+
# CA2208: Method passes parameter as the paramName argument to a ArgumentNullException constructor. Replace this argument with one of the method's parameter names. Note that the provided parameter name should have the exact casing as declared on the method.
162+
dotnet_diagnostic.CA2208.severity = error
163+
164+
# CA1834: Use 'StringBuilder.Append(char)' instead of 'StringBuilder.Append(string)' when the input is a constant unit string
165+
dotnet_diagnostic.CA1834.severity = error
166+
167+
# IDE0220: Add explicit cast
168+
dotnet_diagnostic.IDE0220.severity = error
169+
csharp_indent_labels = no_change
170+
csharp_space_around_binary_operators = before_and_after
171+
csharp_using_directive_placement = outside_namespace:silent
172+
csharp_prefer_simple_using_statement = true:suggestion
173+
csharp_style_prefer_method_group_conversion = true:silent
174+
csharp_style_prefer_top_level_statements = true:silent
175+
csharp_style_prefer_primary_constructors = true:suggestion
176+
csharp_prefer_system_threading_lock = true:suggestion
177+
csharp_style_expression_bodied_methods = false:silent
178+
csharp_style_expression_bodied_constructors = false:silent
179+
csharp_style_expression_bodied_operators = false:silent
180+
csharp_style_expression_bodied_properties = true:silent
181+
csharp_style_expression_bodied_indexers = true:silent
182+
csharp_style_expression_bodied_accessors = true:silent
183+
csharp_style_expression_bodied_lambdas = true:silent
184+
csharp_style_expression_bodied_local_functions = false:silent
185+
csharp_style_prefer_null_check_over_type_check = true:suggestion
186+
csharp_prefer_simple_default_expression = true:suggestion
187+
csharp_style_prefer_local_over_anonymous_function = true:suggestion
188+
csharp_style_prefer_index_operator = true:suggestion
189+
csharp_style_prefer_range_operator = true:suggestion
190+
csharp_style_implicit_object_creation_when_type_is_apparent = true:suggestion
191+
csharp_style_prefer_tuple_swap = true:suggestion
192+
csharp_style_prefer_utf8_string_literals = true:suggestion
193+
csharp_style_deconstructed_variable_declaration = true:suggestion
194+
csharp_style_unused_value_assignment_preference = discard_variable:suggestion
195+
csharp_style_unused_value_expression_statement_preference = discard_variable:silent
196+
csharp_prefer_static_anonymous_function = true:suggestion
197+
csharp_style_prefer_readonly_struct = true:suggestion

.gitattributes

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
###############################################################################
2+
# Set default behavior to automatically normalize line endings.
3+
###############################################################################
4+
* text=auto
5+
6+
###############################################################################
7+
# Set default behavior for command prompt diff.
8+
#
9+
# This is need for earlier builds of msysgit that does not have it on by
10+
# default for csharp files.
11+
# Note: This is only used by command line
12+
###############################################################################
13+
#*.cs diff=csharp
14+
15+
###############################################################################
16+
# Set the merge driver for project and solution files
17+
#
18+
# Merging from the command prompt will add diff markers to the files if there
19+
# are conflicts (Merging from VS is not affected by the settings below, in VS
20+
# the diff markers are never inserted). Diff markers may cause the following
21+
# file extensions to fail to load in VS. An alternative would be to treat
22+
# these files as binary and thus will always conflict and require user
23+
# intervention with every merge. To do so, just uncomment the entries below
24+
###############################################################################
25+
#*.sln merge=binary
26+
#*.csproj merge=binary
27+
#*.vbproj merge=binary
28+
#*.vcxproj merge=binary
29+
#*.vcproj merge=binary
30+
#*.dbproj merge=binary
31+
#*.fsproj merge=binary
32+
#*.lsproj merge=binary
33+
#*.wixproj merge=binary
34+
#*.modelproj merge=binary
35+
#*.sqlproj merge=binary
36+
#*.wwaproj merge=binary
37+
38+
###############################################################################
39+
# behavior for image files
40+
#
41+
# image files are treated as binary by default.
42+
###############################################################################
43+
#*.jpg binary
44+
#*.png binary
45+
#*.gif binary
46+
47+
###############################################################################
48+
# diff behavior for common document formats
49+
#
50+
# Convert binary document formats to text before diffing them. This feature
51+
# is only available from the command line. Turn it on by uncommenting the
52+
# entries below.
53+
###############################################################################
54+
#*.doc diff=astextplain
55+
#*.DOC diff=astextplain
56+
#*.docx diff=astextplain
57+
#*.DOCX diff=astextplain
58+
#*.dot diff=astextplain
59+
#*.DOT diff=astextplain
60+
#*.pdf diff=astextplain
61+
#*.PDF diff=astextplain
62+
#*.rtf diff=astextplain
63+
#*.RTF diff=astextplain

.github/FUNDING.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# These are supported funding model platforms
2+
3+
github: [pictos]

.github/workflows/dotnet-macos.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# This workflow will build a .NET project
2+
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-net
3+
4+
name: Build project on macOS
5+
6+
on:
7+
pull_request:
8+
branches: [ "main" ]
9+
workflow_dispatch:
10+
11+
env:
12+
LIB_CSPROJ: Path_To_Plugin
13+
SAMPLE_CSPROJ: Path_To_Sample
14+
15+
jobs:
16+
build:
17+
18+
runs-on: macos-15
19+
20+
steps:
21+
- uses: actions/checkout@v4
22+
23+
- name: Setup .NET
24+
uses: actions/setup-dotnet@v4
25+
with:
26+
dotnet-version: 9.0.x
27+
28+
- name: Setup Xcode
29+
uses: maxim-lobanov/setup-xcode@v1
30+
with:
31+
xcode-version: '16.3'
32+
33+
- name: Workload install
34+
run: dotnet workload install maui
35+
36+
- name: Restore library dependencies
37+
run: dotnet restore ${{env.LIB_CSPROJ}}
38+
39+
- name: Restore sample dependencies
40+
run: dotnet restore ${{env.SAMPLE_CSPROJ}}
41+
42+
- name: Build library
43+
run: dotnet build ${{env.LIB_CSPROJ}} -c Release -f net9.0-ios --no-restore
44+
45+
- name: Build Sample app
46+
run: dotnet build ${{env.SAMPLE_CSPROJ}} -c Release -f net9.0-ios --no-restore
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
# This workflow will build a .NET project
2+
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-net
3+
4+
name: Build project on Windows
5+
6+
on:
7+
push:
8+
branches: [ "main" ]
9+
paths-ignore:
10+
- "**.md"
11+
pull_request:
12+
branches: [ "main" ]
13+
workflow_dispatch:
14+
15+
16+
env:
17+
LIB_CSPROJ: Path_To_Plugin
18+
SAMPLE_CSPROJ: Path_To_Sample
19+
NugetPackageVersion: '99.0.0-preview${{ github.run_number }}'
20+
CurrentSemanticVersionBase: '99.0.0'
21+
Package_Creation_Path: Path_To_Lookup_Into_Nuget
22+
23+
jobs:
24+
build:
25+
26+
runs-on: windows-latest
27+
28+
steps:
29+
- uses: actions/checkout@v4
30+
31+
- name: Setup .NET
32+
uses: actions/setup-dotnet@v4
33+
with:
34+
dotnet-version: 9.0.x
35+
36+
- name: Get Nuget version and Name for PR
37+
if: ${{ github.event_name == 'pull_request' }}
38+
run: |
39+
echo "NugetPackageVersion=${{ env.CurrentSemanticVersionBase }}-build-${{ github.event.pull_request.number }}.${{ github.run_number }}+${{ github.sha }}"
40+
shell: bash
41+
42+
- name: Workload install
43+
run: dotnet workload install maui
44+
45+
- name: Restore library dependencies
46+
run: dotnet restore ${{env.LIB_CSPROJ}}
47+
48+
- name: Restore sample dependencies
49+
run: dotnet restore ${{env.SAMPLE_CSPROJ}}
50+
51+
- name: Build library
52+
run: dotnet build ${{env.LIB_CSPROJ}} -c Release -p:PackageVersion=${{ env.NugetPackageVersion }} -p:Version=${{ env.NugetPackageVersion }} --no-restore
53+
54+
- name: Build Sample app
55+
run: dotnet build ${{env.SAMPLE_CSPROJ}} -c Release --no-restore
56+
57+
- name: Create Nuget
58+
run: dotnet pack ${{env.LIB_CSPROJ}} -c Release --no-restore --no-build --include-symbols --include-source
59+
60+
- name: Copy NuGet Packages to Staging Directory
61+
if: ${{ runner.os == 'Windows' && !startsWith(github.ref, 'refs/tags/') }}
62+
run: |
63+
mkdir -p ${{ github.workspace }}/nuget
64+
Get-ChildItem -Path ${{env.Package_Creation_Path}} -Recurse | Where-Object { $_.Extension -match "nupkg" } | Copy-Item -Destination "${{ github.workspace }}/nuget"
65+
shell: pwsh
66+
67+
- name: List NuGet packages found
68+
run: |
69+
Get-ChildItem -Path "${{ github.workspace }}/nuget" | Format-Table Name
70+
shell: pwsh
71+
72+
- name: Publish Packages
73+
uses: actions/upload-artifact@v4
74+
with:
75+
name: packages
76+
path: ${{ github.workspace }}/nuget/

0 commit comments

Comments
 (0)