Generate a very basic manpage in POD format

- Instead of depending on pandoc, use perl’s POD format, which
  needs fewer dependencies to run
- Generate a very basic command line options summary based on
  subprojects/docs/src/docs/userguide/commandLine.adoc
- Convert the necessary subset of asciidoc to POD using a simple
  and stupid sed script
parent 2406ad27
......@@ -4,4 +4,5 @@ buildSrc/.gradle/
buildSrc/build/
buildSrc/src/main/java/tmp/
debian/.gradlehome/
debian/*.1
\ No newline at end of file
debian/*.1
debian/*.pod
......@@ -68,7 +68,6 @@ Build-Depends: ant,
libxbean-reflect-java,
libxerces2-java,
maven-repo-helper,
pandoc,
testng
Standards-Version: 4.3.0
Vcs-Git: https://salsa.debian.org/java-team/gradle.git
......
% GRADLE(1) | Gradle Command Line Manual
% Gradle depvelopers
# NAME
=head1 NAME
gradle - Adaptable, fast automation for all
# SYNOPSIS
=head1 SYNOPSIS
**gradle** [_option..._] [_task..._]
B<gradle> [I<option...>] [I<task...>]
# OPTIONS
=head1 OPTIONS
A detailed guide of the command line interface is provided on Gradle's official
website. The project itself does not provide a manpage, therefore maintaining
it is error-prone and costly. Sorry for the inconvenience.
it is error-prone and costly.
The summary of the options is provided below.
=over
@GENERATED@
=back
=head1 SEE ALSO
L<https://docs.gradle.org/current/userguide/command_line_interface.html>
# SEE ALSO
=head1 AUTHORS
https://docs.gradle.org/current/userguide/command_line_interface.html
\ No newline at end of file
Gradle developers
......@@ -42,12 +42,41 @@ endif
%:
dh $@ --with maven_repo_helper,javahelper
override_dh_auto_build:
debian/gradle.1: debian/gradle.pod
touch -d@$(SOURCE_DATE_EPOCH) $<
pod2man -r "Gradle $(GRADLE_VERSION)" -c "Gradle Command Line Manual" $< > $@
debian/gradle.pod: debian/gradle.pod.in
sed '/@GENERATED@/,$$d' $< > $@
# process items: `-?`, `-h`, `--help`:: → =item `-?`, `-h`, `--help`
# process bold: `-?` → B<-?>
# remove empty line markers
# drop text from links: https://gradle.com/build-scans[...]
# drop underscores from documentation links
# replace documentation links by UPPERCASE LABELS
# move parethesed option "(comments)" outside of the bold parts
# cut off everything after and including the [[daemon_cli]] section
# cut off the introduction
sed \
-e 's/\(.*\):: *$$/\n=item \1\n/' \
-e 's/`\([^`]*\)`/B<\1>/g' \
-e 's/^+$$//g' \
-e 's/\(https:[^[]*\)[[][^]]*\]/L<\1>/g' \
-e '/<<sec:[^>]*>>/y/_/ /' \
-e 's/<<sec:\([^>]*\)>>/the documentation section B<\U\1\E>/g' \
-e '/<<[^>]*>>/y/_/ /' \
-e 's/<<\([^>]*\)>>/the documentation section B<\U\1\E>/g' \
-e 's/ (\([^)]*\))>/> (\1)/g' \
-e '/daemon_cli]]/,$$d' \
-e '0,/The command-line options available/d' \
subprojects/docs/src/docs/userguide/commandLine.adoc >> $@
sed '0,/@GENERATED@/d' $< >> $@
override_dh_auto_build: debian/gradle.1
$(RM) gradle.properties # Some properties here breaks the latest JVM
mkdir --parents buildSrc/src/main/java/tmp # Symlinks are for building Gradle 4 using Gradle 3
ln --symbolic --force --target-directory=buildSrc/src/main/java/tmp/ $(patsubst %,../../../../../%,$(GRADLE_COMPAT_BUILDSRC_SOURCE))
gradle $(GRADLE_TASKS) $(GRADLE_FLAGS)
pandoc -s -o debian/gradle.1 debian/gradle.1.md
override_dh_auto_clean:
dh_auto_clean
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment