From 5126696eb094996261d6e4beb3c8ddfc6933f4f9 Mon Sep 17 00:00:00 2001 From: tooomm Date: Fri, 24 Jul 2026 23:13:01 +0200 Subject: [PATCH] readability and removed duplication --- .ci/compile.sh | 55 +++++++++++++++++++++++++++++++++++--------------- 1 file changed, 39 insertions(+), 16 deletions(-) diff --git a/.ci/compile.sh b/.ci/compile.sh index d5321cc95..f95bbfcdd 100755 --- a/.ci/compile.sh +++ b/.ci/compile.sh @@ -1,22 +1,45 @@ #!/bin/bash -# This script is to be used by the ci environment from the project root directory, do not use it from somewhere else. +# This script is to be used by the CI environment from the project root directory, do not use it from somewhere else. -# Compiles cockatrice inside of a ci environment -# --install runs make install -# --package [] runs make package, optionally force the type -# --suffix renames package with this suffix, requires arg -# --server compiles servatrice -# --test runs tests -# --debug or --release sets the build type ie CMAKE_BUILD_TYPE -# --ccache [] uses ccache and shows stats, optionally provide size -# --evict-ccache runs ccache eviction based on given age after build -# --dir sets the name of the build dir, default is "build" -# --cmake-generator sets CMAKE_GENERATOR as used by cmake -# --target-macos-version sets the min os version - only used for macOS builds -# uses env: BUILDTYPE MAKE_INSTALL MAKE_PACKAGE PACKAGE_TYPE PACKAGE_SUFFIX MAKE_SERVER MAKE_NO_CLIENT MAKE_TEST USE_CCACHE CCACHE_SIZE CCACHE_EVICTION_AGE BUILD_DIR CMAKE_GENERATOR TARGET_MACOS_VERSION -# (correspond to args: --debug/--release --install --package --suffix --server --test --ccache --dir ) -# exitcode: 1 for failure, 3 for invalid arguments +# Compiles Cockatrice inside a CI environment +# +# Supported arguments: +# --install Runs cmake install +# --package [] Runs cmake package (optionally: define the type) +# --suffix Renames package with provided suffix +# --server Compiles Servatrice +# --test Runs tests +# --debug / --release Sets the build type (CMAKE_BUILD_TYPE) +# --ccache [] Uses ccache and shows stats, optionally provide size +# --evict-ccache Runs ccache eviction based on given age after build +# --dir Sets the name of the build dir, default is "build" +# --cmake-generator Sets the CMake generator (CMAKE_GENERATOR) +# --target-macos-version Sets the min OS version - only used for macOS builds +# +# Used environment variables: +# BUILDTYPE +# MAKE_INSTALL +# MAKE_PACKAGE +# PACKAGE_TYPE +# PACKAGE_SUFFIX +# MAKE_SERVER +# MAKE_NO_CLIENT +# MAKE_TEST +# USE_CCACHE +# CCACHE_SIZE +# CCACHE_EVICTION_AGE +# BUILD_DIR +# CMAKE_GENERATOR +# TARGET_MACOS_VERSION +# +# Exitcodes: +# 1 --> Failure +# 3 --> Invalid argument(s) + +#TODO order above comment, check & add +# there are also missing ones like "--no-client" and "--vcpkg" +# arguments and env variables are doubled and are not used uniformly between Linux and macOS/Windows builds which adds complexity # Read arguments while [[ $# != 0 ]]; do