1
0
forked from 0ad/0ad
Commit Graph

24123 Commits

Author SHA1 Message Date
de9dab27ab
Fix GLES 2.0 build after the compute shader addition 2024-09-12 17:31:43 +03:00
26994b156b Split source package downloads
Instead of fetching the whole svn repo containing all current
dependencies into source, fetch them individually into subdirectories of
source.

Adds a wrapper script to each package to place the build output where
it's currently expected.

This allows adding and removing dependencies as well as changing origin
of those packages on a case by case basis.

It's recommended to run "git clean -dxf libraries/source" to free up
extra space and remove untracked files no longer covered by changes in
.gitignore.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2024-09-08 22:17:08 +02:00
2b5ecd02a7 build-source-libs.sh: drop Perl dependency
Instead of using Perl to get the absolute path due to readlink -f
implementations differing behaviour use realpath. Since the inclusion
into coreutils this should be a valid alternative.

Also check for [[:space:]] instead of only \s as if that one is an issue
the others are as well.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2024-09-08 17:51:16 +02:00
bf82871ca8 build-source-libs.sh: remove --source-libs-dir
During the migration it apparently looked possibly useful at some point,
in the end it remained unused.

Further the clean-source-libs.sh doesn't handle the case where
build-source-libs.sh was invoked with --source-libs-dir.

Finally, when switching to support individual package this becomes very
complex to support.

For all the above reason remove the option.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2024-09-08 17:51:16 +02:00
33134af6c3 Stop using the source-libs repository on Windows
All prebuilt files for Windows libraries are now stored in the
windows-libs SVN repository for the foreseeable future.
2024-09-08 17:51:15 +02:00
966d859050 Add yamllint to pre-commit
Adding a hook to pre-commit to enforce a consistent style and remove the
hook check-yaml which only checks if a document is parsable and so
become redundant.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2024-09-08 13:08:11 +02:00
87f667732c Format yaml files
The schema at https://json.schemastore.org/gitea-issue-forms.json
doesn't like empty titles, so just remove the key to the same effect as
a zero length string.

Add document start markers where they are missing.

Use a max line length of 100 as discussed with Dunedan.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2024-09-08 13:08:11 +02:00
10e7513bba
Revert changes in check_diff.py in batches
This is to avoid running into errors caused by the limited length of
command line input when reverting lots of files.
2024-09-08 11:39:08 +02:00
fce48ca4be Include names of unit actions before descriptions in tooltips
Respecting the format of the tooltips of the other panels, include
a short name in bold on the first line of the tooltip to facilitate
a quick understanding of the action, and below, in normal font, a
description with relevant details.

The description of the patrol action is rewritten to make it more
understandable.

Fixes #7016
2024-09-08 10:25:59 +02:00
34a209b680
Update glad to 2.0.7
Release: https://github.com/Dav1dde/glad/releases/tag/v2.0.7
2024-09-08 09:31:14 +02:00
0f87124b98
Some glad improvements
- Silence a MSVC warning in vulkan.cpp, refs #6987
- Document the patching of gl.h for macOS, from r26094
- Fix shellcheck warnings in the generation script
2024-09-08 09:26:46 +02:00
35d998694f
Move glad from source-libs to source/third_party
Improve definition of the gladwrapper project in premake.
2024-09-08 09:18:45 +02:00
09f55a1afc Revising the loading screen tips and adding new ones 2024-09-06 14:53:35 +02:00
afa9f212f4 Add yaml setting to editorconfig
Currently all files adhere to the same formatting, let's codify it so it
stays like this in the future.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2024-09-04 19:45:50 +02:00
8d0af4b184
Unify Windows scripts for getting nightly binaries
The new script merges existing scripts for downloading translations and
SPIR-V shaders, and also exports game binaries from the latest nightly
build into the git repo.

