Skip to content

Commit 4da7e2f

Browse files
committed
start afresh
1 parent 0a39fdd commit 4da7e2f

File tree

1,538 files changed

+1101
-1020
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,538 files changed

+1101
-1020
lines changed

.devcontainer/Dockerfile.linux

+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# FROM mcr.microsoft.com/devcontainers/dotnet:0-6.0
2+
FROM mcr.microsoft.com/devcontainers/base:debian-11
3+
4+
# Add backports.
5+
RUN echo "deb http://deb.debian.org/debian bullseye-backports main" > /etc/apt/sources.list.d/backports.list
6+
7+
# Install dependencies.
8+
RUN apt-get update && apt-get install -y --no-install-recommends \
9+
file \
10+
nsis \
11+
imagemagick \
12+
wine64 \
13+
shellcheck
14+
15+
# Install dotnet SDK and PowerShell.
16+
RUN curl -SOL https://packages.microsoft.com/config/debian/11/packages-microsoft-prod.deb \
17+
&& dpkg -i packages-microsoft-prod.deb \
18+
&& rm packages-microsoft-prod.deb \
19+
&& apt-get update \
20+
&& apt-get install -y --no-install-recommends \
21+
dotnet-sdk-6.0 \
22+
powershell
23+
24+
# Install updated packages from backports.
25+
RUN apt-get update && sudo apt-get install -y --no-install-recommends \
26+
curl/bullseye-backports \
27+
wine64/bullseye-backports
28+
29+
# Install AppImageTool.
30+
RUN curl -SLO https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-x86_64.AppImage \
31+
&& install appimagetool-x86_64.AppImage /usr/local/bin \
32+
&& rm appimagetool-x86_64.AppImage
33+
34+
35+
# Download rcdedit.
36+
USER vscode
37+
RUN curl -SLo /home/vscode/rcedit-x64.exe https://github.com/electron/rcedit/releases/download/v1.1.1/rcedit-x64.exe
38+
ENV PATH=/usr/lib/wine/:$PATH

.devcontainer/Dockerfile.windows

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# This file permits OpenRA to be built on Windows without the need to install
2+
# any local development tools or SDKs. From the repository root, build using:
3+
#
4+
# docker build -t openra .
5+
#
6+
# You can then open the container and build interactively using:
7+
#
8+
# docker run -it -v .:C:\OpenRA openra
9+
#
10+
# You can now run `./make.cmd`: output will be shared to the host.
11+
#
12+
# Alternatively, build directly from the host by running:
13+
#
14+
# docker run -it -v .:C:\OpenRA openra ./make.ps1 a
15+
16+
FROM mcr.microsoft.com/windows/servercore:ltsc2022
17+
18+
RUN setx path "%path%;C:\Users\ContainerAdministrator\AppData\Local\Microsoft\dotnet"
19+
SHELL ["powershell", "-command"]
20+
21+
RUN Invoke-WebRequest -Uri https://dot.net/v1/dotnet-install.ps1 -UseBasicParsing -OutFile dotnet-install.ps1
22+
RUN ./dotnet-install.ps1
23+
24+
WORKDIR C:/OpenRA
25+
ENTRYPOINT ["powershell"]

.devcontainer/devcontainer.json

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
{
2+
"name": "C# (.NET)",
3+
"build": {
4+
"dockerfile": "Dockerfile.linux"
5+
},
6+
"customizations": {
7+
"vscode": {
8+
"extensions": [
9+
"EditorConfig.EditorConfig",
10+
"foxundermoon.shell-format",
11+
"GitHub.vscode-github-actions",
12+
"idleberg.nsis",
13+
"macabeus.vscode-fluent",
14+
"ms-dotnettools.csdevkit",
15+
"ms-dotnettools.csharp",
16+
"ms-python.python",
17+
"ms-vscode.cpptools-extension-pack",
18+
"ms-vscode.makefile-tools",
19+
"ms-vscode.powershell",
20+
"nico-castell.linux-desktop-file",
21+
"openra.oraide-vscode",
22+
"openra.vscode-openra-lua",
23+
"tamasfe.even-better-toml",
24+
"timonwong.shellcheck"
25+
]
26+
}
27+
},
28+
"features": {},
29+
"postAttachCommand": {
30+
"safe-dir": "git config --global --add safe.directory ${containerWorkspaceFolder}"
31+
}
32+
}
File renamed without changes.
File renamed without changes.

.github/workflows/documentation.yml

