chore: add projects for CLI introspection - #5
Conversation
There was a problem hiding this comment.
Pull request overview
This PR scaffolds the solution structure needed for upcoming CLI introspection work by adding new library, example, benchmark, and test projects, and wiring them into the solution/build.
Changes:
- Added new library projects for CLI Schema and OpenCLI introspection scaffolding.
- Added example apps (C#, F#, Visual Basic), a BenchmarkDotNet benchmarks project, and an MSTest test project.
- Updated solution and repo-wide build/package configuration to support the new projects.
Reviewed changes
Copilot reviewed 29 out of 29 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| source/tests/FlashOWare.CommandLine.Introspection.Tests/Properties/AssemblyInfo.cs | Adds MSTest parallelization setting for tests. |
| source/tests/FlashOWare.CommandLine.Introspection.Tests/FlashOWare.CommandLine.Introspection.Tests.csproj | Introduces MSTest-based test project referencing new libs. |
| source/tests/Directory.Build.props | Sets test-project defaults and shared usings under /tests. |
| source/tests/.globalconfig | Configures analyzer severities for test projects. |
| source/perf/FlashOWare.CommandLine.Introspection.Benchmarks/Properties/AssemblyInfo.cs | Adds assembly metadata for benchmarks project. |
| source/perf/FlashOWare.CommandLine.Introspection.Benchmarks/Program.cs | Adds BenchmarkDotNet entrypoint with custom config. |
| source/perf/FlashOWare.CommandLine.Introspection.Benchmarks/FlashOWare.CommandLine.Introspection.Benchmarks.csproj | Adds benchmark project referencing new libs. |
| source/perf/Directory.Build.props | Sets shared build defaults under /perf. |
| source/perf/.globalconfig | Configures analyzer severities for perf projects. |
| source/lib/FlashOWare.CommandLine.Introspection.OpenCli/Properties/AssemblyInfo.cs | Adds CLS compliance metadata for OpenCLI library. |
| source/lib/FlashOWare.CommandLine.Introspection.OpenCli/FlashOWare.CommandLine.Introspection.OpenCli.csproj | Adds OpenCLI library project. |
| source/lib/FlashOWare.CommandLine.Introspection.CliSchema/Properties/AssemblyInfo.cs | Adds CLS compliance metadata for CLI Schema library. |
| source/lib/FlashOWare.CommandLine.Introspection.CliSchema/FlashOWare.CommandLine.Introspection.CliSchema.csproj | Adds CLI Schema library project. |
| source/lib/Directory.Build.props | Adds pack/doc/trim/AOT-related defaults for libraries. |
| source/lib/.globalconfig | Enables global config under /lib. |
| source/FlashOWare.CommandLine.slnx | Adds new projects/files to the solution structure. |
| source/examples/FlashOWare.CommandLine.Example.VisualBasic/Properties/GlobalSuppressions.vb | Adds demo-specific suppression. |
| source/examples/FlashOWare.CommandLine.Example.VisualBasic/Properties/AssemblyInfo.vb | Adds assembly metadata for VB example. |
| source/examples/FlashOWare.CommandLine.Example.VisualBasic/Program.vb | Adds VB demo app using System.CommandLine + Octokit. |
| source/examples/FlashOWare.CommandLine.Example.VisualBasic/FlashOWare.CommandLine.Example.VisualBasic.vbproj | Adds VB example project and references. |
| source/examples/FlashOWare.CommandLine.Example.FSharp/Program.fs | Adds F# demo app using System.CommandLine + Octokit. |
| source/examples/FlashOWare.CommandLine.Example.FSharp/FlashOWare.CommandLine.Example.FSharp.fsproj | Adds F# example project and references. |
| source/examples/FlashOWare.CommandLine.Example.CSharp/Properties/AssemblyInfo.cs | Adds assembly metadata for C# example. |
| source/examples/FlashOWare.CommandLine.Example.CSharp/Program.cs | Adds C# demo app using System.CommandLine + Octokit. |
| source/examples/FlashOWare.CommandLine.Example.CSharp/FlashOWare.CommandLine.Example.CSharp.csproj | Adds C# example project and references. |
| source/examples/Directory.Build.props | Enables trimming/AOT defaults for example apps. |
| source/examples/.globalconfig | Example-specific analyzer configuration. |
| source/Directory.Packages.props | Adds central package versions for new dependencies. |
| source/Directory.Build.props | Extends repo-wide language version and build/analyzer settings. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| @@ -0,0 +1 @@ | |||
| [assembly: Parallelize(Scope = ExecutionScope.MethodLevel)] | |||
There was a problem hiding this comment.
Wrong!
The SDK in use for this Project is MSTest.Sdk, which already comes with:
<ItemGroup>
<Using Include="Microsoft.VisualStudio.TestTools.UnitTesting" />
</ItemGroup>You only did a syntactic check of this document,
but with .NET and C#, you need to do semantic checks of the compilation.
| <AssemblyName>FlashOWare.CommandLine.Introspection.Tests</AssemblyName> | ||
| <RootNamespace>FlashOWare.CommandLine.Tests</RootNamespace> |
There was a problem hiding this comment.
No!
This is a conscious structural decision:
This single Test-Project will include tests for more than one library.
So there will be an appropriate Introspection folder/namespace added once features are added to the libraries and respective tests are added here.
However, I might change my mind here, see:
- https://github.com/FlashOWare/command-line-interfaces/pull/5/files#r3778299260
- https://github.com/FlashOWare/command-line-interfaces/pull/5/files#r3778304518
When applying this change, there will be two test projects instead, one per library project.
| <PropertyGroup> | ||
| <TargetFramework>net10.0</TargetFramework> |
| <!-- The IsAotCompatible assembly metadata was introduced in .NET 10.0: [assembly: AssemblyMetadata("IsAotCompatible", "True")] --> | ||
| <PropertyGroup> | ||
| <IsAotCompatible Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net8.0'))">true</IsAotCompatible> | ||
| <VerifyReferenceAotCompatibility Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net10.0'))">true</VerifyReferenceAotCompatibility> |
There was a problem hiding this comment.
Incorrect!
The IsAotCompatible metadata is indeed emitted since net10.0.
But Native AOT deployment is already supported since net7.0, and net8.0 adds AOT analysis warnings.
See documentation:
https://learn.microsoft.com/dotnet/core/deploying/native-aot#target-framework-requirements
When preparing libraries for AOT compatibility, target the latest supported TFM. This helps you benefit from the latest analyzer improvements. At a minimum, targetnet8.0or later. This version is required for AOT analysis warnings.
Therefore can we only VerifyReferenceAotCompatibility since net10.0.
| </PropertyGroup> | ||
|
|
||
| <PropertyGroup> | ||
| <AllowUnsafeBlocks>true</AllowUnsafeBlocks> |
There was a problem hiding this comment.
Rejected!
This is preparing for Unsafe evolution, starting with the upcoming C# 15, planned to be releases with C# 16. See:
| <PropertyGroup> | ||
| <OutputType>Library</OutputType> | ||
| <TargetFramework>net10.0</TargetFramework> | ||
| <AssemblyName>FlashOWare.CommandLine.Introspection.CliSchema</AssemblyName> |
There was a problem hiding this comment.
suggestion: Consider removing ".Introspection." from the project/assembly/package name.
| <PropertyGroup> | ||
| <OutputType>Library</OutputType> | ||
| <TargetFramework>net10.0</TargetFramework> | ||
| <AssemblyName>FlashOWare.CommandLine.Introspection.OpenCli</AssemblyName> |
There was a problem hiding this comment.
suggestion: Consider removing ".Introspection." from the project/assembly/package name.
Summary
Add .NET projects for CLI introspection (see #3 and #4)
Remarks
TODO
closes: #2