Skip to content

Commit 6964339

Browse files
authored
Merge pull request #215 from sunnamed434/net9_0_support
.NET 9 Support
2 parents 75ca61e + 195573c commit 6964339

File tree

19 files changed

+90
-52
lines changed

19 files changed

+90
-52
lines changed

.github/workflows/BitMono.CLI.yaml

+18-15
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
name: BitMono.CLI
2-
32
on:
43
create:
54
tags:
@@ -15,26 +14,30 @@ on:
1514
- '.github/workflows/BitMono.CLI.yaml'
1615
- 'src/**'
1716
- 'test/**'
18-
1917
jobs:
2018
Build:
2119
runs-on: ubuntu-latest
2220
strategy:
2321
matrix:
24-
target-framework: [net8.0, net7.0, net6.0, net462, netstandard2.1, netstandard2.0]
25-
runtime: [linux-x64, win-x64, linux-arm64, win-arm64, osx-x64, osx-arm64]
26-
22+
target-framework: [net9.0, net8.0, net7.0, net6.0, net462, netstandard2.1, netstandard2.0]
23+
runtime: [linux-x64, win-x64, linux-arm64, win-arm64, osx-x64, osx-arm64, win-x86]
24+
exclude:
25+
# Exclude win-x86 builds for .NET Standard as they're architecture-independent
26+
- runtime: win-x86
27+
target-framework: netstandard2.0
28+
- runtime: win-x86
29+
target-framework: netstandard2.1
2730
steps:
2831
- name: Checkout code
2932
uses: actions/checkout@v4
3033
with:
3134
fetch-depth: 0
32-
35+
3336
- name: Setup .NET
3437
uses: actions/setup-dotnet@v4
3538
with:
36-
dotnet-version: 8.x
37-
39+
dotnet-version: 9.x
40+
3841
- name: Build Project
3942
uses: ./.github/actions/project-build
4043
id: project-build
@@ -44,30 +47,30 @@ jobs:
4447
target_framework: ${{ matrix.target-framework }}
4548
runtime_version: ${{ matrix.runtime }}
4649
github_token: ${{ secrets.PAT }}
47-
50+
4851
- name: Install zip (for Linux/macOS)
4952
run: |
50-
if [[ "${{ matrix.runtime }}" == "linux-x64" || "${{ matrix.runtime }}" == "linux-arm64" ]]; then
53+
if [[ "${{ matrix.runtime }}" =~ ^linux ]]; then
5154
sudo apt-get install -y zip
52-
elif [[ "${{ matrix.runtime }}" == "osx-x64" || "${{ matrix.runtime }}" == "osx-arm64" ]]; then
55+
elif [[ "${{ matrix.runtime }}" =~ ^osx ]]; then
5356
if ! command -v zip &> /dev/null; then
5457
echo "zip is not available on this macOS runner, and it should be pre-installed."
5558
exit 1
5659
fi
5760
fi
58-
61+
5962
- name: Zip artifacts
6063
run: |
6164
cd ./src/BitMono.CLI/bin/Release/${{ matrix.target-framework }}/${{ matrix.runtime }} && \
6265
zip -qq -r ./BitMono-v${{ steps.project-build.outputs.version }}-CLI-${{ matrix.target-framework }}-${{ matrix.runtime }}.zip *
63-
66+
6467
- name: Upload build
65-
uses: actions/upload-artifact@v4 # There were problems with v4 + matrix, but now it seems to be working ok, see here: see: https://github.com/actions/upload-artifact/issues/478
68+
uses: actions/upload-artifact@v4
6669
with:
6770
name: BitMono-v${{ steps.project-build.outputs.version }}-CLI-${{ matrix.target-framework }}-${{ matrix.runtime }}
6871
path: "./src/BitMono.CLI/bin/Release/${{ matrix.target-framework }}/${{ matrix.runtime }}/BitMono-v${{ steps.project-build.outputs.version }}-CLI-${{ matrix.target-framework }}-${{ matrix.runtime }}.zip"
6972
if-no-files-found: error
70-
73+
7174
- name: Create Release
7275
if: github.event_name == 'create' && github.event.ref_type == 'tag'
7376
uses: ncipollo/[email protected]

BitMono.sln

