2
0
Fork 0
mirror of https://github.com/kyleneideck/BackgroundMusic synced 2025-02-26 11:57:08 +00:00

Add debug build option to build script.

Also add info about logging to CONTRIBUTING.md.
This commit is contained in:
Kyle Neideck 2016-04-29 12:04:10 +10:00
parent 6fb281c3ce
commit e95f371305
2 changed files with 22 additions and 5 deletions

View file

@ -5,6 +5,19 @@
Firstly, thanks for reading this. Pull requests, bug reports, feature requests, etc. are all very welcome (including
ones from non-developers).
For bug reports about `build_and_install.sh`, please include your `build_and_install.log`. (It should be written to the
same directory as `build_and_install.sh`.)
For bug reports about Background Music itself, if you feel like being really helpful, you could reproduce your bug with
a debug build and include the relevant logs. But don't feel obligated to. You can build and install a debug build with
`./build_and_install.sh -d`.
BGMDriver and BGMXPCHelper log messages to system.log by default. You can read them in Console.app. BGMApp's logs go to
stdout, except errors or warnings that should be visible to users, which go to syslog. To get BGMApp's logs either run
it in Xcode or from a terminal (e.g. `$ /Applications/Background\ Music.app/Contents/MacOS/Background\ Music`).
I'm working on adding logging to release builds and generally making the process easier.
The code is mostly C++ and Objective-C. But don't worry if you don't know those languages--I don't either. Or Core
Audio, for that matter.

View file

@ -65,8 +65,7 @@ error_handler() {
fi
}
# Build for release by default.
# TODO: Add an option to use the debug configuration?
# Build for release by default. Use -d for a debug build.
CONFIGURATION=Release
#CONFIGURATION=Debug
@ -121,7 +120,8 @@ RECOMMENDED_MIN_XCODE_VERSION=7
usage() {
echo "Usage: $0 [options]" >&2
echo -e "\t-d\tDon't clean before building/installing." >&2
echo -e "\t-n\tDon't clean before building/installing." >&2
echo -e "\t-d\tDebug build. (Release is the default.)" >&2
echo -e "\t-c\tContinue on script errors. Might not be safe." >&2
echo -e "\t-h\tPrint this usage statement." >&2
exit 1
@ -206,11 +206,14 @@ show_spinner() {
}
parse_options() {
while getopts ":dch" opt; do
while getopts ":ndch" opt; do
case $opt in
d)
n)
CLEAN=""
;;
d)
CONFIGURATION="Debug"
;;
c)
CONTINUE_ON_ERROR=1
echo "$(tput setaf 11)WARNING$(tput sgr0): Ignoring errors."
@ -379,6 +382,7 @@ fi
# Print initial message.
echo "$(bold_face About to install Background Music). Please pause all audio, if you can."
[[ "${CONFIGURATION}" == "Debug" ]] && echo "Debug build."
echo
echo "This script will install:"
echo " - ${APP_PATH}/${APP_DIR}"