Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update "testing" build script so it works regardless of execution location #929

Merged
merged 41 commits into from
Jan 18, 2018
Merged
Show file tree
Hide file tree
Changes from 40 commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
ba9a626
testing atom commits
cailyoung Jun 19, 2017
b6215fc
testing atom commits again
cailyoung Jun 19, 2017
da5f7bc
Merge pull request #1 from cailyoung/cail
cailyoung Jun 20, 2017
6775ff8
Revert "Cail"
cailyoung Jun 21, 2017
d5e28e6
Merge pull request #2 from cailyoung/revert-1-cail
cailyoung Jun 21, 2017
4c4b52b
Merge pull request #3 from CommandPost/develop
cailyoung Jun 24, 2017
f6feaff
Merge pull request #4 from CommandPost/develop
cailyoung Sep 28, 2017
73c6794
Merge pull request #5 from CommandPost/develop
cailyoung Oct 3, 2017
1ed6ff4
Merge pull request #6 from CommandPost/develop
cailyoung Oct 17, 2017
1921390
Merge remote-tracking branch 'CommandPost/develop' into develop
cailyoung Oct 17, 2017
e6ebc30
Merge pull request #7 from CommandPost/develop
cailyoung Oct 21, 2017
8262bc1
Merge branch 'develop' of https://github.com/cailyoung/CommandPost in…
cailyoung Oct 21, 2017
24ba9b3
Merge pull request #8 from CommandPost/develop
cailyoung Oct 23, 2017
45031d8
Merge remote-tracking branch 'CommandPost/develop' into develop
cailyoung Oct 23, 2017
263bff3
Merge remote-tracking branch 'origin/develop' into develop
cailyoung Oct 23, 2017
0a99d8d
Merge pull request #9 from CommandPost/develop
cailyoung Oct 28, 2017
2b6142e
Merge pull request #10 from CommandPost/develop
cailyoung Oct 29, 2017
6fb5f23
Merge pull request #11 from CommandPost/develop
cailyoung Nov 22, 2017
f614c13
Merge pull request #12 from CommandPost/develop
cailyoung Nov 29, 2017
9b34830
Merge pull request #13 from CommandPost/develop
cailyoung Dec 27, 2017
f017fbb
altered global warning exclusions in .luacheckrc to set std
cailyoung Jan 2, 2018
a009db2
fail early if cd fails on build
cailyoung Jan 2, 2018
ac0369b
fail early on make failure
cailyoung Jan 2, 2018
9931fc2
use subshell for build artefact search and quote sub to catch spaces
cailyoung Jan 2, 2018
a48a771
remove file from commits
cailyoung Jan 2, 2018
cb1449d
correct directory change
cailyoung Jan 2, 2018
82873aa
change build artefact deletion to look for release scheme build
cailyoung Jan 2, 2018
749f1f2
failsafe the dev build script
cailyoung Jan 2, 2018
7af27ba
refactor dev build script to use librelease.sh
cailyoung Jan 2, 2018
8e0992c
fix hard directory for librelease include
cailyoung Jan 2, 2018
2f3e2cf
correct shellcheck directive
cailyoung Jan 2, 2018
843cfde
add dev build function to librelease
cailyoung Jan 2, 2018
812e0bc
Correct directory
cailyoung Jan 2, 2018
d0172a8
fix cleanup directory
cailyoung Jan 2, 2018
81d7e04
fix build directory hardcoding
cailyoung Jan 2, 2018
28096b1
success message
cailyoung Jan 2, 2018
1af277f
safety quotes
cailyoung Jan 2, 2018
b25a260
Merge pull request #14 from CommandPost/develop
cailyoung Jan 2, 2018
b74f20b
Merge pull request #15 from cailyoung/develop
cailyoung Jan 2, 2018
1aedd43
dummy commit to rerun linter
cailyoung Jan 7, 2018
d378c47
make pushd/popd safe
cailyoung Jan 8, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
32 changes: 23 additions & 9 deletions scripts/build_commandpost_testing.sh
Original file line number Diff line number Diff line change
@@ -1,20 +1,34 @@
#!/bin/bash

