Skip to content

Commit

Permalink
Add all projects
Browse files Browse the repository at this point in the history
  • Loading branch information
BretJohnson committed Feb 7, 2024
1 parent 4273816 commit f61f66d
Show file tree
Hide file tree
Showing 89 changed files with 2,871 additions and 57 deletions.
40 changes: 34 additions & 6 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ trim_trailing_whitespace = true

# MSBuild project files
[*.{csproj,vbproj,vcxproj,vcxproj.filters,proj,projitems,shproj,msbuildproj,props,targets}]
indent_size = 2
indent_size = 4

# Xml config files
[*.{ruleset,config,nuspec,resx,vsixmanifest,vsct,runsettings}]
Expand Down Expand Up @@ -71,7 +71,7 @@ dotnet_naming_style.non_private_static_field_style.capitalization = pascal_case
# Constants are PascalCase
dotnet_naming_rule.constants_should_be_pascal_case.severity = suggestion
dotnet_naming_rule.constants_should_be_pascal_case.symbols = constants
dotnet_naming_rule.constants_should_be_pascal_case.style = constant_style
dotnet_naming_rule.constants_should_be_pascal_case.style = non_private_static_field_style

dotnet_naming_symbols.constants.applicable_kinds = field, local
dotnet_naming_symbols.constants.required_modifiers = const
Expand All @@ -81,21 +81,22 @@ dotnet_naming_style.constant_style.capitalization = pascal_case
# Static fields are camelCase
dotnet_naming_rule.static_fields_should_be_camel_case.severity = suggestion
dotnet_naming_rule.static_fields_should_be_camel_case.symbols = static_fields
dotnet_naming_rule.static_fields_should_be_camel_case.style = static_field_style
dotnet_naming_rule.static_fields_should_be_camel_case.style = camel_case_style

dotnet_naming_symbols.static_fields.applicable_kinds = field
dotnet_naming_symbols.static_fields.required_modifiers = static

dotnet_naming_style.static_field_style.capitalization = camel_case

# Instance fields are camelCase
# Instance fields are camelCase and start with _
dotnet_naming_rule.instance_fields_should_be_camel_case.severity = suggestion
dotnet_naming_rule.instance_fields_should_be_camel_case.symbols = instance_fields
dotnet_naming_rule.instance_fields_should_be_camel_case.style = instance_field_style

dotnet_naming_symbols.instance_fields.applicable_kinds = field

dotnet_naming_style.instance_field_style.capitalization = camel_case
dotnet_naming_style.instance_field_style.required_prefix = _

# Locals and parameters are camelCase
dotnet_naming_rule.locals_should_be_camel_case.severity = suggestion
Expand All @@ -109,7 +110,7 @@ dotnet_naming_style.camel_case_style.capitalization = camel_case
# Local functions are PascalCase
dotnet_naming_rule.local_functions_should_be_pascal_case.severity = suggestion
dotnet_naming_rule.local_functions_should_be_pascal_case.symbols = local_functions
dotnet_naming_rule.local_functions_should_be_pascal_case.style = local_function_style
dotnet_naming_rule.local_functions_should_be_pascal_case.style = non_private_static_field_style

dotnet_naming_symbols.local_functions.applicable_kinds = local_function

Expand All @@ -118,11 +119,13 @@ dotnet_naming_style.local_function_style.capitalization = pascal_case
# By default, name items with PascalCase
dotnet_naming_rule.members_should_be_pascal_case.severity = suggestion
dotnet_naming_rule.members_should_be_pascal_case.symbols = all_members
dotnet_naming_rule.members_should_be_pascal_case.style = pascal_case_style
dotnet_naming_rule.members_should_be_pascal_case.style = non_private_static_field_style

dotnet_naming_symbols.all_members.applicable_kinds = *

dotnet_naming_style.pascal_case_style.capitalization = pascal_case
dotnet_style_operator_placement_when_wrapping = beginning_of_line
tab_width = 4

# CSharp code style settings:
[*.cs]
Expand Down Expand Up @@ -183,6 +186,31 @@ dotnet_diagnostic.DOC202.severity = warning

# CA1062: Validate arguments of public methods
dotnet_diagnostic.CA1062.severity = warning
csharp_using_directive_placement = outside_namespace:silent
csharp_prefer_simple_using_statement = true:suggestion
csharp_style_namespace_declarations = block_scoped:silent
csharp_style_prefer_method_group_conversion = true:silent
csharp_style_prefer_top_level_statements = true:silent
csharp_style_prefer_primary_constructors = true:suggestion
csharp_style_expression_bodied_lambdas = true:silent
csharp_style_expression_bodied_local_functions = false:silent

