This repository was archived by the owner on Dec 6, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathsettings-script.sh
More file actions
executable file
·35 lines (25 loc) · 1.46 KB
/
Copy pathsettings-script.sh
File metadata and controls
executable file
·35 lines (25 loc) · 1.46 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#!/bin/sh
SOURCE_FILE="${SRCROOT}/Pods/Target Support Files/Pods-${TARGET_NAME}/Pods-${TARGET_NAME}-acknowledgements.plist"
TARGET_FILE="${TARGET_BUILD_DIR}/${EXECUTABLE_NAME}.app/Settings.bundle/Pods-acknowledgements.plist"
#location of symbolic link creator
CP="/bin/cp"
$CP "${SOURCE_FILE}" "${TARGET_FILE}"
echo "SOURCE_FILE = ${SOURCE_FILE}"
echo "TARGET_FILE = ${TARGET_FILE}"
INFOPLISTPATH="${TARGET_BUILD_DIR}/${EXECUTABLE_NAME}.app/Info.plist"
VERSION_LIST_PATH="${TARGET_BUILD_DIR}/${EXECUTABLE_NAME}.app/Settings.bundle/Version.plist"
# Location of PlistBuddy
PLISTBUDDY="/usr/libexec/PlistBuddy"
BUILD_VERSION=$(/usr/libexec/PlistBuddy -c "Print CFBundleShortVersionString" "${INFOPLISTPATH}")
BUILD_NUMBER=$(/usr/libexec/PlistBuddy -c "Print CFBundleVersion" "${INFOPLISTPATH}")
# Get the current git commmit hash (first 7 characters of the SHA)
GITREVSHA=$(git --git-dir="${PROJECT_DIR}/.git" --work-tree="${PROJECT_DIR}" rev-parse --short HEAD)
echo "INFOPLISTPATH = ${INFOPLISTPATH}"
echo "VERSION_LIST_PATH = ${VERSION_LIST_PATH}"
echo "BUILD_VERSION = ${BUILD_VERSION}"
echo "BUILD_NUMBER = ${BUILD_NUMBER}"
echo "GIT SHA = ${GITREVSHA}"
# Set the Git hash in the info plist for reference
$PLISTBUDDY -c "Set :PreferenceSpecifiers:1:DefaultValue $BUILD_VERSION" "${VERSION_LIST_PATH}"
$PLISTBUDDY -c "Set :PreferenceSpecifiers:2:DefaultValue $BUILD_NUMBER" "${VERSION_LIST_PATH}"
$PLISTBUDDY -c "Set :PreferenceSpecifiers:3:DefaultValue $GITREVSHA" "${VERSION_LIST_PATH}"