+7-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
77
ProjectSection(SolutionItems) = preProject
88
.editorconfig = .editorconfig
99
.gitignore = .gitignore
10-
CHANGELOG.md = CHANGELOG.md
1110
CONTRIBUTING.md = CONTRIBUTING.md
1211
LICENSE = LICENSE
1312
README.md = README.md
@@ -60,6 +59,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BitMono.Obfuscation.Tests",
6059
EndProject
6160
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BitMono.Obfuscation.TestCases.CosturaDecompressor", "test\TestBinaries\DotNet\BitMono.Obfuscation.TestCases.CosturaDecompressor\BitMono.Obfuscation.TestCases.CosturaDecompressor.csproj", "{E73C9803-971F-4F7D-A21B-9097C2EC1A80}"
6261
EndProject
62+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Sandbox", "test\Sandbox\Sandbox.csproj", "{C5BD413C-89AF-4480-870D-985AE6C44A38}"
63+
EndProject
6364
Global
6465
GlobalSection(SolutionConfigurationPlatforms) = preSolution
6566
Debug|Any CPU = Debug|Any CPU
@@ -134,6 +135,10 @@ Global
134135
{E73C9803-971F-4F7D-A21B-9097C2EC1A80}.Debug|Any CPU.Build.0 = Debug|Any CPU
135136
{E73C9803-971F-4F7D-A21B-9097C2EC1A80}.Release|Any CPU.ActiveCfg = Release|Any CPU
136137
{E73C9803-971F-4F7D-A21B-9097C2EC1A80}.Release|Any CPU.Build.0 = Release|Any CPU
138+
{C5BD413C-89AF-4480-870D-985AE6C44A38}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
139+
{C5BD413C-89AF-4480-870D-985AE6C44A38}.Debug|Any CPU.Build.0 = Debug|Any CPU
140+
{C5BD413C-89AF-4480-870D-985AE6C44A38}.Release|Any CPU.ActiveCfg = Release|Any CPU
141+
{C5BD413C-89AF-4480-870D-985AE6C44A38}.Release|Any CPU.Build.0 = Release|Any CPU
137142
EndGlobalSection
138143
GlobalSection(SolutionProperties) = preSolution
139144
HideSolutionNode = FALSE
@@ -158,6 +163,7 @@ Global
158163
{1683308C-36D4-49B1-8CCE-9DDE09336856} = {A431DCB4-6EF9-4BEF-8902-FA704D62624E}
159164
{49E6076C-FEC8-4411-B7AE-4DB6112370C1} = {1EF50257-AFD3-48A3-9E22-03BDC25550A7}
160165
{E73C9803-971F-4F7D-A21B-9097C2EC1A80} = {A431DCB4-6EF9-4BEF-8902-FA704D62624E}
166+
{C5BD413C-89AF-4480-870D-985AE6C44A38} = {1EF50257-AFD3-48A3-9E22-03BDC25550A7}
161167
EndGlobalSection
162168
GlobalSection(ExtensibilityGlobals) = postSolution
163169
SolutionGuid = {7DA0BB43-C1D4-4688-BE43-A9ED2D6F78EE}

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,7 @@ Feel free to use BitMono on frameworks which described below. Be careful using s
180180

181181
| Framework | Version |
182182
|----------------|---------|
183+
| .NET | 9.0 |
183184
| .NET | 8.0 |
184185
| .NET | 7.0 |
185186
| .NET | 6.0 |

build.md

+7-4
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,22 @@
11
## Binaries
22

3-
If you just need the compiled binaries simply install them [from releases][releases] - open the dropdown button `Assets`, and select the preferred archive, these binaries were made automatically via CI/CD pipeline.
3+
If you just need the compiled binaries simply install them [from releases][releases] - open the dropdown button `Assets`, and select the preferred archive, these binaries were made automatically via CI/CD pipeline.
44

55
### Compiling
66

77
Recommended to install tools via Visual Studio installer, otherwise you can install those tools directly via provided links down below or just searching for it by yourself.
88

99
- [.NET Framework 462][net462]
1010
- [Visual Studio 2022][vs2022]/[JetBrains Rider][rider] or newer to build the solution
11+
- [.NET 9.0][net9]
1112
- [.NET 8.0][net8]
1213
- [.NET 7.0][net7]
1314
- [.NET 6.0][net6]
1415

