Skip to content

Commit ab0fc74

Browse files
committed
Add support for .NET 10 across build and project files
1 parent 7f4edb4 commit ab0fc74

File tree

12 files changed

+54
-14
lines changed

12 files changed

+54
-14
lines changed

.github/workflows/build.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ jobs:
2626
dotnet-version: |
2727
8.x
2828
9.x
29+
10.x
2930
3031
# let's make sure we're on the version we think we are.
3132
- name: Announce .NET version

.github/workflows/publish.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,10 @@ jobs:
1515
uses: actions/setup-dotnet@v4
1616
with:
1717
dotnet-version: |
18-
8.0.x
19-
9.0.x
18+
8.x
19+
9.x
20+
10.x
21+
2022
# since we're packaging for net7 now...
2123
- name: remove global.json
2224
run: rm global.json
@@ -28,6 +30,7 @@ jobs:
2830
run: dotnet run --project build
2931
env:
3032
BuildNet9: true
33+
BuildNet10: true
3134
IgnoreTests: true
3235
- name: Get version from tag
3336
id: tag_name

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1010

1111
### Changed
1212

13-
- [FSharp.Compiler.Service update to 43.10.100-rc2.25502.107 for .NET 10 support]
13+
- [FSharp.Compiler.Service update to 43.10.100 for .NET 10 support](https://github.com/ionide/proj-info/pull/239/) (thanks @TheAngryByrd)
1414

1515
## [0.71.2] - 2025-06-01
1616

CONTRIBUTING.md

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,10 @@ So if you set global.json to a 9.0.xxx SDK, you'll _always_ use the 9.x MSBuild
1919
Our FAKE build project will handle creating/deleting a temporary `global.json` file in the `test` directory for you.
2020

2121
1. `dotnet run --project .\build\ -- -t Test`
22-
1. This should chose the `Test:net8.0` and `Test:net9.0` targets and run against that respective runtime.
22+
1. This will run the following test targets against their respective runtime.
23+
* `Test:net8.0`
24+
* `Test:net9.0`
25+
* `Test:net10.0`
2326

2427
### Manually invoking dotnet test
2528

@@ -36,8 +39,7 @@ If you want to run `dotnet test` directly, you'll need to set the `global.json`
3639
```json
3740
"sdk": {
3841
"version": "9.0.100",
39-
"rollForward": "latestMinor",
40-
"allowPrerelease": true
42+
"rollForward": "latestMinor"
4143
}
4244
```
4345
1. Move to the test project
@@ -48,7 +50,20 @@ If you want to run `dotnet test` directly, you'll need to set the `global.json`
4850
4. Run tests with `dotnet test`
4951

5052

51-
53+
#### Against LTS (net10.0)
54+
1. Change global.json to use net10.0
55+
```json
56+
"sdk": {
57+
"version": "10.0.100",
58+
"rollForward": "latestMinor"
59+
}
60+
```
61+
1. Move to the test project
62+
1. `cd test/Ionide.ProjInfo.Tests`
63+
3. Set environment variable `BuildNet10` to `true`
64+
1. Bash: `export BuildNet10=true`
65+
2. PowerShell: `$env:BuildNet10 = "true"`
66+
4. Run tests with `dotnet test`
5267

5368

5469
## Release

Directory.Packages.props

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
<FSharpCoreVersion>6.0.0</FSharpCoreVersion>
88
<!-- However for the FCS project, FSharpCoreCompilerVersion needs to match whats specified in
99
the FSharp.Compiler.Service dependency -->
10-
<FSharpCoreCompilerVersion>10.0.100-rc2.25502.107</FSharpCoreCompilerVersion>
11-
<FSharpCompilerVersion>43.10.100-rc2.25502.107</FSharpCompilerVersion>
10+
<FSharpCoreCompilerVersion>10.0.100</FSharpCoreCompilerVersion>
11+
<FSharpCompilerVersion>43.10.100</FSharpCompilerVersion>
1212
<ExpectoVersion>10.2.3</ExpectoVersion>
1313
<FakeVersion>6.1.3</FakeVersion>
1414
<NuGetAuditMode>direct</NuGetAuditMode>

build/Program.fs

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -94,12 +94,14 @@ let init args =
9494
Map.ofSeq [
9595
"net8.0", "8.0.100"
9696
"net9.0", "9.0.100"
97+
"net10.0", "10.0.100"
9798
]
9899

99-
let tfmToBuildNet9Map =
100+
let tfmToEnvVar =
100101
Map.ofSeq [
101-
"net8.0", false
102-
"net9.0", true
102+
"net8.0", None
103+
"net9.0", Some "BuildNet9"
104+
"net10.0", Some "BuildNet10"
103105
]
104106

105107
let testTFM tfm =
@@ -112,11 +114,19 @@ let init args =
112114
else
113115
""
114116

117+
let envs =
118+
match
119+
tfmToEnvVar
120+
|> Map.tryFind tfm
121+
|> Option.flatten with
122+
| Some envVar -> Map.ofSeq [ envVar, "true" ]
123+
| None -> Map.empty
124+
115125
exec
116126
"dotnet"
117127
$"test --blame --blame-hang-timeout 60s --framework {tfm} --logger trx --logger GitHubActions -c %s{configuration} .\\Ionide.ProjInfo.Tests\\Ionide.ProjInfo.Tests.fsproj -- %s{failedOnFocus}"
118128
"test"
119-
(Map.ofSeq [ "BuildNet9", tfmToBuildNet9Map.[tfm].ToString() ])
129+
envs
120130
|> ignore
121131
finally
122132
System.IO.File.Delete "test\\global.json"
@@ -125,6 +135,7 @@ let init args =
125135

126136
Target.create "Test:net8.0" (fun _ -> testTFM "net8.0")
127137
Target.create "Test:net9.0" (fun _ -> testTFM "net9.0")
138+
Target.create "Test:net10.0" (fun _ -> testTFM "net10.0")
128139

129140
"Build"
130141
==> ("Test:net8.0")
@@ -136,6 +147,11 @@ let init args =
136147
=?> ("Test", not ignoreTests)
137148
|> ignore
138149

150+
"Build"
151+
==> ("Test:net10.0")
152+
=?> ("Test", not ignoreTests)
153+
|> ignore
154+
139155
Target.create
140156
"ListPackages"
141157
(fun _ ->

global.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@
44
"rollForward": "latestMinor",
55
"allowPrerelease": true
66
}
7-
}
7+
}

