Skip to content

Commit d5c5805

Browse files
committed
Add docs
1 parent cf589e7 commit d5c5805

35 files changed

+524
-60
lines changed

docs/build.gradle

Lines changed: 50 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -1,63 +1,67 @@
1-
buildscript {
2-
repositories {
3-
maven {
4-
url = "https://plugins.gradle.org/m2/"
5-
}
6-
}
7-
dependencies {
8-
classpath "org.asciidoctor:asciidoctor-gradle-jvm:3.3.2"
9-
}
1+
plugins {
2+
id 'groovy'
3+
id 'org.graceframework.grace-doc'
104
}
115

12-
apply plugin: "org.asciidoctor.jvm.convert"
6+
def DOCUMENTATION_GROUP = 'Documentation'
137

148
repositories {
15-
maven {
16-
url = "https://repo.grails.org/grails/core"
17-
}
18-
}
19-
20-
asciidoctor {
21-
resources {
22-
from('src/docs/images')
23-
into "./images"
24-
}
25-
26-
attributes 'experimental' : 'true',
27-
'compat-mode' : 'true',
28-
'toc' : 'left',
29-
'icons' : 'font',
30-
'version' : project.version,
31-
'sourcedir' : "${rootProject.allprojects.find { it.name == 'views-core'}.projectDir}/src/main/groovy"
9+
mavenCentral()
3210
}
3311

3412
configurations {
35-
documentation.extendsFrom(compileClasspath)
13+
documentation
3614
}
3715

3816
dependencies {
39-
documentation project(path: ':views-json', configuration: 'compileOnly')
40-
documentation project(path: ':views-markup', configuration: 'compileOnly')
41-
documentation project(path: ':views-gradle', configuration: 'compileOnly')
17+
documentation "com.github.javaparser:javaparser-core:$javaParserCoreVersion"
18+
documentation "org.apache.groovy:groovy:$groovyVersion"
19+
documentation "org.apache.groovy:groovy-ant:$groovyVersion"
4220
}
4321

44-
task apidocs(type: Groovydoc, group: 'documentation') {
45-
def allProjects = rootProject.allprojects.findAll { project ->
46-
['views-core', 'views-json', 'views-json-testing-support', 'views-markup','views-gradle'].contains(project.name)
22+
def cleanTask = project.tasks.findByName('clean')
23+
if (cleanTask == null) {
24+
task clean(type: Delete) {
25+
delete(buildDir)
4726
}
48-
source allProjects.collect { project ->
49-
project.files('src/main/groovy')
50-
}
27+
}
28+
else {
29+
cleanTask.doLast {
30+
ant.delete(dir: 'build/docs')
31+
}
32+
}
5133

52-
destinationDir = new File(buildDir, 'docs/api')
53-
// Might need a classpath
54-
docTitle = "Grails Views ${version}"
55-
56-
classpath = configurations.documentation
57-
groovyClasspath = configurations.documentation
34+
tasks.withType(Groovydoc) {
35+
group = DOCUMENTATION_GROUP
36+
docTitle = "Grace Views - ${project.version}"
37+
destinationDir = project.file('build/docs/manual/api')
38+
def files = []
39+
project.rootProject.subprojects
40+
.findAll { !it.name != 'docs' && !it.name.startsWith('examples') }
41+
.each { subproject ->
42+
if(subproject.file('src/main/groovy').exists()) {
43+
files += subproject.files('src/main/groovy')
44+
}
45+
if(subproject.file('src/main/java').exists()) {
46+
files += subproject.files('src/main/java')
47+
}
48+
}
49+
if (project.file('src/main/groovy').exists()) {
50+
files += project.files('src/main/groovy')
51+
}
52+
source = files
53+
classpath += configurations.documentation
5854
}
5955

60-
task docs(type:Copy, dependsOn:[apidocs, asciidoctor], group:'documentation') {
61-
from "$buildDir/asciidoc/html5"
62-
into "$buildDir/docs"
56+
docs {
57+
dependsOn groovydoc
58+
}
59+
60+
def assembleTask = project.tasks.findByName('assemble')
61+
if (assembleTask == null) {
62+
task assemble(dependsOn: docs, type:Zip) {
63+
baseName = "${project.name}-${project.version}"
64+
destinationDir = new File(project.buildDir, 'distributions')
65+
from project.files("${buildDir}/docs")
66+
}
6367
}
File renamed without changes.

docs/src/docs/guide/json.adoc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
= JSON Views
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)