summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
Diffstat (limited to 'tools')
-rwxr-xr-xtools/build.sh4
-rwxr-xr-xtools/gendocs.sh26
-rwxr-xr-xtools/prepare-commit-msg27
-rwxr-xr-xtools/spellcheck.sh2
-rwxr-xr-xtools/travis-before_install.sh17
-rwxr-xr-xtools/travis-install.sh23
6 files changed, 95 insertions, 4 deletions
diff --git a/tools/build.sh b/tools/build.sh
index ba563e34..b7a80587 100755
--- a/tools/build.sh
+++ b/tools/build.sh
@@ -4,8 +4,8 @@ flavor=$1
shift 1
JOBS=-j$(sysctl -n hw.activecpu)
-OPTIONS="$flavor --debug --python --ninja --doxygen $JOBS"
-OPTIONS="$OPTIONS --prefix /usr/local/Cellar/ledger/HEAD"
+#OPTIONS="$flavor --debug --python --ninja --doxygen $JOBS"
+OPTIONS="$flavor --debug --ninja $JOBS"
time ( \
cd ~/src/ledger ; \
diff --git a/tools/gendocs.sh b/tools/gendocs.sh
index 9126a406..483f0230 100755
--- a/tools/gendocs.sh
+++ b/tools/gendocs.sh
@@ -1,5 +1,29 @@
#!/bin/bash
+
+# By default US Letter is used as the PDF papersize.
+# For those preferring other dimensions add a4 or small
+# as a commandline argument to this script to create a
+# DIN A4 or smallbook version of the PDF.
+case $1 in
+ a4*|afour*)
+ papersize='--texinfo=@afourpaper';;
+ small*)
+ papersize='--texinfo=@smallbook';;
+ *)
+ papersize='';; # US Letter is texinfo default
+esac
+
+# Use keg-only Mac Hombrew texinfo if installed.
+# Since texi2pdf is a shell script itself executing texi2dvi
+# PATH is prepended with the path to correct texinfo scripts.
+if [ $(uname -s) = 'Darwin' ]; then
+ brew list texinfo >/dev/null 2>&1 \
+ && export PATH="$(brew --prefix texinfo)/bin:$PATH"
+fi
+
echo "===================================== Making Info..."
makeinfo ledger3.texi
+echo "===================================== Making HTML..."
+makeinfo --html --no-split ledger3.texi
echo "===================================== Making PDF..."
-texi2pdf --quiet --batch ledger3.texi
+texi2pdf --quiet --batch ${papersize} ledger3.texi
diff --git a/tools/prepare-commit-msg b/tools/prepare-commit-msg
new file mode 100755
index 00000000..e103888a
--- /dev/null
+++ b/tools/prepare-commit-msg
@@ -0,0 +1,27 @@
+#!/bin/sh
+#
+# Prepare git commit message:
+# - Add [ci skip] if the changes seem irrelevant for continuous integration
+
+# Add [ci skip] to the commit message unless there are changes to files
+# that are relevant for testing such as src/*, test/*, ledger3.texi, ...
+function add_ci_skip()
+{
+ pattern="$1"; shift
+ if [ $(git diff --cached --name-only | grep --count "$pattern") -eq 0 ]; then
+ tempfile=$(mktemp $0.XXXXXX)
+ cat - "$1" <<EOF > "$tempfile"
+
+# It seems the changes to be committed are irrelevant for the continuous
+# integration, therefore it will be skipped for this commit.
+#
+# If you still want continuous integration to run for this commit
+# comment or remove the next line.
+[ci skip]
+EOF
+ mv "$tempfile" "$1"
+ fi
+}
+
+## MAIN
+add_ci_skip '\(^src\|^test\|^doc/ledger3.texi\|^\.travis.yml\|CMakeLists.txt\)' "$@"
diff --git a/tools/spellcheck.sh b/tools/spellcheck.sh
index ae86a3d6..182f32cb 100755
--- a/tools/spellcheck.sh
+++ b/tools/spellcheck.sh
@@ -1,3 +1,3 @@
#!/bin/sh
-aspell check --mode=texinfo ledger3.texi \ No newline at end of file
+aspell --lang=en_US.UTF-8 check --mode=texinfo $(dirname $0)/../doc/ledger3.texi
diff --git a/tools/travis-before_install.sh b/tools/travis-before_install.sh
new file mode 100755
index 00000000..a1800021
--- /dev/null
+++ b/tools/travis-before_install.sh
@@ -0,0 +1,17 @@
+#!/usr/bin/env bash
+
+#set -x
+set -e
+set -o pipefail
+
+if [ "${TRAVIS_OS_NAME}" = "osx" ]; then
+ brew update
+fi
+
+if [ -n "${BOOST_VERSION}" ]; then
+ echo "Downloading boost ${BOOST_VERSION}"
+ mkdir -p $BOOST_ROOT
+ wget --no-verbose --output-document=- \
+ http://sourceforge.net/projects/boost/files/boost/${BOOST_VERSION}/boost_${BOOST_VERSION//./_}.tar.bz2/download \
+ | tar jxf - --strip-components=1 -C "${BOOST_ROOT}"
+fi
diff --git a/tools/travis-install.sh b/tools/travis-install.sh
new file mode 100755
index 00000000..b5039d5c
--- /dev/null
+++ b/tools/travis-install.sh
@@ -0,0 +1,23 @@
+#!/usr/bin/env bash
+
+#set -x
+set -e
+set -o pipefail
+
+if [ "${TRAVIS_OS_NAME}" = "osx" ]; then
+ for formula in $(echo "${BREWS//,/ }"); do
+ echo "Checking ${formula} formula"
+ brew outdated "${formula}" \
+ || (brew unlink "${formula}"
+ brew install "${formula}"
+ )
+ done
+fi
+
+if [ -d "${BOOST_ROOT}" ]; then
+ echo "Installing boost ${BOOST_VERSION} in ${BOOST_ROOT}"
+ (cd "${BOOST_ROOT}"
+ ./bootstrap.sh --with-libraries="${BOOST_LIBS}"
+ ./b2 threading=multi --prefix="${BOOST_ROOT}" -d0 install
+ )
+fi