Skip to content

Commit

Permalink
SDK Update for release-20231010.
Browse files Browse the repository at this point in the history
  • Loading branch information
MustaphaTR committed Oct 12, 2023
1 parent 1177047 commit 26f13bc
Show file tree
Hide file tree
Showing 12 changed files with 905 additions and 106 deletions.
843 changes: 774 additions & 69 deletions .editorconfig

Large diffs are not rendered by default.

10 changes: 7 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ on:
push:
pull_request:

permissions:
contents: read # to fetch code (actions/checkout)

jobs:
linux:
name: Linux (.NET 6.0)
Expand Down Expand Up @@ -32,7 +35,7 @@ jobs:
run: |
sudo apt-get install lua5.1
make check-scripts
make test
make TREAT_WARNINGS_AS_ERRORS=true test
linux-mono:
name: Linux (mono)
Expand All @@ -56,7 +59,7 @@ jobs:
- name: Check Mod
run: |
# check-scripts does not depend on .net/mono, so is not needed here
make RUNTIME=mono test
make RUNTIME=mono TREAT_WARNINGS_AS_ERRORS=true test
windows:
name: Windows (.NET 6.0)
Expand All @@ -80,7 +83,8 @@ jobs:
- name: Check Mods
run: |
chocolatey install lua --version 5.1.5.52
choco install lua --version 5.1.5.52
$ENV:Path = $ENV:Path + ";C:\Program Files (x86)\Lua\5.1\"
$ENV:TREAT_WARNINGS_AS_ERRORS = "true"
.\make.ps1 check-scripts
.\make.ps1 test
3 changes: 3 additions & 0 deletions .github/workflows/packaging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ on:
tags:
- '*'

permissions:
contents: write # for release creation (svenstaro/upload-release-action)

jobs:
linux:
name: Linux AppImages
Expand Down
9 changes: 9 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"recommendations": [
"EditorConfig.EditorConfig",
"ms-dotnettools.csharp",
"openra.oraide-vscode",
"openra.vscode-openra-lua",
"macabeus.vscode-fluent",
]
}
30 changes: 30 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"version": "0.2.0",
"configurations": [
{
"name": "Launch (Example)",
"type": "coreclr",
"request": "launch",
"program": "${workspaceRoot}/engine/bin/OpenRA.dll",
"args": [
"Game.Mod=example",
"Engine.EngineDir=${workspaceRoot}/engine",
"Engine.ModSearchPaths=${workspaceRoot}/mods, ${workspaceRoot}/engine/mods",
"Debug.DisplayDeveloperSettings=true",
],
"preLaunchTask": "build",
},
{
"name": "Launch Utility",
"type": "coreclr",
"request": "launch",
"program": "${workspaceRoot}/engine/bin/OpenRA.Utility.dll",
"args": ["example", "--check-yaml"],
"env": {
"ENGINE_DIR": "${workspaceRoot}/engine",
"MOD_SEARCH_PATHS": "${workspaceRoot}/mods, ${workspaceRoot}/engine/mods"
},
"preLaunchTask": "build",
},
],
}
37 changes: 37 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{
"version": "2.0.0",
"tasks": [
{
"label": "build",
"command": "make",
"args": ["all", "CONFIGURATION=Debug"],
"windows": {
"command": "make.cmd"
}
},
{
"label": "Run Utility",
"command": "dotnet ${workspaceRoot}/engine/bin/OpenRA.Utility.dll ${input:modId} ${input:command}",
"type": "shell",
"options": {
"env": {
"ENGINE_DIR": "${workspaceRoot}/engine",
"MOD_SEARCH_PATHS": "${workspaceRoot}/mods,${workspaceRoot}/engine/mods"
}
}
}
],
"inputs": [
{
"id": "modId",
"description": "ID of the mod to run",
"default": "all",
"type": "promptString"
}, {
"id": "command",
"description": "Name of the command + parameters",
"default": "",
"type": "promptString"
},
]
}
13 changes: 6 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# to compile, run:
# make
#
# to compile using Mono (version 6.4 or greater) instead of .NET 6, run:
# to compile using Mono (version 6.12 or greater) instead of .NET 6, run:
# make RUNTIME=mono
#
# to compile using system libraries for native dependencies, run:
Expand All @@ -22,7 +22,7 @@
# make [RUNTIME=net6] check
#
# to check your mod yaml for errors, run:
# make [RUNTIME=net6] test
# make [RUNTIME=net6] [TREAT_WARNINGS_AS_ERRORS=false] test
#
# the following are internal sdk helpers that are not intended to be run directly:
# make check-variables
Expand Down Expand Up @@ -145,7 +145,7 @@ engine: check-variables check-sdk-scripts