+10-10
Original file line numberDiff line numberDiff line change
@@ -43,14 +43,14 @@ jobs:
4343
env:
4444
GIT_TAG: ${{ github.event.inputs.tag }}
4545
run: |
46-
./utility.sh all --settings-docs "${GIT_TAG}" > "wiki/Settings (playtest).md"
46+
./packaging/shared/utility.sh all --settings-docs "${GIT_TAG}" > "wiki/Settings (playtest).md"
4747
4848
- name: Update Wiki (Release)
4949
if: startsWith(github.event.inputs.tag, 'release-')
5050
env:
5151
GIT_TAG: ${{ github.event.inputs.tag }}
5252
run: |
53-
./utility.sh all --settings-docs "${GIT_TAG}" > "wiki/Settings.md"
53+
./packaging/shared/utility.sh all --settings-docs "${GIT_TAG}" > "wiki/Settings.md"
5454
5555
- name: Push Wiki
5656
env:
@@ -105,20 +105,20 @@ jobs:
105105
env:
106106
GIT_TAG: ${{ github.event.inputs.tag }}
107107
run: |
108-
./utility.sh all --docs "${GIT_TAG}" | python3 ./packaging/format-docs.py > "docs/api/traits.md"
109-
./utility.sh all --weapon-docs "${GIT_TAG}" | python3 ./packaging/format-docs.py > "docs/api/weapons.md"
110-
./utility.sh all --sprite-sequence-docs "${GIT_TAG}" | python3 ./packaging/format-docs.py > "docs/api/sprite-sequences.md"
111-
./utility.sh all --lua-docs "${GIT_TAG}" > "docs/api/lua.md"
108+
./packaging/shared/utility.sh all --docs "${GIT_TAG}" | python3 ./packaging/shared/format-docs.py > "docs/api/traits.md"
109+
./packaging/shared/utility.sh all --weapon-docs "${GIT_TAG}" | python3 ./packaging/shared/format-docs.py > "docs/api/weapons.md"
110+
./packaging/shared/utility.sh all --sprite-sequence-docs "${GIT_TAG}" | python3 ./packaging/shared/format-docs.py > "docs/api/sprite-sequences.md"
111+
./packaging/shared/utility.sh all --lua-docs "${GIT_TAG}" > "docs/api/lua.md"
112112
113113
- name: Update docs.openra.net (Release)
114114
if: startsWith(github.event.inputs.tag, 'release-')
115115
env:
116116
GIT_TAG: ${{ github.event.inputs.tag }}
117117
run: |
118-
./utility.sh all --docs "${GIT_TAG}" | python3 ./packaging/format-docs.py > "docs/api/traits.md"
119-
./utility.sh all --weapon-docs "${GIT_TAG}" | python3 ./packaging/format-docs.py > "docs/api/weapons.md"
120-
./utility.sh all --sprite-sequence-docs "${GIT_TAG}" | python3 ./packaging/format-docs.py > "docs/api/sprite-sequences.md"
121-
./utility.sh all --lua-docs "${GIT_TAG}" > "docs/api/lua.md"
118+
./packaging/shared/utility.sh all --docs "${GIT_TAG}" | python3 ./packaging/shared/format-docs.py > "docs/api/traits.md"
119+
./packaging/shared/utility.sh all --weapon-docs "${GIT_TAG}" | python3 ./packaging/shared/format-docs.py > "docs/api/weapons.md"
120+
./packaging/shared/utility.sh all --sprite-sequence-docs "${GIT_TAG}" | python3 ./packaging/shared/format-docs.py > "docs/api/sprite-sequences.md"
121+
./packaging/shared/utility.sh all --lua-docs "${GIT_TAG}" > "docs/api/lua.md"
122122
123123
- name: Commit docs.openra.net
124124
env:

.github/workflows/itch.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
wget -q "https://github.com/${{ github.repository }}/releases/download/${{ github.event.inputs.tag }}/OpenRA-Dune-2000-x86_64.AppImage"
2424
wget -q "https://github.com/${{ github.repository }}/releases/download/${{ github.event.inputs.tag }}/OpenRA-Red-Alert-x86_64.AppImage"
2525
wget -q "https://github.com/${{ github.repository }}/releases/download/${{ github.event.inputs.tag }}/OpenRA-Tiberian-Dawn-x86_64.AppImage"
26-
wget -q "https://raw.githubusercontent.com/${{ github.repository }}/${{ github.event.inputs.tag }}/packaging/.itch.toml"
26+
wget -q "https://raw.githubusercontent.com/${{ github.repository }}/${{ github.event.inputs.tag }}/packaging/shared/.itch.toml"
2727
zip -u "OpenRA-${{ github.event.inputs.tag }}-x64-win-itch.zip" .itch.toml
2828
2929
- name: Publish Windows Installer