15-
To build the solution from command line, use:
16+
To build the solution from command line, use:
1617

1718
```bash
18-
$ dotnet build
19+
$ dotnet build
1920
```
2021

2122
Otherwise do that via IDE `Build` button if you have.
@@ -29,6 +30,7 @@ $ dotnet test
2930
### Release On GitHub details
3031

3132
Archives examples (versions and/or naming can be a bit different):
33+
- .NET 9.0: `BitMono-v0.24.2+7aaeceac-CLI-net9.0-linux-x64.zip`
3234
- .NET 8.0: `BitMono-v0.24.2+7aaeceac-CLI-net8.0-linux-x64.zip`
3335
- .NET 7.0: `BitMono-v0.24.2+7aaeceac-CLI-net7.0-win-x64.zip`
3436
- .NET 6.0: `BitMono-v0.24.2+7aaeceac-CLI-net6.0-linux-x64.zip`
@@ -39,7 +41,7 @@ Archives examples (versions and/or naming can be a bit different):
3941
To be more clear:
4042
- `v0.24.2` is the version and the value `+7aaeceac` after the version is the hash of the commit.
4143
- `CLI` is the `command line interface` meaning, currently BitMono only have CLI for usage.
42-
- `net8.0`, `net7.0`, `net6.0`, `net462`, `netstandard2.1`, `netstandard2.0` is the target framework that BitMono was built on.
44+
- `net.9.0`, `net8.0`, `net7.0`, `net6.0`, `net462`, `netstandard2.1`, `netstandard2.0` is the target framework that BitMono was built on.
4345

4446
### Help
4547

@@ -52,5 +54,6 @@ If you have any issues/questions freely, ask them [here][issues], or contact via
5254
[net6]: https://dotnet.microsoft.com/en-us/download/dotnet/6.0
5355
[net7]: https://dotnet.microsoft.com/en-us/download/dotnet/7.0
5456
[net8]: https://dotnet.microsoft.com/en-us/download/dotnet/8.0
57+
[net9]: https://dotnet.microsoft.com/en-us/download/dotnet/9.0
5558
[releases]: https://github.com/sunnamed434/BitMono/releases
5659
[issues]: https://github.com/sunnamed434/BitMono/issues

props/SharedProjectProps.props

+3-3
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,13 @@
2626
<AllowedOutputExtensionsInPackageBuildOutputFolder>$(AllowedOutputExtensionsInPackageBuildOutputFolder);.pdb</AllowedOutputExtensionsInPackageBuildOutputFolder>
2727
</PropertyGroup>
2828

29-
<PropertyGroup Condition=" '$(Configuration)' =='Release' ">
29+
<PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
3030
<GenerateDocumentationFile>true</GenerateDocumentationFile>
3131
</PropertyGroup>
3232

3333
<ItemGroup Condition=" '$(TargetFramework)' == 'net462' ">
34-
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.2" PrivateAssets="All" />
35-
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0" PrivateAssets="All"/>
34+
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.3" PrivateAssets="All" />
35+
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="8.0.0" PrivateAssets="All"/>
3636
</ItemGroup>
3737

3838
</Project>

props/SharedTestProps.props

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
<Project>
22

33
<PropertyGroup>
4-
<TargetFramework>net8.0</TargetFramework>
4+
<TargetFramework>net9.0</TargetFramework>
55
<LangVersion>preview</LangVersion>
66
</PropertyGroup>
77

88
<ItemGroup>
99
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.12.0"/>
1010
<PackageReference Include="FluentAssertions" Version="7.0.0"/>
11-
<PackageReference Include="xunit" Version="2.9.2"/>
12-
<PackageReference Include="xunit.runner.visualstudio" Version="3.0.0"/>
11+
<PackageReference Include="xunit" Version="2.9.3"/>
12+
<PackageReference Include="xunit.runner.visualstudio" Version="3.0.1"/>
1313
<PackageReference Include="coverlet.collector" Version="6.0.3"/>
1414
</ItemGroup>
1515