all: engine
ifeq ($(RUNTIME), mono)
@command -v $(MSBUILD) >/dev/null || (echo "OpenRA requires the '$(MSBUILD)' tool provided by Mono >= 6.4."; exit 1)
@command -v $(MSBUILD) >/dev/null || (echo "OpenRA requires the '$(MSBUILD)' tool provided by Mono >= 6.12."; exit 1)
ifneq ("$(MOD_SOLUTION_FILES)","")
@find . -maxdepth 1 -name '*.sln' -exec $(MSBUILD) -t:Build -restore -p:Configuration=${CONFIGURATION} -p:TargetPlatform=$(TARGETPLATFORM) -p:Mono=true \;
endif
Expand Down Expand Up @@ -181,11 +181,10 @@ check: engine
ifneq ("$(MOD_SOLUTION_FILES)","")
@echo "Compiling in Debug mode..."
ifeq ($(RUNTIME), mono)
# Enabling EnforceCodeStyleInBuild and GenerateDocumentationFile as a workaround for some code style rules (in particular IDE0005) being bugged and not reporting warnings/errors otherwise.
@$(MSBUILD) -t:build -restore -p:Configuration=Debug -warnaserror -p:TargetPlatform=$(TARGETPLATFORM) -p:Mono=true -p:EnforceCodeStyleInBuild=true -p:GenerateDocumentationFile=true
@$(MSBUILD) -t:clean\;build -restore -p:Configuration=Debug -warnaserror -p:TargetPlatform=$(TARGETPLATFORM)
else
# Enabling EnforceCodeStyleInBuild and GenerateDocumentationFile as a workaround for some code style rules (in particular IDE0005) being bugged and not reporting warnings/errors otherwise.
@$(DOTNET) build -c Debug -nologo -warnaserror -p:TargetPlatform=$(TARGETPLATFORM) -p:EnforceCodeStyleInBuild=true -p:GenerateDocumentationFile=true
@$(DOTNET) clean -c Debug --nologo --verbosity minimal
@$(DOTNET) build -c Debug -nologo -warnaserror -p:TargetPlatform=$(TARGETPLATFORM)
endif
endif
@echo "Checking for explicit interface violations..."
Expand Down
5 changes: 3 additions & 2 deletions launch-dedicated.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
@echo on

set Name="Dedicated Server"
set Map=""
set ListenPort=1234
set AdvertiseOnline=True
set Password=""
Expand All @@ -18,7 +19,7 @@ set EnableGeoIP=True
set EnableLintChecks=True
set ShareAnonymizedIPs=True

set JoinChatDelay=5000
set FloodLimitJoinCooldown=5000

@echo off
setlocal EnableDelayedExpansion
Expand All @@ -37,7 +38,7 @@ if not exist %ENGINE_DIRECTORY%\bin\OpenRA.exe goto noengine
cd %ENGINE_DIRECTORY%

:loop
bin\OpenRA.Server.exe Game.Mod=%MOD_ID% Engine.EngineDir=".." Server.Name=%Name% Server.ListenPort=%ListenPort% Server.AdvertiseOnline=%AdvertiseOnline% Server.EnableSingleplayer=%EnableSingleplayer% Server.Password=%Password% Server.RequireAuthentication=%RequireAuthentication% Server.RecordReplays=%RecordReplays% Server.ProfileIDBlacklist=%ProfileIDBlacklist% Server.ProfileIDWhitelist=%ProfileIDWhitelist% Server.EnableSyncReports=%EnableSyncReports% Server.EnableGeoIP=%EnableGeoIP% Server.ShareAnonymizedIPs=%ShareAnonymizedIPs% Server.EnableLintChecks=%EnableLintChecks% Engine.SupportDir=%SupportDir% Server.JoinChatDelay=%JoinChatDelay%
bin\OpenRA.Server.exe Game.Mod=%MOD_ID% Engine.EngineDir=".." Server.Name=%Name% Server.Map=%Map% Server.ListenPort=%ListenPort% Server.AdvertiseOnline=%AdvertiseOnline% Server.EnableSingleplayer=%EnableSingleplayer% Server.Password=%Password% Server.RequireAuthentication=%RequireAuthentication% Server.RecordReplays=%RecordReplays% Server.ProfileIDBlacklist=%ProfileIDBlacklist% Server.ProfileIDWhitelist=%ProfileIDWhitelist% Server.EnableSyncReports=%EnableSyncReports% Server.EnableGeoIP=%EnableGeoIP% Server.ShareAnonymizedIPs=%ShareAnonymizedIPs% Server.EnableLintChecks=%EnableLintChecks% Engine.SupportDir=%SupportDir% Server.FloodLimitJoinCooldown=%FloodLimitJoinCooldown%
goto loop

