-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
.Net Processes - Update shared code pattern (#9438)
### Motivation and Context <!-- Thank you for your contribution to the semantic-kernel repo! Please help reviewers and future users, providing the following information: 1. Why is this change required? 2. What problem does it solve? 3. What scenario does it contribute to? 4. If it fixes an open issue, please link to the issue here. --> Shared code causing type collisions when used outside of _Runtime_ projects. ### Description <!-- Describe your changes, the overall approach, the underlying design. These notes will help understanding how your code works. Thanks! --> - Separate shared code for _Runtime_ projects from that which is targeted for _Core_ and _Abstractions_ - Isolate testing of shared code into its own project: `Process.Utilities.UnitTests` - Must never grant internal visiblity to `Process.Utilities.UnitTests` - Must never add reference from `Process.Utilities.UnitTests` to _Runtime_ projects - Must never allow common utilities to be `public` ### Contribution Checklist <!-- Before submitting this PR, please make sure: --> - [X] The code builds clean without any errors or warnings - [X] The PR follows the [SK Contribution Guidelines](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md) and the [pre-submission formatting script](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md#development-scripts) raises no violations - [X] All unit tests pass, and I have added new tests where possible - [X] I didn't break anyone 😄
- Loading branch information
Showing
17 changed files
with
87 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
44 changes: 44 additions & 0 deletions
44
dotnet/src/Experimental/Process.Utilities.UnitTests/Process.Utilities.UnitTests.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<RootNamespace>SemanticKernel.Process.Utilities.UnitTests</RootNamespace> | ||
<AssemblyName>SemanticKernel.Process.Utilities.UnitTests</AssemblyName> | ||
<TargetFrameworks>net8.0</TargetFrameworks> | ||
<RollForward>LatestMajor</RollForward> | ||
<IsTestProject>true</IsTestProject> | ||
<IsPackable>false</IsPackable> | ||
<LangVersion>12</LangVersion> | ||
<NoWarn> | ||
$(NoWarn);CA2007,CA1812,CA1861,CA1063,VSTHRD111,SKEXP0001,SKEXP0050,SKEXP0080,SKEXP0110;OPENAI001</NoWarn> | ||
</PropertyGroup> | ||
|
||
<Import Project="$(RepoRoot)/dotnet/src/InternalUtilities/process/InternalUtilities.props" /> | ||
<Import Project="$(RepoRoot)/dotnet/src/InternalUtilities/process/RuntimeUtilities.props" /> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="Microsoft.NET.Test.Sdk" /> | ||
<PackageReference Include="Moq" /> | ||
<PackageReference Include="Verify.Xunit" /> | ||
<PackageReference Include="xunit" /> | ||
<PackageReference Include="xunit.runner.visualstudio"> | ||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> | ||
<PrivateAssets>all</PrivateAssets> | ||
</PackageReference> | ||
<PackageReference Include="coverlet.collector"> | ||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> | ||
<PrivateAssets>all</PrivateAssets> | ||
</PackageReference> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<ProjectReference Include="..\..\SemanticKernel.Abstractions\SemanticKernel.Abstractions.csproj" /> | ||
<ProjectReference Include="..\..\SemanticKernel.Core\SemanticKernel.Core.csproj" /> | ||
<ProjectReference Include="..\Process.Abstractions\Process.Abstractions.csproj" /> | ||
<ProjectReference Include="..\Process.Core\Process.Core.csproj" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<Folder Include="Runtime\" /> | ||
</ItemGroup> | ||
|
||
</Project> |
7 changes: 4 additions & 3 deletions
7
...ss.UnitTests/Runtime/ProcessEventTests.cs → ....Utilities.UnitTests/ProcessEventTests.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 3 additions & 3 deletions
6
....UnitTests/Runtime/ProcessMessageTests.cs → ...tilities.UnitTests/ProcessMessageTests.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<Project> | ||
<ItemGroup> | ||
<Compile Include="$(RepoRoot)/dotnet/src/InternalUtilities/process/Internal/**/*.cs" Link="%(RecursiveDir)Internal/%(Filename)%(Extension)" /> | ||
</ItemGroup> | ||
</Project> |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
<Project> | ||
<ItemGroup> | ||
<Compile Include="$(RepoRoot)/dotnet/src/InternalUtilities/process/**/*.cs" Link="%(RecursiveDir)Runtime/%(Filename)%(Extension)" /> | ||
<Compile Include="$(RepoRoot)/dotnet/src/InternalUtilities/process/Runtime/**/*.cs" Link="%(RecursiveDir)Runtime/%(Filename)%(Extension)" /> | ||
</ItemGroup> | ||
</Project> |