2016-10-14 13:15:32 +03:00
|
|
|
#!/bin/bash
|
2019-12-22 23:45:42 +03:00
|
|
|
set -Eeuo pipefail
|
2016-10-17 23:35:29 +03:00
|
|
|
|
2016-10-15 10:38:09 +03:00
|
|
|
echo "### Building VimR target"
|
2019-12-22 23:45:42 +03:00
|
|
|
pushd "$( dirname "${BASH_SOURCE[0]}" )/.." > /dev/null
|
|
|
|
|
2020-11-14 17:52:18 +03:00
|
|
|
readonly deployment_target_file="./resources/x86_64_deployment_target.txt"
|
2019-12-22 23:45:42 +03:00
|
|
|
readonly deployment_target=$(cat ${deployment_target_file})
|
|
|
|
readonly code_sign=${code_sign:?"true or false"}
|
|
|
|
readonly use_carthage_cache=${use_carthage_cache:?"true or false"}
|
|
|
|
readonly build_path="./build"
|
2016-10-14 13:15:32 +03:00
|
|
|
|
2020-02-01 19:50:41 +03:00
|
|
|
# Carthage often crashes => do it at the beginning.
|
|
|
|
echo "### Updating carthage"
|
|
|
|
if [[ ${use_carthage_cache} == true ]]; then
|
|
|
|
carthage update --cache-builds --platform macos
|
|
|
|
else
|
|
|
|
carthage update --platform macos
|
|
|
|
fi
|
|
|
|
|
2020-08-16 20:07:53 +03:00
|
|
|
./bin/download_nvimserver.sh
|
2016-10-14 13:15:32 +03:00
|
|
|
|
2016-10-15 10:38:09 +03:00
|
|
|
echo "### Xcodebuilding"
|
2016-10-17 23:35:29 +03:00
|
|
|
|
2019-12-22 23:45:42 +03:00
|
|
|
rm -rf ${build_path}
|
2019-04-28 10:34:21 +03:00
|
|
|
|
2019-12-22 23:45:42 +03:00
|
|
|
if [[ ${code_sign} == true ]] ; then
|
2020-02-05 02:24:59 +03:00
|
|
|
identity="Developer ID Application: Tae Won Ha (H96Q2NKTQH)"
|
2020-08-16 20:07:53 +03:00
|
|
|
entitlements_path=$(realpath Carthage/Build/Mac/NvimServer/NvimServer.entitlements)
|
2020-02-07 01:22:44 +03:00
|
|
|
|
2020-08-17 19:32:58 +03:00
|
|
|
xcodebuild -configuration Release -derivedDataPath ./build -workspace VimR.xcworkspace -scheme VimR clean build
|
2020-02-07 01:22:44 +03:00
|
|
|
|
2020-02-05 02:24:59 +03:00
|
|
|
pushd ${build_path}/Build/Products/Release > /dev/null
|
2020-11-14 19:18:31 +03:00
|
|
|
codesign --verbose --force -s "${identity}" --deep --timestamp --options=runtime VimR.app/Contents/Frameworks/Sparkle.framework/Versions/A/Resources/Autoupdate.app
|
|
|
|
codesign --verbose --force -s "${identity}" --timestamp --options=runtime VimR.app/Contents/Frameworks/Sparkle.framework/Versions/A
|
|
|
|
codesign --verbose --force -s "${identity}" --timestamp --options=runtime --entitlements="${entitlements_path}" \
|
2020-11-14 17:52:18 +03:00
|
|
|
VimR.app/Contents/Resources/NvimView_NvimView.bundle/Contents/Resources/NvimServer
|
2020-11-14 19:18:31 +03:00
|
|
|
|
|
|
|
codesign --verbose --force -s "${identity}" --deep --timestamp --options=runtime VimR.app
|
2020-02-05 02:24:59 +03:00
|
|
|
popd > /dev/null
|
2016-10-17 23:35:29 +03:00
|
|
|
else
|
2019-12-22 23:45:42 +03:00
|
|
|
xcodebuild -configuration Release -scheme VimR -workspace VimR.xcworkspace -derivedDataPath ${build_path} clean build
|
2016-10-17 23:35:29 +03:00
|
|
|
fi
|
2016-10-14 13:15:32 +03:00
|
|
|
|
2019-12-22 23:45:42 +03:00
|
|
|
popd > /dev/null
|
2016-10-15 10:38:09 +03:00
|
|
|
echo "### Built VimR target"
|