1
1
plugins {
2
- id " io.github.rwinch. antora" version " 0.0.2 "
3
- id " org.springframework.antora.check-version"
2
+ id ' org. antora' version ' 1. 0.0-alpha.3 '
3
+ id ' org.springframework.antora.check-version'
4
4
}
5
5
6
6
apply plugin : ' io.spring.convention.docs'
7
7
apply plugin : ' java'
8
8
9
- node {
10
- version = " 16.17.0"
11
- }
12
-
13
9
antora {
14
- antoraVersion = " 3.1.0"
15
- playbookFile = file(" local-antora-playbook.yml" )
16
- arguments = [" --clean" , " --stacktrace" ]
17
- }
18
-
19
- tasks. antora {
20
- dependsOn " generateAntora"
10
+ version = ' ~3.1'
11
+ playbook = file(' local-antora-playbook.yml' )
12
+ options = [' --clean' , ' --stacktrace' ]
21
13
environment = [
22
- " ALGOLIA_API_KEY" : " 82c7ead946afbac3cf98c32446154691" ,
23
- " ALGOLIA_APP_ID" : " 244V8V9FGG" ,
24
- " ALGOLIA_INDEX_NAME" : " security-docs"
14
+ ' ALGOLIA_API_KEY' : ' 82c7ead946afbac3cf98c32446154691' ,
15
+ ' ALGOLIA_APP_ID' : ' 244V8V9FGG' ,
16
+ ' ALGOLIA_INDEX_NAME' : ' security-docs'
25
17
]
26
18
}
27
19
28
- tasks. register(" generateAntora" ) {
29
- group = " Documentation"
30
- description = " Generates the antora.yml for dynamic properties"
20
+ tasks. antora. dependsOn ' generateAntora'
21
+
22
+ tasks. register(' generateAntora' ) {
23
+ group = ' Documentation'
24
+ description = ' Generates the antora.yml for dynamic properties'
31
25
doLast {
32
26
def docsTag = snapshotBuild ? ' current' : project. version
33
27
def ghTag = snapshotBuild ? ' main' : project. version
34
28
def ghUrl = " https://github.com/spring-projects/spring-security/tree/$ghTag "
35
- def ghOldSamplesUrl = " https://github.com/spring-projects/spring-security/tree/5.4.x/samples"
29
+ def ghOldSamplesUrl = ' https://github.com/spring-projects/spring-security/tree/5.4.x/samples'
36
30
def ghSamplesUrl = " https://github.com/spring-projects/spring-security-samples/tree/$samplesBranch "
37
31
def securityDocsUrl = " https://docs.spring.io/spring-security/site/docs/$docsTag "
38
32
def securityApiUrl = " $securityDocsUrl /api/"
39
33
def securityReferenceUrl = " $securityDocsUrl /reference/html5/"
40
34
def springFrameworkApiUrl = " https://docs.spring.io/spring-framework/docs/$springFrameworkVersion /javadoc-api/"
41
35
def springFrameworkReferenceUrl = " https://docs.spring.io/spring-framework/docs/$springFrameworkVersion /reference/html/"
42
36
def versions = resolvedVersions(project. configurations. testRuntimeClasspath)
43
- def ymlVersions = " "
37
+ def ymlVersions = ' '
44
38
versions. call(). each { name , version ->
45
39
ymlVersions + = """
46
40
${ name} : ${ version} """
47
41
}
48
- def outputFile = new File ( " $b uildDir / generateAntora/antora.yml" )
42
+ def outputFile = layout . buildDirectory . file( ' generateAntora/antora.yml' ) . orNull . asFile
49
43
outputFile. getParentFile(). mkdirs()
50
44
outputFile. createNewFile()
51
- def antoraYmlText = file(" antora.yml" ) . getText ()
45
+ def antoraYmlText = file(' antora.yml' ) . text . trim ()
52
46
outputFile. setText(""" $antoraYmlText
53
47
title: Spring Security
54
48
start_page: ROOT:index.adoc
@@ -71,23 +65,23 @@ ${ymlVersions}
71
65
}
72
66
73
67
dependencies {
74
- testImplementation platform(project(" :spring-security-dependencies" ))
75
- testImplementation " com.unboundid:unboundid-ldapsdk"
76
- testImplementation " org.apache.directory.server:apacheds-core"
77
- testImplementation " org.springframework:spring-core"
68
+ testImplementation platform(project(' :spring-security-dependencies' ))
69
+ testImplementation ' com.unboundid:unboundid-ldapsdk'
70
+ testImplementation ' org.apache.directory.server:apacheds-core'
71
+ testImplementation ' org.springframework:spring-core'
78
72
}
79
73
80
74
def resolvedVersions (Configuration configuration ) {
81
75
return {
82
76
configuration. resolvedConfiguration
83
77
.resolvedArtifacts
84
- .collectEntries { [(it. name + " -version" ): it. moduleVersion. id. version] }
78
+ .collectEntries { [(it. name + ' -version' ): it. moduleVersion. id. version] }
85
79
}
86
80
}
87
81
88
82
repositories {
89
83
mavenCentral()
90
- maven { url " https://repo.spring.io/release" }
91
- maven { url " https://repo.spring.io/milestone" }
92
- maven { url " https://repo.spring.io/snapshot" }
84
+ maven { url ' https://repo.spring.io/release' }
85
+ maven { url ' https://repo.spring.io/milestone' }
86
+ maven { url ' https://repo.spring.io/snapshot' }
93
87
}
0 commit comments