:noengine
Expand Down
38 changes: 20 additions & 18 deletions launch-dedicated.sh
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ fi

NAME="${Name:-"Dedicated Server"}"
LAUNCH_MOD="${Mod:-"${MOD_ID}"}"
MAP="${Map:-""}"
LISTEN_PORT="${ListenPort:-"1234"}"
ADVERTISE_ONLINE="${AdvertiseOnline:-"True"}"
PASSWORD="${Password:-""}"
Expand All @@ -65,7 +66,7 @@ ENABLE_GEOIP="${EnableGeoIP:-"True"}"
ENABLE_LINT_CHECKS="${EnableLintChecks:-"True"}"
SHARE_ANONYMISED_IPS="${ShareAnonymizedIPs:-"True"}"

JOIN_CHAT_DELAY="${JoinChatDelay:-"5000"}"
FLOOD_LIMIT_JOIN_COOLDOWN="${FloodLimitJoinCooldown:-"5000"}"

SUPPORT_DIR="${SupportDir:-""}"

Expand All @@ -79,21 +80,22 @@ fi
cd "${ENGINE_DIRECTORY}"

while true; do
MOD_SEARCH_PATHS="${MOD_SEARCH_PATHS}"
${RUNTIME_LAUNCHER} bin/OpenRA.Server.dll Engine.EngineDir=".." Game.Mod="${LAUNCH_MOD}" \
Server.Name="${NAME}" \
Server.ListenPort="${LISTEN_PORT}" \
Server.AdvertiseOnline="${ADVERTISE_ONLINE}" \
Server.Password="${PASSWORD}" \
Server.RecordReplays="${RECORD_REPLAYS}" \
Server.RequireAuthentication="${REQUIRE_AUTHENTICATION}" \
Server.ProfileIDBlacklist="${PROFILE_ID_BLACKLIST}" \
Server.ProfileIDWhitelist="${PROFILE_ID_WHITELIST}" \
Server.EnableSingleplayer="${ENABLE_SINGLE_PLAYER}" \
Server.EnableSyncReports="${ENABLE_SYNC_REPORTS}" \
Server.EnableGeoIP="${ENABLE_GEOIP}" \
Server.EnableLintChecks="${ENABLE_LINT_CHECKS}" \
Server.ShareAnonymizedIPs="${SHARE_ANONYMISED_IPS}" \
Server.JoinChatDelay="${JOIN_CHAT_DELAY}" \
Engine.SupportDir="${SUPPORT_DIR}"
MOD_SEARCH_PATHS="${MOD_SEARCH_PATHS}" \
${RUNTIME_LAUNCHER} bin/OpenRA.Server.dll Engine.EngineDir=".." Game.Mod="${LAUNCH_MOD}" \
Server.Name="${NAME}" \
Server.Map="${MAP}" \
Server.ListenPort="${LISTEN_PORT}" \
Server.AdvertiseOnline="${ADVERTISE_ONLINE}" \
Server.Password="${PASSWORD}" \
Server.RecordReplays="${RECORD_REPLAYS}" \
Server.RequireAuthentication="${REQUIRE_AUTHENTICATION}" \
Server.ProfileIDBlacklist="${PROFILE_ID_BLACKLIST}" \
Server.ProfileIDWhitelist="${PROFILE_ID_WHITELIST}" \
Server.EnableSingleplayer="${ENABLE_SINGLE_PLAYER}" \
Server.EnableSyncReports="${ENABLE_SYNC_REPORTS}" \
Server.EnableGeoIP="${ENABLE_GEOIP}" \
Server.EnableLintChecks="${ENABLE_LINT_CHECKS}" \
Server.ShareAnonymizedIPs="${SHARE_ANONYMISED_IPS}" \
Server.FloodLimitJoinCooldown="${FLOOD_LIMIT_JOIN_COOLDOWN}" \
Engine.SupportDir="${SUPPORT_DIR}"
done
5 changes: 3 additions & 2 deletions make.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,9 @@ function Check-Command

Write-Host "Compiling $modID in Debug configuration..." -ForegroundColor Cyan

# Enabling EnforceCodeStyleInBuild and GenerateDocumentationFile as a workaround for some code style rules (in particular IDE0005) being bugged and not reporting warnings/errors otherwise.
dotnet build -c Debug --nologo -warnaserror -p:TargetPlatform=win-x64 -p:EnforceCodeStyleInBuild=true -p:GenerateDocumentationFile=true
dotnet clean -c Debug --nologo --verbosity minimal
dotnet build -c Debug --nologo -warnaserror -p:TargetPlatform=win-x64

