1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-06-08 10:16:03 +02:00
cdt/releng/scripts/do_generate_asciidoc.sh
Jonah Graham 9aa3144840 Generate more of the documentation with asciidoc and automate more
- Migrate all getting_started from html to adoc
- Document (in README.md) notes on migrating html to adoc
- Reorganize generation of adoc slightly so that
  - all directories can be generates at once
  - output suffix changed to htm so that migrated files
    exist at the same URL on help.eclipse.org
- Add generation to the cleanliness checks to ensure that the
  html matches adoc
- Manage the adoc headers with a script as that is a large section
  of copy-pasted code on each adoc file (see README + adoc-headers.txt)
- Move maven version info to pluginManagement (consistency with other
  maven plug-ins)
- New profile "asciidoc-auto-refresh" which will auto build the
  files as edited.

Prerequisite of #992
2025-01-14 13:05:53 -05:00

39 lines
1.3 KiB
Bash
Executable file

#!/bin/bash
###############################################################################
# Copyright (c) 2025 Kichwa Coders Canada Inc
#
# This program and the accompanying materials
# are made available under the terms of the Eclipse Public License 2.0
# which accompanies this distribution, and is available at
# https://www.eclipse.org/legal/epl-2.0/
#
# SPDX-License-Identifier: EPL-2.0
###############################################################################
set -e
SCRIPT=$( basename "${BASH_SOURCE[0]}" )
##
# Make sure that asciidocs are up to date
##
for p in doc/org.eclipse.cdt.doc.user; do
echo "Rebuilding $p asciidocs to make sure they match source"
echo "Ensure adoc files start with expected contents"
ref_header=$p/adoc-headers.txt
git ls-files -- $p/**/*.adoc | while read i ; do
end_line=$(awk '/\/\/ ENDOFHEADER/{ print NR + 1; exit }' $i)
tmpfile=$(mktemp /tmp/adoc.XXXXXX)
cat $ref_header > $tmpfile
tail --lines=+${end_line:=0} $i >> $tmpfile
mv -f $tmpfile $i
done
echo "Generate html from adoc files"
logfile=asciidoc-${p//\//-}.log
if ! ${MVN:-mvn} -B -V generate-resources -DuseSimrelRepo -f $p >${logfile} 2>&1; then
echo "Rebuilding of $p asciidocs failed. The log (${logfile}) is part of the artifacts of the build"
exit 1
fi
done