Skip to content

Commit

Permalink
Upgrade to .NET 9.
Browse files Browse the repository at this point in the history
  • Loading branch information
huguesv committed Nov 12, 2024
1 parent 50fa83e commit 9b0bff2
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 20 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.0.x'
dotnet-version: '9.0.x'
- name: Clean
run: dotnet clean ${{env.solutionFile}} --configuration Release && dotnet nuget locals all --clear
- name: Build
Expand Down
10 changes: 5 additions & 5 deletions src/Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
</PropertyGroup>
<ItemGroup>
<PackageVersion Include="coverlet.collector" Version="6.0.2" />
<PackageVersion Include="FluentAssertions" Version="6.12.0" />
<PackageVersion Include="FluentAssertions.Analyzers" Version="0.32.0" />
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.10.0" />
<PackageVersion Include="MSTest.TestAdapter" Version="3.3.1" />
<PackageVersion Include="MSTest.TestFramework" Version="3.4.0" />
<PackageVersion Include="FluentAssertions" Version="6.12.2" />
<PackageVersion Include="FluentAssertions.Analyzers" Version="0.34.1" />
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.11.1" />
<PackageVersion Include="MSTest.TestAdapter" Version="3.6.3" />
<PackageVersion Include="MSTest.TestFramework" Version="3.6.3" />
<PackageVersion Include="SharpZipLib" Version="1.4.2" />
<PackageVersion Include="StyleCop.Analyzers" Version="1.2.0-beta.556" />
</ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net9.0</TargetFramework>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<IsPackable>false</IsPackable>
<ImplicitUsings>enable</ImplicitUsings>
Expand Down
12 changes: 2 additions & 10 deletions src/Woohoo.Agi.Interpreter/Interpreter/GameFolder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,7 @@ public GameFolder(string folderPath)

public byte[] Read(string file)
{
byte[] data;

using (FileStream stream = new FileStream(Path.Combine(this.folderPath, file), FileMode.Open, FileAccess.Read, FileShare.Read))
{
data = new byte[stream.Length];
stream.Read(data, 0, data.Length);
}

return data;
return File.ReadAllBytes(Path.Combine(this.folderPath, file));
}

public bool Exists(string file)
Expand Down Expand Up @@ -68,7 +60,7 @@ public string[] GetGameFiles()
// Get the list of files to include
foreach (string pattern in includePatterns)
{
string[] files = Directory.GetFiles(this.folderPath, pattern);
string[] files = Directory.GetFiles(this.folderPath, pattern, SearchOption.TopDirectoryOnly);
foreach (string file in files)
{
// File name only, no path
Expand Down
2 changes: 1 addition & 1 deletion src/Woohoo.Agi.Interpreter/Woohoo.Agi.Interpreter.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net9.0</TargetFramework>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<ImplicitUsings>enable</ImplicitUsings>
<NeutralLanguage>en</NeutralLanguage>
Expand Down
2 changes: 1 addition & 1 deletion src/Woohoo.Agi.Player/GameZipArchive.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public byte[] Read(string file)
using (Stream stream = this.zipFile.GetInputStream(entry))
{
data = new byte[entry.Size];
stream.Read(data, 0, data.Length);
stream.ReadExactly(data, 0, data.Length);
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/Woohoo.Agi.Player/Woohoo.Agi.Player.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net9.0</TargetFramework>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<Platforms>x86;x64</Platforms>
<Backend>SDL</Backend>
Expand Down

0 comments on commit 9b0bff2

Please sign in to comment.