1
1
mirror of https://github.com/qvacua/vimr.git synced 2024-12-11 07:22:23 +03:00
vimr/bin/build_vimr.sh

47 lines
1.9 KiB
Bash
Raw Normal View History

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-08-21 09:59:40 +03:00
readonly deployment_target_file="./resources/x86_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-08-17 19:57:57 +03:00
codesign --force -s "${identity}" --deep --timestamp --options=runtime VimR.app
2020-02-07 01:22:44 +03:00
codesign --force -s "${identity}" --timestamp --options=runtime --entitlements="${entitlements_path}" \
VimR.app/Contents/Frameworks/NvimView.framework/Versions/A/NvimServer
2020-03-05 21:40:29 +03:00
codesign --force -s "${identity}" --timestamp --options=runtime VimR.app/Contents/Frameworks/NvimView.framework/Versions/A
2020-02-05 02:24:59 +03:00
codesign --force -s "${identity}" --deep --timestamp --options=runtime VimR.app/Contents/Frameworks/Sparkle.framework/Versions/A/Resources/Autoupdate.app
codesign --force -s "${identity}" --deep --timestamp --options=runtime VimR.app/Contents/Frameworks/Sparkle.framework/Versions/A
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"