Skip to content

Commit b219225

Browse files
authored
Added the build_mas_archive.sh script (#479)
1 parent c75d07a commit b219225

File tree

2 files changed

+39
-0
lines changed

2 files changed

+39
-0
lines changed

Scripts/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ Builds tests and the main application without running so that CodeQL can interce
88
## `build_help.sh`
99
Converts the markdown documention into a pdf placed in `build_help.tmp/Help.pdf`
1010

11+
## `build_mas_archive.sh`
12+
Builds and archive Nimble Commander for submission to MacAppStore.
13+
1114
## `build_nightly.sh`
1215
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.
1316
`xcodebuild`, `xcpretty` and `create-dmg` must be available in the environment in order for this script to run.

Scripts/build_mas_archive.sh

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
#!/bin/sh
2+
3+
set -e
4+
set -o pipefail
5+
6+
if ! [ -x "$(command -v xcpretty)" ] ; then
7+
echo 'xcpretty is not found, aborting. (https://github.com/xcpretty/xcpretty)'
8+
exit -1
9+
fi
10+
11+
# https://github.com/xcpretty/xcpretty/issues/48
12+
export LC_CTYPE=en_US.UTF-8
13+
14+
# Set up the paths to the sources and artifacts
15+
SCRIPTS_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
16+
ROOT_DIR=$(cd "$SCRIPTS_DIR/.." && pwd)
17+
XCODEPROJ="${ROOT_DIR}/Source/NimbleCommander/NimbleCommander.xcodeproj"
18+
BUILD_DIR="${SCRIPTS_DIR}/build_mas_archive.tmp"
19+
BUILT_PATH="${BUILD_DIR}/built"
20+
mkdir -p "${BUILD_DIR}"
21+
22+
# Build Help.pdf and copy it into the NC sources
23+
${SCRIPTS_DIR}/build_help.sh
24+
cp -f "${SCRIPTS_DIR}/build_help.tmp/Help.pdf" "${ROOT_DIR}/Source/NimbleCommander/NimbleCommander/Resources/Help.pdf"
25+
26+
# Gather common flags in the XC variable
27+
XC="xcodebuild \
28+
-project ${XCODEPROJ} \
29+
-scheme NimbleCommander-MAS \
30+
-configuration Release \
31+
OTHER_CFLAGS=\"-fdebug-prefix-map=${ROOT_DIR}=.\""
32+
33+
# Build and archive the project
34+
$XC archive | xcpretty
35+
36+
## Done!

0 commit comments

Comments
 (0)