Polish SAML 2.0 Artifacts

- Produce sources jar
- Produce Javadoc jar

Issue gh-9095
This commit is contained in:
Josh Cummings 2021-04-06 17:10:53 -06:00
parent ba5de76fb3
commit 951202e797
No known key found for this signature in database
GPG Key ID: 49EF60DD7FF83443
4 changed files with 102 additions and 28 deletions

View File

@ -8,6 +8,7 @@ buildscript {
}
plugins {
id 'java'
id 'java-library'
id 'io.spring.convention.repository'
id 'io.spring.convention.management-configuration'
@ -23,10 +24,22 @@ configurations {
canBeConsumed = true
canBeResolved = false
}
sourceElements {
canBeConsumed = true
canBeResolved = false
}
javadocElements {
canBeConsumed = true
canBeResolved = false
}
}
artifacts {
classesOnlyElements(compileJava.destinationDir)
sourceSets.main.allSource.srcDirs.forEach({ dir ->
sourceElements(dir)
})
javadocElements(javadoc.destinationDir)
}
repositories {

View File

@ -8,6 +8,7 @@ buildscript {
}
plugins {
id 'java'
id 'java-library'
id 'io.spring.convention.repository'
id 'io.spring.convention.management-configuration'
@ -23,10 +24,22 @@ configurations {
canBeConsumed = true
canBeResolved = false
}
sourceElements {
canBeConsumed = true
canBeResolved = false
}
javadocElements {
canBeConsumed = true
canBeResolved = false
}
}
artifacts {
classesOnlyElements(compileJava.destinationDir)
sourceSets.main.allSource.srcDirs.forEach({ dir ->
sourceElements(dir)
})
javadocElements(javadoc.destinationDir)
}
repositories {

View File

@ -8,6 +8,7 @@ buildscript {
}
plugins {
id 'java'
id 'java-library'
id 'io.spring.convention.repository'
id 'io.spring.convention.management-configuration'
@ -26,10 +27,22 @@ configurations {
attribute(TargetJvmVersion.TARGET_JVM_VERSION_ATTRIBUTE, 11)
}
}
sourceElements {
canBeConsumed = true
canBeResolved = false
}
javadocElements {
canBeConsumed = true
canBeResolved = false
}
}
artifacts {
classesOnlyElements(compileJava.destinationDir)
sourceSets.main.allSource.srcDirs.forEach({ dir ->
sourceElements(dir)
})
javadocElements(javadoc.destinationDir)
}
sourceCompatibility = '11'

View File

@ -1,35 +1,51 @@
apply plugin: 'io.spring.convention.spring-module'
build.dependsOn(project(":saml2-service-provider-core").tasks["build"])
build.dependsOn(project(":saml2-service-provider-opensaml3").tasks["build"])
build.dependsOn(project(":saml2-service-provider-opensaml4").tasks["build"])
check.dependsOn(project(":saml2-service-provider-core").tasks["check"])
check.dependsOn(project(":saml2-service-provider-opensaml3").tasks["check"])
check.dependsOn(project(":saml2-service-provider-opensaml4").tasks["check"])
test.dependsOn(project(":saml2-service-provider-core").tasks["test"])
test.dependsOn(project(":saml2-service-provider-opensaml3").tasks["test"])
test.dependsOn(project(":saml2-service-provider-opensaml4").tasks["test"])
clean.dependsOn(project(":saml2-service-provider-core").tasks["clean"])
clean.dependsOn(project(":saml2-service-provider-opensaml3").tasks["clean"])
clean.dependsOn(project(":saml2-service-provider-opensaml4").tasks["clean"])
format.dependsOn(project(":saml2-service-provider-core").tasks["format"])
format.dependsOn(project(":saml2-service-provider-opensaml3").tasks["format"])
format.dependsOn(project(":saml2-service-provider-opensaml4").tasks["format"])
tasks.forEach({ task ->
if (project(":saml2-service-provider-core").tasks.findByName(task.name)) {
task.dependsOn(project(":saml2-service-provider-core").tasks[task.name])
}
if (project(":saml2-service-provider-opensaml3").tasks.findByName(task.name)) {
task.dependsOn(project(":saml2-service-provider-opensaml3").tasks[task.name])
}
if (project(":saml2-service-provider-opensaml4").tasks.findByName(task.name)) {
task.dependsOn(project(":saml2-service-provider-opensaml4").tasks[task.name])
}
})
configurations {
core {
coreSource {
canBeConsumed = false
canBeResolved = true
}
opensaml3 {
opensaml3Source {
canBeConsumed = false
canBeResolved = true
}
opensaml4 {
opensaml4Source {
canBeConsumed = false
canBeResolved = true
}
coreClasses {
canBeConsumed = false
canBeResolved = true
}
opensaml3Classes {
canBeConsumed = false
canBeResolved = true
}
opensaml4Classes {
canBeConsumed = false
canBeResolved = true
}
coreJavadoc {
canBeConsumed = false
canBeResolved = true
}
opensaml3Javadoc {
canBeConsumed = false
canBeResolved = true
}
opensaml4Javadoc {
canBeConsumed = false
canBeResolved = true
}
@ -37,13 +53,32 @@ configurations {
dependencies {
management platform(project(":spring-security-dependencies"))
core(project(path: ":saml2-service-provider-core", configuration: 'classesOnlyElements'))
opensaml3(project(path: ":saml2-service-provider-opensaml3", configuration: 'classesOnlyElements'))
opensaml4(project(path: ":saml2-service-provider-opensaml4", configuration: 'classesOnlyElements'))
coreSource(project(path: ":saml2-service-provider-core", configuration: 'sourceElements'))
opensaml3Source(project(path: ":saml2-service-provider-opensaml3", configuration: 'sourceElements'))
opensaml4Source(project(path: ":saml2-service-provider-opensaml4", configuration: 'sourceElements'))
coreClasses(project(path: ":saml2-service-provider-core", configuration: 'classesOnlyElements'))
opensaml3Classes(project(path: ":saml2-service-provider-opensaml3", configuration: 'classesOnlyElements'))
opensaml4Classes(project(path: ":saml2-service-provider-opensaml4", configuration: 'classesOnlyElements'))
coreJavadoc(project(path: ":saml2-service-provider-core", configuration: 'javadocElements'))
opensaml3Javadoc(project(path: ":saml2-service-provider-opensaml3", configuration: 'javadocElements'))
opensaml4Javadoc(project(path: ":saml2-service-provider-opensaml4", configuration: 'javadocElements'))
}
jar {
from configurations.core
from configurations.opensaml3
from configurations.opensaml4
from configurations.coreClasses
from configurations.opensaml3Classes
from configurations.opensaml4Classes
}
javadocJar {
from configurations.coreJavadoc
from configurations.opensaml3Javadoc
from configurations.opensaml4Javadoc
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
}
sourcesJar {
from configurations.coreSource
from configurations.opensaml3Source
from configurations.opensaml4Source
}