src/Ionide.ProjInfo.FCS/Ionide.ProjInfo.FCS.fsproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
<PropertyGroup>
44
<TargetFrameworks>net8.0</TargetFrameworks>
55
<TargetFrameworks Condition="'$(BuildNet9)' == 'true'">$(TargetFrameworks);net9.0</TargetFrameworks>
6+
<TargetFrameworks Condition="'$(BuildNet10)' == 'true'">$(TargetFrameworks);net10.0</TargetFrameworks>
67
</PropertyGroup>
78

89
<ItemGroup>

src/Ionide.ProjInfo.ProjectSystem/Ionide.ProjInfo.ProjectSystem.fsproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
<PropertyGroup>
44
<TargetFrameworks>net8.0</TargetFrameworks>
55
<TargetFrameworks Condition="'$(BuildNet9)' == 'true'">$(TargetFrameworks);net9.0</TargetFrameworks>
6+
<TargetFrameworks Condition="'$(BuildNet10)' == 'true'">$(TargetFrameworks);net10.0</TargetFrameworks>
67
</PropertyGroup>
78

89
<ItemGroup>

src/Ionide.ProjInfo.Tool/Ionide.ProjInfo.Tool.fsproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
<OutputType>Exe</OutputType>
55
<TargetFrameworks>net8.0</TargetFrameworks>
66
<TargetFrameworks Condition="'$(BuildNet9)' == 'true'">$(TargetFrameworks);net9.0</TargetFrameworks>
7+
<TargetFrameworks Condition="'$(BuildNet10)' == 'true'">$(TargetFrameworks);net10.0</TargetFrameworks>
78
<PackAsTool>true</PackAsTool>
89
<ToolCommandName>proj-info</ToolCommandName>
910
<RollForward>LatestMajor</RollForward>

0 commit comments

Comments
 (0)