Skip to content

Commit 296bb9e

Browse files
Fix runtime detection in targets file (#477) (#478)
* Fix runtime detection in targets file * Restore pretty print * Use --version instead of --list-sdks * Update dotnet.yml * Update codecov.yml * Update stryker.yml * copilot can't make up its mind
1 parent 9c404c4 commit 296bb9e

File tree

4 files changed

+14
-27
lines changed

4 files changed

+14
-27
lines changed

.github/workflows/codecov.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ jobs:
2020
- name: Setup .NET 9
2121
uses: actions/setup-dotnet@v4
2222
with:
23-
dotnet-quality: preview
2423
dotnet-version: 9.0.x
2524

2625
- name: Setup .NET 8

.github/workflows/dotnet.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ jobs:
2727
- name: Setup .NET 9
2828
uses: actions/setup-dotnet@v4
2929
with:
30-
dotnet-quality: preview
3130
dotnet-version: 9.0.x
3231

3332
- name: Setup .NET 8

.github/workflows/stryker.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ jobs:
1818
- name: Setup .NET 9
1919
uses: actions/setup-dotnet@v4
2020
with:
21-
dotnet-quality: preview
2221
dotnet-version: 9.0.x
2322

2423
- name: Install Stryker

src/FlatSharp.Compiler/FlatSharp.Compiler.targets

Lines changed: 14 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -94,34 +94,24 @@
9494
<Output TaskParameter="IncludeDirectories" PropertyName="Includes" />
9595
</ProcessFlatSharpSchema>
9696

97-
<!-- Query the installed SDKs. -->
98-
<Exec Command="dotnet --list-sdks" ConsoleToMsBuild="false">
97+
<!-- Query the installed runtimes. -->
98+
<Exec Command="dotnet --list-runtimes" ConsoleToMsBuild="true">
9999
<Output TaskParameter="ConsoleOutput" PropertyName="StdOut" />
100100
</Exec>
101101

102102
<PropertyGroup>
103-
<CompilerVersion>net9.0</CompilerVersion>
104-
</PropertyGroup>
105-
106-
<!-- try .net6.0. -->
107-
<PropertyGroup Condition=" $([System.Text.RegularExpressions.Regex]::IsMatch($(StdOut), '6\.0\.\d+')) ">
108-
<CompilerVersion>net6.0</CompilerVersion>
109-
</PropertyGroup>
110-
111-
<!-- try .net7.0. -->
112-
<PropertyGroup Condition=" $([System.Text.RegularExpressions.Regex]::IsMatch($(StdOut), '7\.0\.\d+')) ">
113-
<CompilerVersion>net7.0</CompilerVersion>
114-
</PropertyGroup>
115-
116-
<!-- try .net8.0. -->
117-
<PropertyGroup Condition=" $([System.Text.RegularExpressions.Regex]::IsMatch($(StdOut), '8\.0\.\d+')) ">
118-
<CompilerVersion>net8.0</CompilerVersion>
119-
</PropertyGroup>
120-
121-
<!-- try .net9.0. -->
122-
<PropertyGroup Condition=" $([System.Text.RegularExpressions.Regex]::IsMatch($(StdOut), '9\.0\.\d+')) ">
123-
<CompilerVersion>net9.0</CompilerVersion>
124-
</PropertyGroup>
103+
<IsMatching6>$([System.Text.RegularExpressions.Regex]::IsMatch($(StdOut), '6\.0\.\d+'))</IsMatching6>
104+
<IsMatching7>$([System.Text.RegularExpressions.Regex]::IsMatch($(StdOut), '7\.0\.\d+'))</IsMatching7>
105+
<IsMatching8>$([System.Text.RegularExpressions.Regex]::IsMatch($(StdOut), '8\.0\.\d+'))</IsMatching8>
106+
<IsMatching9>$([System.Text.RegularExpressions.Regex]::IsMatch($(StdOut), '9\.0\.\d+'))</IsMatching9>
107+
<CompilerVersion>net9.0</CompilerVersion>
108+
<CompilerVersion Condition=" '$(IsMatching6)' == 'True' ">net6.0</CompilerVersion>
109+
<CompilerVersion Condition=" '$(IsMatching7)' == 'True' ">net7.0</CompilerVersion>
110+
<CompilerVersion Condition=" '$(IsMatching8)' == 'True' ">net8.0</CompilerVersion>
111+
<CompilerVersion Condition=" '$(IsMatching9)' == 'True' ">net9.0</CompilerVersion>
112+
</PropertyGroup>
113+
114+
<Message Text=".NET runtime detection: 6: $(IsMatching6), 7: $(IsMatching7), 8: $(IsMatching8), 9: $(IsMatching9). Selected: $(CompilerVersion)" Importance="High"/>
125115

126116
<PropertyGroup>
127117
<FlatSharpOutput>$(IntermediateOutputPath)</FlatSharpOutput>

0 commit comments

Comments
 (0)