Skip to content

Commit 345b841

Browse files
committed
Merge branch '7.0.x' into docs/spring-configuration-metadata
Reconcile configuration metadata reference with the docs unification on 7.0.x. The asciidoctor build moved from per-plugin docs subprojects to a central :docs project, so configurationProperties generation lives in :core-docs while the combined index.adoc and :docs:asciidoctor depend on the generated file. Assisted-by: claude-code:claude-opus-4-7
2 parents 5fab3c6 + 5719267 commit 345b841

149 files changed

Lines changed: 1657 additions & 812 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/gradle.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ jobs:
4040
java-version: 17
4141
distribution: liberica
4242
- name: "🐘 Setup Gradle"
43-
uses: gradle/actions/setup-gradle@v4
43+
uses: gradle/actions/setup-gradle@0723195856401067f7a2779048b490ace7a47d7c # v5.0.2
4444
with:
4545
develocity-access-key: ${{ secrets.GRAILS_DEVELOCITY_ACCESS_KEY }}
4646
- name: "🏃‍♂️ Run Tests"
@@ -67,7 +67,7 @@ jobs:
6767
java-version: 17
6868
distribution: liberica
6969
- name: "🐘 Setup Gradle"
70-
uses: gradle/actions/setup-gradle@v4
70+
uses: gradle/actions/setup-gradle@0723195856401067f7a2779048b490ace7a47d7c # v5.0.2
7171
with:
7272
develocity-access-key: ${{ secrets.GRAILS_DEVELOCITY_ACCESS_KEY }}
7373
- name: "🏃‍♂️ Run Different Config Functional Tests"
@@ -93,7 +93,7 @@ jobs:
9393
java-version: 17
9494
distribution: liberica
9595
- name: "🐘 Setup Gradle"
96-
uses: gradle/actions/setup-gradle@v4
96+
uses: gradle/actions/setup-gradle@0723195856401067f7a2779048b490ace7a47d7c # v5.0.2
9797
with:
9898
develocity-access-key: ${{ secrets.GRAILS_DEVELOCITY_ACCESS_KEY }}
9999
- name: "📤 Publish Snapshot artifacts"

.github/workflows/rat.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,9 @@ jobs:
3838
distribution: liberica
3939
java-version: 17
4040
- name: "🐘 Setup Gradle"
41-
uses: gradle/actions/setup-gradle@v4
41+
uses: gradle/actions/setup-gradle@0723195856401067f7a2779048b490ace7a47d7c # v5.0.2
4242
with:
43-
develocity-access-key: ${{ secrets.GRAILS_DEVELOCITY_ACCESS_KEY }}
43+
develocity-access-key: ${{ secrets.GRAILS_DEVELOCITY_ACCESS_KEY }}
4444
- name: "🧐 Apache License - Release Audit Tool"
4545
run: ./gradlew rat
4646
- name: Upload RAT HTML report

