Skip to content

Commit 4c3b3fc

Browse files
dmytrostrukrojirogerbarreto
authored
.Net: Migrate sln to slnx (#12325)
### 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. --> Replaced `sln` with `slnx` solution file: https://devblogs.microsoft.com/visualstudio/new-simpler-solution-file-format/ ### Description <!-- Describe your changes, the overall approach, the underlying design. These notes will help understanding how your code works. Thanks! --> ### 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 😄 --------- Co-authored-by: Shay Rojansky <[email protected]> Co-authored-by: Roger Barreto <[email protected]>
1 parent 3499c7a commit 4c3b3fc

12 files changed

+374
-1751
lines changed

.github/_typos.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ extend-exclude = [
2323
"PopulationByCountry.csv",
2424
"PopulationByAdmin1.csv",
2525
"WomensSuffrage.txt",
26-
"SK-dotnet.sln.DotSettings",
26+
"SK-dotnet.slnx.DotSettings",
2727
"**/azure_ai_search_hotel_samples/README.md",
2828
"**/Demos/ProcessFrameworkWithAspire/ProcessFramework.Aspire/ProcessFramework.Aspire.ProcessOrchestrator/Program.cs",
2929
"**/Demos/ProcessFrameworkWithAspire/**/*.http",

.github/workflows/dotnet-build-and-test.yml

Lines changed: 23 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -72,28 +72,43 @@ jobs:
7272
- uses: actions/checkout@v4
7373
with:
7474
persist-credentials: false
75-
- name: Setup dotnet ${{ matrix.dotnet }}
76-
uses: actions/setup-dotnet@v3
75+
76+
- name: Setup dotnet
77+
uses: actions/[email protected]
7778
with:
78-
dotnet-version: ${{ matrix.dotnet }}
79+
global-json-file: ${{ github.workspace }}/dotnet/global.json
80+
7981
- name: Build dotnet solutions
8082
shell: bash
8183
run: |
82-
export SOLUTIONS=$(find ./dotnet/ -type f -name "*.sln" | tr '\n' ' ')
84+
export SOLUTIONS=$(find ./dotnet/ -type f -name "*.slnx" | tr '\n' ' ')
8385
for solution in $SOLUTIONS; do
8486
dotnet build $solution -c ${{ matrix.configuration }} --warnaserror
8587
done
88+
8689
- name: Package install check
8790
shell: bash
88-
if: matrix.os == 'ubuntu-latest'
8991
run: |
90-
export SOLUTIONS=$(find ./dotnet/ -type f -name "*.sln" | tr '\n' ' ')
92+
export SOLUTIONS=$(find ./dotnet/ -type f -name "*.slnx" | tr '\n' ' ')
9193
for solution in $SOLUTIONS; do
9294
dotnet pack $solution -c ${{ matrix.configuration }} --no-build --no-restore --output ./artifacts
9395
done
9496
dotnet new console --name packcheck --output consoleapp
95-
dotnet add consoleapp/packcheck.csproj package Microsoft.SemanticKernel --source ./artifacts
96-
dotnet build consoleapp/packcheck.csproj
97+
98+
# Create minimal nuget.config and use only dotnet nuget commands
99+
echo '<?xml version="1.0" encoding="utf-8"?><configuration><packageSources><clear /></packageSources></configuration>' > consoleapp/nuget.config
100+
101+
# Add sources with local first using dotnet nuget commands
102+
dotnet nuget add source ../artifacts --name local --configfile consoleapp/nuget.config
103+
dotnet nuget add source https://api.nuget.org/v3/index.json --name nuget.org --configfile consoleapp/nuget.config
104+
105+
# Change to project directory to ensure local nuget.config is used
106+
cd consoleapp
107+
dotnet add packcheck.csproj package Microsoft.SemanticKernel
108+
dotnet build -c ${{ matrix.configuration }} packcheck.csproj
109+
cd ..
110+
111+
# Clean up
97112
rm -rf ./artifacts
98113
rm -rf ./consoleapp
99114

.github/workflows/dotnet-ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131

3232
- name: Find solutions
3333
shell: bash
34-
run: echo "solutions=$(find ./ -type f -name "*.sln" | tr '\n' ' ')" >> $GITHUB_ENV
34+
run: echo "solutions=$(find ./ -type f -name "*.slnx" | tr '\n' ' ')" >> $GITHUB_ENV
3535

3636
- name: Pull container dotnet/sdk:${{ matrix.dotnet }}
3737
run: |
@@ -94,7 +94,7 @@ jobs:
9494
9595
- name: Find solutions
9696
shell: bash
97-
run: echo "solutions=$(find ./dotnet -type f -name "*.sln" | tr '\n' ' ')" >> $GITHUB_ENV
97+
run: echo "solutions=$(find ./dotnet -type f -name "*.slnx" | tr '\n' ' ')" >> $GITHUB_ENV
9898

9999
- name: Restore dependencies
100100
shell: bash

.github/workflows/dotnet-format.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,11 +73,11 @@ jobs:
7373
done
7474
done
7575
else
76-
# if the changed-files step failed, run dotnet on the whole sln instead of specific projects
77-
csproj_files=$(find ./ -type f -name "*.sln" | tr '\n' ' ');
76+
# if the changed-files step failed, run dotnet on the whole slnx instead of specific projects
77+
csproj_files=$(find ./ -type f -name "*.slnx" | tr '\n' ' ');
7878
fi
7979
csproj_files=($(printf "%s\n" "${csproj_files[@]}" | sort -u))
80-
echo "Found ${#csproj_files[@]} unique csproj/sln files: ${csproj_files[*]}"
80+
echo "Found ${#csproj_files[@]} unique csproj/slnx files: ${csproj_files[*]}"
8181
echo "::set-output name=csproj_files::${csproj_files[*]}"
8282
8383
- name: Pull container dotnet/sdk:${{ matrix.dotnet }}

.gitignore

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -439,7 +439,6 @@ __pycache__/
439439
.mypy_cache/
440440
__pypackages__/
441441
.pdm.toml
442-
global.json
443442

444443
# doxfx
445444
**/DROP/
@@ -499,4 +498,4 @@ swa-cli.config.json
499498
**/.kiota
500499

501500
# dapr extension files
502-
**/dapr.yaml
501+
**/dapr.yaml

dotnet/Directory.Build.targets

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,9 @@
33
<!-- using Central Package Management feature -->
44
<!-- https://learn.microsoft.com/en-us/nuget/consume-packages/Central-Package-Management -->
55
<Sdk Name="Microsoft.Build.CentralPackageVersions" Version="2.1.3" />
6-
<!-- Only run 'dotnet format' on dev machines, Release builds. Skip on GitHub Actions -->
7-
<!-- as this runs in its own Actions job. -->
6+
<!-- Only run 'dotnet format' on dev machines, Release builds. Skip on GitHub Actions and Azure DevOps. -->
87
<Target Name="DotnetFormatOnBuild" BeforeTargets="Build"
9-
Condition=" '$(Configuration)' == 'Release' AND '$(GITHUB_ACTIONS)' == '' ">
8+
Condition=" '$(Configuration)' == 'Release' AND '$(GITHUB_ACTIONS)' == '' AND '$(TF_BUILD)' != 'true' ">
109
<Message Text="Running dotnet format" Importance="high" />
1110
<Exec Command="dotnet format --no-restore -v diag $(ProjectFileName)" />
1211
</Target>

dotnet/MEVD.slnf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"solution": {
3-
"path": "SK-dotnet.sln",
3+
"path": "SK-dotnet.slnx",
44
"projects":
55
[
66
"src/Connectors/Connectors.Memory.AzureAISearch/Connectors.Memory.AzureAISearch.csproj",

0 commit comments

Comments
 (0)