forked from spring-projects/spring-graphql
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
119 lines (102 loc) · 2.52 KB
/
build.gradle
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
plugins {
id 'java'
id 'org.asciidoctor.jvm.convert' version '3.3.2'
}
description = "Spring for GraphQL reference documentation"
configurations {
asciidoctorExtensions
}
jar {
enabled = false
}
javadoc {
enabled = false
}
dependencies {
asciidoctorExtensions 'io.spring.asciidoctor.backends:spring-asciidoctor-backends:0.0.2'
}
repositories {
maven {
url "https://repo.spring.io/release"
mavenContent {
includeGroup "io.spring.asciidoctor.backends"
}
}
}
ext.javadocLinks = [
"https://docs.oracle.com/javase/8/docs/api/",
"https://javadoc.io/doc/com.graphql-java/graphql-java/${graphQlJavaVersion}/",
"https://docs.spring.io/spring-boot/docs/${bootVersion}/api/",
"https://docs.spring.io/spring-framework/docs/5.3.x/javadoc-api/"
] as String[]
/**
* Produce Javadoc for all Spring for GraphQL modules in "build/docs/javadoc"
*/
task api(type: Javadoc) {
group = "Documentation"
description = "Generates aggregated Javadoc API documentation."
title = "${rootProject.description} ${version} API"
dependsOn {
moduleProjects.collect {
it.tasks.getByName("jar")
}
}
options {
encoding = "UTF-8"
memberLevel = JavadocMemberLevel.PROTECTED
author = true
header = rootProject.description
use = true
splitIndex = true
links(project.ext.javadocLinks)
addStringOption('Xdoclint:none', '-quiet')
}
source = moduleProjects.collect { project ->
project.sourceSets.main.allJava
}
classpath = moduleProjects.collect { project ->
project.sourceSets.main.compileClasspath
}.sum()
maxMemory = "1024m"
destinationDir = file("$buildDir/docs/javadoc")
}
/**
* Generate the Spring for GraphQL Reference documentation from "src/docs/asciidoc"
* in "build/docs/reference/html".
*/
asciidoctor {
configurations 'asciidoctorExtensions'
baseDirFollowsSourceDir()
sources {
include '*.adoc'
}
logDocuments = true
outputOptions {
backends "spring-html"
}
outputDir "$buildDir/docs/reference/html"
attributes 'spring-graphql-version': project.version,
'spring-boot-version': bootVersion
}
/**
* Zip all docs into a single archive
*/
task docsZip(type: Zip, dependsOn: ['api', 'asciidoctor']) {
group = "Distribution"
description = "Builds -${archiveClassifier} archive containing api and reference " +
"for deployment at https://docs.spring.io/spring-graphql/docs."
from (api) {
into "api"
}
from ("$asciidoctor.outputDir") {
into "reference/html"
}
}
apply from: "${rootDir}/gradle/publishing.gradle"
publishing {
publications {
mavenJava(MavenPublication) {
artifact docsZip
}
}
}