Lars Schneider | 505ad91 | 2017-04-26 21:15:44 +0200 | [diff] [blame] | 1 | #!/usr/bin/env bash |
Lars Schneider | b98712b | 2016-05-04 10:38:36 +0200 | [diff] [blame] | 2 | # |
| 3 | # Perform sanity checks on documentation and build it. |
| 4 | # |
| 5 | |
Johannes Schindelin | c2160f2 | 2019-01-27 15:26:50 -0800 | [diff] [blame] | 6 | . ${0%/*}/lib.sh |
Lars Schneider | 657343a | 2017-09-10 16:44:28 +0200 | [diff] [blame] | 7 | |
SZEDER Gábor | 37fc8cb | 2019-03-29 13:35:20 +0100 | [diff] [blame] | 8 | filter_log () { |
| 9 | sed -e '/^GIT_VERSION = /d' \ |
Johannes Schindelin | 3018389 | 2020-02-09 22:36:16 +0000 | [diff] [blame] | 10 | -e "/constant Gem::ConfigMap is deprecated/d" \ |
SZEDER Gábor | 37fc8cb | 2019-03-29 13:35:20 +0100 | [diff] [blame] | 11 | -e '/^ \* new asciidoc flags$/d' \ |
brian m. carlson | f6461b8 | 2019-09-15 22:43:32 +0000 | [diff] [blame] | 12 | -e '/stripped namespace before processing/d' \ |
| 13 | -e '/Attributed.*IDs for element/d' \ |
SZEDER Gábor | 37fc8cb | 2019-03-29 13:35:20 +0100 | [diff] [blame] | 14 | "$1" |
| 15 | } |
| 16 | |
Lars Schneider | b98712b | 2016-05-04 10:38:36 +0200 | [diff] [blame] | 17 | make check-builtins |
| 18 | make check-docs |
Lars Schneider | b98712b | 2016-05-04 10:38:36 +0200 | [diff] [blame] | 19 | |
Lars Schneider | 159e601 | 2017-04-11 10:33:07 +0200 | [diff] [blame] | 20 | # Build docs with AsciiDoc |
SZEDER Gábor | 37fc8cb | 2019-03-29 13:35:20 +0100 | [diff] [blame] | 21 | make doc > >(tee stdout.log) 2> >(tee stderr.raw >&2) |
| 22 | cat stderr.raw |
| 23 | filter_log stderr.raw >stderr.log |
| 24 | test ! -s stderr.log |
Lars Schneider | b98712b | 2016-05-04 10:38:36 +0200 | [diff] [blame] | 25 | test -s Documentation/git.html |
| 26 | test -s Documentation/git.xml |
| 27 | test -s Documentation/git.1 |
Lars Schneider | 159e601 | 2017-04-11 10:33:07 +0200 | [diff] [blame] | 28 | grep '<meta name="generator" content="AsciiDoc ' Documentation/git.html |
| 29 | |
SZEDER Gábor | 37fc8cb | 2019-03-29 13:35:20 +0100 | [diff] [blame] | 30 | rm -f stdout.log stderr.log stderr.raw |
SZEDER Gábor | b92cb86 | 2017-12-31 17:02:06 +0100 | [diff] [blame] | 31 | check_unignored_build_artifacts |
| 32 | |
Lars Schneider | 159e601 | 2017-04-11 10:33:07 +0200 | [diff] [blame] | 33 | # Build docs with AsciiDoctor |
| 34 | make clean |
SZEDER Gábor | 37fc8cb | 2019-03-29 13:35:20 +0100 | [diff] [blame] | 35 | make USE_ASCIIDOCTOR=1 doc > >(tee stdout.log) 2> >(tee stderr.raw >&2) |
| 36 | cat stderr.raw |
| 37 | filter_log stderr.raw >stderr.log |
| 38 | test ! -s stderr.log |
Lars Schneider | 159e601 | 2017-04-11 10:33:07 +0200 | [diff] [blame] | 39 | test -s Documentation/git.html |
| 40 | grep '<meta name="generator" content="Asciidoctor ' Documentation/git.html |
SZEDER Gábor | 9cc2c76 | 2017-12-31 11:12:05 +0100 | [diff] [blame] | 41 | |
SZEDER Gábor | 37fc8cb | 2019-03-29 13:35:20 +0100 | [diff] [blame] | 42 | rm -f stdout.log stderr.log stderr.raw |
SZEDER Gábor | b92cb86 | 2017-12-31 17:02:06 +0100 | [diff] [blame] | 43 | check_unignored_build_artifacts |
| 44 | |
SZEDER Gábor | 9cc2c76 | 2017-12-31 11:12:05 +0100 | [diff] [blame] | 45 | save_good_tree |