# failsafes
set -eu
set -o pipefail
#
# Compile CommandPost:
#

cd ../CommandPost-App/
# set directory variables
# export SCRIPT_NAME
export SCRIPT_HOME
export HAMMERSPOON_HOME

# SCRIPT_NAME="$(basename "$0")"
SCRIPT_HOME="$(dirname "$(greadlink -f "$0")")" # fully qualified directory of this script
HAMMERSPOON_HOME="$(greadlink -f "${SCRIPT_HOME}/../../CommandPost-App")" # fully qualified directory of the CommandPost-App repository

make clean
make release
make docs
# Import our function library
# shellcheck source=scripts/inc/librelease.sh disable=SC1091

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Couldn't parse this shellcheck annotation.
Expected "disable". Fix any mentioned problems and try again.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stickler needs to update their shellcheck version to one that includes the source argument for directives. All this does is tell shellcheck where the script actually is.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Couldn't parse this shellcheck annotation.
Expected "disable". Fix any mentioned problems and try again.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same comment as above.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Couldn't parse this shellcheck annotation.
Expected "disable". Fix any mentioned problems and try again.

source "${SCRIPT_HOME}/inc/librelease.sh"

rm -fr `xcodebuild -workspace Hammerspoon.xcworkspace -scheme Hammerspoon -configuration DEBUG -showBuildSettings | sort | uniq | grep " BUILT_PRODUCTS_DIR =" | awk '{ print $3 }'`/CommandPost.app
build_hammerspoon_dev # run the build-dev function from librelease

# clean up the unsigned build
rm -fr "$(xcodebuild -workspace "${HAMMERSPOON_HOME}/Hammerspoon.xcworkspace" -scheme Hammerspoon -configuration Release -showBuildSettings | sort | uniq | grep " BUILT_PRODUCTS_DIR =" | awk '{ print $3 }')/CommandPost.app"

#
# Sign App with self-signed certificate:
#
codesign --verbose --sign "Internal Code Signing" "build/CommandPost.app/Contents/Frameworks/Sparkle.framework/Versions/A"
codesign --verbose --sign "Internal Code Signing" "build/CommandPost.app/Contents/Frameworks/LuaSkin.framework/Versions/A"
codesign --verbose --sign "Internal Code Signing" "build/CommandPost.app"
codesign --verbose --sign "Internal Code Signing" "${HAMMERSPOON_HOME}/build/CommandPost.app/Contents/Frameworks/Sparkle.framework/Versions/A"
codesign --verbose --sign "Internal Code Signing" "${HAMMERSPOON_HOME}/build/CommandPost.app/Contents/Frameworks/LuaSkin.framework/Versions/A"
codesign --verbose --sign "Internal Code Signing" "${HAMMERSPOON_HOME}/build/CommandPost.app"

echo "Dev build complete. Launch from ${HAMMERSPOON_HOME}/build/"
15 changes: 14 additions & 1 deletion scripts/inc/librelease.sh
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,20 @@ function build_hammerspoon_app() {
fi
}

function build_hammerspoon_dev() {
echo "Building CommandPost.app for development..."
pushd "${HAMMERSPOON_HOME}" >/dev/null

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use 'cd ... || exit' or 'cd ... || return' in case cd fails.

make clean
make release
rm build/docs.json
# make docs
# make build/html/LuaSkin
popd >/dev/null

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use 'cd ... || exit' or 'cd ... || return' in case cd fails.

if [ ! -e "${HAMMERSPOON_HOME}"/build/CommandPost.app ]; then
fail "Looks like the build failed. sorry!"
fi
}

############################ POST-BUILD FUNCTIONS #############################

function build_dmgcanvas() {
Expand Down Expand Up @@ -432,4 +446,3 @@ function release_tweet() {
t update "Just released ${VERSION} - http://www.hammerspoon.org/releasenotes/"
t set active "$CURRENT"
}