Watch
2
0
Fork
You've already forked raylib-cs
0

Enable .net8 multitarget

Fixes #295
This commit is contained in:
Ben Parsons 2025-04-23 01:46:07 +00:00
commit 3f4c0d73f4
5 changed files with 26 additions and 31 deletions

View file

@ -1,9 +1,9 @@
name: Build name: Build
on: on:
push: push:
branches: master branches: ["master"]
pull_request: pull_request:
branches: "*" branches: ["*"]
paths-ignore: paths-ignore:
- "README.md" - "README.md"
- ".github/ISSUE_TEMPLATE/**" - ".github/ISSUE_TEMPLATE/**"
@ -35,7 +35,9 @@ jobs:
- name: setup dotnet - name: setup dotnet
uses: actions/setup-dotnet@v4 uses: actions/setup-dotnet@v4
with: with:
dotnet-version: 6.0.x dotnet-version: |
6.0.x
8.0.x
- name: setup dependencies - name: setup dependencies
run: | run: |
@ -81,7 +83,9 @@ jobs:
- name: setup dotnet - name: setup dotnet
uses: actions/setup-dotnet@v4 uses: actions/setup-dotnet@v4
with: with:
dotnet-version: 6.0.x dotnet-version: |
6.0.x
8.0.x
- name: build projects - name: build projects
run: dotnet build -c Release /p:BuildArch=${{ matrix.arch }} run: dotnet build -c Release /p:BuildArch=${{ matrix.arch }}
@ -114,7 +118,9 @@ jobs:
- name: setup dotnet - name: setup dotnet
uses: actions/setup-dotnet@v4 uses: actions/setup-dotnet@v4
with: with:
dotnet-version: 6.0.x dotnet-version: |
6.0.x
8.0.x
- name: build projects - name: build projects
run: dotnet build -c Release /p:BuildArch=${{ matrix.arch }} run: dotnet build -c Release /p:BuildArch=${{ matrix.arch }}
@ -167,7 +173,9 @@ jobs:
- name: setup dotnet - name: setup dotnet
uses: actions/setup-dotnet@v4 uses: actions/setup-dotnet@v4
with: with:
dotnet-version: 6.0.x dotnet-version: |
6.0.x
8.0.x
- name: create NuGet Package - name: create NuGet Package
run: dotnet pack Raylib-cs -c Release --output nuget run: dotnet pack Raylib-cs -c Release --output nuget

View file

@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk"> <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup> <PropertyGroup>
<OutputType>Exe</OutputType> <OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework> <TargetFrameworks>net6.0;net8.0</TargetFrameworks>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks> <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<StartupObject>Examples.Program</StartupObject> <StartupObject>Examples.Program</StartupObject>
<RunWorkingDirectory>$(MSBuildThisFileDirectory)</RunWorkingDirectory> <RunWorkingDirectory>$(MSBuildThisFileDirectory)</RunWorkingDirectory>

View file

@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk" InitialTargets="ConfigureNative"> <Project Sdk="Microsoft.NET.Sdk" InitialTargets="ConfigureNative">
<PropertyGroup> <PropertyGroup>
<TargetFramework>net6.0</TargetFramework> <TargetFrameworks>net6.0;net8.0</TargetFrameworks>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo> <GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath> <AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
</PropertyGroup> </PropertyGroup>
@ -44,11 +44,7 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Content <Content Include="$(OutputPath)native/raylib/$(NativePre)raylib.$(NativeExt)" Link="%(Filename)%(Extension)" CopyToOutputDirectory="PreserveNewest" Condition="Exists('$(OutputPath)native/raylib/$(NativePre)raylib.$(NativeExt)')" />
Include="$(OutputPath)native/raylib/$(NativePre)raylib.$(NativeExt)"
Link="%(Filename)%(Extension)"
CopyToOutputDirectory="PreserveNewest"
Condition="Exists('$(OutputPath)native/raylib/$(NativePre)raylib.$(NativeExt)')" />
<CMakeArgs Include="-B $(OutputPath)native" /> <CMakeArgs Include="-B $(OutputPath)native" />
<CMakeArgs Include="-S $(BaseIntermediateOutputPath)raylib-$(TargetRaylibTag)" /> <CMakeArgs Include="-S $(BaseIntermediateOutputPath)raylib-$(TargetRaylibTag)" />
@ -62,20 +58,11 @@
</ItemGroup> </ItemGroup>
<Target Name="ConfigureNative" Condition="$(SkipLocalBuild) != true"> <Target Name="ConfigureNative" Condition="$(SkipLocalBuild) != true">
<DownloadFile <DownloadFile SourceUrl="https://github.com/raysan5/raylib/archive/refs/tags/$(TargetRaylibTag).zip" DestinationFolder="$(BaseIntermediateOutputPath)" DestinationFileName="raylib.zip" Condition="!Exists('$(BaseIntermediateOutputPath)raylib.zip')" />
SourceUrl="https://github.com/raysan5/raylib/archive/refs/tags/$(TargetRaylibTag).zip"
DestinationFolder="$(BaseIntermediateOutputPath)"
DestinationFileName="raylib.zip"
Condition="!Exists('$(BaseIntermediateOutputPath)raylib.zip')" />
<Unzip <Unzip SourceFiles="$(BaseIntermediateOutputPath)raylib.zip" DestinationFolder="$(BaseIntermediateOutputPath)" OverwriteReadOnlyFiles="true" Condition="!Exists('$(BaseIntermediateOutputPath)raylib-$(TargetRaylibTag)')" />
SourceFiles="$(BaseIntermediateOutputPath)raylib.zip"
DestinationFolder="$(BaseIntermediateOutputPath)"
OverwriteReadOnlyFiles="true"
Condition="!Exists('$(BaseIntermediateOutputPath)raylib-$(TargetRaylibTag)')" />
<Exec Command="cmake @(CMakeArgs, ' ') $(CMakeExtraArgs)" <Exec Command="cmake @(CMakeArgs, ' ') $(CMakeExtraArgs)" Condition="!Exists('$(BaseIntermediateOutputPath)native/CMakeCache.txt')" />
Condition="!Exists('$(BaseIntermediateOutputPath)native/CMakeCache.txt')" />
<Exec Command="cmake --build $(OutputPath)native --config $(Configuration)" /> <Exec Command="cmake --build $(OutputPath)native --config $(Configuration)" />
</Target> </Target>

View file

@ -1,15 +1,15 @@
<Project Sdk="Microsoft.NET.Sdk"> <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup> <PropertyGroup>
<TargetFramework>net6.0</TargetFramework> <TargetFrameworks>net6.0;net8.0</TargetFrameworks>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks> <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<LangVersion>12</LangVersion> <LangVersion>12</LangVersion>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.7.1" /> <PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0" />
<PackageReference Include="xunit" Version="2.4.1" /> <PackageReference Include="xunit" Version="2.6.2" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.3" /> <PackageReference Include="xunit.runner.visualstudio" Version="2.5.4" />
<PackageReference Include="coverlet.collector" Version="1.3.0" /> <PackageReference Include="coverlet.collector" Version="6.0.0" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>

View file

@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk"> <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup> <PropertyGroup>
<TargetFramework>net6.0</TargetFramework> <TargetFrameworks>net6.0;net8.0</TargetFrameworks>
<EnableDefaultItems>false</EnableDefaultItems> <EnableDefaultItems>false</EnableDefaultItems>
<AssemblyName>Raylib-cs</AssemblyName> <AssemblyName>Raylib-cs</AssemblyName>
<RootNamespace>Raylib_cs</RootNamespace> <RootNamespace>Raylib_cs</RootNamespace>