129 lines
3.3 KiB
Groovy
129 lines
3.3 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')
|
|
api 'org.springframework:spring-webflux'
|
|
api 'org.springframework:spring-webmvc'
|
|
api 'org.springframework:spring-websocket'
|
|
api 'org.springframework:spring-messaging'
|
|
api 'org.springframework.data:spring-data-commons'
|
|
api 'com.querydsl:querydsl-core'
|
|
api "org.springframework.boot:spring-boot-starter-graphql:${springBootVersion}"
|
|
}
|
|
|
|
jar {
|
|
enabled = false
|
|
}
|
|
|
|
javadoc {
|
|
enabled = false
|
|
}
|
|
|
|
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/${springBootVersion}/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")
|
|
}
|
|
|
|
antora {
|
|
version = '3.2.0-alpha.2'
|
|
options = [clean: true, fetch: !project.gradle.startParameter.offline, stacktrace: true]
|
|
environment = [
|
|
'ALGOLIA_API_KEY': '9d489079e5ec46dbb238909fee5c9c29',
|
|
'ALGOLIA_APP_ID': 'WB1FQYI187',
|
|
'ALGOLIA_INDEX_NAME': 'springsecurity',
|
|
]
|
|
dependencies = [
|
|
'@antora/atlas-extension': '1.0.0-alpha.1',
|
|
'@antora/collector-extension': '1.0.0-alpha.3',
|
|
'@asciidoctor/tabs': '1.0.0-beta.3',
|
|
'@springio/antora-extensions': '1.4.2',
|
|
'@springio/asciidoctor-extensions': '1.0.0-alpha.8',
|
|
'@opendevise/antora-release-line-extension': '1.0.0',
|
|
]
|
|
}
|
|
|
|
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
|
|
}
|
|
}
|
|
}
|
|
|
|
|