So finally I found a solution. To create a PDF file, you must provide the following files:
You must add after that to build the .gradle line
apply from: "docbook.gradle"
after
apply plugin: "java"
Then add this to the end of build.gradle:
docbookPdf { sourceFileName = "docbook.xml" stylesheet = file("doc/docbook-style.xsl") sourceDirectory = file( "doc" ) docsDir = new File(project.getBuildDir(), "docs"); }
Here we placed docbook.xml and docbook-style.xsl in the rootDirectory / doc directory, and we placed the generated PDF in the rootDirectory / docs (/ pdf) file.
Here is an example docbook stylesheet that you can use: http://cl.ly/2n1p3o0r1L3Z1d2U4345
To generate the PDF from the terminal, go to the directory where the build.gradle file is located and execute
gradle docbookPdf
if you named task docbookPdf.
What is it. It should work on any platform.
source share