mirror of
https://github.com/ironfox-oss/IronFox.git
synced 2026-08-01 02:16:36 -04:00
These are constant values (defined at `ironfox.configure`) which can be used anywhere... specifically: - In Gecko (via the `IFConstants.sys.mjs` module) - In `ironfox.cfg` (via the equivalent prefs set at `ironfox.js` and `phoenix-overrides.cfg`) - In any Kotlin/Java project (via the `org.ironfoxoss.core.IFConstants` components) So this allows us to define these values in one place, and be able to use them anywhere. It also ensures the values always match across all projects. Signed-off-by: celenity <celenity@celenity.dev>
77 lines
2.5 KiB
Bash
Executable File
77 lines
2.5 KiB
Bash
Executable File
#!/bin/bash
|
|
|
|
set -euo pipefail
|
|
|
|
# Set-up our environment
|
|
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
|
|
if [[ -z "${1+x}" ]]; then
|
|
echo_red_text "Usage: $0 arm|arm64|x86_64|bundle" >&1
|
|
exit 1
|
|
fi
|
|
|
|
readonly target=$(echo "${1}" | "${IRONFOX_AWK}" '{print tolower($0)}')
|
|
|
|
if [[ -z "${2+x}" ]]; then
|
|
readonly project='fenix'
|
|
else
|
|
readonly project=$(echo "${2}" | "${IRONFOX_AWK}" '{print tolower($0)}')
|
|
fi
|
|
|
|
# Build IronFox
|
|
readonly IRONFOX_FROM_BUILD=1
|
|
export IRONFOX_FROM_BUILD
|
|
if [[ "${IRONFOX_LOG_BUILD}" == 1 ]]; then
|
|
readonly BUILD_LOG_FILE="${IRONFOX_LOG_DIR}/build-${target}.log"
|
|
|
|
# If the log file already exists, remove it
|
|
if [[ -f "${BUILD_LOG_FILE}" ]]; then
|
|
rm "${BUILD_LOG_FILE}"
|
|
fi
|
|
|
|
# Ensure our log directory exists
|
|
mkdir -vp "${IRONFOX_LOG_DIR}"
|
|
|
|
bash -x "${IRONFOX_SCRIPTS}/build-if.sh" "${target}" "${project}" > >(tee -a "${BUILD_LOG_FILE}") 2>&1
|
|
else
|
|
bash -x "${IRONFOX_SCRIPTS}/build-if.sh" "${target}" "${project}"
|
|
fi
|
|
|
|
# We should only try to sign IronFox if we actually built Fenix, so check that first
|
|
## (All `rebuild-` targets eventually build Fenix, because eventually Fenix consumes everything...)
|
|
if [[ "${project}" == 'fenix' ]] || [[ "${project}" == 'rebuild-ac-core' ]] || [[ "${project}" == 'rebuild-ac' ]] ||
|
|
[[ "${project}" == 'rebuild-as' ]] || [[ "${project}" == 'rebuild-fenix' ]] || [[ "${project}" == 'rebuild-gecko' ]] ||
|
|
[[ "${project}" == 'rebuild-geckoview' ]] || [[ "${project}" == 'rebuild-glean' ]] || [[ "${project}" == 'rebuild-ironfox-core' ]] ||
|
|
[[ "${project}" == 'rebuild-llvm' ]] || [[ "${project}" == 'rebuild-microg' ]] || [[ "${project}" == 'rebuild-nimbus-fml' ]] ||
|
|
[[ "${project}" == 'rebuild-uniffi' ]] || [[ "${project}" == 'rebuild-up-ac' ]] || [[ "${project}" == 'rebuild-wasi' ]]; then
|
|
readonly IRONFOX_BUILT_FENIX=1
|
|
else
|
|
readonly IRONFOX_BUILT_FENIX=0
|
|
fi
|
|
|
|
# Sign IronFox
|
|
if [[ "${IRONFOX_SIGN}" == 1 ]] && [[ "${IRONFOX_BUILT_FENIX}" == 1 ]]; then
|
|
if [[ "${IRONFOX_LOG_SIGN}" == 1 ]]; then
|
|
readonly SIGN_LOG_FILE="${IRONFOX_LOG_DIR}/sign.log"
|
|
|
|
# If the log file already exists, remove it
|
|
if [[ -f "${SIGN_LOG_FILE}" ]]; then
|
|
rm "${SIGN_LOG_FILE}"
|
|
fi
|
|
|
|
# Ensure our log directory exists
|
|
mkdir -vp "${IRONFOX_LOG_DIR}"
|
|
|
|
bash "${IRONFOX_SCRIPTS}/sign.sh" "${target}" > >(tee -a "${SIGN_LOG_FILE}") 2>&1
|
|
else
|
|
bash "${IRONFOX_SCRIPTS}/sign.sh" "${target}"
|
|
fi
|
|
fi
|