This allows contributors, especially artists, to obtain a working build
of the game without learning how to build the game for Windows, refs #1814.
2024-09-04 17:20:50 +02:00
eb499b4c5c
Fix a regression introduced with 4a049c5f3a 2024-09-04 15:03:21 +02:00
19e7d14506
Use PEP 8 naming conventions for fontbuilder2 2024-09-03 14:01:47 +02:00
4a049c5f3a
Use PEP 8 naming conventions for i18n tools 2024-09-03 13:51:27 +02:00
80f808df4a
Markdown format for fontbuilder2 README
The fontbuilder2 README file was already partially formatted with
Markdown, but didn't indicate that via its file extension. This commit
changes that and improves the formatting of the README itself.
2024-09-03 13:39:28 +02:00
9fd05e38a4 Update libraries to fix some build errors on recent macOS.
Fixes #6797
Fixes #6902
Refs #6915
Fixes #6916
Refs #4362
2024-09-03 11:17:12 +02:00
f7630b155c Do not hardcode JOBS in CI pipelines
This build environment variable is now set agent-wide and corresponds to
the number of CPUs of each agent.
2024-09-02 21:47:08 +02:00
670f68c1c5 Fix remnant from old Jenkins configuration 2024-09-02 21:47:08 +02:00
f87dfebc71 build-macos-libs.sh: move to posix shell
This removes the remaining bashisms and changes the shebang.

Also remove command chaining in subshells as this allows for comments
to go where they belong and shellcheck directives to be more specific.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2024-09-02 15:37:44 +02:00
79127ec59d Automatically try to unbreak CI incremental builds
This entirely reverts ee3318309b and removes the [CLEANBUILD] feature,
which needed to be used without omission to be efficient.

Instead, in case of build failure, the CI automatically starts a
non-incremental second build by running `make clean` (or the MSBuild
equivalent) before retrying the build.
2024-09-01 13:29:17 +02:00
bcf97b608b
Enable ruff rules for docstrings and comments
This enables some ruff rules for docstrings and comments. The idea is to
not enforce the presence of docstrings, but to ensure they are properly
formatted if they're present.

For comments this adds checks that they don't contain code and verify
the formatting of comments with "TODO" tags.

As part of this, some commented out code which hasn't been touch in the
past 10 years gets removed as well.

The rules enabled enabled by this are:

- check formatting of existing docstrings (D200-)
- check comments for code (ERA)
- check formatting of TODO tags (TD001, TD004-)
2024-08-31 21:09:20 +02:00
91ab55d6ea
Convert license_dbghelp.txt to UTF-8 2024-08-31 17:04:05 +02:00
9ac60514c3 build-macos-libs.sh: partial move to posix shell
Change all non posix constructs except for stacked pushd/popd for the
sake of reviewability.

The reminder will be done in a separate commit.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2024-08-30 18:36:09 +02:00
3564512a63 android/setup-libs.sh: move to posix shell
Convert various non posix consturcts and change shebang to /bin/sh

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2024-08-29 12:55:48 +02:00
2634f8762e build-unix-win32.sh: move to posix shell
Convert non posix shell constructs and change shebang to /bin/sh

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2024-08-29 12:55:26 +02:00
1c4a32baa4 build-archives.sh: move to posix shell
Convert various no posix constructs and change the shebang to /bin/sh.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2024-08-29 12:55:26 +02:00
8ed1a0cb5a templatessorter.sh: move to posix shell
This one is already clean, so just change the shebang

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2024-08-29 12:55:26 +02:00
f2bef8388a
Use UTF-8 as encoding when working with files
This explicitly uses UTF-8 encoding when reading or writing files with
Python. This is necessary as the default locale varies between
operating systems.
2024-08-29 07:22:46 +02:00
c3b99feb60
Enable ruff rules for code simplification
This enables ruff rules which check for code which can be simplified to
improve readability.

The additionally rules getting enabled by this are:

- remove unnecessary nesting of if-statements (SIM102)
- use contextlib.suppress() for no-op exception handling (SIM105)
- use enumerate() for counting in loops (SIM113)
- use context managers for opening files (SIM115)
2024-08-29 07:00:43 +02:00
028ec40165
Add a RC file to add metadata to the pyrogenesis executable 2024-08-28 23:37:36 +02:00
631f7b292e Add pre-commit hook for shellcheck
Using shellcheck-py[1] instead of the official shellcheck-precommit[2]
to avoid a dependency on docker.

