Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 2 additions & 8 deletions .github/workflows/msbuild.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,9 @@ jobs:
build:
name: 👌 Verify build
runs-on: windows-latest
steps:
steps:
- name: 🛒 Checkout repository
uses: actions/checkout@v6
- uses: actions/setup-dotnet@v5
with:
dotnet-version: |
8.0.x
9.0.x
10.0.x
- name: 🛠️ Prepare
working-directory: test/MSBuild
run: |
Expand All @@ -46,7 +40,7 @@ jobs:
run: dotnet build -v d -filelogger
- name: 🧪 Build Output
working-directory: test/MSBuild
run: cat msbuild.log
run: cat msbuild.log
- name: 🗳️ Upload
uses: actions/upload-artifact@v6
with:
Expand Down
1 change: 1 addition & 0 deletions src/Refitter.MSBuild/Refitter.MSBuild.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
<Content Include="$(AssemblyName).targets" PackagePath="tasks" />
<Content Include="../Refitter/bin/$(Configuration)/net8.0/**/*" PackagePath="tasks/net8.0" />
<Content Include="../Refitter/bin/$(Configuration)/net9.0/**/*" PackagePath="tasks/net9.0" />
<Content Include="../Refitter/bin/$(Configuration)/net10.0/**/*" PackagePath="tasks/net10.0" />
</ItemGroup>

</Project>
8 changes: 7 additions & 1 deletion src/Refitter.MSBuild/RefitterGenerateTask.cs
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,13 @@ private List<string> StartProcess(string file)
var refitterDll = $"{packageFolder}{separator}..{separator}net8.0{separator}refitter.dll";

List<string> installedRuntimes = GetInstalledDotnetRuntimes();
if (installedRuntimes.Any(r => r.StartsWith("Microsoft.NETCore.App 9.")))
if (installedRuntimes.Any(r => r.StartsWith("Microsoft.NETCore.App 10.")))
{
// Use .NET 10 version if available
refitterDll = $"{packageFolder}{separator}..{separator}net10.0{separator}refitter.dll";
TryLogCommandLine("Detected .NET 10 runtime. Using .NET 10 version of Refitter.");
}
else if (installedRuntimes.Any(r => r.StartsWith("Microsoft.NETCore.App 9.")))
{
// Use .NET 9 version if available
refitterDll = $"{packageFolder}{separator}..{separator}net9.0{separator}refitter.dll";
Expand Down
5 changes: 1 addition & 4 deletions test/MSBuild/Refitter.MSBuild.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,14 @@

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

<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Http.Resilience" Version="10.1.0" />
<PackageReference Include="Refit.HttpClientFactory" Version="9.0.2" />
<PackageReference Include="Microsoft.Extensions.Http.Polly" Version="10.0.1" />
<PackageReference Include="Polly.Contrib.WaitAndRetry" Version="1.1.1" />
</ItemGroup>

</Project>
4 changes: 2 additions & 2 deletions test/MSBuild/build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ dotnet pack -c release ../../src/Refitter.MSBuild/Refitter.MSBuild.csproj -o .
dotnet add package .\Refitter.MSBuild.1.0.0.nupkg --source .
dotnet restore
dotnet add package Refitter.MSBuild --source .
dotnet run -v d -filelogger
dotnet run -v d -filelogger -c Release
dotnet remove package Refitter.MSBuild
Remove-Item Refitter.MSBuild.*.nupkg -Force
Remove-Item Refitter.MSBuild.*.nupkg -Force
Loading