mirror of
https://github.com/bitcoinj/bitcoinj.git
synced 2025-02-22 06:21:47 +01:00
wallettool/build.gradle: generate man, html5 and adoc manpages
Adds the picocli-codegen annotation processor. To build the documentation use `gradle bitcoinj-wallettool:asciidoctor`. The results are in: * wallettool/build/generated-picocli-docs/wallet-tool.adoc (asciidoc source) * wallettool/build/docs/html5/wallet-tool.html (HTML version) * wallettool/build/docs/manpage/wallet-tool.1 (man format)
This commit is contained in:
parent
96db76da83
commit
4cde8940fc
1 changed files with 35 additions and 0 deletions
|
@ -1,13 +1,24 @@
|
|||
import org.gradle.util.GradleVersion
|
||||
|
||||
plugins {
|
||||
id 'java'
|
||||
id 'application'
|
||||
id 'eclipse'
|
||||
id 'org.asciidoctor.jvm.convert' version '3.3.2' apply false
|
||||
}
|
||||
|
||||
def annotationProcessorMinVersion = GradleVersion.version("4.6")
|
||||
boolean hasAnnotationProcessor = (GradleVersion.current().compareTo(annotationProcessorMinVersion) > 0)
|
||||
|
||||
dependencies {
|
||||
implementation project(':bitcoinj-core')
|
||||
implementation 'info.picocli:picocli:4.6.3'
|
||||
implementation 'org.slf4j:slf4j-jdk14:1.7.36'
|
||||
if (hasAnnotationProcessor) {
|
||||
annotationProcessor 'info.picocli:picocli-codegen:4.6.3'
|
||||
} else {
|
||||
compileOnly 'info.picocli:picocli-codegen:4.6.3'
|
||||
}
|
||||
}
|
||||
|
||||
sourceCompatibility = 11
|
||||
|
@ -21,3 +32,27 @@ compileJava {
|
|||
|
||||
mainClassName = "org.bitcoinj.wallettool.WalletTool"
|
||||
applicationName = "wallet-tool"
|
||||
|
||||
task generateManpageAsciiDoc(type: JavaExec) {
|
||||
dependsOn(classes)
|
||||
group = "Documentation"
|
||||
description = "Generate AsciiDoc manpage"
|
||||
if (hasAnnotationProcessor) {
|
||||
classpath(sourceSets.main.compileClasspath, configurations.annotationProcessor, sourceSets.main.runtimeClasspath)
|
||||
} else {
|
||||
classpath(sourceSets.main.compileClasspath, sourceSets.main.runtimeClasspath)
|
||||
}
|
||||
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']
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue