Skip to content

Commit

Permalink
Feat: net9
Browse files Browse the repository at this point in the history
  • Loading branch information
SamboyCoding committed Nov 15, 2024
1 parent 14b0f05 commit 0ea4a82
Show file tree
Hide file tree
Showing 12 changed files with 27 additions and 17 deletions.
2 changes: 1 addition & 1 deletion Cpp2IL.Core.Tests/Cpp2IL.Core.Tests.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>
<Nullable>enable</Nullable>

<IsPackable>false</IsPackable>
Expand Down
2 changes: 1 addition & 1 deletion Cpp2IL.Core/Cpp2IL.Core.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<PublishRepositoryUrl>true</PublishRepositoryUrl>
<RepositoryType>git</RepositoryType>
<RepositoryUrl>https://github.com/SamboyCoding/Cpp2IL.git</RepositoryUrl>
<TargetFrameworks>net8.0;net7.0;net6.0;netstandard2.0</TargetFrameworks>
<TargetFrameworks>net9.0;net8.0;net7.0;net6.0;netstandard2.0</TargetFrameworks>
<Title>Cpp2IL.Core</Title>
<VersionPrefix>2022.1.0</VersionPrefix>

Expand Down
10 changes: 10 additions & 0 deletions Cpp2IL.Core/Extensions/StreamExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,19 @@ public static uint ReadUnityCompressedUint(this Stream stream)
if (b == 240)
{
//Full Uint
#if NET7_0_OR_GREATER
Span<byte> buffer = stackalloc byte[4];
stream.ReadExactly(buffer);
return BitConverter.ToUInt32(buffer);
#elif NET5_0_OR_GREATER
Span<byte> buffer = stackalloc byte[4];
stream.Read(buffer);
return BitConverter.ToUInt32(buffer);
#else
var buffer = new byte[4];
stream.Read(buffer, 0, 4);
return BitConverter.ToUInt32(buffer, 0);
#endif
}

//Special constant values
Expand Down
2 changes: 1 addition & 1 deletion Cpp2IL.Plugin.BuildReport/Cpp2IL.Plugin.BuildReport.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net9.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<DebugType>embedded</DebugType>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net9.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<DebugType>embedded</DebugType>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net9.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
Expand Down
2 changes: 1 addition & 1 deletion Cpp2IL/Cpp2IL.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<Nullable>enable</Nullable>
<OutputType>Exe</OutputType>
<PublishSingleFile Condition="'$(TargetFramework)'!='net472' and '$(GITHUB_ACTIONS)' == 'true'">true</PublishSingleFile>
<TargetFrameworks>net7.0;net472</TargetFrameworks>
<TargetFrameworks>net9.0;net472</TargetFrameworks>
<VersionPrefix>2022.1.0</VersionPrefix>
<ServerGarbageCollection>true</ServerGarbageCollection>
</PropertyGroup>
Expand Down
2 changes: 1 addition & 1 deletion LibCpp2IL/LibCpp2IL.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<PublishRepositoryUrl>true</PublishRepositoryUrl>
<Description>Library for interacting with IL2CPP metadata and binaries</Description>
<Configurations>Debug;Release</Configurations>
<TargetFrameworks>net8.0;net7.0;net6.0;netstandard2.0</TargetFrameworks>
<TargetFrameworks>net9.0;net8.0;net7.0;net6.0;netstandard2.0</TargetFrameworks>
<PolySharpIncludeRuntimeSupportedAttributes>true</PolySharpIncludeRuntimeSupportedAttributes>
</PropertyGroup>

Expand Down
2 changes: 1 addition & 1 deletion LibCpp2ILTests/LibCpp2ILTests.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>

<IsPackable>false</IsPackable>

Expand Down
2 changes: 1 addition & 1 deletion WasmDisassembler/WasmDisassembler.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<RepositoryUrl>https://github.com/SamboyCoding/Cpp2IL.git</RepositoryUrl>
<PublishRepositoryUrl>true</PublishRepositoryUrl>
<Description>Simple, zero-dependency disassembler for WebAssembly bytecode</Description>
<TargetFrameworks>net8.0;net7.0;net6.0;netstandard2.0</TargetFrameworks>
<TargetFrameworks>net9.0;net8.0;net7.0;net6.0;netstandard2.0</TargetFrameworks>
</PropertyGroup>

<PropertyGroup Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net6.0'))">
Expand Down
12 changes: 6 additions & 6 deletions do-release.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,15 @@ Write-Host "Building Cpp2IL release version $fullVersionString"

Write-Host " Building Cpp2IL - Windows, Standalone .NET"

$null = dotnet publish -c Release -f "net7.0" -r "win-x64" /p:VersionSuffix=$version /p:PublishSingleFile=true --self-contained
$null = dotnet publish -c Release -f "net9.0" -r "win-x64" /p:VersionSuffix=$version /p:PublishSingleFile=true --self-contained

Write-Host " Building Cpp2IL - Linux, Standalone .NET"

$null = dotnet publish -c Release -f "net7.0" -r "linux-x64" /p:VersionSuffix=$version /p:PublishSingleFile=true --self-contained
$null = dotnet publish -c Release -f "net9.0" -r "linux-x64" /p:VersionSuffix=$version /p:PublishSingleFile=true --self-contained

Write-Host " Building Cpp2IL - MacOS, Standalone .NET"

$null = dotnet publish -c Release -f "net7.0" -r "osx-x64" /p:VersionSuffix=$version /p:PublishSingleFile=true --self-contained
$null = dotnet publish -c Release -f "net9.0" -r "osx-x64" /p:VersionSuffix=$version /p:PublishSingleFile=true --self-contained

Write-Host " Building Cpp2IL - Windows, .NET Framework"

Expand Down Expand Up @@ -92,9 +92,9 @@ Write-Host "Moving files to artifacts directory"

$null = New-Item -ItemType Directory -Force -Path $ArtifactsDir

CopyAndRename "net7.0" "win-x64" "Windows" ".exe"
CopyAndRename "net7.0" "linux-x64" "Linux" ""
CopyAndRename "net7.0" "osx-x64" "OSX" ""
CopyAndRename "net9.0" "win-x64" "Windows" ".exe"
CopyAndRename "net9.0" "linux-x64" "Linux" ""
CopyAndRename "net9.0" "osx-x64" "OSX" ""
ZipAndRename "net472" "win-x64" "Windows-Netframework472" ".exe"

Write-Host "Done!"
Expand Down
4 changes: 2 additions & 2 deletions global.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"sdk": {
"version": "8.0.0",
"version": "9.0.0",
"rollForward": "latestMinor",
"allowPrerelease": false
}
}
}

0 comments on commit 0ea4a82

Please sign in to comment.