Skip to content

Commit

Permalink
Added the build_mas_archive.sh script (#479)
Browse files Browse the repository at this point in the history
  • Loading branch information
mikekazakov authored Dec 17, 2024
1 parent c75d07a commit b219225
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Scripts/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
36 changes: 36 additions & 0 deletions Scripts/build_mas_archive.sh
Original file line number Diff line number Diff line change
@@ -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!

0 comments on commit b219225

Please sign in to comment.