mirror of
https://github.com/ironfox-oss/IronFox.git
synced 2026-07-31 18:07:06 -04:00
Notably, this means that:
- It's now possible to build components individually
- This should especially be useful for ex. CI, so we can avoid timeouts and improve build speed by building certain components simultaneously
- It's now possible to rebuild only a specific project and its consumers (instead of always having to build everything...)
- ex. If I make a change to Gecko, I can just use `rebuild-gecko`, which only builds Gecko and its consumers (GeckoView, AC, and Fenix), instead of trying to build everything unconditionally
The default build behavior (ex. if no argument is specified) still remains the same
This also adds checks to ensure that the build script fails fast if important variables are not properly set/configured
Also includes some minor tweaks, such as a renaming of a couple of the CI jobs for clarity, and the addition of an `IRONFOX_TEMP` variable to indicate the temporary build directory
Signed-off-by: celenity <celenity@celenity.dev>
54 lines
1.4 KiB
Bash
Executable File
54 lines
1.4 KiB
Bash
Executable File
#!/bin/bash
|
|
|
|
set -euo pipefail
|
|
|
|
if [[ "${CI_COMMIT_REF_NAME}" == "${PRODUCTION_BRANCH}" ]]; then
|
|
# Target release
|
|
export IRONFOX_RELEASE=1
|
|
fi
|
|
|
|
# Set-up our environment
|
|
if [[ -z "${IRONFOX_CI+x}" ]]; then
|
|
export IRONFOX_CI=1
|
|
fi
|
|
if [[ -z "${IRONFOX_SET_ENVS+x}" ]]; then
|
|
bash -x $(dirname $0)/env.sh
|
|
fi
|
|
source $(dirname $0)/env.sh
|
|
|
|
# Include utilities
|
|
source "${IRONFOX_UTILS}"
|
|
|
|
# Set-up target parameters
|
|
readonly ci_target=$(echo "${1}" | "${IRONFOX_AWK}" '{print tolower($0)}')
|
|
|
|
if [[ -z "${2+x}" ]]; then
|
|
readonly ci_project='fenix'
|
|
else
|
|
readonly ci_project=$(echo "${2}" | "${IRONFOX_AWK}" '{print tolower($0)}')
|
|
fi
|
|
|
|
# Function to compress our archives
|
|
function compress_archives() {
|
|
if [[ "${ci_project}" == 'geckoview' ]]; then
|
|
local readonly ci_job_artifact="build-aar-${ci_target}"
|
|
elif [[ "${ci_project}" == 'fenix' ]]; then
|
|
local readonly ci_job_artifact="build-final-${ci_target}"
|
|
fi
|
|
bash -x "${IRONFOX_SCRIPTS}/ci-compress.sh" "${ci_job_artifact}"
|
|
}
|
|
|
|
# By default, we know the build hasn't failed...
|
|
IRONFOX_CI_BUILD_FAILED=0
|
|
|
|
# Build IronFox
|
|
readonly IRONFOX_FROM_CI_BUILD=1
|
|
export IRONFOX_FROM_CI_BUILD
|
|
bash -x "${IRONFOX_SCRIPTS}/ci-build-if.sh" "${ci_target}" "${ci_project}" || IRONFOX_CI_BUILD_FAILED=1
|
|
|
|
readonly IRONFOX_CI_BUILD_FAILED
|
|
export IRONFOX_CI_BUILD_FAILED
|
|
|
|
# Compress our archives
|
|
compress_archives
|