Skip to content

Commit a66cdf4

Browse files
authored
Transition to multi-package repository (#126)
***NO_CI***
1 parent 81298b0 commit a66cdf4

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+1623
-55
lines changed

.editorconfig

+213
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,213 @@
1+
# EditorConfig for Visual Studio 2022: https://learn.microsoft.com/en-us/visualstudio/ide/create-portable-custom-editor-options?view=vs-2022
2+
3+
# This is a top-most .editorconfig file
4+
root = true
5+
6+
#=====================================================
7+
#
8+
# nanoFramework specific settings
9+
#
10+
#
11+
#=====================================================
12+
[*]
13+
# Generic EditorConfig settings
14+
end_of_line = crlf
15+
charset = utf-8-bom
16+
17+
# Visual Studio spell checker
18+
spelling_languages = en-us
19+
spelling_checkable_types = strings,identifiers,comments
20+
spelling_error_severity = information
21+
spelling_exclusion_path = spelling_exclusion.dic
22+
23+
#=====================================================
24+
#
25+
# Settings copied from the .NET runtime
26+
#
27+
# https://github.com/dotnet/runtime
28+
#
29+
#=====================================================
30+
# Default settings:
31+
# A newline ending every file
32+
# Use 4 spaces as indentation
33+
insert_final_newline = true
34+
indent_style = space
35+
indent_size = 4
36+
trim_trailing_whitespace = true
37+
38+
# Generated code
39+
[*{_AssemblyInfo.cs,.notsupported.cs,AsmOffsets.cs}]
40+
generated_code = true
41+
42+
# C# files
43+
[*.cs]
44+
# New line preferences
45+
csharp_new_line_before_open_brace = all
46+
csharp_new_line_before_else = true
47+
csharp_new_line_before_catch = true
48+
csharp_new_line_before_finally = true
49+
csharp_new_line_before_members_in_object_initializers = true
50+
csharp_new_line_before_members_in_anonymous_types = true
51+
csharp_new_line_between_query_expression_clauses = true
52+
53+
# Indentation preferences
54+
csharp_indent_block_contents = true
55+
csharp_indent_braces = false
56+
csharp_indent_case_contents = true
57+
csharp_indent_case_contents_when_block = false
58+
csharp_indent_switch_labels = true
59+
csharp_indent_labels = one_less_than_current
60+
61+
# Modifier preferences
62+
csharp_preferred_modifier_order = public,private,protected,internal,file,static,extern,new,virtual,abstract,sealed,override,readonly,unsafe,required,volatile,async:suggestion
63+
64+
# avoid this. unless absolutely necessary
65+
dotnet_style_qualification_for_field = false:suggestion
66+
dotnet_style_qualification_for_property = false:suggestion
67+
dotnet_style_qualification_for_method = false:suggestion
68+
dotnet_style_qualification_for_event = false:suggestion
69+
70+
# Types: use keywords instead of BCL types, and permit var only when the type is clear
71+
csharp_style_var_for_built_in_types = false:suggestion
72+
csharp_style_var_when_type_is_apparent = false:none
73+
csharp_style_var_elsewhere = false:suggestion
74+
dotnet_style_predefined_type_for_locals_parameters_members = true:suggestion
75+
dotnet_style_predefined_type_for_member_access = true:suggestion
76+
77+
# name all constant fields using PascalCase
78+
dotnet_naming_rule.constant_fields_should_be_pascal_case.severity = suggestion
79+
dotnet_naming_rule.constant_fields_should_be_pascal_case.symbols = constant_fields
80+
dotnet_naming_rule.constant_fields_should_be_pascal_case.style = pascal_case_style
81+
dotnet_naming_symbols.constant_fields.applicable_kinds = field
82+
dotnet_naming_symbols.constant_fields.required_modifiers = const
83+
dotnet_naming_style.pascal_case_style.capitalization = pascal_case
84+
85+
# static fields should have s_ prefix
86+
dotnet_naming_rule.static_fields_should_have_prefix.severity = suggestion
87+
dotnet_naming_rule.static_fields_should_have_prefix.symbols = static_fields
88+
dotnet_naming_rule.static_fields_should_have_prefix.style = static_prefix_style
89+
dotnet_naming_symbols.static_fields.applicable_kinds = field
90+
dotnet_naming_symbols.static_fields.required_modifiers = static
91+
dotnet_naming_symbols.static_fields.applicable_accessibilities = private, internal, private_protected
92+
dotnet_naming_style.static_prefix_style.required_prefix = s_
93+
dotnet_naming_style.static_prefix_style.capitalization = camel_case
94+
95+
# internal and private fields should be _camelCase
96+
dotnet_naming_rule.camel_case_for_private_internal_fields.severity = suggestion
97+
dotnet_naming_rule.camel_case_for_private_internal_fields.symbols = private_internal_fields
98+
dotnet_naming_rule.camel_case_for_private_internal_fields.style = camel_case_underscore_style
99+
dotnet_naming_symbols.private_internal_fields.applicable_kinds = field
100+
dotnet_naming_symbols.private_internal_fields.applicable_accessibilities = private, internal
101+
dotnet_naming_style.camel_case_underscore_style.required_prefix = _
102+
dotnet_naming_style.camel_case_underscore_style.capitalization = camel_case
103+
104+
# Code style defaults
105+
csharp_using_directive_placement = outside_namespace:suggestion
106+
dotnet_sort_system_directives_first = true
107+
csharp_prefer_braces = true:silent
108+
csharp_preserve_single_line_blocks = true:none
109+
csharp_preserve_single_line_statements = false:none
110+
csharp_prefer_static_local_function = true:suggestion
111+
csharp_prefer_simple_using_statement = false:none
112+
csharp_style_prefer_switch_expression = true:suggestion
113+
dotnet_style_readonly_field = true:suggestion
114+
115+
# Expression-level preferences
116+
dotnet_style_object_initializer = true:suggestion
117+
dotnet_style_collection_initializer = true:suggestion
118+
dotnet_style_prefer_collection_expression = when_types_exactly_match
119+
dotnet_style_explicit_tuple_names = true:suggestion
120+
dotnet_style_coalesce_expression = true:suggestion
121+
dotnet_style_null_propagation = true:suggestion
122+
dotnet_style_prefer_is_null_check_over_reference_equality_method = true:suggestion
123+
dotnet_style_prefer_inferred_tuple_names = true:suggestion
124+
dotnet_style_prefer_inferred_anonymous_type_member_names = true:suggestion
125+
dotnet_style_prefer_auto_properties = true:suggestion
126+
dotnet_style_prefer_conditional_expression_over_assignment = true:silent
127+
dotnet_style_prefer_conditional_expression_over_return = true:silent
128+
csharp_prefer_simple_default_expression = true:suggestion
129+
130+
# Expression-bodied members
131+
csharp_style_expression_bodied_methods = true:silent
132+
csharp_style_expression_bodied_constructors = true:silent
133+
csharp_style_expression_bodied_operators = true:silent
134+
csharp_style_expression_bodied_properties = true:silent
135+
csharp_style_expression_bodied_indexers = true:silent
136+
csharp_style_expression_bodied_accessors = true:silent
137+
csharp_style_expression_bodied_lambdas = true:silent
138+
csharp_style_expression_bodied_local_functions = true:silent
139+
140+
# Pattern matching
141+
csharp_style_pattern_matching_over_is_with_cast_check = true:suggestion
142+
csharp_style_pattern_matching_over_as_with_null_check = true:suggestion
143+
csharp_style_inlined_variable_declaration = true:suggestion
144+
145+
# Null checking preferences
146+
csharp_style_throw_expression = true:suggestion
147+
csharp_style_conditional_delegate_call = true:suggestion
148+
149+
# Other features
150+
csharp_style_prefer_index_operator = false:none
151+
csharp_style_prefer_range_operator = false:none
152+
csharp_style_pattern_local_over_anonymous_function = false:none
153+
154+
# Space preferences
155+
csharp_space_after_cast = false
156+
csharp_space_after_colon_in_inheritance_clause = true
157+
csharp_space_after_comma = true
158+
csharp_space_after_dot = false
159+
csharp_space_after_keywords_in_control_flow_statements = true
160+
csharp_space_after_semicolon_in_for_statement = true
161+
csharp_space_around_binary_operators = before_and_after
162+
csharp_space_around_declaration_statements = do_not_ignore
163+
csharp_space_before_colon_in_inheritance_clause = true
164+
csharp_space_before_comma = false
165+
csharp_space_before_dot = false
166+
csharp_space_before_open_square_brackets = false
167+
csharp_space_before_semicolon_in_for_statement = false
168+
csharp_space_between_empty_square_brackets = false
169+
csharp_space_between_method_call_empty_parameter_list_parentheses = false
170+
csharp_space_between_method_call_name_and_opening_parenthesis = false
171+
csharp_space_between_method_call_parameter_list_parentheses = false
172+
csharp_space_between_method_declaration_empty_parameter_list_parentheses = false
173+
csharp_space_between_method_declaration_name_and_open_parenthesis = false
174+
csharp_space_between_method_declaration_parameter_list_parentheses = false
175+
csharp_space_between_parentheses = false
176+
csharp_space_between_square_brackets = false
177+
178+
# License header
179+
file_header_template = Licensed to the .NET Foundation under one or more agreements.\nThe .NET Foundation licenses this file to you under the MIT license.
180+
181+
# C++ Files
182+
[*.{cpp,h,in}]
183+
curly_bracket_next_line = true
184+
indent_brace_style = Allman
185+
186+
# Xml project files
187+
[*.{csproj,vbproj,vcxproj,vcxproj.filters,proj,nativeproj,locproj}]
188+
indent_size = 2
189+
190+
[*.{csproj,vbproj,proj,nativeproj,locproj}]
191+
charset = utf-8
192+
193+
# Xml build files
194+
[*.builds]
195+
indent_size = 2
196+
197+
# Xml files
198+
[*.{xml,stylecop,resx,ruleset}]
199+
indent_size = 2
200+
201+
# Xml config files
202+
[*.{props,targets,config,nuspec}]
203+
indent_size = 2
204+
205+
# YAML config files
206+
[*.{yml,yaml}]
207+
indent_size = 2
208+
209+
# Shell scripts
210+
[*.sh]
211+
end_of_line = lf
212+
[*.{cmd,bat}]
213+
end_of_line = crlf

.github/.changelog-config.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
}
3838
],
3939
"sort": "ASC",
40-
"template": "${{CHANGELOG}}\n\n**Full Changelog:** ${{RELEASE_DIFF}}\n\nThe following NuGet package is available from this release:\n\n:package: [nanoFramework.Devices.Can](https://www.nuget.org/packages/nanoFramework.Devices.Can/)",
40+
"template": "${{CHANGELOG}}\n\n**Full Changelog:** ${{RELEASE_DIFF}}\n\nThe following NuGet packages are available from this release:\n\n:package: [nanoFramework.Devices.Can.Core](https://www.nuget.org/packages/nanoFramework.Devices.Can.Core/)\n:package: [nanoFramework.Device.Can.Stm32](https://www.nuget.org/packages/nanoFramework.Devices.Can.Stm32/)",
4141
"pr_template": "* ${{TITLE}} by @${{AUTHOR}} in #${{NUMBER}}",
4242
"empty_template": "- no changes",
4343
"max_tags_to_fetch": 200,