src/BitMono.API/BitMono.API.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFrameworks>net8.0;net7.0;net6.0;net462;netstandard2.1;netstandard2.0;</TargetFrameworks>
4+
<TargetFrameworks>net9.0;net8.0;net7.0;net6.0;net462;netstandard2.1;netstandard2.0;</TargetFrameworks>
55
</PropertyGroup>
66

77
<Import Project="$(MSBuildThisFileDirectory)..\..\props\SharedProjectProps.props" />

src/BitMono.CLI/BitMono.CLI.csproj

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<PropertyGroup>
44
<OutputType>Exe</OutputType>
5-
<TargetFrameworks>net8.0;net7.0;net6.0;net462;netstandard2.1;netstandard2.0;</TargetFrameworks>
5+
<TargetFrameworks>net9.0;net8.0;net7.0;net6.0;net462;netstandard2.1;netstandard2.0;</TargetFrameworks>
66
<ApplicationIcon>BitMonoLogo.ico</ApplicationIcon>
77
<SolutionDir>$([System.IO.Path]::GetFullPath($(MSBuildProjectDirectory)/../../))</SolutionDir>
88
</PropertyGroup>
@@ -21,7 +21,7 @@
2121

2222
<ItemGroup>
2323
<PackageReference Include="CommandLineParser" Version="2.9.1"/>
24-
<PackageReference Include="Costura.Fody" Version="5.7.0">
24+
<PackageReference Include="Costura.Fody" Version="6.0.0">
2525
<PrivateAssets>all</PrivateAssets>
2626
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
2727
</PackageReference>

src/BitMono.Core/BitMono.Core.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFrameworks>net8.0;net7.0;net6.0;net462;netstandard2.1;netstandard2.0;</TargetFrameworks>
4+
<TargetFrameworks>net9.0;net8.0;net7.0;net6.0;net462;netstandard2.1;netstandard2.0;</TargetFrameworks>
55
</PropertyGroup>
66

77
<Import Project="$(MSBuildThisFileDirectory)..\..\props\SharedProjectProps.props" />

src/BitMono.Host/BitMono.Host.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFrameworks>net8.0;net7.0;net6.0;net462;netstandard2.1;netstandard2.0;</TargetFrameworks>
4+
<TargetFrameworks>net9.0;net8.0;net7.0;net6.0;net462;netstandard2.1;netstandard2.0;</TargetFrameworks>
55
</PropertyGroup>
66

77
<Import Project="$(MSBuildThisFileDirectory)..\..\props\SharedProjectProps.props" />

src/BitMono.Host/obfuscation.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@
7272
"OutputConfigureForNativeCodeWarnings": true,
7373

7474
// Opens directory with protected file in file explorer in top of the screen, if set to true
75-
"OpenFileDestinationInFileExplorer": true,
75+
"OpenFileDestinationInFileExplorer": false,
7676

7777
// Set to true to enable, in cases when you want to obfuscate only the specific namespace(s)
7878
"SpecificNamespacesObfuscationOnly": false,

src/BitMono.Obfuscation/BitMono.Obfuscation.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFrameworks>net8.0;net7.0;net6.0;net462;netstandard2.1;netstandard2.0;</TargetFrameworks>
4+
<TargetFrameworks>net9.0;net8.0;net7.0;net6.0;net462;netstandard2.1;netstandard2.0;</TargetFrameworks>
55
</PropertyGroup>
66

77
<Import Project="$(MSBuildThisFileDirectory)..\..\props\SharedProjectProps.props" />

src/BitMono.Protections/BitMono.Protections.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFrameworks>net8.0;net7.0;net6.0;net462;netstandard2.1;netstandard2.0;</TargetFrameworks>
4+
<TargetFrameworks>net9.0;net8.0;net7.0;net6.0;net462;netstandard2.1;netstandard2.0;</TargetFrameworks>
55
</PropertyGroup>
66

77
<Import Project="$(MSBuildThisFileDirectory)..\..\props\SharedProjectProps.props" />

src/BitMono.Runtime/BitMono.Runtime.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFrameworks>net8.0;net7.0;net6.0;net462;netstandard2.1;netstandard2.0;</TargetFrameworks>
4+
<TargetFrameworks>net9.0;net8.0;net7.0;net6.0;net462;netstandard2.1;netstandard2.0;</TargetFrameworks>
55
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
66
</PropertyGroup>
77

0 commit comments

Comments
 (0)