Skip to content

Commit 46dc89d

Browse files
authored
Upgrade project to target .NET 10 runtime (#29)
2 parents f508d8b + 7c2e55e commit 46dc89d

File tree

13 files changed

+41
-90
lines changed

13 files changed

+41
-90
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ jobs:
6767

6868
strategy:
6969
matrix:
70-
os: ['ubuntu-24.04', 'windows-2022']
70+
os: ['ubuntu-24.04', 'windows-2025']
7171

7272
env:
7373
Configuration: 'Release'

.github/workflows/release.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ env:
1919

2020
jobs:
2121
release:
22-
runs-on: ubuntu-22.04
22+
runs-on: ubuntu-24.04
2323

2424
steps:
2525
- name: checkout
@@ -28,7 +28,7 @@ jobs:
2828
- name: setup dotnet
2929
uses: actions/setup-dotnet@v5
3030
with:
31-
dotnet-version: 8
31+
dotnet-version: 10
3232

3333
- name: restore
3434
run: dotnet restore

src/Directory.Build.props

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
<Project>
22

33
<PropertyGroup>
4-
<TargetFrameworks>net6.0;net7.0;net8.0</TargetFrameworks>
4+
<TargetFrameworks>net8.0;net10.0</TargetFrameworks>
55
<ImplicitUsings>enable</ImplicitUsings>
66
<Nullable>enable</Nullable>
7-
<VersionPrefix>1.8.0</VersionPrefix>
7+
<VersionPrefix>2.0.0</VersionPrefix>
88
</PropertyGroup>
99

1010
<PropertyGroup>

src/VbaCompiler/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ var macroFilePath = compiler.CompileExcelMacroFile("bin", "MyMacro.xlsm", vbaPro
2424

2525
### Requirements
2626

27-
The compiler works on .NET 6, 7 and 8 runtimes on Windows and macOS.
27+
The compiler works on .NET 8 and 10 runtimes on Windows, Linux and macOS.
2828

2929
### Samples
3030

src/VbaCompiler/Vba/ProjectRecord.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@ public class ProjectRecord
99
{
1010
public ProjectRecord()
1111
{
12-
this.HostExtenders = new List<string>()
13-
{
12+
this.HostExtenders =
13+
[
1414
Constants.HostExtender_VBE
15-
};
16-
this.Modules = new List<ModuleUnit>();
15+
];
16+
this.Modules = [];
1717
}
1818

1919
public string Id { get; set; } = "";
@@ -37,7 +37,7 @@ public ProjectRecord()
3737
/// </summary>
3838
public string VisibilityState { get; set; } = "";
3939

40-
public IList<string> HostExtenders { get; }
40+
public List<string> HostExtenders { get; }
4141

4242
public ICollection<ModuleUnit> Modules { get; set; }
4343

src/VbaCompiler/VbaCompiler.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ namespace vbamc
1414
{
1515
public class VbaCompiler
1616
{
17-
private IList<ModuleUnit> modules = new List<ModuleUnit>();
17+
private List<ModuleUnit> modules = [];
1818

19-
public IDictionary<string, string> ExtendedProperties { get; set; } = new Dictionary<string, string>();
19+
public Dictionary<string, string> ExtendedProperties { get; set; } = [];
2020

2121
public Guid ProjectId { get; set; }
2222

src/VbaCompiler/VbaCompiler.csproj

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,9 @@
1010
</PropertyGroup>
1111

1212
<ItemGroup>
13-
<PackageReference Include="DocumentFormat.OpenXml" Version="3.0.2" />
14-
<PackageReference Include="OpenMcdf" Version="2.3.1" />
15-
<PackageReference Include="NetOfficeFw.VbaCompression" Version="2.0.0" />
16-
<PackageReference Include="System.Collections.Specialized" Version="4.3.0" />
13+
<PackageReference Include="DocumentFormat.OpenXml" Version="3.3.0" />
14+
<PackageReference Include="OpenMcdf" Version="2.4.1" />
15+
<PackageReference Include="NetOfficeFw.VbaCompression" Version="3.0.1" />
1716
</ItemGroup>
1817

1918
<ItemGroup>

src/vbamc/Program.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ public static int Main(string[] args)
1515

1616
[Required]
1717
[Option("-m|--module")]
18-
public IEnumerable<string> Modules { get; } = Enumerable.Empty<string>();
18+
public IEnumerable<string> Modules { get; } = [];
1919

2020
[Option("-c|--class")]
21-
public IEnumerable<string> Classes { get; } = Enumerable.Empty<string>();
21+
public IEnumerable<string> Classes { get; } = [];
2222

2323
// [Option("-d|--document")]
2424
// public string? Document { get; }
@@ -39,7 +39,7 @@ public static int Main(string[] args)
3939
public string? UserProfilePath { get; }
4040

4141
[Option("-p|--property", Description = "Extended property in the format name=value")]
42-
public string[] ExtendedProperties { get; } = Array.Empty<string>();
42+
public string[] ExtendedProperties { get; } = [];
4343

4444
private void OnExecute()
4545
{

src/vbamc/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ vbamc --module Module.vb --class MyClass.vb --name "VBA Project" --company "ACME
1111

1212
### Requirements
1313

14-
The compiler works on .NET 6, 7 and 8 runtimes on Windows and macOS.
14+
The compiler works on .NET 8 and 10 runtimes on Windows, Linux and macOS.
1515

1616
### Samples
1717

tests/VbaCompiler.Tests/VbaCompiler.Tests.csproj

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFramework>net8.0</TargetFramework>
4+
<TargetFrameworks>net8.0;net10.0</TargetFrameworks>
55
<Nullable>enable</Nullable>
66

77
<IsPackable>false</IsPackable>
@@ -22,16 +22,13 @@
2222
</ItemGroup>
2323

2424
<ItemGroup>
25-
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.9.0" />
26-
<PackageReference Include="NUnit" Version="4.1.0" />
27-
<PackageReference Include="NUnit3TestAdapter" Version="4.5.0" />
28-
<PackageReference Include="coverlet.collector" Version="6.0.2">
25+
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="18.0.0" />
26+
<PackageReference Include="NUnit" Version="4.4.0" />
27+
<PackageReference Include="NUnit3TestAdapter" Version="5.2.0" />
28+
<PackageReference Include="coverlet.collector" Version="6.0.4">
2929
<PrivateAssets>all</PrivateAssets>
3030
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
3131
</PackageReference>
32-
<PackageReference Include="System.Collections" Version="4.3.0" />
33-
<PackageReference Include="System.IO.FileSystem.Primitives" Version="4.3.0" />
34-
<PackageReference Include="System.Text.Encoding.Extensions" Version="4.3.0" />
3532
</ItemGroup>
3633

3734
<ItemGroup>

0 commit comments

Comments
 (0)