[1] https://github.com/shellcheck-py/shellcheck-py
[2] https://github.com/koalaman/shellcheck-precommit

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2024-08-28 18:23:18 +02:00
6f5ac7c4ae Fix issues pointed out by shellcheck
Some are real bugs, some are bashisms, but most is zealous quoting of
variables.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2024-08-28 18:23:18 +02:00
0feeb5884a
Cache Python dependencies in pre-commit workflow
This should speed up installation of pre-commit as part of the Gitea
Action a bit, as it caches the Python packages required for it.

The cache functionality of actions/setup-python is unsuitable for this
use case, as we don't have a file with requirements we want to use as
key. Instead, we just want to cache whatever is downloaded via pip from
PyPI and keep it for further invocations. This commit achieves that by
using the same cache key for every workflow run. The cache is being
updated even if pre-commit fails so we always keep the the Python
packages used for installing pre-commit cached.
2024-08-28 07:42:08 +02:00
97e6691c76
Fix Atlas in the nightly build
The Windows autobuilder contains two built versions of wxWidgets. One
corresponds to the oldest supported version of the library, and is used
for CI. However, the nightly build should use a recent version of the
library, compiled with the same toolset as the main game.

This commit adapts the nightly-build pipeline to use the rebuilt recent
copy of wxWidgets.
2024-08-27 21:38:37 +02:00
ea647067f0
Enable ruff rules to check for ambiguous code
This enables some ruff rules to check for ambiguous and dead Python
code, which might cause unintended side-effects.

The enabled rules are:

- a bunch of rules related to shadowing of builtin structures (A)
- a bunch of rules checking for unused arguments (ARG)
- a rule checking for useless expressions (B018)
- a rule checking for unbound loop variables (B023)
- a rule checking redefined function parameters (PLR1704)
2024-08-27 19:28:11 +02:00
ee3318309b
Allow to force non-incremental Jenkins builds
In all the builds using precompiled headers, an update to libraries will
crash the CI, as those headers will become outdated. It is then
necessary to force a full rebuild of the game by cleaning up the
workspaces.

This commit allows this CI behavior to be triggered by specifying
[CLEANBUILD] in the first line of the commit message.
This will constitute an opportunity to inform users that they need to
clean their workspaces when pulling the update.
2024-08-27 17:13:49 +02:00
2a67c9a503
Abort previous builds in pull requests
This will save precious build time by stopping the build of obsolete
commits.
2024-08-27 14:39:19 +02:00
f8ac0e4f68 Run checkrefs.py as Gitea Actions workflow 2024-08-27 13:33:21 +02:00
183a0b13f3 Add .already-built for premake to .gitignore
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2024-08-27 12:55:17 +02:00
13da3457bc
Delete wrongly committed file from abdda50892 2024-08-27 12:46:33 +02:00
ae3fad73ce
Add a markdownlint pre-commit hook
This adds a pre-commit hook to link Markdown files and fixes all
reported findings.
2024-08-27 10:06:31 +02:00
af6cda9073 Add shfmt to .pre-commit-config
Run shfmt as part of the ci workflow.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2024-08-26 09:03:00 +02:00
a04a5f70c7 Add global .editorconfig
This sets some reasonable defaults for all files.

Adds settings for *.sh files, doubles as configuration for shfmt.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2024-08-26 09:03:00 +02:00
abdda50892 Format shell scripts using shfmt
This updates shell scripts to use a consistent style that can be enforced
via pre-commit hook.

As for choosing tabs over spaces, some arguments are:

- tabs can help people with visual impairment
- tabs allow for indenting heredocs in bash
- tabs are the default for the tool shfmt

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2024-08-26 09:03:00 +02:00
c763c010b8
Add a bunch of additional pre-commit hooks 2024-08-26 07:46:41 +02:00
1800b5f1c0
Add executable bits for files with shebangs 2024-08-26 07:46:38 +02:00