.github/workflows/packaging.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ jobs:
121121
- name: Package Installers
122122
run: |
123123
mkdir -p build/windows
124-
./packaging/windows/buildpackage.sh "${GIT_TAG}" "${PWD}/build/windows"
124+
./packaging/windows_cross/buildpackage.sh "${GIT_TAG}" "${PWD}/build/windows"
125125
126126
- name: Upload Packages
127127
uses: svenstaro/upload-release-action@v2

.gitignore

+11-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ _ReSharper.*/
1717
/.vscode/settings.json
1818

1919
# binaries
20-
IP2LOCATION-LITE-DB1.IPV6.BIN.ZIP
20+
res/IP2LOCATION-LITE-DB1.IPV6.BIN.ZIP
2121

2222
# backup files by various editors
2323
*~
@@ -54,3 +54,13 @@ update.log
5454

5555
# IntelliJ files
5656
.idea
57+
58+
# Temporary packaging directories
59+
build/
60+
packaging/windows_cross/build/
61+
packaging/linux/ra/
62+
packaging/linux/ra.appdir/
63+
packaging/linux/cnc/
64+
packaging/linux/cnc.appdir/
65+
packaging/linux/d2k/
66+
packaging/linux/d2k.appdir/

Makefile

+18-18
Original file line numberDiff line numberDiff line change
@@ -98,15 +98,15 @@ else
9898
@$(DOTNET) build -c ${CONFIGURATION} -nologo -p:TargetPlatform=$(TARGETPLATFORM)
9999
endif
100100
ifeq ($(TARGETPLATFORM), unix-generic)
101-
@./configure-system-libraries.sh
101+
@sh -c './packaging/shared/configure-system-libraries.sh'
102102
endif
103-
@./fetch-geoip.sh
103+
@sh -c './packaging/shared/fetch-geoip.sh'
104104

