Skip to content

Commit bc61bd8

Browse files
committed
[#2492] build(documentation): mark not compatible with configuration cache, refactor use of project
ascii doctor plugin is not compatible yet asciidoctor/asciidoctor-gradle-plugin#730
1 parent e08feb1 commit bc61bd8

File tree

1 file changed

+26
-16
lines changed

1 file changed

+26
-16
lines changed

documentation/build.gradle

Lines changed: 26 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -101,30 +101,40 @@ asciidoctor {
101101
enabled = false
102102
}
103103

104-
def renderReferenceDocumentationTask = tasks.register( 'renderReferenceDocumentation', AsciidoctorTask ) {
105-
description = 'Renders the Reference Documentation in HTML format using Asciidoctor.'
106-
sourceDir = file( 'src/main/asciidoc/reference' )
104+
def renderReferenceDocumentationTask = tasks.register( "renderReferenceDocumentation", AsciidoctorTask ) {
105+
description = "Renders the Reference Documentation in HTML format using Asciidoctor."
106+
notCompatibleWithConfigurationCache( "AsciidoctorGradlePlugin does not support configuration cache yet" )
107+
108+
// use of provider to obtain info and cache the value
109+
def versionFamily = providers.provider { project.projectVersion.family }
110+
def fullVersion = providers.provider { project.version.toString() }
111+
def asciidocReference = layout.projectDirectory.dir("src/main/asciidoc/reference")
112+
113+
sourceDir = asciidocReference.asFile
114+
107115
sources {
108-
include 'index.adoc'
116+
include( "index.adoc" )
109117
}
110118

111119
resources {
112-
from( sourceDir ) {
113-
include 'images/**'
114-
include 'css/**'
120+
from( asciidocReference ) {
121+
include( "images/**", "css/**" )
115122
}
116123
}
117124

118-
outputDir = project.layout.buildDirectory.dir( "asciidoc/reference/html_single" ).get().asFile
119-
options logDocuments: true
125+
outputDir = layout.buildDirectory.dir("asciidoc/reference/html_single").get().asFile
126+
127+
options( logDocuments: true )
120128

121-
attributes icons: 'font',
122-
'source-highlighter': 'rouge',
123-
experimental: true,
124-
linkcss: true,
125-
majorMinorVersion: project.projectVersion.family,
126-
fullVersion: project.version.toString(),
127-
docinfo: 'private'
129+
attributes(
130+
"icons": "font",
131+
"source-highlighter": "rouge",
132+
"experimental": true,
133+
"linkcss": true,
134+
"majorMinorVersion": versionFamily.get(),
135+
"fullVersion": fullVersion.get(),
136+
"docinfo": "private"
137+
)
128138
}
129139

130140
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

0 commit comments

Comments
 (0)