-
-
Notifications
You must be signed in to change notification settings - Fork 18
Expand file tree
/
Copy pathbuild.gradle
More file actions
143 lines (126 loc) · 4.29 KB
/
Copy pathbuild.gradle
File metadata and controls
143 lines (126 loc) · 4.29 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
import org.asciidoctor.gradle.jvm.AsciidoctorJExtension
import org.asciidoctor.gradle.jvm.pdf.AsciidoctorPdfThemesExtension
import org.firebirdsql.documentation.asciidoc.AsciidocToDocbook
import org.firebirdsql.documentation.asciidoc.FbAsciidocHtmlTask
import org.firebirdsql.documentation.asciidoc.FbAsciidocPdfTask
plugins {
id 'org.firebirdsql.documentation'
// Version controlled through buildSrc/build.gradle
id 'org.asciidoctor.jvm.base'
id 'org.asciidoctor.jvm.pdf' apply false
}
repositories {
mavenCentral()
}
extensions.create(AsciidoctorPdfThemesExtension.NAME, AsciidoctorPdfThemesExtension, project)
extensions.getByType(AsciidoctorJExtension).modules.pdf.use()
pdfThemes {
local 'firebird', {
themeDir = file('src/theme/firebird-pdf')
themeName = 'firebird'
}
}
configurations {
asciidoctorExt { }
}
dependencies {
asciidoctorExt 'org.firebirdsql.asciidoctor:canonical-link:1.0'
}
asciidoctorj {
version = '3.0.1'
}
docConfig {
docRoot.set(file('src/docs'))
outputRoot.set(layout.buildDirectory.dir('docs'))
}
def asciidocHtml = tasks.register('asciidocHtml', FbAsciidocHtmlTask) {
group = 'Documentation'
description = 'Generate HTML documentation from asciidoc'
configurations 'asciidoctorExt'
baseDirFollowsSourceFile()
executionMode = OUT_OF_PROCESS
attributes 'revnumber': false, 'stylesdir': file(stylesDir), 'stylesheet': 'firebird.css',
'docinfo': 'shared', 'docinfodir': file(stylesDir.file('docinfo'))
// TODO move definitions of images to copy to the task
resources {
from(stylesDir.file('docinfo')) {
include 'images/**/*'
}
}
doFirst {
languages.each { lang ->
resources lang, {
from(sourceDirProperty.file(lang)) {
include 'images/**/*'
}
}
}
}
jvm {
if (JavaVersion.current() != JavaVersion.VERSION_1_8) {
jvmArgs "--add-opens", "java.base/sun.nio.ch=ALL-UNNAMED", "--add-opens", "java.base/java.io=ALL-UNNAMED"
}
}
}
def asciidocPdf = tasks.register('asciidocPdf', FbAsciidocPdfTask) {
group = 'Documentation'
description = 'Generate PDF documentation from asciidoc'
configurations 'asciidoctorExt'
baseDirFollowsSourceFile()
executionMode = OUT_OF_PROCESS
attributes 'revnumber': false, 'source-highlighter': 'rouge', 'media': 'screen', 'toc': 'macro', 'compress': '',
'icon-set': 'fas', 'pdf-fontsdir': "${file('src/theme/fonts')},GEM_FONTS_DIR"
theme = 'firebird'
asciidoctorj {
modules {
pdf {
version '2.3.23'
}
}
}
jvm {
if (JavaVersion.current() > JavaVersion.VERSION_1_8) {
jvmArgs "--add-opens", "java.base/sun.nio.ch=ALL-UNNAMED", "--add-opens", "java.base/java.io=ALL-UNNAMED"
}
}
}
def copyXsltNgCustomizations = tasks.register('copyXsltNgCustomizations', Copy) {
from 'src/docs/xsltng'
into layout.buildDirectory.dir('docs/asciidoc/docbook')
}
def copyDocbook5Css = tasks.register('copyDocbook5Css', Copy) {
from 'src/theme/docbook5/css'
into layout.buildDirectory.dir('docs/chunk/css')
}
def copyDocbook5Js = tasks.register('copyDocbook5Js', Copy) {
from 'src/theme/docbook5/js'
into layout.buildDirectory.dir('docs/chunk/js')
}
def asciidocDocbook = tasks.register('asciidocDocbook', AsciidocToDocbook) {
dependsOn copyXsltNgCustomizations, copyDocbook5Css, copyDocbook5Js
group = 'Documentation'
description = 'Generate Docbook from asciidoc'
baseDirFollowsSourceFile()
executionMode = OUT_OF_PROCESS
// TODO move definitions of images to copy to the task
// resources {
// from(stylesDir.file('docinfo')) {
// include 'images/**/*'
// }
// }
doFirst {
languages.each { lang ->
resources lang, {
from(sourceDirProperty.file(lang)) {
include 'images/**/*'
duplicatesStrategy DuplicatesStrategy.EXCLUDE
}
}
}
}
jvm {
if (JavaVersion.current() > JavaVersion.VERSION_1_8) {
jvmArgs "--add-opens", "java.base/sun.nio.ch=ALL-UNNAMED", "--add-opens", "java.base/java.io=ALL-UNNAMED"
}
}
}