if ($lastexitcode -ne 0)
{
Write-Host "Build failed." -ForegroundColor Red
Expand Down
4 changes: 0 additions & 4 deletions packaging/windows/buildpackage.nsi
Original file line number Diff line number Diff line change
Expand Up @@ -111,9 +111,6 @@ Section "Game" GAME
"$OUTDIR\${PACKAGING_WINDOWS_LAUNCHER_NAME}.exe" "" "" "" ""
!insertmacro MUI_STARTMENU_WRITE_END

SetOutPath "$INSTDIR\lua"
File "${SRCDIR}\lua\*.lua"

SetOutPath "$INSTDIR\glsl"
File "${SRCDIR}\glsl\*.frag"
File "${SRCDIR}\glsl\*.vert"
Expand Down Expand Up @@ -162,7 +159,6 @@ Function ${UN}Clean
RMDir /r $INSTDIR\mods
RMDir /r $INSTDIR\maps
RMDir /r $INSTDIR\glsl
RMDir /r $INSTDIR\lua
Delete $INSTDIR\*.exe
Delete $INSTDIR\*.dll
Delete $INSTDIR\*.ico
Expand Down
14 changes: 13 additions & 1 deletion packaging/windows/buildpackage.sh
Original file line number Diff line number Diff line change
Expand Up @@ -108,11 +108,23 @@ function build_platform()
echo "Mod version ${MOD_VERSION} will remain unchanged.";
fi

TAG_TYPE="${TAG%%-*}"
TAG_VERSION="${TAG#*-}"
BACKWARDS_TAG="${TAG_VERSION}-${TAG_TYPE}"

# Create multi-resolution icon
convert "${ARTWORK_DIR}/icon_16x16.png" "${ARTWORK_DIR}/icon_24x24.png" "${ARTWORK_DIR}/icon_32x32.png" "${ARTWORK_DIR}/icon_48x48.png" "${ARTWORK_DIR}/icon_256x256.png" "${BUILTDIR}/${MOD_ID}.ico"

echo "Compiling Windows launcher (${PLATFORM})"
install_windows_launcher "${TEMPLATE_ROOT}/${ENGINE_DIRECTORY}" "${BUILTDIR}" "win-${PLATFORM}" "${MOD_ID}" "${PACKAGING_WINDOWS_LAUNCHER_NAME}" "${PACKAGING_DISPLAY_NAME}" "${PACKAGING_FAQ_URL}"
install_windows_launcher "${TEMPLATE_ROOT}/${ENGINE_DIRECTORY}" "${BUILTDIR}" "win-${PLATFORM}" "${MOD_ID}" "${PACKAGING_WINDOWS_LAUNCHER_NAME}" "${PACKAGING_DISPLAY_NAME}" "${PACKAGING_FAQ_URL}" "${TAG}"

# Use rcedit to patch the generated EXE with missing assembly/PortableExecutable information because .NET 6 ignores that when building on Linux.
# Using a backwards version tag because rcedit is unable to set versions starting with a letter.
wine64 rcedit-x64.exe "${BUILTDIR}/${PACKAGING_WINDOWS_LAUNCHER_NAME}.exe" --set-product-version "${BACKWARDS_TAG}"
wine64 rcedit-x64.exe "${BUILTDIR}/${PACKAGING_WINDOWS_LAUNCHER_NAME}.exe" --set-version-string "ProductName" "OpenRA"
wine64 rcedit-x64.exe "${BUILTDIR}/${PACKAGING_WINDOWS_LAUNCHER_NAME}.exe" --set-version-string "CompanyName" "The OpenRA team"
wine64 rcedit-x64.exe "${BUILTDIR}/${PACKAGING_WINDOWS_LAUNCHER_NAME}.exe" --set-version-string "FileDescription" "${PACKAGING_WINDOWS_LAUNCHER_NAME} mod for OpenRA"
wine64 rcedit-x64.exe "${BUILTDIR}/${PACKAGING_WINDOWS_LAUNCHER_NAME}.exe" --set-version-string "LegalCopyright" "Copyright (c) The OpenRA Developers and Contributors"

wine64 rcedit-x64.exe "${BUILTDIR}/${PACKAGING_WINDOWS_LAUNCHER_NAME}.exe" --set-icon "${BUILTDIR}/${MOD_ID}.ico"

Expand Down

0 comments on commit 26f13bc

Please sign in to comment.