-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Expand file tree
/
Copy pathspring-session-docs.gradle
More file actions
94 lines (82 loc) · 3.38 KB
/
spring-session-docs.gradle
File metadata and controls
94 lines (82 loc) · 3.38 KB
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
plugins {
id 'org.antora' version '1.0.0'
id 'io.spring.antora.generate-antora-yml' version '0.0.1'
}
apply plugin: 'io.spring.convention.docs'
apply plugin: 'io.spring.convention.spring-test'
dependencies {
management platform(project(":spring-session-dependencies"))
testImplementation 'io.lettuce:lettuce-core'
testImplementation 'jakarta.servlet:jakarta.servlet-api'
testImplementation 'org.assertj:assertj-core'
testImplementation 'org.junit.jupiter:junit-jupiter-api'
testImplementation 'org.mockito:mockito-core'
testImplementation 'org.mockito:mockito-junit-jupiter'
testImplementation 'org.springframework.security:spring-security-config'
testImplementation 'org.springframework.security:spring-security-test'
testImplementation 'org.springframework.security:spring-security-web'
testImplementation 'org.springframework:spring-jdbc'
testImplementation 'org.springframework:spring-messaging'
testImplementation 'org.springframework:spring-test'
testImplementation 'org.springframework:spring-webmvc'
testImplementation 'org.springframework:spring-websocket'
testImplementation project(':spring-session-core')
testImplementation project(':spring-session-data-redis')
testImplementation project(':spring-session-jdbc')
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine'
testRuntimeOnly 'org.junit.platform:junit-platform-launcher'
}
antora {
options = [clean: true, fetch: !project.gradle.startParameter.offline, stacktrace: true]
environment = [
'BUILD_REFNAME': 'HEAD',
'BUILD_VERSION': project.version,
]
}
tasks.register("syncAntoraAttachments", Sync) {
group = 'Documentation'
description = 'Syncs the Antora attachments'
from project.provider( { project.tasks.api.outputs } )
into project.layout.buildDirectory.dir('generated-antora-resources/modules/ROOT/assets/attachments/api/java')
}
tasks.named("generateAntoraYml") {
asciidocAttributes = project.provider( { generateAttributes() } )
asciidocAttributes.putAll(providers.provider( { resolvedVersions(project.configurations.testRuntimeClasspath) }))
}
tasks.register("generateAntoraResources") {
dependsOn 'generateAntoraYml', 'syncAntoraAttachments'
}
def generateAttributes() {
def ghTag = snapshotBuild ? 'main' : project.version
def docsUrl = 'https://docs.spring.io'
def springBootRefDocs = "${docsUrl}/spring-boot/reference"
def springSecurityRefDocs = "${docsUrl}/spring-security/reference"
def springFrameworkRefDocs = "${docsUrl}/spring-framework/reference"
return ['gh-tag':ghTag,
'spring-boot-ref-docs': springBootRefDocs.toString(),
'spring-session-version': project.version,
'spring-security-ref-docs': springSecurityRefDocs.toString(),
'spring-framework-ref-docs': springFrameworkRefDocs.toString(),
'docs-url': docsUrl]
}
sourceSets {
test {
java {
srcDirs = ['modules/ROOT/examples/java']
}
resources {
srcDirs = ['modules/ROOT/examples/resources']
}
}
}
repositories {
mavenCentral()
maven { url 'https://repo.spring.io/release' }
maven { url 'https://repo.spring.io/milestone' }
maven { url 'https://repo.spring.io/snapshot' }
}
def resolvedVersions(Configuration configuration) {
return configuration.resolvedConfiguration
.resolvedArtifacts
.collectEntries { [(it.name + "-version"): it.moduleVersion.id.version] }
}