From a2fae693a4b2fd5a73b3775ef5aac8428d97bf0a Mon Sep 17 00:00:00 2001 From: Michael Kazakov Date: Tue, 17 Dec 2024 20:54:51 +0000 Subject: [PATCH] Added the build_mas_archive.sh script --- Scripts/README.md | 3 +++ Scripts/build_mas_archive.sh | 36 ++++++++++++++++++++++++++++++++++++ 2 files changed, 39 insertions(+) create mode 100755 Scripts/build_mas_archive.sh diff --git a/Scripts/README.md b/Scripts/README.md index abfecd4da..03dadfd84 100644 --- a/Scripts/README.md +++ b/Scripts/README.md @@ -8,6 +8,9 @@ Builds tests and the main application without running so that CodeQL can interce ## `build_help.sh` Converts the markdown documention into a pdf placed in `build_help.tmp/Help.pdf` +## `build_mas_archive.sh` +Builds and archive Nimble Commander for submission to MacAppStore. + ## `build_nightly.sh` Builds Nimble Commander with the `NimbleCommander-NonMAS` scheme / `Release` configuration, signs it, packages the runnable build into a `.dmg` image and notarizes the final image. `xcodebuild`, `xcpretty` and `create-dmg` must be available in the environment in order for this script to run. diff --git a/Scripts/build_mas_archive.sh b/Scripts/build_mas_archive.sh new file mode 100755 index 000000000..254b60688 --- /dev/null +++ b/Scripts/build_mas_archive.sh @@ -0,0 +1,36 @@ +#!/bin/sh + +set -e +set -o pipefail + +if ! [ -x "$(command -v xcpretty)" ] ; then + echo 'xcpretty is not found, aborting. (https://github.com/xcpretty/xcpretty)' + exit -1 +fi + +# https://github.com/xcpretty/xcpretty/issues/48 +export LC_CTYPE=en_US.UTF-8 + +# Set up the paths to the sources and artifacts +SCRIPTS_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" +ROOT_DIR=$(cd "$SCRIPTS_DIR/.." && pwd) +XCODEPROJ="${ROOT_DIR}/Source/NimbleCommander/NimbleCommander.xcodeproj" +BUILD_DIR="${SCRIPTS_DIR}/build_mas_archive.tmp" +BUILT_PATH="${BUILD_DIR}/built" +mkdir -p "${BUILD_DIR}" + +# Build Help.pdf and copy it into the NC sources +${SCRIPTS_DIR}/build_help.sh +cp -f "${SCRIPTS_DIR}/build_help.tmp/Help.pdf" "${ROOT_DIR}/Source/NimbleCommander/NimbleCommander/Resources/Help.pdf" + +# Gather common flags in the XC variable +XC="xcodebuild \ + -project ${XCODEPROJ} \ + -scheme NimbleCommander-MAS \ + -configuration Release \ + OTHER_CFLAGS=\"-fdebug-prefix-map=${ROOT_DIR}=.\"" + +# Build and archive the project +$XC archive | xcpretty + +## Done!