.github/workflows/pr-checks.yml

+2
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ jobs:
1010
check_package_lock:
1111
name: nanoFramework
1212
uses: nanoframework/nf-tools/.github/workflows/check-package-lock.yml@main
13+
with:
14+
solution: 'nanoFramework.Device.Can.sln'
1315
check_nuget_latest:
1416
name: nanoFramework
1517
uses: nanoframework/nf-tools/.github/workflows/check-packages-updated.yml@main

.github/workflows/update-dependencies.yml

+3-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ name: Daily update dependencies
77

88
on:
99
schedule:
10-
# At 00:10 UTC.
10+
# At 00:10 UTC.
1111
- cron: '10 00 * * Wed,Fri'
1212
repository_dispatch:
1313
types: update-dependencies
@@ -18,4 +18,5 @@ jobs:
1818
uses: nanoframework/nf-tools/.github/workflows/update-dependencies.yml@main
1919
secrets: inherit
2020
with:
21-
solutionsToCheck: 'nanoFramework.Device.Can.sln'
21+
solutionsToCheck: |
22+
nanoFramework.Device.Can.sln

README.md

+19-2
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,33 @@
1-
[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=nanoframework_lib-nanoFramework.Devices.Can&metric=alert_status)](https://sonarcloud.io/dashboard?id=nanoframework_lib-nanoFramework.Devices.Can) [![Reliability Rating](https://sonarcloud.io/api/project_badges/measure?project=nanoframework_lib-nanoFramework.Devices.Can&metric=reliability_rating)](https://sonarcloud.io/dashboard?id=nanoframework_lib-nanoFramework.Devices.Can) [![License](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE) [![NuGet](https://img.shields.io/nuget/dt/nanoFramework.Device.Can.svg?label=NuGet&style=flat&logo=nuget)](https://www.nuget.org/packages/nanoFramework.Device.Can/) [![#yourfirstpr](https://img.shields.io/badge/first--timers--only-friendly-blue.svg)](https://github.com/nanoframework/Home/blob/main/CONTRIBUTING.md) [![Discord](https://img.shields.io/discord/478725473862549535.svg?logo=discord&logoColor=white&label=Discord&color=7289DA)](https://discord.gg/gCyBu8T)
1+
[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=nanoframework_lib-nanoFramework.Devices.Can&metric=alert_status)](https://sonarcloud.io/dashboard?id=nanoframework_lib-nanoFramework.Devices.Can) [![Reliability Rating](https://sonarcloud.io/api/project_badges/measure?project=nanoframework_lib-nanoFramework.Devices.Can&metric=reliability_rating)](https://sonarcloud.io/dashboard?id=nanoframework_lib-nanoFramework.Devices.Can) [![License](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE) [![NuGet](https://img.shields.io/nuget/dt/nanoFramework.Device.Can.svg?label=NuGet&style=flat&logo=nuget)](https://www.nuget.org/packages/nanoFramework.Device.Can/) [![#yourfirstpr](https://img.shields.io/badge/first--timers--only-friendly-blue.svg)](https://github.com/nanoframework/Home/blob/main/CONTRIBUTING.md) [![Discord](https://img.shields.io/discord/478725473862549535.svg?logo=discord&logoColor=white&label=Discord&color=7289DA)](https://discord.gg/gCyBu8T)
22

33
![nanoFramework logo](https://raw.githubusercontent.com/nanoframework/Home/main/resources/logo/nanoFramework-repo-logo.png)
44

55
-----
66

77
### Welcome to the .NET **nanoFramework** CAN Class Library repository
88

9+
These libraries are the successor of the `nanoFramework.Device.Can` class library that required a native component and was available for two STM32-based boards. The direct replacement of that library is `nanoFramework.Device.Can.Stm32`.
10+
911
## Build status
1012

1113
| Component | Build Status | NuGet Package |
1214
|:-|---|---|
13-
| nanoFramework.Device.Can | [![Build Status](https://dev.azure.com/nanoframework/nanoFramework.Device.Can/_apis/build/status/nanoFramework.Device.Can?repoName=nanoframework%2FnanoFramework.Device.Can&branchName=main)](https://dev.azure.com/nanoframework/nanoFramework.Device.Can/_build/latest?definitionId=25&repoName=nanoframework%2FnanoFramework.Device.Can&branchName=main) | [![NuGet](https://img.shields.io/nuget/v/nanoFramework.Device.Can.svg?label=NuGet&style=flat&logo=nuget)](https://www.nuget.org/packages/nanoFramework.Device.Can/) |
15+
| nanoFramework.Device.Can.Core | [![Build Status](https://dev.azure.com/nanoframework/nanoFramework.Device.Can/_apis/build/status/nanoFramework.Device.Can?repoName=nanoframework%2FnanoFramework.Device.Can&branchName=main)](https://dev.azure.com/nanoframework/nanoFramework.Device.Can/_build/latest?definitionId=25&repoName=nanoframework%2FnanoFramework.Device.Can&branchName=main) | [![NuGet](https://img.shields.io/nuget/v/nanoFramework.Device.Can.Core.svg?label=NuGet&style=flat&logo=nuget)](https://www.nuget.org/packages/nanoFramework.Device.Can.Core/) |
16+
| nanoFramework.Device.Can.Esp32 | [![Build Status](https://dev.azure.com/nanoframework/nanoFramework.Device.Can/_apis/build/status/nanoFramework.Device.Can?repoName=nanoframework%2FnanoFramework.Device.Can&branchName=main)](https://dev.azure.com/nanoframework/nanoFramework.Device.Can/_build/latest?definitionId=25&repoName=nanoframework%2FnanoFramework.Device.Can&branchName=main) | [![NuGet](https://img.shields.io/nuget/v/nanoFramework.Device.Can.Esp32.svg?label=NuGet&style=flat&logo=nuget)](https://www.nuget.org/packages/nanoFramework.Device.Can.Esp32/) |
17+
| nanoFramework.Device.Can.Mcp2515 | [![Build Status](https://dev.azure.com/nanoframework/nanoFramework.Device.Can/_apis/build/status/nanoFramework.Device.Can?repoName=nanoframework%2FnanoFramework.Device.Can&branchName=main)](https://dev.azure.com/nanoframework/nanoFramework.Device.Can/_build/latest?definitionId=25&repoName=nanoframework%2FnanoFramework.Device.Can&branchName=main) | [![NuGet](https://img.shields.io/nuget/v/nanoFramework.Device.Can.Mc2515.svg?label=NuGet&style=flat&logo=nuget)](https://www.nuget.org/packages/nanoFramework.Device.Can.Mcp2515/) |
18+
| nanoFramework.Device.Can.Stm32 | [![Build Status](https://dev.azure.com/nanoframework/nanoFramework.Device.Can/_apis/build/status/nanoFramework.Device.Can?repoName=nanoframework%2FnanoFramework.Device.Can&branchName=main)](https://dev.azure.com/nanoframework/nanoFramework.Device.Can/_build/latest?definitionId=25&repoName=nanoframework%2FnanoFramework.Device.Can&branchName=main) | [![NuGet](https://img.shields.io/nuget/v/nanoFramework.Device.Can.Stm32.svg?label=NuGet&style=flat&logo=nuget)](https://www.nuget.org/packages/nanoFramework.Device.Can.Stm32/) |
19+
20+
## The .NET **nanoFramework** CAN Class Libraries
21+
22+
To exchange CAN messages by a .NET **nanoFramework** application, at least one device dependent class library is required:
23+
24+
- `nanoFramework.Device.Can.Esp32` uses the CAN/TWAI implementation of an ESP32 microcontroller. This requires a matching firmware/target version for the microcontroller that provides the native part of the implementation. In general an external CAN transceiver is also required.
25+
- `nanoFramework.Device.Can.Stm` uses the CAN implementation of a STM32 microcontroller. This requires a matching firmware/target version for the microcontroller that provides the native part of the implementation. In general an external CAN transceiver is also required.
26+
- `nanoFramework.Device.Can.Mcp2515` uses an external CAN device based on the MCP2515 chip. It is a 100% .NET implementation that works with every microcontroller, and can be used in combination with the ESP32 or STM32 library. MCP2515 boards typically include a CAN transceiver.
27+
28+
All device dependent libraries are based on:
29+
30+
- `nanoFramework.Device.Can.Core` contains the common classes and interfaces. As the `nanoFramework.Device.Can` namespace implements the basic ISO 11898 CAN message transfer, this library can be used to implement higher-level protocols (e.g., CAN-TP or ISO-TP as used in ODB II) in device independent libraries.
1431

1532
## Feedback and documentation
1633

Stub-generation.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Stub generation
2+
3+
The libraries that require a native components generate a stub for the native part on each build. The stub is placed in, e.g., the `nanoFramework.Device.Can.Stm32\bin\Release\Stubs` directory.
4+
5+
The native component will probably require access to the common classes in `nanoFramework.Device.Can.Core`. As that library is pure .NET, no stub is required. To generate the stub, select the **GenerateStub** configuration (instead of *Debug* or *Release*) in the *nanoFramework.Device.Can.sln* solution and build the solution. The stub will be placed in the `nanoFramework.Device.Can.Core\bin'\GenerateStubs\Stubs` directory.

0 commit comments

Comments
 (0)