blob: de41888430a260630650341371f9fa6216a4bcbe [file] [log] [blame]
Lars Schneider505ad912017-04-26 21:15:44 +02001#!/usr/bin/env bash
Lars Schneiderb98712b2016-05-04 10:38:36 +02002#
3# Perform sanity checks on documentation and build it.
4#
5
Johannes Schindelinc2160f22019-01-27 15:26:50 -08006. ${0%/*}/lib.sh
Lars Schneider657343a2017-09-10 16:44:28 +02007
SZEDER Gábor37fc8cb2019-03-29 13:35:20 +01008filter_log () {
9 sed -e '/^GIT_VERSION = /d' \
Johannes Schindelin30183892020-02-09 22:36:16 +000010 -e "/constant Gem::ConfigMap is deprecated/d" \
SZEDER Gábor37fc8cb2019-03-29 13:35:20 +010011 -e '/^ \* new asciidoc flags$/d' \
brian m. carlsonf6461b82019-09-15 22:43:32 +000012 -e '/stripped namespace before processing/d' \
13 -e '/Attributed.*IDs for element/d' \
SZEDER Gábor37fc8cb2019-03-29 13:35:20 +010014 "$1"
15}
16
Lars Schneiderb98712b2016-05-04 10:38:36 +020017make check-builtins
18make check-docs
Lars Schneiderb98712b2016-05-04 10:38:36 +020019
Lars Schneider159e6012017-04-11 10:33:07 +020020# Build docs with AsciiDoc
SZEDER Gábor37fc8cb2019-03-29 13:35:20 +010021make doc > >(tee stdout.log) 2> >(tee stderr.raw >&2)
22cat stderr.raw
23filter_log stderr.raw >stderr.log
24test ! -s stderr.log
Lars Schneiderb98712b2016-05-04 10:38:36 +020025test -s Documentation/git.html
26test -s Documentation/git.xml
27test -s Documentation/git.1
Lars Schneider159e6012017-04-11 10:33:07 +020028grep '<meta name="generator" content="AsciiDoc ' Documentation/git.html
29
SZEDER Gábor37fc8cb2019-03-29 13:35:20 +010030rm -f stdout.log stderr.log stderr.raw
SZEDER Gáborb92cb862017-12-31 17:02:06 +010031check_unignored_build_artifacts
32
Lars Schneider159e6012017-04-11 10:33:07 +020033# Build docs with AsciiDoctor
34make clean
SZEDER Gábor37fc8cb2019-03-29 13:35:20 +010035make USE_ASCIIDOCTOR=1 doc > >(tee stdout.log) 2> >(tee stderr.raw >&2)
36cat stderr.raw
37filter_log stderr.raw >stderr.log
38test ! -s stderr.log
Lars Schneider159e6012017-04-11 10:33:07 +020039test -s Documentation/git.html
40grep '<meta name="generator" content="Asciidoctor ' Documentation/git.html
SZEDER Gábor9cc2c762017-12-31 11:12:05 +010041
SZEDER Gábor37fc8cb2019-03-29 13:35:20 +010042rm -f stdout.log stderr.log stderr.raw
SZEDER Gáborb92cb862017-12-31 17:02:06 +010043check_unignored_build_artifacts
44
SZEDER Gábor9cc2c762017-12-31 11:12:05 +010045save_good_tree