mirror of
				https://github.com/spring-projects/spring-security.git
				synced 2025-10-31 06:38:42 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			67 lines
		
	
	
		
			2.9 KiB
		
	
	
	
		
			Groovy
		
	
	
	
	
	
			
		
		
	
	
			67 lines
		
	
	
		
			2.9 KiB
		
	
	
	
		
			Groovy
		
	
	
	
	
	
| plugins {
 | |
| 	id 'org.antora' version '1.0.0'
 | |
| 	id 'io.spring.antora.generate-antora-yml' version '0.0.1'
 | |
| 	id 'io.spring.convention.repository'
 | |
| }
 | |
| 
 | |
| apply plugin: 'io.spring.convention.docs'
 | |
| apply plugin: 'java'
 | |
| 
 | |
| 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( { generateAttributes() } )
 | |
| 	asciidocAttributes.putAll(providers.provider( { resolvedVersions(project.configurations.testRuntimeClasspath) }))
 | |
| }
 | |
| 
 | |
| dependencies {
 | |
| 	testImplementation platform(project(':spring-security-dependencies'))
 | |
| 	testImplementation 'com.unboundid:unboundid-ldapsdk'
 | |
| 	testImplementation 'org.apache.directory.server:apacheds-core'
 | |
| 	testImplementation 'org.springframework:spring-core'
 | |
| }
 | |
| 
 | |
| def generateAttributes() {
 | |
| 	def springFrameworkVersion = libs.org.springframework.spring.framework.bom.get().versionConstraint.displayName
 | |
| 	springFrameworkVersion = springFrameworkVersion.contains("-")
 | |
| 			? springFrameworkVersion.substring(0, springFrameworkVersion.indexOf("-"))
 | |
| 			: springFrameworkVersion
 | |
| 	def springBootVersion = project.property("springBootVersion")
 | |
| 	def samplesBranch = project.property("samplesBranch")
 | |
| 
 | |
| 	def docsTag = snapshotBuild ? 'current' : project.version
 | |
| 	def ghTag = snapshotBuild ? 'main' : project.version
 | |
| 	def ghUrl = "https://github.com/spring-projects/spring-security/tree/$ghTag"
 | |
| 	def ghOldSamplesUrl = 'https://github.com/spring-projects/spring-security/tree/5.4.x/samples'
 | |
| 	def ghSamplesUrl = "https://github.com/spring-projects/spring-security-samples/tree/$samplesBranch"
 | |
| 	def securityDocsUrl = "https://docs.spring.io/spring-security/site/docs/$docsTag"
 | |
| 	def securityApiUrl = "$securityDocsUrl/api/"
 | |
| 	def securityReferenceUrl = "$securityDocsUrl/reference/html5/"
 | |
| 	def springFrameworkApiUrl = "https://docs.spring.io/spring-framework/docs/$springFrameworkVersion/javadoc-api/"
 | |
| 	def springFrameworkReferenceUrl = "https://docs.spring.io/spring-framework/docs/$springFrameworkVersion/reference/html/"
 | |
| 	def springBootReferenceUrl = "https://docs.spring.io/spring-boot/docs/$springBootVersion/reference/html/"
 | |
| 
 | |
| 	return	['gh-old-samples-url': ghOldSamplesUrl.toString(),
 | |
| 		'gh-samples-url': ghSamplesUrl.toString(),
 | |
| 		'gh-url': ghUrl.toString(),
 | |
| 		'security-api-url': securityApiUrl.toString(),
 | |
| 		'security-reference-url': securityReferenceUrl.toString(),
 | |
| 		'spring-framework-api-url': springFrameworkApiUrl.toString(),
 | |
| 		'spring-framework-reference-url': springFrameworkReferenceUrl.toString(),
 | |
| 		'spring-boot-reference-url': springBootReferenceUrl.toString(),
 | |
| 		'spring-security-version': project.version]
 | |
| 		+ resolvedVersions(project.configurations.testRuntimeClasspath)
 | |
| }
 | |
| 
 | |
| def resolvedVersions(Configuration configuration) {
 | |
| 	return configuration.resolvedConfiguration
 | |
| 				.resolvedArtifacts
 | |
| 				.collectEntries { [(it.name + '-version'): it.moduleVersion.id.version] }
 | |
| }
 |