[Git][java-team/gradle][master] Generate a very basic manpage in POD format

Andrej Shadura gitlab at salsa.debian.org
Tue Feb 26 17:21:42 GMT 2019


Andrej Shadura pushed to branch master at Debian Java Maintainers / gradle


Commits:
7683089e by Andrej Shadura at 2019-02-26T17:21:08Z
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

- - - - -


4 changed files:

- debian/clean
- debian/control
- debian/gradle.1.md → debian/gradle.pod.in
- debian/rules


Changes:

=====================================
debian/clean
=====================================
@@ -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


=====================================
debian/control
=====================================
@@ -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


=====================================
debian/gradle.1.md → debian/gradle.pod.in
=====================================
@@ -1,20 +1,27 @@
-% 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
+ at 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


=====================================
debian/rules
=====================================
@@ -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



View it on GitLab: https://salsa.debian.org/java-team/gradle/commit/7683089e9b2b67283a16d82bdc4bf117739b0040

-- 
View it on GitLab: https://salsa.debian.org/java-team/gradle/commit/7683089e9b2b67283a16d82bdc4bf117739b0040
You're receiving this email because of your account on salsa.debian.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/pkg-java-commits/attachments/20190226/25c0213f/attachment.html>


More information about the pkg-java-commits mailing list