Skip to content

Commit

Permalink
Merge pull request #215 from sunnamed434/net9_0_support
Browse files Browse the repository at this point in the history
.NET 9 Support
  • Loading branch information
sunnamed434 authored Jan 11, 2025
2 parents 75ca61e + 195573c commit 6964339
Show file tree
Hide file tree
Showing 19 changed files with 90 additions and 52 deletions.
33 changes: 18 additions & 15 deletions .github/workflows/BitMono.CLI.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
name: BitMono.CLI

on:
create:
tags:
Expand All @@ -15,26 +14,30 @@ on:
- '.github/workflows/BitMono.CLI.yaml'
- 'src/**'
- 'test/**'

jobs:
Build:
runs-on: ubuntu-latest
strategy:
matrix:
target-framework: [net8.0, net7.0, net6.0, net462, netstandard2.1, netstandard2.0]
runtime: [linux-x64, win-x64, linux-arm64, win-arm64, osx-x64, osx-arm64]

target-framework: [net9.0, net8.0, net7.0, net6.0, net462, netstandard2.1, netstandard2.0]
runtime: [linux-x64, win-x64, linux-arm64, win-arm64, osx-x64, osx-arm64, win-x86]
exclude:
# Exclude win-x86 builds for .NET Standard as they're architecture-independent
- runtime: win-x86
target-framework: netstandard2.0
- runtime: win-x86
target-framework: netstandard2.1
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.x

dotnet-version: 9.x
- name: Build Project
uses: ./.github/actions/project-build
id: project-build
Expand All @@ -44,30 +47,30 @@ jobs:
target_framework: ${{ matrix.target-framework }}
runtime_version: ${{ matrix.runtime }}
github_token: ${{ secrets.PAT }}

- name: Install zip (for Linux/macOS)
run: |
if [[ "${{ matrix.runtime }}" == "linux-x64" || "${{ matrix.runtime }}" == "linux-arm64" ]]; then
if [[ "${{ matrix.runtime }}" =~ ^linux ]]; then
sudo apt-get install -y zip
elif [[ "${{ matrix.runtime }}" == "osx-x64" || "${{ matrix.runtime }}" == "osx-arm64" ]]; then
elif [[ "${{ matrix.runtime }}" =~ ^osx ]]; then
if ! command -v zip &> /dev/null; then
echo "zip is not available on this macOS runner, and it should be pre-installed."
exit 1
fi
fi
- name: Zip artifacts
run: |
cd ./src/BitMono.CLI/bin/Release/${{ matrix.target-framework }}/${{ matrix.runtime }} && \
zip -qq -r ./BitMono-v${{ steps.project-build.outputs.version }}-CLI-${{ matrix.target-framework }}-${{ matrix.runtime }}.zip *
- name: Upload build
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
uses: actions/upload-artifact@v4
with:
name: BitMono-v${{ steps.project-build.outputs.version }}-CLI-${{ matrix.target-framework }}-${{ matrix.runtime }}
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"
if-no-files-found: error

- name: Create Release
if: github.event_name == 'create' && github.event.ref_type == 'tag'
uses: ncipollo/[email protected]
Expand Down
8 changes: 7 additions & 1 deletion BitMono.sln
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
ProjectSection(SolutionItems) = preProject
.editorconfig = .editorconfig
.gitignore = .gitignore
CHANGELOG.md = CHANGELOG.md
CONTRIBUTING.md = CONTRIBUTING.md
LICENSE = LICENSE
README.md = README.md
Expand Down Expand Up @@ -60,6 +59,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BitMono.Obfuscation.Tests",
EndProject
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}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Sandbox", "test\Sandbox\Sandbox.csproj", "{C5BD413C-89AF-4480-870D-985AE6C44A38}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -134,6 +135,10 @@ Global
{E73C9803-971F-4F7D-A21B-9097C2EC1A80}.Debug|Any CPU.Build.0 = Debug|Any CPU
{E73C9803-971F-4F7D-A21B-9097C2EC1A80}.Release|Any CPU.ActiveCfg = Release|Any CPU
{E73C9803-971F-4F7D-A21B-9097C2EC1A80}.Release|Any CPU.Build.0 = Release|Any CPU
{C5BD413C-89AF-4480-870D-985AE6C44A38}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{C5BD413C-89AF-4480-870D-985AE6C44A38}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C5BD413C-89AF-4480-870D-985AE6C44A38}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C5BD413C-89AF-4480-870D-985AE6C44A38}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand All @@ -158,6 +163,7 @@ Global
{1683308C-36D4-49B1-8CCE-9DDE09336856} = {A431DCB4-6EF9-4BEF-8902-FA704D62624E}
{49E6076C-FEC8-4411-B7AE-4DB6112370C1} = {1EF50257-AFD3-48A3-9E22-03BDC25550A7}
{E73C9803-971F-4F7D-A21B-9097C2EC1A80} = {A431DCB4-6EF9-4BEF-8902-FA704D62624E}
{C5BD413C-89AF-4480-870D-985AE6C44A38} = {1EF50257-AFD3-48A3-9E22-03BDC25550A7}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {7DA0BB43-C1D4-4688-BE43-A9ED2D6F78EE}
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,7 @@ Feel free to use BitMono on frameworks which described below. Be careful using s

| Framework | Version |
|----------------|---------|
| .NET | 9.0 |
| .NET | 8.0 |
| .NET | 7.0 |
| .NET | 6.0 |
Expand Down
11 changes: 7 additions & 4 deletions build.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,22 @@
## Binaries

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.
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.

### Compiling

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.

- [.NET Framework 462][net462]
- [Visual Studio 2022][vs2022]/[JetBrains Rider][rider] or newer to build the solution
- [.NET 9.0][net9]
- [.NET 8.0][net8]
- [.NET 7.0][net7]
- [.NET 6.0][net6]

To build the solution from command line, use:
To build the solution from command line, use:

```bash
$ dotnet build
$ dotnet build
```

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

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

### Help

Expand All @@ -52,5 +54,6 @@ If you have any issues/questions freely, ask them [here][issues], or contact via
[net6]: https://dotnet.microsoft.com/en-us/download/dotnet/6.0
[net7]: https://dotnet.microsoft.com/en-us/download/dotnet/7.0
[net8]: https://dotnet.microsoft.com/en-us/download/dotnet/8.0
[net9]: https://dotnet.microsoft.com/en-us/download/dotnet/9.0
[releases]: https://github.com/sunnamed434/BitMono/releases
[issues]: https://github.com/sunnamed434/BitMono/issues
6 changes: 3 additions & 3 deletions props/SharedProjectProps.props
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,13 @@
<AllowedOutputExtensionsInPackageBuildOutputFolder>$(AllowedOutputExtensionsInPackageBuildOutputFolder);.pdb</AllowedOutputExtensionsInPackageBuildOutputFolder>
</PropertyGroup>

<PropertyGroup Condition=" '$(Configuration)' =='Release' ">
<PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
<GenerateDocumentationFile>true</GenerateDocumentationFile>
</PropertyGroup>

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

</Project>
6 changes: 3 additions & 3 deletions props/SharedTestProps.props
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
<Project>

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net9.0</TargetFramework>
<LangVersion>preview</LangVersion>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.12.0"/>
<PackageReference Include="FluentAssertions" Version="7.0.0"/>
<PackageReference Include="xunit" Version="2.9.2"/>
<PackageReference Include="xunit.runner.visualstudio" Version="3.0.0"/>
<PackageReference Include="xunit" Version="2.9.3"/>
<PackageReference Include="xunit.runner.visualstudio" Version="3.0.1"/>
<PackageReference Include="coverlet.collector" Version="6.0.3"/>
</ItemGroup>

Expand Down
2 changes: 1 addition & 1 deletion src/BitMono.API/BitMono.API.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net8.0;net7.0;net6.0;net462;netstandard2.1;netstandard2.0;</TargetFrameworks>
<TargetFrameworks>net9.0;net8.0;net7.0;net6.0;net462;netstandard2.1;netstandard2.0;</TargetFrameworks>
</PropertyGroup>

<Import Project="$(MSBuildThisFileDirectory)..\..\props\SharedProjectProps.props" />
Expand Down
4 changes: 2 additions & 2 deletions src/BitMono.CLI/BitMono.CLI.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

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

<ItemGroup>
<PackageReference Include="CommandLineParser" Version="2.9.1"/>
<PackageReference Include="Costura.Fody" Version="5.7.0">
<PackageReference Include="Costura.Fody" Version="6.0.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
Expand Down
2 changes: 1 addition & 1 deletion src/BitMono.Core/BitMono.Core.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net8.0;net7.0;net6.0;net462;netstandard2.1;netstandard2.0;</TargetFrameworks>
<TargetFrameworks>net9.0;net8.0;net7.0;net6.0;net462;netstandard2.1;netstandard2.0;</TargetFrameworks>
</PropertyGroup>

<Import Project="$(MSBuildThisFileDirectory)..\..\props\SharedProjectProps.props" />
Expand Down
2 changes: 1 addition & 1 deletion src/BitMono.Host/BitMono.Host.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net8.0;net7.0;net6.0;net462;netstandard2.1;netstandard2.0;</TargetFrameworks>
<TargetFrameworks>net9.0;net8.0;net7.0;net6.0;net462;netstandard2.1;netstandard2.0;</TargetFrameworks>
</PropertyGroup>

<Import Project="$(MSBuildThisFileDirectory)..\..\props\SharedProjectProps.props" />
Expand Down
2 changes: 1 addition & 1 deletion src/BitMono.Host/obfuscation.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
"OutputConfigureForNativeCodeWarnings": true,

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

// Set to true to enable, in cases when you want to obfuscate only the specific namespace(s)
"SpecificNamespacesObfuscationOnly": false,
Expand Down
2 changes: 1 addition & 1 deletion src/BitMono.Obfuscation/BitMono.Obfuscation.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net8.0;net7.0;net6.0;net462;netstandard2.1;netstandard2.0;</TargetFrameworks>
<TargetFrameworks>net9.0;net8.0;net7.0;net6.0;net462;netstandard2.1;netstandard2.0;</TargetFrameworks>
</PropertyGroup>

<Import Project="$(MSBuildThisFileDirectory)..\..\props\SharedProjectProps.props" />
Expand Down
2 changes: 1 addition & 1 deletion src/BitMono.Protections/BitMono.Protections.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net8.0;net7.0;net6.0;net462;netstandard2.1;netstandard2.0;</TargetFrameworks>
<TargetFrameworks>net9.0;net8.0;net7.0;net6.0;net462;netstandard2.1;netstandard2.0;</TargetFrameworks>
</PropertyGroup>

<Import Project="$(MSBuildThisFileDirectory)..\..\props\SharedProjectProps.props" />
Expand Down
2 changes: 1 addition & 1 deletion src/BitMono.Runtime/BitMono.Runtime.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net8.0;net7.0;net6.0;net462;netstandard2.1;netstandard2.0;</TargetFrameworks>
<TargetFrameworks>net9.0;net8.0;net7.0;net6.0;net462;netstandard2.1;netstandard2.0;</TargetFrameworks>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup>

Expand Down
Loading

0 comments on commit 6964339

Please sign in to comment.