1
1
mirror of https://github.com/qvacua/vimr.git synced 2024-11-24 03:25:03 +03:00

Refactor slightly

This commit is contained in:
Tae Won Ha 2020-11-15 22:11:01 +01:00
parent bb7b0a95e3
commit f45553d4dd
No known key found for this signature in database
GPG Key ID: E40743465B5B8B44
6 changed files with 22 additions and 12 deletions

View File

@ -3,8 +3,13 @@ set -Eeuo pipefail
main () {
pushd "$(dirname "${BASH_SOURCE[0]}")/.." > /dev/null
local -r x86_64_deployment_target=$(cat ./resources/x86_64_deployment_target.txt)
local -r arm64_deployment_target=$(cat ./resources/arm64_deployment_target.txt)
local x86_64_deployment_target
x86_64_deployment_target=$(cat ./resources/x86_64_deployment_target.txt)
readonly x86_64_deployment_target
local arm64_deployment_target
arm64_deployment_target=$(cat ./resources/arm64_deployment_target.txt)
readonly arm64_deployment_target
local -r pcre_version="8.43"
local -r xz_version="5.2.4"

View File

@ -14,7 +14,7 @@ build_for_local_dev() {
local -r nvimserver_path="./NvimServer"
pushd ${nvimserver_path} >/dev/null
if [[ ${clean} == true ]]; then
if [[ "${clean}" == true ]]; then
local -r -x clean_deps=false
./NvimServer/bin/clean_all.sh
fi

View File

@ -4,7 +4,7 @@ set -Eeuo pipefail
readonly clean=${clean:?"true or false: when true, xcodebuild clean will be performed"}
main() {
if "${clean}" ; then
if [[ "${clean}" == true ]]; then
local -r cmd="clean build"
else
local -r cmd="build"

View File

@ -6,7 +6,9 @@ readonly nvimserver_dir_path="${target_dir_path}/NvimServer"
download_nvimserver() {
echo "### Downloading NvimServer"
local -r version=$(cat ./resources/nvimserver_version.txt)
local version
version=$(cat ./resources/nvimserver_version.txt)
readonly version
echo "#### Downloading ${version}"
@ -29,7 +31,7 @@ download_nvimserver() {
main() {
pushd "$(dirname "${BASH_SOURCE[0]}")/.." > /dev/null
download_nvimserver
download_nvimserver
popd >/dev/null
}

View File

@ -8,25 +8,25 @@ main() {
echo "### Notarizing"
ditto -c -k --keepParent VimR.app VimR.app.zip
echo "### Uploading"
declare -x request_uuid
echo "#### Uploading"
local -x request_uuid
request_uuid=$(xcrun \
altool --notarize-app --primary-bundle-id "com.qvacua.VimR" \
--username "hataewon@gmail.com" --password "@keychain:dev-notar" \
--file VimR.app.zip | grep RequestUUID | sed -E 's/.* = (.*)/\1/')
readonly request_uuid
echo "### Uploaded"
echo "#### Uploaded"
echo "Use 'xcrun altool --notarization-history 0 -u hataewon@gmail.com -p @keychain:dev-notar' or"
echo "'xcrun altool --notarization-info ${request_uuid} -u hataewon@gmail.com -p @keychain:dev-notar'"
pushd "$(dirname "${BASH_SOURCE[0]}")/.." >/dev/null
echo "### Waiting for notarization ${request_uuid} to finish"
echo "#### Waiting for notarization ${request_uuid} to finish"
./bin/wait_for_notarization.py
echo "### Notarization finished"
popd >/dev/null
xcrun stapler staple VimR.app
echo "### Notarization finished"
popd >/dev/null
}

View File

@ -7,7 +7,9 @@ readonly identity="Developer ID Application: Tae Won Ha (H96Q2NKTQH)"
main () {
pushd "$(dirname "${BASH_SOURCE[0]}")/.." >/dev/null
echo "### Signing VimR"
local -r entitlements_path=$(realpath ./Carthage/Build/Mac/NvimServer/NvimServer.entitlements)
local entitlements_path
entitlements_path=$(realpath ./Carthage/Build/Mac/NvimServer/NvimServer.entitlements)
readonly entitlements_path
codesign --verbose --force -s "${identity}" --deep --timestamp --options=runtime \
"${vimr_app_path}/Contents/Frameworks/Sparkle.framework/Versions/A/Resources/Autoupdate.app"
@ -20,6 +22,7 @@ main () {
codesign --verbose --force -s "${identity}" --deep --timestamp --options=runtime \
"${vimr_app_path}"
echo "### Signed VimR"
echo "### Use 'spctl -a -vvvv ${vimr_app_path}' to verify the signing."
popd >/dev/null