# For now, don't require doc

# SA1600: Elements should be documented
dotnet_diagnostic.SA1600.severity = silent

# SA1601: Partial elements should be documented
dotnet_diagnostic.SA1601.severity = silent

# SA1602: Enumeration items should be documented
dotnet_diagnostic.SA1602.severity = silent

# SA1615: Element return value should be documented
dotnet_diagnostic.SA1615.severity = silent

# CS1591: Missing XML comment for publicly visible type or member
dotnet_diagnostic.CS1591.severity = silent

[*.sln]
indent_style = tab
12 changes: 7 additions & 5 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,20 @@
<PropertyGroup>
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
<CentralPackageTransitivePinningEnabled>true</CentralPackageTransitivePinningEnabled>
<MauiVersion>8.0.6</MauiVersion>
</PropertyGroup>
<ItemGroup>
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.8.0" />
<PackageVersion Include="xunit.runner.visualstudio" Version="2.5.6" />
<PackageVersion Include="xunit" Version="2.6.6" />
</ItemGroup>
<ItemGroup>
<GlobalPackageReference Include="CSharpIsNullAnalyzer" Version="0.1.495" />
<GlobalPackageReference Include="DotNetAnalyzers.DocumentationAnalyzers" Version="1.0.0-beta.59" />
<GlobalPackageReference Include="Nerdbank.GitVersioning" Version="3.6.133" />
<GlobalPackageReference Include="Nullable" Version="1.3.1" />
<GlobalPackageReference Include="StyleCop.Analyzers.Unstable" Version="1.2.0.556" />

<PackageVersion Include="Microsoft.Maui.Controls" Version="$(MauiVersion)" />
<PackageVersion Include="Microsoft.Maui.Controls.Compatibility" Version="$(MauiVersion)" />
<PackageVersion Include="Aspire.Hosting" Version="8.0.0-preview.2.23619.3" />
<PackageVersion Include="Microsoft.Extensions.Logging.Debug" Version="8.0.0" />
<PackageVersion Include="Microsoft.Extensions.Hosting" Version="8.0.0" />
</ItemGroup>
<ItemGroup>
<GlobalPackageReference Include="Microsoft.SourceLink.GitHub" Version="8.0.0" />
Expand Down
42 changes: 27 additions & 15 deletions MauiAspire.sln
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.29322.22
# Visual Studio Version 17
VisualStudioVersion = 17.9.34526.213
MinimumVisualStudioVersion = 15.0.26124.0
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{1CE9670B-D5FF-46A7-9D00-24E70E6ED48B}"
ProjectSection(SolutionItems) = preProject
Expand Down Expand Up @@ -32,35 +32,47 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{36CCE840-6
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{781AA387-FFB1-47AD-8A96-E7AE9A8A775F}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MauiAspire", "src\MauiAspire\MauiAspire.csproj", "{38C0C2D0-5419-4703-A517-F2B4F3DADE1E}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MauiAspire.App", "src\MauiAspire.App\MauiAspire.App.csproj", "{F257BEFA-72A9-46CE-85B4-34BA745CA753}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{53AB3F91-55BA-46F5-97F2-F1BBFA3EC4FB}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MauiAspire.Hosting", "src\MauiAspire.Hosting\MauiAspire.Hosting.csproj", "{10607B5B-5430-4560-800B-05986D9DD1DA}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MauiAspire.Tests", "test\MauiAspire.Tests\MauiAspire.Tests.csproj", "{5D0008F8-DE83-4740-81A3-9851176A7D86}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MauiAspire.Hosting.SettingsGenerator", "src\MauiAspire.Hosting.SettingsGenerator\MauiAspire.Hosting.SettingsGenerator.csproj", "{09E69644-F3BA-4E51-87BE-B768F731B5B4}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MauiAspire.ProjectTemplates", "src\MauiAspire.ProjectTemplates\MauiAspire.ProjectTemplates.csproj", "{53E288B2-9431-489D-BA0C-7A2547EE5624}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{38C0C2D0-5419-4703-A517-F2B4F3DADE1E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{38C0C2D0-5419-4703-A517-F2B4F3DADE1E}.Debug|Any CPU.Build.0 = Debug|Any CPU
{38C0C2D0-5419-4703-A517-F2B4F3DADE1E}.Release|Any CPU.ActiveCfg = Release|Any CPU
{38C0C2D0-5419-4703-A517-F2B4F3DADE1E}.Release|Any CPU.Build.0 = Release|Any CPU
{5D0008F8-DE83-4740-81A3-9851176A7D86}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{5D0008F8-DE83-4740-81A3-9851176A7D86}.Debug|Any CPU.Build.0 = Debug|Any CPU
{5D0008F8-DE83-4740-81A3-9851176A7D86}.Release|Any CPU.ActiveCfg = Release|Any CPU
{5D0008F8-DE83-4740-81A3-9851176A7D86}.Release|Any CPU.Build.0 = Release|Any CPU
{F257BEFA-72A9-46CE-85B4-34BA745CA753}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{F257BEFA-72A9-46CE-85B4-34BA745CA753}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F257BEFA-72A9-46CE-85B4-34BA745CA753}.Release|Any CPU.ActiveCfg = Release|Any CPU
{F257BEFA-72A9-46CE-85B4-34BA745CA753}.Release|Any CPU.Build.0 = Release|Any CPU
{10607B5B-5430-4560-800B-05986D9DD1DA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{10607B5B-5430-4560-800B-05986D9DD1DA}.Debug|Any CPU.Build.0 = Debug|Any CPU
{10607B5B-5430-4560-800B-05986D9DD1DA}.Release|Any CPU.ActiveCfg = Release|Any CPU
{10607B5B-5430-4560-800B-05986D9DD1DA}.Release|Any CPU.Build.0 = Release|Any CPU
{09E69644-F3BA-4E51-87BE-B768F731B5B4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{09E69644-F3BA-4E51-87BE-B768F731B5B4}.Debug|Any CPU.Build.0 = Debug|Any CPU
{09E69644-F3BA-4E51-87BE-B768F731B5B4}.Release|Any CPU.ActiveCfg = Release|Any CPU
{09E69644-F3BA-4E51-87BE-B768F731B5B4}.Release|Any CPU.Build.0 = Release|Any CPU
{53E288B2-9431-489D-BA0C-7A2547EE5624}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{53E288B2-9431-489D-BA0C-7A2547EE5624}.Debug|Any CPU.Build.0 = Debug|Any CPU
{53E288B2-9431-489D-BA0C-7A2547EE5624}.Release|Any CPU.ActiveCfg = Release|Any CPU
{53E288B2-9431-489D-BA0C-7A2547EE5624}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{9E154A29-1796-4B85-BD81-B6A385D8FF71} = {1CE9670B-D5FF-46A7-9D00-24E70E6ED48B}
{36CCE840-6FE5-4DB9-A8D5-8CF3CB6D342A} = {1CE9670B-D5FF-46A7-9D00-24E70E6ED48B}
{38C0C2D0-5419-4703-A517-F2B4F3DADE1E} = {781AA387-FFB1-47AD-8A96-E7AE9A8A775F}
{5D0008F8-DE83-4740-81A3-9851176A7D86} = {53AB3F91-55BA-46F5-97F2-F1BBFA3EC4FB}
{F257BEFA-72A9-46CE-85B4-34BA745CA753} = {781AA387-FFB1-47AD-8A96-E7AE9A8A775F}
{10607B5B-5430-4560-800B-05986D9DD1DA} = {781AA387-FFB1-47AD-8A96-E7AE9A8A775F}
{09E69644-F3BA-4E51-87BE-B768F731B5B4} = {781AA387-FFB1-47AD-8A96-E7AE9A8A775F}
{53E288B2-9431-489D-BA0C-7A2547EE5624} = {781AA387-FFB1-47AD-8A96-E7AE9A8A775F}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {E3944F6A-384B-4B0F-B93F-3BD513DC57BD}
Expand Down
85 changes: 85 additions & 0 deletions src/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@

[*.{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_operator_placement_when_wrapping = beginning_of_line
tab_width = 4
indent_size = 4
end_of_line = crlf
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:silent
dotnet_style_object_initializer = true:suggestion
dotnet_style_collection_initializer = true:suggestion
dotnet_style_prefer_simplified_boolean_expressions = true:suggestion
dotnet_style_prefer_conditional_expression_over_assignment = true:silent
dotnet_style_prefer_conditional_expression_over_return = true:silent
dotnet_style_explicit_tuple_names = true:suggestion
dotnet_style_prefer_inferred_tuple_names = true:suggestion
dotnet_style_prefer_inferred_anonymous_type_member_names = true:suggestion
dotnet_style_prefer_compound_assignment = true:suggestion
dotnet_style_prefer_simplified_interpolation = true:suggestion
dotnet_style_prefer_collection_expression = when_types_loosely_match:suggestion

[*.cs]
csharp_indent_labels = flush_left
csharp_using_directive_placement = outside_namespace:silent
csharp_prefer_simple_using_statement = true:suggestion
csharp_prefer_braces = true:silent
csharp_style_namespace_declarations = block_scoped:silent
csharp_style_prefer_method_group_conversion = true:silent
csharp_style_prefer_top_level_statements = true:silent
csharp_style_prefer_primary_constructors = true:suggestion
csharp_style_expression_bodied_methods = false:none
csharp_style_expression_bodied_constructors = false:none
csharp_style_expression_bodied_operators = false:none
csharp_style_expression_bodied_properties = true:none
csharp_style_expression_bodied_indexers = true:none
csharp_style_expression_bodied_accessors = true:none
csharp_style_expression_bodied_lambdas = true:silent
csharp_style_expression_bodied_local_functions = false:silent
28 changes: 28 additions & 0 deletions src/MauiAspire.App/MauiAspire.App.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net8.0-android;net8.0-ios;net8.0-maccatalyst</TargetFrameworks>
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows'))">$(TargetFrameworks);net8.0-windows10.0.19041.0</TargetFrameworks>
<!-- Uncomment to also build the tizen app. You will need to install tizen by following this: https://github.com/Samsung/Tizen.NET -->
<!-- <TargetFrameworks>$(TargetFrameworks);net8.0-tizen</TargetFrameworks> -->
<UseMaui>true</UseMaui>
<SingleProject>true</SingleProject>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>

<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'ios'">11.0</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'maccatalyst'">13.1</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'android'">21.0</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows'">10.0.17763.0</SupportedOSPlatformVersion>
<TargetPlatformMinVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows'">10.0.17763.0</TargetPlatformMinVersion>
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'tizen'">6.5</SupportedOSPlatformVersion>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Maui.Controls" />
<PackageReference Include="Microsoft.Maui.Controls.Compatibility" />
<PackageReference Include="Microsoft.Extensions.Logging.Debug" />
<PackageReference Include="Microsoft.Extensions.Hosting" />
</ItemGroup>

</Project>
15 changes: 15 additions & 0 deletions src/MauiAspire.App/MauiHostEnvironment.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
using Microsoft.Extensions.FileProviders;
using Microsoft.Extensions.Hosting;

namespace MauiAspire.App;

internal class MauiHostEnvironment : IHostEnvironment
{
public string ApplicationName { get; set; } = typeof(MauiHostEnvironment).Assembly.GetName().Name;

public IFileProvider ContentRootFileProvider { get; set; } = new PhysicalFileProvider(AppContext.BaseDirectory);

public string ContentRootPath { get; set; } = AppContext.BaseDirectory;

public string EnvironmentName { get; set; } = "Development"; // TODO: Get the correct EnvironmentName
}
38 changes: 38 additions & 0 deletions src/MauiAspire.App/WrapperMauiAppBuilder.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Diagnostics.Metrics;
using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.Logging;

namespace MauiAspire.App;

public class WrapperMauiAppBuilder : IHostApplicationBuilder
{
private readonly MauiAppBuilder _appBuilder;

public WrapperMauiAppBuilder(MauiAppBuilder appBuilder)
{
_appBuilder = appBuilder;
}

public IConfigurationManager Configuration => _appBuilder.Configuration;

public IHostEnvironment Environment => new MauiHostEnvironment();

public ILoggingBuilder Logging => _appBuilder.Logging;

public IMetricsBuilder Metrics => null;

public IDictionary<object, object> Properties => throw new NotImplementedException();

public IServiceCollection Services => _appBuilder.Services;

public void ConfigureContainer<TContainerBuilder>(IServiceProviderFactory<TContainerBuilder> factory, Action<TContainerBuilder>? configure = null) where TContainerBuilder : notnull
{
_appBuilder.ConfigureContainer<TContainerBuilder>(factory, configure);
}

public MauiApp Build()
{
return _appBuilder.Build();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>

</Project>
Loading

0 comments on commit f61f66d

Please sign in to comment.