Prior to this commit, the "client" and "testing" sections of the reference documentation were using inline code snippets. Because of this, several snippets were out of date or invalid. This commit moves all those code snippets to actual Java classes compiled with the documentation. Fixes gh-1042
119 lines
2.9 KiB
Groovy
119 lines
2.9 KiB
Groovy
plugins {
|
|
id 'java-library'
|
|
id 'org.antora' version '1.0.0'
|
|
id 'io.spring.antora.generate-antora-yml' version '0.0.1'
|
|
}
|
|
|
|
description = "Spring for GraphQL reference documentation"
|
|
|
|
configurations {
|
|
dependencyManagement {
|
|
canBeConsumed = false
|
|
canBeResolved = false
|
|
visible = false
|
|
}
|
|
matching { it.name.endsWith("Classpath") }.all { it.extendsFrom(dependencyManagement) }
|
|
}
|
|
|
|
dependencies {
|
|
dependencyManagement(enforcedPlatform(dependencies.project(path: ":platform")))
|
|
api project(':spring-graphql')
|
|
api project(':spring-graphql-test')
|
|
implementation 'org.springframework:spring-webflux'
|
|
implementation 'org.springframework:spring-webmvc'
|
|
implementation 'org.springframework:spring-websocket'
|
|
implementation 'org.springframework:spring-messaging'
|
|
implementation 'org.springframework.data:spring-data-commons'
|
|
implementation 'com.querydsl:querydsl-core'
|
|
implementation "org.springframework.boot:spring-boot-starter-graphql:${springBootVersion}"
|
|
implementation "org.springframework.boot:spring-boot-starter-web:${springBootVersion}"
|
|
implementation 'io.rsocket:rsocket-core'
|
|
implementation 'io.rsocket:rsocket-transport-netty'
|
|
implementation 'io.projectreactor:reactor-test'
|
|
implementation 'org.assertj:assertj-core'
|
|
}
|
|
|
|
jar {
|
|
enabled = false
|
|
}
|
|
|
|
javadoc {
|
|
enabled = false
|
|
}
|
|
|
|
|
|
/**
|
|
* 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")
|
|
}
|
|
|
|
|
|
antora {
|
|
options = [clean: true, fetch: !project.gradle.startParameter.offline, stacktrace: true]
|
|
environment = [
|
|
'BUILD_REFNAME': 'HEAD',
|
|
'BUILD_VERSION': project.version,
|
|
]
|
|
}
|
|
|
|
tasks.named("generateAntoraYml") {
|
|
asciidocAttributes = project.provider( { ['spring-graphql-version': project.version,
|
|
'spring-boot-version': springBootVersion,
|
|
'spring-framework-version': springFrameworkVersion] } )
|
|
}
|
|
|
|
tasks.named("antora") {
|
|
mustRunAfter "check"
|
|
}
|
|
|
|
/**
|
|
* Zip all docs into a single archive
|
|
*/
|
|
task docsZip(type: Zip, dependsOn: ['api']) {
|
|
group = "Distribution"
|
|
description = "Builds -${archiveClassifier} archive containing api and reference " +
|
|
"for deployment at https://docs.spring.io/spring-graphql/docs."
|
|
from (api) {
|
|
into "api"
|
|
}
|
|
}
|
|
|
|
publishing {
|
|
publications {
|
|
mavenJava(MavenPublication) {
|
|
artifact docsZip
|
|
}
|
|
}
|
|
}
|
|
|
|
|