105105
# dotnet clean and msbuild -t:Clean leave files that cause problems when switching between mono/dotnet
106106
# Deleting the intermediate / output directories ensures the build directory is actually clean
107107
clean:
108-
@-$(RM_RF) ./bin ./*/obj
109-
@-$(RM_F) IP2LOCATION-LITE-DB1.IPV6.BIN.ZIP
108+
@-$(RM_RF) ./src/bin ./src/*/obj ./build ./packaging/*/build
109+
@-$(RM_F) ./res/IP2LOCATION-LITE-DB1.IPV6.BIN.ZIP
110110

111111
check:
112112
@echo
@@ -118,14 +118,14 @@ else
118118
@$(DOTNET) build -c Debug -nologo -warnaserror -p:TargetPlatform=$(TARGETPLATFORM)
119119
endif
120120
ifeq ($(TARGETPLATFORM), unix-generic)
121-
@./configure-system-libraries.sh
121+
@sh -c './packaging/shared/configure-system-libraries.sh'
122122
endif
123123
@echo
124124
@echo "Checking for explicit interface violations..."
125-
@./utility.sh all --check-explicit-interfaces
125+
@sh -c './packaging/shared/utility.sh all --check-explicit-interfaces'
126126
@echo
127127
@echo "Checking for incorrect conditional trait interface overrides..."
128-
@./utility.sh all --check-conditional-trait-interface-overrides
128+
@sh -c './packaging/shared/utility.sh all --check-conditional-trait-interface-overrides'
129129

130130
check-scripts:
131131
@echo
@@ -135,16 +135,16 @@ check-scripts:
135135
test: all
136136
@echo
137137
@echo "Testing Tiberian Sun mod MiniYAML..."
138-
@./utility.sh ts --check-yaml
138+
@sh -c './packaging/shared/utility.sh ts --check-yaml'
139139
@echo
140140
@echo "Testing Dune 2000 mod MiniYAML..."
141-
@./utility.sh d2k --check-yaml
141+
@sh -c './packaging/shared/utility.sh d2k --check-yaml'
142142
@echo
143143
@echo "Testing Tiberian Dawn mod MiniYAML..."
144-
@./utility.sh cnc --check-yaml
144+
@sh -c './packaging/shared/utility.sh cnc --check-yaml'
145145
@echo
146146
@echo "Testing Red Alert mod MiniYAML..."
147-
@./utility.sh ra --check-yaml
147+
@sh -c './packaging/shared/utility.sh ra --check-yaml'
148148

149149
tests:
150150
@dotnet build OpenRA.Test/OpenRA.Test.csproj -c Debug --nologo -p:TargetPlatform=$(TARGETPLATFORM)
@@ -157,22 +157,22 @@ version: VERSION mods/ra/mod.yaml mods/cnc/mod.yaml mods/d2k/mod.yaml mods/ts/mo
157157
ifeq ($(VERSION),)
158158
$(error Unable to determine new version (requires git or override of variable VERSION))
159159
endif
160-
@sh -c '. ./packaging/functions.sh; set_engine_version "$(VERSION)" .'
161-
@sh -c '. ./packaging/functions.sh; set_mod_version "$(VERSION)" mods/ra/mod.yaml mods/cnc/mod.yaml mods/d2k/mod.yaml mods/ts/mod.yaml mods/modcontent/mod.yaml mods/all/mod.yaml'
160+
@sh -c 'echo "$(VERSION)" >"./VERSION"''
161+
@sh -c ./packaging/shared/set-mod-version.sh "$(VERSION)" mods/ra/mod.yaml mods/cnc/mod.yaml mods/d2k/mod.yaml mods/ts/mod.yaml mods/modcontent/mod.yaml mods/all/mod.yaml'
162162

163163
install:
164-
@sh -c '. ./packaging/functions.sh; install_assemblies $(CWD) $(DESTDIR)$(gameinstalldir) $(TARGETPLATFORM) $(RUNTIME) True True True'
165-
@sh -c '. ./packaging/functions.sh; install_data $(CWD) $(DESTDIR)$(gameinstalldir) cnc d2k ra'
164+
@sh -c './packaging/shared/install-assemblies.sh $(CWD) "$(DESTDIR)" "$(gameinstalldir)" $(TARGETPLATFORM) $(RUNTIME) True True True'
165+
@sh -c './packaging/shared/install-data.sh $(CWD) "$(DESTDIR)" "$(gameinstalldir)" cnc d2k ra'
166166

167167
install-linux-shortcuts:
168-
@sh -c '. ./packaging/functions.sh; install_linux_shortcuts $(CWD) "$(DESTDIR)" "$(gameinstalldir)" "$(bindir)" "$(datadir)" "$(shell head -n1 VERSION)" cnc d2k ra'
168+
@sh -c '. ./packaging/linux/install-shortcuts.sh $(CWD) "$(DESTDIR)" "$(gameinstalldir)" "$(bindir)" "$(datadir)" "$(shell head -n1 VERSION)" cnc d2k ra'
169169

170170
install-linux-appdata:
171-
@sh -c '. ./packaging/functions.sh; install_linux_appdata $(CWD) "$(DESTDIR)" "$(datadir)" cnc d2k ra'
171+
@sh -c './packaging/linux/install-appdata.sh $(CWD) "$(DESTDIR)" "$(datadir)" cnc d2k ra'
172172

173173
install-man: all
174174
@mkdir -p $(DESTDIR)$(mandir)/man6/
175-
@./utility.sh all --man-page > $(DESTDIR)$(mandir)/man6/openra.6
175+
@sh -c './packaging/shared/utility.sh all --man-page > $(DESTDIR)$(mandir)/man6/openra.6'
176176

177177
help:
178178
@echo 'to compile, run:'

OpenRA.sln

+10-10
Original file line numberDiff line numberDiff line change
@@ -3,25 +3,25 @@ Microsoft Visual Studio Solution File, Format Version 12.00
33
# Visual Studio Version 16
44
VisualStudioVersion = 16.0.28803.352
55
MinimumVisualStudioVersion = 10.0.40219.1
6-
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OpenRA.Game", "OpenRA.Game\OpenRA.Game.csproj", "{0DFB103F-2962-400F-8C6D-E2C28CCBA633}"
6+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OpenRA.Game", "src\OpenRA.Game\OpenRA.Game.csproj", "{0DFB103F-2962-400F-8C6D-E2C28CCBA633}"
77
EndProject
8-
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OpenRA.Mods.Cnc", "OpenRA.Mods.Cnc\OpenRA.Mods.Cnc.csproj", "{2881135D-4D62-493E-8F83-5EEE92CCC6BE}"
8+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OpenRA.Mods.Cnc", "src\OpenRA.Mods.Cnc\OpenRA.Mods.Cnc.csproj", "{2881135D-4D62-493E-8F83-5EEE92CCC6BE}"
99
EndProject
10-
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OpenRA.Utility", "OpenRA.Utility\OpenRA.Utility.csproj", "{F33337BE-CB69-4B24-850F-07D23E408DDF}"
10+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OpenRA.Utility", "src\OpenRA.Utility\OpenRA.Utility.csproj", "{F33337BE-CB69-4B24-850F-07D23E408DDF}"
1111
EndProject
12-
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OpenRA.Server", "OpenRA.Server\OpenRA.Server.csproj", "{76F621A1-3D8E-4A99-9F7E-B071EB657817}"
12+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OpenRA.Server", "src\OpenRA.Server\OpenRA.Server.csproj", "{76F621A1-3D8E-4A99-9F7E-B071EB657817}"
1313
EndProject
14-
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OpenRA.Mods.D2k", "OpenRA.Mods.D2k\OpenRA.Mods.D2k.csproj", "{C0B0465C-6BE2-409C-8770-3A9BF64C4344}"
14+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OpenRA.Mods.D2k", "src\OpenRA.Mods.D2k\OpenRA.Mods.D2k.csproj", "{C0B0465C-6BE2-409C-8770-3A9BF64C4344}"
1515
EndProject
16-
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OpenRA.Platforms.Default", "OpenRA.Platforms.Default\OpenRA.Platforms.Default.csproj", "{33D03738-C154-4028-8EA8-63A3C488A651}"
16+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OpenRA.Platforms.Default", "src\OpenRA.Platforms.Default\OpenRA.Platforms.Default.csproj", "{33D03738-C154-4028-8EA8-63A3C488A651}"
1717
EndProject
18-
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OpenRA.Mods.Common", "OpenRA.Mods.Common\OpenRA.Mods.Common.csproj", "{FE6C8CC0-2F07-442A-B29F-17617B3B7FC6}"
18+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OpenRA.Mods.Common", "src\OpenRA.Mods.Common\OpenRA.Mods.Common.csproj", "{FE6C8CC0-2F07-442A-B29F-17617B3B7FC6}"
1919
EndProject
20-
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OpenRA.Test", "OpenRA.Test\OpenRA.Test.csproj", "{6CB8E1B7-6B36-4D93-8633-7C573E194AC4}"
20+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OpenRA.Test", "src\OpenRA.Test\OpenRA.Test.csproj", "{6CB8E1B7-6B36-4D93-8633-7C573E194AC4}"
2121
EndProject
22-
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OpenRA.Launcher", "OpenRA.Launcher\OpenRA.Launcher.csproj", "{54DAE0E0-3125-49D3-992E-A0E931EB5FC8}"
22+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OpenRA.Launcher", "src\OpenRA.Launcher\OpenRA.Launcher.csproj", "{54DAE0E0-3125-49D3-992E-A0E931EB5FC8}"
2323
EndProject
24-
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OpenRA.WindowsLauncher", "OpenRA.WindowsLauncher\OpenRA.WindowsLauncher.csproj", "{912B578E-0BC0-4987-807B-1E294A87DA37}"
24+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OpenRA.WindowsLauncher", "src\OpenRA.WindowsLauncher\OpenRA.WindowsLauncher.csproj", "{912B578E-0BC0-4987-807B-1E294A87DA37}"
2525
EndProject
2626
Global
2727
GlobalSection(SolutionConfigurationPlatforms) = preSolution

TODO.md

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# TODO
2+
3+
```sh
4+
packaging/windows_cross/buildpackage.sh
5+
```
6+
7+
## Overall
8+
9+
- Totally reorganise build system so that it works the same way on all
10+
platforms
11+
- Have proper phases for each section, which can be linked to make targets,
12+
and depend on one another
13+
- ~Don't build multiple architectures at once at the script level~
14+
- Unify makefiles (somehow)
15+
- ~Clean up script litter everywhere~
16+
- ~Move the C# source into one top level directory~
17+
- Fix the launch scripts (easier when there is no more disparity between
18+
regular and package builds)
19+
- Verify that all builds still work
20+
- Investigate a generic cross-platform build process
21+
- Pre-commit
22+
- Stop fetching anything at build time (kills reproduceability)
23+
24+
## Windows
25+
26+
- ~Rename to windows_cross~
27+
- Investigate native packaging etc as well
28+
- Fix resource hacking
29+
30+
## Linux
31+
32+
- ~Verify it works~
33+
- Fix crash on map launch
34+
- Fix dedicated server launch script
35+
- Add other packaging options
36+
37+
## MacOS
38+
39+
- Verify it works
40+
- Check if unsigned releases work at all

fetch-geoip.sh

-24
This file was deleted.

0 commit comments

Comments
 (0)