Update to .NET 6
This commit is contained in:
committed by
Matthias Mailänder
parent
eae6d33cd9
commit
b12c15ea9d
12
.github/workflows/ci.yaml
vendored
12
.github/workflows/ci.yaml
vendored
@@ -7,17 +7,17 @@ on:
|
||||
|
||||
jobs:
|
||||
linux:
|
||||
name: Linux (.NET 5.0)
|
||||
name: Linux (.NET 6.0)
|
||||
runs-on: ubuntu-20.04
|
||||
|
||||
steps:
|
||||
- name: Clone Repository
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Install .NET 5
|
||||
- name: Install .NET 6.0
|
||||
uses: actions/setup-dotnet@v1
|
||||
with:
|
||||
dotnet-version: '5.0.x'
|
||||
dotnet-version: '6.0.x'
|
||||
|
||||
- name: Check Code
|
||||
run: |
|
||||
@@ -48,17 +48,17 @@ jobs:
|
||||
make RUNTIME=mono test
|
||||
|
||||
windows:
|
||||
name: Windows (.NET 5.0)
|
||||
name: Windows (.NET 6.0)
|
||||
runs-on: windows-2019
|
||||
|
||||
steps:
|
||||
- name: Clone Repository
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Install .NET 5
|
||||
- name: Install .NET 6.0
|
||||
uses: actions/setup-dotnet@v1
|
||||
with:
|
||||
dotnet-version: '5.0.x'
|
||||
dotnet-version: '6.0.x'
|
||||
|
||||
- name: Check Code
|
||||
shell: powershell
|
||||
|
||||
12
.github/workflows/packaging.yml
vendored
12
.github/workflows/packaging.yml
vendored
@@ -39,10 +39,10 @@ jobs:
|
||||
- name: Clone Repository
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Install .NET 5
|
||||
- name: Install .NET 6.0
|
||||
uses: actions/setup-dotnet@v1
|
||||
with:
|
||||
dotnet-version: '5.0.x'
|
||||
dotnet-version: '6.0.x'
|
||||
|
||||
- name: Prepare Environment
|
||||
run: echo "GIT_TAG=${GITHUB_REF#refs/tags/}" >> ${GITHUB_ENV}
|
||||
@@ -68,10 +68,10 @@ jobs:
|
||||
- name: Clone Repository
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Install .NET 5
|
||||
- name: Install .NET 6.0
|
||||
uses: actions/setup-dotnet@v1
|
||||
with:
|
||||
dotnet-version: '5.0.x'
|
||||
dotnet-version: '6.0.x'
|
||||
|
||||
- name: Prepare Environment
|
||||
run: echo "GIT_TAG=${GITHUB_REF#refs/tags/}" >> ${GITHUB_ENV}
|
||||
@@ -103,10 +103,10 @@ jobs:
|
||||
- name: Clone Repository
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Install .NET 5
|
||||
- name: Install .NET 6.0
|
||||
uses: actions/setup-dotnet@v1
|
||||
with:
|
||||
dotnet-version: '5.0.x'
|
||||
dotnet-version: '6.0.x'
|
||||
|
||||
- name: Prepare Environment
|
||||
run: |
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework Condition="'$(Mono)' == ''">net5.0</TargetFramework>
|
||||
<TargetFramework Condition="'$(Mono)' == ''">net6.0</TargetFramework>
|
||||
<TargetFramework Condition="'$(Mono)' != ''">netstandard2.1</TargetFramework>
|
||||
</PropertyGroup>
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ Windows
|
||||
|
||||
Compiling OpenRA requires the following dependencies:
|
||||
* [Windows PowerShell >= 4.0](http://microsoft.com/powershell) (included by default in recent Windows 10 versions)
|
||||
* [.NET 5 SDK](https://dotnet.microsoft.com/download/dotnet/5.0) (or via Visual Studio)
|
||||
* [.NET 6 SDK](https://dotnet.microsoft.com/download/dotnet/6.0) (or via Visual Studio)
|
||||
|
||||
To compile OpenRA, open the `OpenRA.sln` solution in the main folder, build it from the command-line with `dotnet` or use the Makefile analogue command `make all` scripted in PowerShell syntax.
|
||||
|
||||
@@ -17,9 +17,9 @@ Run the game with `launch-game.cmd`. It can be handed arguments that specify the
|
||||
Linux
|
||||
=====
|
||||
|
||||
.NET 5 or Mono (version 6.4 or later) is required to compile OpenRA. We recommend using .NET 5 when possible, as Mono is poorly packaged by most Linux distributions (e.g. missing the required `msbuild` toolchain), and has been deprecated as a standalone project.
|
||||
.NET 6 or Mono (version 6.4 or later) is required to compile OpenRA. We recommend using .NET 6 when possible, as Mono is poorly packaged by most Linux distributions (e.g. missing the required `msbuild` toolchain), and has been deprecated as a standalone project.
|
||||
|
||||
The [.NET 5 download page](https://dotnet.microsoft.com/download/dotnet/5.0) provides repositories for various package managers and binary releases for several architectures. If you prefer to use Mono, we suggest adding the [upstream repository](https://www.mono-project.com/download/stable/#download-lin) for your distro to obtain the latest version and the `msbuild` toolchain.
|
||||
The [.NET 6 download page](https://dotnet.microsoft.com/download/dotnet/6.0) provides repositories for various package managers and binary releases for several architectures. If you prefer to use Mono, we suggest adding the [upstream repository](https://www.mono-project.com/download/stable/#download-lin) for your distro to obtain the latest version and the `msbuild` toolchain.
|
||||
|
||||
To compile OpenRA, run `make` from the command line (or `make RUNTIME=mono` if using Mono). After this one can run the game with `./launch-game.sh`. It is also possible to specify the mod you wish to run from the command line, e.g. with `./launch-game.sh Game.Mod=ts` if you wish to try the experimental Tiberian Sun mod.
|
||||
|
||||
@@ -78,6 +78,6 @@ Type `sudo make install` for system-wide installation. Run `sudo make install-li
|
||||
macOS
|
||||
=====
|
||||
|
||||
[.NET 5](https://dotnet.microsoft.com/download/dotnet/5.0) or [Mono](https://www.mono-project.com/download/stable/#download-mac) (version 6.4 or later) is required to compile OpenRA. We recommend using .NET 5 unless you are running a very old version of macOS (10.9 through 10.12).
|
||||
[.NET 6](https://dotnet.microsoft.com/download/dotnet/6.0) or [Mono](https://www.mono-project.com/download/stable/#download-mac) (version 6.4 or later) is required to compile OpenRA. We recommend using .NET 6 unless you are running a very old version of macOS (10.9 through 10.14).
|
||||
|
||||
To compile OpenRA, run `make` from the command line (or `make RUNTIME=mono` if using Mono). Run with `./launch-game.sh`.
|
||||
|
||||
24
Makefile
24
Makefile
@@ -3,20 +3,20 @@
|
||||
# to compile, run:
|
||||
# make
|
||||
#
|
||||
# to compile using Mono (version 6.4 or greater) instead of .NET 5, run:
|
||||
# to compile using Mono (version 6.4 or greater) instead of .NET 6, run:
|
||||
# make RUNTIME=mono
|
||||
#
|
||||
# to compile using system libraries for native dependencies, run:
|
||||
# make [RUNTIME=net5] TARGETPLATFORM=unix-generic
|
||||
# make [RUNTIME=net6] TARGETPLATFORM=unix-generic
|
||||
#
|
||||
# to check the official mods for erroneous yaml files, run:
|
||||
# make [RUNTIME=net5] test
|
||||
# make [RUNTIME=net6] test
|
||||
#
|
||||
# to check the engine and official mod dlls for code style violations, run:
|
||||
# make [RUNTIME=net5] check
|
||||
# make [RUNTIME=net6] check
|
||||
#
|
||||
# to compile and install Red Alert, Tiberian Dawn, and Dune 2000, run:
|
||||
# make [RUNTIME=net5] [prefix=/foo] [bindir=/bar/bin] install
|
||||
# make [RUNTIME=net6] [prefix=/foo] [bindir=/bar/bin] install
|
||||
#
|
||||
# to compile and install Red Alert, Tiberian Dawn, and Dune 2000
|
||||
# using system libraries for native dependencies, run:
|
||||
@@ -53,7 +53,7 @@ RM_R = $(RM) -r
|
||||
RM_F = $(RM) -f
|
||||
RM_RF = $(RM) -rf
|
||||
|
||||
RUNTIME ?= net5
|
||||
RUNTIME ?= net6
|
||||
CONFIGURATION ?= Release
|
||||
|
||||
# Only for use in target version:
|
||||
@@ -159,24 +159,24 @@ help:
|
||||
@echo 'to compile, run:'
|
||||
@echo ' make'
|
||||
@echo
|
||||
@echo 'to compile using Mono (version 6.4 or greater) instead of .NET 5, run:'
|
||||
@echo 'to compile using Mono (version 6.4 or greater) instead of .NET 6, run:'
|
||||
@echo ' make RUNTIME=mono'
|
||||
@echo
|
||||
@echo 'to compile using system libraries for native dependencies, run:'
|
||||
@echo ' make [RUNTIME=net5] TARGETPLATFORM=unix-generic'
|
||||
@echo ' make [RUNTIME=net6] TARGETPLATFORM=unix-generic'
|
||||
@echo
|
||||
@echo 'to check the official mods for erroneous yaml files, run:'
|
||||
@echo ' make [RUNTIME=net5] test'
|
||||
@echo ' make [RUNTIME=net6] test'
|
||||
@echo
|
||||
@echo 'to check the engine and official mod dlls for code style violations, run:'
|
||||
@echo ' make [RUNTIME=net5] check'
|
||||
@echo ' make [RUNTIME=net6] check'
|
||||
@echo
|
||||
@echo 'to compile and install Red Alert, Tiberian Dawn, and Dune 2000 run:'
|
||||
@echo ' make [RUNTIME=net5] [prefix=/foo] [TARGETPLATFORM=unix-generic] install'
|
||||
@echo ' make [RUNTIME=net6] [prefix=/foo] [TARGETPLATFORM=unix-generic] install'
|
||||
@echo
|
||||
@echo 'to compile and install Red Alert, Tiberian Dawn, and Dune 2000'
|
||||
@echo 'using system libraries for native dependencies, run:'
|
||||
@echo ' make [RUNTIME=net5] [prefix=/foo] [bindir=/bar/bin] TARGETPLATFORM=unix-generic install'
|
||||
@echo ' make [RUNTIME=net6] [prefix=/foo] [bindir=/bar/bin] TARGETPLATFORM=unix-generic install'
|
||||
@echo
|
||||
@echo 'to install Linux startup scripts, desktop files, icons, and MIME metadata'
|
||||
@echo ' make install-linux-shortcuts'
|
||||
|
||||
@@ -31,7 +31,7 @@ namespace OpenRA.Support
|
||||
parameters.Add(new Parameter
|
||||
{
|
||||
Name = name,
|
||||
Value = Uri.EscapeUriString(value.ToString())
|
||||
Value = Uri.EscapeDataString(value.ToString())
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -13,6 +13,7 @@ using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Threading.Tasks;
|
||||
using OpenRA.Mods.Common.FileFormats;
|
||||
using OpenRA.Widgets;
|
||||
@@ -472,6 +473,11 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
||||
if (Platform.CurrentPlatform != PlatformType.Windows)
|
||||
return null;
|
||||
|
||||
// We need an extra check for the platform here to silence a warning when the registry is accessed
|
||||
// TODO: Remove this once our platform checks use the same method
|
||||
if (!RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
|
||||
return null;
|
||||
|
||||
foreach (var prefix in source.RegistryPrefixes)
|
||||
{
|
||||
var path = Microsoft.Win32.Registry.GetValue(prefix + source.RegistryKey, source.RegistryValue, null) as string;
|
||||
|
||||
@@ -56,7 +56,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
||||
|
||||
return $"&sysinfoversion={SystemInformationVersion}&"
|
||||
+ GetSystemInformation()
|
||||
.Select(kv => kv.Key + "=" + Uri.EscapeUriString(kv.Value.Value))
|
||||
.Select(kv => kv.Key + "=" + Uri.EscapeDataString(kv.Value.Value))
|
||||
.JoinWith("&");
|
||||
}
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@ patch_config()
|
||||
done
|
||||
done
|
||||
else
|
||||
# NET 5 does not support .config files, so we must use symlinks instead
|
||||
# .NET 6 does not support .config files, so we must use symlinks instead
|
||||
# Exit early if the symlink already exists
|
||||
if [ -L "bin/${REPLACE}" ]; then
|
||||
return 0
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
# SRC_PATH: Path to the root OpenRA directory
|
||||
# DEST_PATH: Path to the root of the install destination (will be created if necessary)
|
||||
# TARGETPLATFORM: Platform type (win-x86, win-x64, osx-x64, linux-x64, unix-generic)
|
||||
# RUNTIME: Runtime type (net5, mono)
|
||||
# RUNTIME: Runtime type (net6, mono)
|
||||
# COPY_GENERIC_LAUNCHER: If set to True the OpenRA.exe will also be copied (True, False)
|
||||
# COPY_CNC_DLL: If set to True the OpenRA.Mods.Cnc.dll will also be copied (True, False)
|
||||
# COPY_D2K_DLL: If set to True the OpenRA.Mods.D2k.dll will also be copied (True, False)
|
||||
@@ -153,7 +153,7 @@ install_windows_launcher()
|
||||
rm -rf "${SRC_PATH}/OpenRA.WindowsLauncher/obj"
|
||||
dotnet publish "${SRC_PATH}/OpenRA.WindowsLauncher/OpenRA.WindowsLauncher.csproj" -c Release -r "${TARGETPLATFORM}" -p:LauncherName="${LAUNCHER_NAME}" -p:TargetPlatform="${TARGETPLATFORM}" -p:ModID="${MOD_ID}" -p:DisplayName="${MOD_NAME}" -p:FaqUrl="${FAQ_URL}" -o "${DEST_PATH}" --self-contained true
|
||||
|
||||
# NET 5 is unable to customize the application host for windows when compiling from Linux,
|
||||
# NET 6 is unable to customize the application host for windows when compiling from Linux,
|
||||
# so we must patch the properties we need in the PE header.
|
||||
# Setting the application icon requires an external tool, so is left to the calling code
|
||||
python3 "${SRC_PATH}/packaging/windows/fixlauncher.py" "${DEST_PATH}/${LAUNCHER_NAME}.exe"
|
||||
|
||||
@@ -65,7 +65,7 @@ build_appimage() {
|
||||
IS_D2K="True"
|
||||
fi
|
||||
|
||||
install_assemblies "${SRCDIR}" "${APPDIR}/usr/lib/openra" "linux-x64" "net5" "True" "True" "${IS_D2K}"
|
||||
install_assemblies "${SRCDIR}" "${APPDIR}/usr/lib/openra" "linux-x64" "net6" "True" "True" "${IS_D2K}"
|
||||
install_data "${SRCDIR}" "${APPDIR}/usr/lib/openra" "${MOD_ID}"
|
||||
set_engine_version "${TAG}" "${APPDIR}/usr/lib/openra"
|
||||
set_mod_version "${TAG}" "${APPDIR}/usr/lib/openra/mods/${MOD_ID}/mod.yaml" "${APPDIR}/usr/lib/openra/mods/modcontent/mod.yaml"
|
||||
|
||||
@@ -74,7 +74,7 @@ build_app() {
|
||||
fi
|
||||
|
||||
# Install engine and mod files
|
||||
RUNTIME="net5"
|
||||
RUNTIME="net6"
|
||||
if [ "${PLATFORM}" = "compat" ]; then
|
||||
RUNTIME="mono"
|
||||
fi
|
||||
@@ -128,8 +128,8 @@ build_platform() {
|
||||
modify_plist "{MINIMUM_SYSTEM_VERSION}" "10.9" "${TEMPLATE_DIR}/Contents/Info.plist"
|
||||
clang -m64 launcher-mono.m -o "${TEMPLATE_DIR}/Contents/MacOS/Launcher" -framework AppKit -mmacosx-version-min=10.9
|
||||
else
|
||||
modify_plist "{MINIMUM_SYSTEM_VERSION}" "10.13" "${TEMPLATE_DIR}/Contents/Info.plist"
|
||||
clang -m64 launcher.m -o "${TEMPLATE_DIR}/Contents/MacOS/Launcher" -framework AppKit -mmacosx-version-min=10.13
|
||||
modify_plist "{MINIMUM_SYSTEM_VERSION}" "10.14" "${TEMPLATE_DIR}/Contents/Info.plist"
|
||||
clang -m64 launcher.m -o "${TEMPLATE_DIR}/Contents/MacOS/Launcher" -framework AppKit -mmacosx-version-min=10.14
|
||||
fi
|
||||
|
||||
build_app "${PLATFORM}" "${TEMPLATE_DIR}" "${BUILTDIR}/OpenRA - Red Alert.app" "ra" "Red Alert" "699222659766026240"
|
||||
|
||||
@@ -63,7 +63,7 @@ function build_platform()
|
||||
USE_PROGRAMFILES32=""
|
||||
fi
|
||||
|
||||
install_assemblies "${SRCDIR}" "${BUILTDIR}" "win-${PLATFORM}" "net5" "False" "True" "True"
|
||||
install_assemblies "${SRCDIR}" "${BUILTDIR}" "win-${PLATFORM}" "net6" "False" "True" "True"
|
||||
install_data "${SRCDIR}" "${BUILTDIR}" "cnc" "d2k" "ra"
|
||||
set_engine_version "${TAG}" "${BUILTDIR}"
|
||||
set_mod_version "${TAG}" "${BUILTDIR}/mods/cnc/mod.yaml" "${BUILTDIR}/mods/d2k/mod.yaml" "${BUILTDIR}/mods/ra/mod.yaml" "${BUILTDIR}/mods/modcontent/mod.yaml"
|
||||
|
||||
Reference in New Issue
Block a user