.github/workflows/release-notes.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,6 @@ jobs:
3939
runs-on: ubuntu-latest
4040
steps:
4141
- name: "📝 Update Release Draft"
42-
uses: release-drafter/release-drafter@v6
42+
uses: release-drafter/release-drafter@6a93d829887aa2e0748befe2e808c66c0ec6e4c7 # v6.4.0
4343
env:
4444
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/release.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ jobs:
7171
distribution: ${{ env.JAVA_DISTRIBUTION }}
7272
java-version: ${{ env.JAVA_VERSION }}
7373
- name: "🐘 Setup Gradle"
74-
uses: gradle/actions/setup-gradle@v5
74+
uses: gradle/actions/setup-gradle@0723195856401067f7a2779048b490ace7a47d7c # v5.0.2
7575
with:
7676
develocity-access-key: ${{ secrets.GRAILS_DEVELOCITY_ACCESS_KEY }}
7777
- name: "⚙️ Run pre-release"
@@ -116,7 +116,7 @@ jobs:
116116
- name: "📅 Generate build date file"
117117
run: echo "$SOURCE_DATE_EPOCH" >> build/BUILD_DATE.txt
118118
- name: "📤 Upload build date, checksums and published artifacts files"
119-
uses: softprops/action-gh-release@v2
119+
uses: softprops/action-gh-release@153bb8e04406b158c6c84fc1615b65b24149a1fe # v2.6.1
120120
with:
121121
tag_name: ${{ env.TAG }}
122122
files: |
@@ -202,7 +202,7 @@ jobs:
202202
> "apache-${REPO_NAME}-${VERSION}-src.zip.sha512"
203203
cat "./apache-${REPO_NAME}-${VERSION}-src.zip.sha512"
204204
- name: "🚀 Upload ZIP and Signature to GitHub Release"
205-
uses: softprops/action-gh-release@v2
205+
uses: softprops/action-gh-release@153bb8e04406b158c6c84fc1615b65b24149a1fe # v2.6.1
206206
with:
207207
tag_name: ${{ env.TAG }}
208208
files: |
@@ -310,7 +310,7 @@ jobs:
310310
cd dev-repo
311311
svn info "$VERSION" > "DIST_SVN_REVISION.txt"
312312
- name: "📤 Upload the Distribution SVN revision file"
313-
uses: softprops/action-gh-release@v2
313+
uses: softprops/action-gh-release@153bb8e04406b158c6c84fc1615b65b24149a1fe # v2.6.1
314314
with:
315315
tag_name: ${{ env.TAG }}
316316
files: dev-repo/DIST_SVN_REVISION.txt
@@ -431,7 +431,7 @@ jobs:
431431
distribution: ${{ env.JAVA_DISTRIBUTION }}
432432
java-version: ${{ env.JAVA_VERSION }}
433433
- name: "🐘 Setup Gradle"
434-
uses: gradle/actions/setup-gradle@v5
434+
uses: gradle/actions/setup-gradle@0723195856401067f7a2779048b490ace7a47d7c # v5.0.2
435435
with:
436436
develocity-access-key: ${{ secrets.GRAILS_DEVELOCITY_ACCESS_KEY }}
437437
- name: "🔨 Build Documentation"
@@ -466,7 +466,7 @@ jobs:
466466
distribution: ${{ env.JAVA_DISTRIBUTION }}
467467
java-version: ${{ env.JAVA_VERSION }}
468468
- name: "🐘 Setup Gradle"
469-
uses: gradle/actions/setup-gradle@v5
469+
uses: gradle/actions/setup-gradle@0723195856401067f7a2779048b490ace7a47d7c # v5.0.2
470470
with:
471471
develocity-access-key: ${{ secrets.GRAILS_DEVELOCITY_ACCESS_KEY }}
472472
- name: "⚙️ Run post-release"

docs/build.gradle

