Skip to content

Commit f762486

Browse files
committed
Update asciidoctor gradle plugin, make documentation generation task work
Closes gh-91
1 parent 385b140 commit f762486

File tree

4 files changed

+23
-32
lines changed

4 files changed

+23
-32
lines changed

build.gradle

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ buildscript {
1010
}
1111
dependencies {
1212
classpath "io.github.gradle-nexus:publish-plugin:2.0.0"
13-
// classpath "io.github.groovylang.groovydoc:groovydoc-gradle-plugin:1.0.1"
13+
classpath "org.asciidoctor:asciidoctor-gradle-jvm:4.0.3"
1414
classpath "org.graceframework:grace-gradle-plugin:$graceVersion"
1515
classpath "com.github.erdi:webdriver-binaries-gradle-plugin:$webdriverBinariesVersion"
1616
classpath "org.gradle:test-retry-gradle-plugin:1.6.0"
@@ -114,7 +114,6 @@ subprojects { Project subproject ->
114114
documentation "org.fusesource.jansi:jansi:$jansiVersion"
115115
documentation "org.apache.groovy:groovy-dateutil:$groovyVersion"
116116
documentation "org.apache.groovy:groovy-xml:$groovyVersion"
117-
documentation "info.picocli:picocli:$picocliVersion"
118117
documentation "com.github.javaparser:javaparser-core:$javaParserCoreVersion"
119118

120119
testImplementation "org.spockframework:spock-core:$spockVersion", {

docs/build.gradle

Lines changed: 21 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
ext {
2-
githubBranch = "release/2023.0.0-M1"
2+
githubBranch = "2023.3.x"
33
checkOutDir = "build/checkout"
44
zipFile = "build/source.zip"
55

@@ -12,19 +12,13 @@ ext {
1212

1313
version rootProject.version
1414

15-
apply plugin: 'org.asciidoctor.convert'
15+
apply plugin: "org.asciidoctor.jvm.convert"
1616
apply plugin: 'groovy'
1717

18-
configurations.all {
19-
resolutionStrategy.eachDependency { DependencyResolveDetails details ->
20-
if (details.requested.group == 'org.apache.groovy' && details.requested.name.startsWith('groovy')) {
21-
details.useVersion(groovyVersion)
22-
}
23-
if (details.requested.group == 'org.springframework') {
24-
details.useVersion(springVersion)
25-
}
26-
if (details.requested.group == "org.springframework.boot") {
27-
details.useVersion(springBootVersion)
18+
configurations {
19+
documentation {
20+
attributes {
21+
attribute(Bundling.BUNDLING_ATTRIBUTE, (Bundling) (objects.named(Bundling, 'external')))
2822
}
2923
}
3024
}
@@ -33,7 +27,6 @@ dependencies {
3327
documentation "org.graceframework:grace-core:$graceVersion"
3428
documentation "org.graceframework:grace-bootstrap:$graceVersion"
3529
documentation "org.graceframework:grace-spring:$graceVersion"
36-
documentation "info.picocli:picocli:$picocliVersion"
3730
documentation "org.fusesource.jansi:jansi:$jansiVersion"
3831
documentation "org.apache.groovy:groovy-dateutil:$groovyVersion"
3932
documentation "com.github.javaparser:javaparser-core:$javaParserCoreVersion"
@@ -51,21 +44,21 @@ dependencies {
5144

5245
asciidoctor {
5346
resources {
54-
from("${project.projectDir}/src/docs/asciidoc/images")
55-
into "./images"
47+
from("${project.projectDir}/src/docs/images")
48+
into "${project.projectDir}/images"
5649
}
5750

5851
attributes 'experimental' : 'true',
5952
'compat-mode' : 'true',
53+
'toc' : 'left',
6054
'icons' : 'font',
6155
'reproducible' : '',
6256
'version' : project.version,
6357
'pluginVersion' : project.version,
64-
'sourcedir' : "${project.projectDir}/src/main/groovy"
65-
}
58+
// 'mongoDriverVersion': mongodbDriverVersion,
59+
'sourcedir' : "${project.rootDir}"
6660

67-
asciidoctorj {
68-
version = '1.5.4'
61+
baseDirFollowsSourceDir()
6962
}
7063

7164
task fetchSource {
@@ -76,9 +69,9 @@ task fetchSource {
7669
println "Downloading GORM source code."
7770
def tag = System.getenv('TRAVIS_TAG')
7871
if (tag) {
79-
ant.get src: "https://github.com/grace/grace-data/archive/${tag}.zip", dest: zipFile, verbose: true
72+
ant.get src: "https://github.com/graceframework/grace-data/archive/${tag}.zip", dest: zipFile, verbose: true
8073
} else {
81-
ant.get src: "https://github.com/grace/grace-data/zipball/${githubBranch}", dest: zipFile, verbose: true
74+
ant.get src: "https://github.com/graceframework/grace-data/zipball/${githubBranch}", dest: zipFile, verbose: true
8275
}
8376

8477
ant.unzip src: zipFile, dest: checkOutDir, {
@@ -105,9 +98,9 @@ tasks.withType(Groovydoc) {
10598
def files
10699
for (p in coreProjects) {
107100
if (files == null) {
108-
files = project.files("${checkOutDir}/gorm-src/grails-datastore-${p}/src/main/groovy")
101+
files = project.files("${checkOutDir}/gorm-src/grace-datastore-${p}/src/main/groovy")
109102
} else {
110-
files += project.files("${checkOutDir}/gorm-src/grails-datastore-${p}/src/main/groovy")
103+
files += project.files("${checkOutDir}/gorm-src/grace-datastore-${p}/src/main/groovy")
111104
}
112105
}
113106
project.rootProject.subprojects
@@ -131,8 +124,8 @@ task docs(dependsOn:[asciidoctor, groovydoc, copyDocs, copyResources] +
131124
.collect { project -> project.tasks.groovydoc }
132125
)
133126

134-
//task assemble(type: Zip, dependsOn:docs) {
135-
// from "${project.buildDir}/docs"
136-
// baseName = "${project.name}-${project.version}"
137-
// destinationDir = project.file("${project.buildDir}/distributions")
138-
//}
127+
task assemble(type: Zip, dependsOn:docs) {
128+
from "${project.buildDir}/docs"
129+
baseName = "${project.name}-${project.version}"
130+
destinationDir = project.file("${project.buildDir}/distributions")
131+
}

gradle.properties

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ jpaVersion=3.1.0
1515
jtaVersion=2.0.1
1616
junitJupiterVersion=5.10.5
1717
junitPlatformVersion=1.10.5
18-
picocliVersion=4.6.3
1918
seleniumSafariDriverVersion=3.14.0
2019
seleniumVersion=3.14.0
2120
slf4jVersion=2.0.16

settings.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ rootProject.name = 'Grace.Data.Hibernate'
44
include "grace-datastore-gorm-hibernate"
55

66
// Documentation
7-
// include 'docs'
7+
include 'docs'
88

99
// Plugins
1010
include 'grace-plugin'

0 commit comments

Comments
 (0)