WIP: Add task for generating man pages

This commit is contained in:
Paul Schaub 2022-07-27 21:40:24 +02:00
parent 3801a644ef
commit 8c581d459a
Signed by: vanitasvitae
GPG key ID: 62BEE9264BF17311

View file

@ -4,6 +4,7 @@
plugins {
id 'application'
id 'org.asciidoctor.jvm.convert' version '3.1.0'
}
dependencies {
@ -23,6 +24,7 @@ dependencies {
// CLI
implementation "info.picocli:picocli:$picocliVersion"
annotationProcessor "info.picocli:picocli-codegen:$picocliVersion"
// @Nonnull, @Nullable...
implementation "com.google.code.findbugs:jsr305:$jsrVersion"
@ -49,3 +51,24 @@ jar {
exclude "META-INF/*.RSA"
}
}
task generateManpageAsciiDoc(type: JavaExec) {
dependsOn(classes)
group = "Documentation"
description = "Generate AsciiDoc manpage"
classpath(configurations.annotationProcessor, sourceSets.main.runtimeClasspath)
systemProperty("user.language", "en")
main 'picocli.codegen.docgen.manpage.ManPageGenerator'
args mainClassName, "--outdir=${project.buildDir}/generated-picocli-docs", "-v" //, "--template-dir=src/docs/mantemplates"
}
apply plugin: 'org.asciidoctor.jvm.convert'
asciidoctor {
dependsOn(generateManpageAsciiDoc)
sourceDir = file("${project.buildDir}/generated-picocli-docs")
outputDir = file("${project.buildDir}/docs")
logDocuments = true
outputOptions {
backends = ['manpage', 'html5']
}
}