Lines changed: 214 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,214 @@
1+
/*
2+
* Licensed to the Apache Software Foundation (ASF) under one
3+
* or more contributor license agreements. See the NOTICE file
4+
* distributed with this work for additional information
5+
* regarding copyright ownership. The ASF licenses this file
6+
* to you under the Apache License, Version 2.0 (the
7+
* "License"); you may not use this file except in compliance
8+
* with the License. You may obtain a copy of the License at
9+
*
10+
* https://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing,
13+
* software distributed under the License is distributed on an
14+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
* KIND, either express or implied. See the License for the
16+
* specific language governing permissions and limitations
17+
* under the License.
18+
*/
19+
20+
import grails.doc.dropdown.SoftwareVersion
21+
import grails.doc.git.FetchTagsTask
22+
import grails.doc.dropdown.CreateReleaseDropDownTask
23+
import org.asciidoctor.gradle.jvm.AsciidoctorTask
24+
25+
plugins {
26+
id 'groovy'
27+
}
28+
29+
apply plugin: 'org.asciidoctor.jvm.convert'
30+
apply from: rootProject.layout.projectDirectory.file('gradle/reproducible-config.gradle')
31+
32+
// Spring Security + GORM are resolved from the BOM for LDAP doc link generation.
33+
dependencies {
34+
implementation platform("org.apache.grails:grails-bom:$grailsVersion")
35+
implementation 'org.springframework.security:spring-security-core'
36+
implementation 'org.apache.grails.data:grails-datamapping-core'
37+
implementation 'org.apache.groovy:groovy'
38+
}
39+
40+
String getGrailsDocumentationVersion(String version) {
41+
if (version.endsWith('-SNAPSHOT')) {
42+
return 'snapshot'
43+
}
44+
return version
45+
}
46+
47+
// NOTE: This resolves dependencies at configuration time, which means any Gradle command
48+
// at the root level will trigger resolution for this project. Ideally this would be deferred
49+
// to task execution time, but the Asciidoctor plugin requires attributes at configuration time.
50+
ext {
51+
resolvedSpringSecurityVersion = configurations.compileClasspath
52+
.resolvedConfiguration
53+
.resolvedArtifacts
54+
.find {
55+
it.moduleVersion.id.group == 'org.springframework.security' &&
56+
it.moduleVersion.id.name == 'spring-security-core'
57+
}.moduleVersion.id.version
58+
resolvedGormVersion = configurations.compileClasspath
59+
.resolvedConfiguration
60+
.resolvedArtifacts
61+
.find {
62+
it.moduleVersion.id.group == 'org.apache.grails.data' &&
63+
it.moduleVersion.id.name == 'grails-datamapping-core'
64+
}.moduleVersion.id.version
65+
}
66+
logger.lifecycle('Resolved Spring Security version for Guide links: {}', resolvedSpringSecurityVersion)
67+
logger.lifecycle('Resolved GORM version for Guide links: {}', resolvedGormVersion)
68+
69+
ext {
70+
coreDocsDir = rootProject.layout.projectDirectory.dir('plugin-core/docs/src/docs')
71+
aclDocsDir = rootProject.layout.projectDirectory.dir('plugin-acl/docs/src/docs')
72+
casDocsDir = rootProject.layout.projectDirectory.dir('plugin-cas/docs/src/docs')
73+
ldapDocsDir = rootProject.layout.projectDirectory.dir('plugin-ldap/docs/src/docs')
74+
oauth2DocsDir = rootProject.layout.projectDirectory.dir('plugin-oauth2/docs/src/docs')
75+
restDocsDir = rootProject.layout.projectDirectory.dir('plugin-rest/docs/src/docs')
76+
uiDocsDir = rootProject.layout.projectDirectory.dir('plugin-ui/docs/src/docs')
77+
78+
combinedAttributes = [
79+
copyright : 'Apache License, Version 2.0',
80+
docinfo1 : 'true',
81+
doctype : 'book',
82+
encoding : 'utf-8',
83+
icons : 'font',
84+
id : "grails-spring-security-combined:${projectVersion}",
85+
idprefix : '',
86+
idseparator : '-',
87+
lang : 'en',
88+
linkattrs : true,
89+
numbered : '',
90+
producer : 'Asciidoctor',
91+
revnumber : projectVersion,
92+
projectVersion : projectVersion,
93+
version : projectVersion,
94+
setanchors : true,
95+
'source-highlighter' : 'prettify',
96+
toc : 'left',
97+
toc2 : '',
98+
toclevels : '3',
99+
'experimental' : 'true',
100+
'compat-mode' : '',
101+
'threeZeroXProjectVersion' : '3.0.1',
102+
// Cross-project include directories
103+
'core-docs-dir' : coreDocsDir.asFile.absolutePath,
104+
'acl-docs-dir' : aclDocsDir.asFile.absolutePath,
105+
'cas-docs-dir' : casDocsDir.asFile.absolutePath,
106+
'ldap-docs-dir' : ldapDocsDir.asFile.absolutePath,
107+
'oauth2-docs-dir' : oauth2DocsDir.asFile.absolutePath,
108+
'rest-docs-dir' : restDocsDir.asFile.absolutePath,
109+
'ui-docs-dir' : uiDocsDir.asFile.absolutePath,
110+
// REST-specific
111+
'sourcedir' : "${rootProject.findProject(':spring-security-rest').projectDir}/src/main/groovy",
112+
'baseGroovyApiUrl' : "https://apache.github.io/grails-spring-security/${projectVersion}/rest-plugin/groovydoc/",
113+
// LDAP-specific
114+
'customUserDetailsContextMapperPath': "${rootProject.findProject(':ldap-examples-custom-user-details-context-mapper').projectDir}",
115+
'functionalTestAppPath' : "${rootProject.findProject(':ldap-examples-functional-test-app').projectDir}",
116+
'projectUrl' : 'https://github.com/apache/grails-spring-security',
117+
'gormDetailedLink' : "https://gorm.grails.org/${getGrailsDocumentationVersion(resolvedGormVersion)}/hibernate/manual/index.html",
118+
'gormSummaryLink' : "https://docs.grails.org/${getGrailsDocumentationVersion(grailsVersion)}/guide/GORM.html",
119+
'grailsDocBase' : "https://docs.grails.org/${getGrailsDocumentationVersion(grailsVersion)}",
120+
'grailsSpringSecurityCoreVersion' : projectVersion,
121+
'grailsSpringSecurityCoreLink' : "https://apache.github.io/grails-spring-security/${getGrailsDocumentationVersion(projectVersion)}/guide/index.html",
122+
'springSecurityLdapLink' : "https://docs.spring.io/spring-security/reference/${resolvedSpringSecurityVersion}/servlet/authentication/passwords/ldap.html",
123+
'springSecurityLdapApiLink' : "https://docs.spring.io/spring-security/site/docs/${resolvedSpringSecurityVersion}/api",
124+
// Used by index.adoc header links
125+
'springSecurityVersion' : resolvedSpringSecurityVersion,
126+
'springFrameworkVersion' : '6.2.x',
127+
]
128+
}
129+
130+
tasks.named('asciidoctor', AsciidoctorTask) {
131+
dependsOn(':core-docs:generateConfigurationProperties')
132+
sourceDir(layout.projectDirectory.file('src/docs'))
133+
sources { include('index.adoc') }
134+
outputDir = layout.buildDirectory.file('docs')
135+
attributes(combinedAttributes)
136+
baseDirFollowsSourceDir()
137+
jvm {
138+
jvmArgs('--add-opens', 'java.base/sun.nio.ch=ALL-UNNAMED', '--add-opens', 'java.base/java.io=ALL-UNNAMED')
139+
}
140+
// Declare inputs for all plugin doc sources so Gradle knows to rebuild when they change
141+
inputs.dir(coreDocsDir)
142+
inputs.dir(aclDocsDir)
143+
inputs.dir(casDocsDir)
144+
inputs.dir(ldapDocsDir)
145+
inputs.dir(oauth2DocsDir)
146+
inputs.dir(restDocsDir)
147+
inputs.dir(uiDocsDir)
148+
inputs.dir(sourceDir)
149+
outputs.dir(outputDir)
150+
}
151+
152+
def guideDocs = tasks.register('guideDocs', Copy) {
153+
group = 'documentation'
154+
dependsOn('asciidoctor')
155+
duplicatesStrategy = DuplicatesStrategy.INCLUDE
156+
into(layout.buildDirectory.dir('docs'))
157+
['plugin-core', 'plugin-acl', 'plugin-cas', 'plugin-ldap', 'plugin-oauth2', 'plugin-rest', 'plugin-ui'].each { pluginDir ->
158+
from(rootProject.layout.projectDirectory.dir(pluginDir).dir("docs/src/docs")) {
159+
include('**/*.png', '**/*.jpg', '**/*.gif', '**/*.svg')
160+
}
161+
}
162+
from(layout.projectDirectory.dir('src/docs')) {
163+
include('**/*.png', '**/*.jpg', '**/*.gif', '**/*.svg')
164+
}
165+
}
166+
167+
def fetchTagsTask = tasks.register('fetchTags', FetchTagsTask)
168+
169+
def createReleaseDropdown = tasks.register('createReleaseDropdown', CreateReleaseDropDownTask) {
170+
filesToAddDropdowns = layout.buildDirectory.files('docs-modified/index.html')
171+
sourceDocsDirectory = layout.buildDirectory.dir('docs')
172+
modifiedPagesDirectory = layout.buildDirectory.dir('docs-modified')
173+
githubSlug = 'apache/grails-spring-security'
174+
docBaseUrl = "https://apache.github.io/grails-spring-security"
175+
versionHtml = '<span id="revnumber">version ' + project.version + '</span>'
176+
additionalPath = "guide/"
177+
minimumVersion = SoftwareVersion.build('7.0.0-SNAPSHOT')
178+
dependsOn(fetchTagsTask)
179+
dependsOn(guideDocs)
180+
}
181+
182+
tasks.register('copyGuide', Copy) {
183+
dependsOn(createReleaseDropdown)
184+
from(layout.buildDirectory.dir('docs-modified'))
185+
into(rootProject.layout.buildDirectory.dir('docs/guide'))
186+
}
187+
188+
tasks.register('copyGhPages', Copy) {
189+
group = 'documentation'
190+
description = 'Copy the landing page to the root docs directory'
191+
from(project.layout.projectDirectory.dir('src/docs')) {
192+
include 'index.tmpl'
193+
rename('index.tmpl', 'ghpages.html')
194+
}
195+
into(rootProject.layout.buildDirectory.dir('docs'))
196+
}
197+
198+
tasks.register('aggregateDocs') {
199+
group = 'documentation'
200+
description = 'Aggregate all documentation into the root docs directory'
201+
// Combined guide
202+
dependsOn('copyGuide')
203+
// Groovydocs from each plugin's docs subproject
204+
dependsOn(':core-docs:groovydoc')
205+
dependsOn(':acl-docs:groovydoc')
206+
dependsOn(':cas-docs:groovydoc')
207+
dependsOn(':ldap-docs:groovydoc')
208+
dependsOn(':oauth2-docs:groovydoc')
209+
dependsOn(':rest-docs:groovydoc')
210+
dependsOn(':ui-docs:groovydoc')
211+
212+
// Landing page
213+
dependsOn('copyGhPages')
214+
}

0 commit comments

Comments
 (0)