Skip to content

Commit

Permalink
feat: Add support for project-framework distribution 'cli'
Browse files Browse the repository at this point in the history
  • Loading branch information
davidkallesen committed Apr 11, 2024
1 parent ba34e67 commit 2e67e47
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 23 deletions.
39 changes: 16 additions & 23 deletions src/Atc.CodingRules.Updater.CLI/ProjectHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,12 @@ private static void HandleEditorConfigFiles(
continue;
}

EditorConfigHelper.HandleFile(logger, "ProjectFramework", projectFrameworkCodingRulesBaseUrl, csProjFile.Directory!, projectFrameworkType.ToStringLowerCase());
EditorConfigHelper.HandleFile(
logger,
"ProjectFramework",
projectFrameworkCodingRulesBaseUrl,
csProjFile.Directory!,
projectFrameworkType.ToStringLowerCase());
}
}

Expand All @@ -141,29 +146,17 @@ private static ProjectFrameworkType DetermineProjectFrameworkType(
}
else
{
switch (projectType)
projectFrameworkType = projectType switch
{
case DotnetProjectType.AzureFunctionApp:
projectFrameworkType = ProjectFrameworkType.AzureFunctions;
break;
case DotnetProjectType.BlazorServerApp:
case DotnetProjectType.BlazorWAsmApp:
projectFrameworkType = ProjectFrameworkType.Blazor;
break;
case DotnetProjectType.MauiApp:
projectFrameworkType = ProjectFrameworkType.Maui;
break;
case DotnetProjectType.WinFormApp:
projectFrameworkType = ProjectFrameworkType.WinForms;
break;
case DotnetProjectType.WpfApp:
case DotnetProjectType.WpfLibrary:
projectFrameworkType = ProjectFrameworkType.Wpf;
break;
case DotnetProjectType.WebApi:
projectFrameworkType = ProjectFrameworkType.WebApi;
break;
}
DotnetProjectType.AzureFunctionApp => ProjectFrameworkType.AzureFunctions,
DotnetProjectType.BlazorServerApp or DotnetProjectType.BlazorWAsmApp => ProjectFrameworkType.Blazor,
DotnetProjectType.CliApp => ProjectFrameworkType.Cli,
DotnetProjectType.MauiApp => ProjectFrameworkType.Maui,
DotnetProjectType.WinFormApp => ProjectFrameworkType.WinForms,
DotnetProjectType.WpfApp or DotnetProjectType.WpfLibrary => ProjectFrameworkType.Wpf,
DotnetProjectType.WebApi => ProjectFrameworkType.WebApi,
_ => projectFrameworkType,
};
}

return projectFrameworkType;
Expand Down
1 change: 1 addition & 0 deletions src/Atc.CodingRules.Updater/ProjectFrameworkType.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ public enum ProjectFrameworkType
None,
AzureFunctions,
Blazor,
Cli,
Maui,
WebApi,
WinForms,
Expand Down

0 comments on commit 2e67e47

Please sign in to comment.