701 lines
21 KiB
Groovy
701 lines
21 KiB
Groovy
buildscript {
|
|
ext.kotlinVersion = '1.9.25'
|
|
ext.isCI = System.getenv('GITHUB_ACTION')
|
|
repositories {
|
|
mavenCentral()
|
|
gradlePluginPortal()
|
|
maven { url 'https://repo.spring.io/plugins-release-local' }
|
|
if (version.endsWith('SNAPSHOT')) {
|
|
maven { url 'https://repo.spring.io/snapshot' }
|
|
}
|
|
}
|
|
dependencies {
|
|
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion"
|
|
classpath "org.jetbrains.kotlin:kotlin-allopen:$kotlinVersion"
|
|
}
|
|
}
|
|
|
|
plugins {
|
|
id 'base'
|
|
id 'idea'
|
|
id 'org.ajoberstar.grgit' version '5.3.2'
|
|
id 'io.spring.nohttp' version '0.0.11'
|
|
id 'io.spring.dependency-management' version '1.1.7' apply false
|
|
id 'org.antora' version '1.0.0'
|
|
id 'io.spring.antora.generate-antora-yml' version '0.0.1'
|
|
id 'com.github.spotbugs' version '6.0.28'
|
|
id 'io.freefair.aggregate-javadoc' version '8.10.2'
|
|
}
|
|
|
|
description = 'Spring AMQP'
|
|
|
|
ext {
|
|
linkHomepage = 'https://projects.spring.io/spring-amqp'
|
|
linkCi = 'https://build.spring.io/browse/AMQP'
|
|
linkIssue = 'https://jira.spring.io/browse/AMQP'
|
|
linkScmUrl = 'https://github.com/spring-projects/spring-amqp'
|
|
linkScmConnection = 'git://github.com/spring-projects/spring-amqp.git'
|
|
linkScmDevConnection = 'git@github.com:spring-projects/spring-amqp.git'
|
|
|
|
modifiedFiles =
|
|
files()
|
|
.from {
|
|
files(grgit.status().unstaged.modified)
|
|
.filter { f -> f.name.endsWith('.java') || f.name.endsWith('.kt') }
|
|
}
|
|
modifiedFiles.finalizeValueOnRead()
|
|
|
|
assertjVersion = '3.26.3'
|
|
assertkVersion = '0.28.1'
|
|
awaitilityVersion = '4.2.2'
|
|
commonsHttpClientVersion = '5.4.4'
|
|
commonsPoolVersion = '2.12.1'
|
|
hamcrestVersion = '3.0'
|
|
hibernateValidationVersion = '8.0.2.Final'
|
|
jacksonBomVersion = '2.18.4.1'
|
|
jaywayJsonPathVersion = '2.9.0'
|
|
junit4Version = '4.13.2'
|
|
junitJupiterVersion = '5.11.4'
|
|
kotlinCoroutinesVersion = '1.8.1'
|
|
log4jVersion = '2.24.3'
|
|
logbackVersion = '1.5.18'
|
|
micrometerDocsVersion = '1.0.4'
|
|
micrometerVersion = '1.14.8'
|
|
micrometerTracingVersion = '1.4.7'
|
|
mockitoVersion = '5.14.2'
|
|
rabbitmqStreamVersion = '0.18.0'
|
|
rabbitmqVersion = '5.22.0'
|
|
reactorVersion = '2024.0.7'
|
|
springDataVersion = '2024.1.7'
|
|
springRetryVersion = '2.0.12'
|
|
springVersion = '6.2.8'
|
|
testcontainersVersion = '1.20.6'
|
|
|
|
javaProjects = subprojects - project(':spring-amqp-bom')
|
|
}
|
|
|
|
antora {
|
|
version = '3.2.0-alpha.2'
|
|
playbook = file('src/reference/antora/antora-playbook.yml')
|
|
options = ['to-dir' : project.layout.buildDirectory.dir('site').get().toString(), clean: true, fetch: !project.gradle.startParameter.offline, stacktrace: true]
|
|
dependencies = [
|
|
'@antora/atlas-extension': '1.0.0-alpha.2',
|
|
'@antora/collector-extension': '1.0.0-beta.3',
|
|
'@asciidoctor/tabs': '1.0.0-beta.6',
|
|
'@springio/antora-extensions': '1.14.2',
|
|
'@springio/asciidoctor-extensions': '1.0.0-alpha.14',
|
|
]
|
|
}
|
|
|
|
tasks.named('generateAntoraYml') {
|
|
asciidocAttributes = project.provider({
|
|
return ['project-version': project.version]
|
|
})
|
|
baseAntoraYmlFile = file('src/reference/antora/antora.yml')
|
|
}
|
|
|
|
tasks.register('createAntoraPartials', Sync) {
|
|
from { tasks.filterMetricsDocsContent.outputs }
|
|
into layout.buildDirectory.dir('generated-antora-resources/modules/ROOT/partials')
|
|
}
|
|
|
|
tasks.register('generateAntoraResources') {
|
|
dependsOn 'createAntoraPartials'
|
|
dependsOn 'generateAntoraYml'
|
|
}
|
|
|
|
nohttp {
|
|
source.include '**/src/**'
|
|
source.exclude '**/*.gif', '**/*.ks'
|
|
}
|
|
|
|
allprojects {
|
|
group = 'org.springframework.amqp'
|
|
|
|
apply plugin: 'io.spring.dependency-management'
|
|
|
|
dependencyManagement {
|
|
resolutionStrategy {
|
|
cacheChangingModulesFor 0, 'seconds'
|
|
}
|
|
applyMavenExclusions = false
|
|
generatedPomCustomization {
|
|
enabled = false
|
|
}
|
|
|
|
imports {
|
|
mavenBom "com.fasterxml.jackson:jackson-bom:$jacksonBomVersion"
|
|
mavenBom "org.junit:junit-bom:$junitJupiterVersion"
|
|
mavenBom "org.springframework:spring-framework-bom:$springVersion"
|
|
mavenBom "io.projectreactor:reactor-bom:$reactorVersion"
|
|
mavenBom "org.apache.logging.log4j:log4j-bom:$log4jVersion"
|
|
mavenBom "org.springframework.data:spring-data-bom:$springDataVersion"
|
|
mavenBom "io.micrometer:micrometer-bom:$micrometerVersion"
|
|
mavenBom "io.micrometer:micrometer-tracing-bom:$micrometerTracingVersion"
|
|
mavenBom "org.testcontainers:testcontainers-bom:$testcontainersVersion"
|
|
}
|
|
}
|
|
|
|
repositories {
|
|
mavenCentral()
|
|
maven { url 'https://repo.spring.io/milestone' }
|
|
if (version.endsWith('-SNAPSHOT')) {
|
|
maven { url 'https://repo.spring.io/snapshot' }
|
|
}
|
|
// maven { url 'https://repo.spring.io/libs-staging-local' }
|
|
}
|
|
}
|
|
|
|
ext {
|
|
expandPlaceholders = '**/quick-tour.xml'
|
|
javadocLinks = [
|
|
'https://docs.oracle.com/en/java/javase/17/docs/api/',
|
|
'https://jakarta.ee/specifications/platform/9/apidocs/',
|
|
'https://docs.spring.io/spring-framework/docs/current/javadoc-api/'
|
|
] as String[]
|
|
}
|
|
|
|
configure(javaProjects) { subproject ->
|
|
apply plugin: 'java-library'
|
|
apply plugin: 'eclipse'
|
|
apply plugin: 'idea'
|
|
apply plugin: 'checkstyle'
|
|
apply plugin: 'kotlin'
|
|
apply plugin: 'kotlin-spring'
|
|
|
|
apply from: "${rootProject.projectDir}/gradle/publish-maven.gradle"
|
|
|
|
java {
|
|
withJavadocJar()
|
|
withSourcesJar()
|
|
registerFeature('optional') {
|
|
usingSourceSet(sourceSets.main)
|
|
}
|
|
}
|
|
|
|
compileJava {
|
|
options.release = 17
|
|
}
|
|
|
|
compileTestJava {
|
|
sourceCompatibility = JavaVersion.VERSION_17
|
|
targetCompatibility = JavaVersion.VERSION_17
|
|
options.encoding = 'UTF-8'
|
|
}
|
|
|
|
compileTestKotlin {
|
|
kotlinOptions {
|
|
jvmTarget = JavaVersion.VERSION_17
|
|
}
|
|
compilerOptions {
|
|
allWarningsAsErrors = true
|
|
}
|
|
}
|
|
|
|
eclipse {
|
|
project {
|
|
natures += 'org.springframework.ide.eclipse.core.springnature'
|
|
}
|
|
}
|
|
|
|
// dependencies that are common across all java projects
|
|
dependencies {
|
|
def spotbugsAnnotations = "com.github.spotbugs:spotbugs-annotations:${spotbugs.toolVersion.get()}"
|
|
compileOnly spotbugsAnnotations
|
|
testCompileOnly spotbugsAnnotations
|
|
|
|
testImplementation 'org.apache.logging.log4j:log4j-core'
|
|
testImplementation "org.hamcrest:hamcrest-core:$hamcrestVersion"
|
|
testImplementation("org.mockito:mockito-core:$mockitoVersion") {
|
|
exclude group: 'org.hamcrest', module: 'hamcrest-core'
|
|
}
|
|
testImplementation "org.mockito:mockito-junit-jupiter:$mockitoVersion"
|
|
testImplementation 'org.springframework:spring-test'
|
|
|
|
testRuntimeOnly 'org.apache.logging.log4j:log4j-jcl'
|
|
|
|
testImplementation 'org.junit.jupiter:junit-jupiter-api'
|
|
testImplementation 'org.junit.jupiter:junit-jupiter-params'
|
|
testImplementation 'org.junit.jupiter:junit-jupiter-engine'
|
|
testImplementation 'org.junit.platform:junit-platform-launcher'
|
|
testImplementation("org.awaitility:awaitility:$awaitilityVersion") {
|
|
exclude group: 'org.hamcrest'
|
|
}
|
|
|
|
// To avoid compiler warnings about @API annotations in JUnit code
|
|
testCompileOnly 'org.apiguardian:apiguardian-api:1.0.0'
|
|
|
|
testImplementation 'org.jetbrains.kotlin:kotlin-reflect'
|
|
testImplementation 'org.jetbrains.kotlin:kotlin-stdlib-jdk8'
|
|
|
|
|
|
}
|
|
|
|
// enable all compiler warnings; individual projects may customize further
|
|
ext.xLintArg = '-Xlint:all,-options,-processing,-deprecation'
|
|
[compileJava, compileTestJava]*.options*.compilerArgs = [xLintArg]
|
|
|
|
publishing {
|
|
publications {
|
|
mavenJava(MavenPublication) {
|
|
suppressAllPomMetadataWarnings()
|
|
from components.java
|
|
}
|
|
}
|
|
}
|
|
|
|
tasks.withType(JavaForkOptions) {
|
|
jvmArgs '--add-opens', 'java.base/java.util.zip=ALL-UNNAMED'
|
|
}
|
|
|
|
tasks.withType(Javadoc) {
|
|
options.addBooleanOption('Xdoclint:syntax', true) // only check syntax with doclint
|
|
options.addBooleanOption('Werror', true) // fail build on Javadoc warnings
|
|
}
|
|
|
|
test {
|
|
maxHeapSize = '2g'
|
|
jvmArgs '-XX:+HeapDumpOnOutOfMemoryError'
|
|
|
|
testLogging {
|
|
events "skipped", "failed"
|
|
showStandardStreams = project.hasProperty("showStandardStreams") ?: false
|
|
showExceptions = true
|
|
showStackTraces = true
|
|
exceptionFormat = 'full'
|
|
}
|
|
}
|
|
|
|
tasks.register('testAll', Test) {
|
|
dependsOn check
|
|
}
|
|
|
|
gradle.taskGraph.whenReady { graph ->
|
|
if (graph.hasTask(testAll)) {
|
|
test.enabled = false
|
|
}
|
|
}
|
|
|
|
tasks.withType(Test).configureEach {
|
|
// suppress all console output during testing unless running `gradle -i`
|
|
logging.captureStandardOutput(LogLevel.INFO)
|
|
|
|
if (name ==~ /(testAll)/) {
|
|
systemProperty 'RUN_LONG_INTEGRATION_TESTS', 'true'
|
|
}
|
|
environment "SPRING_AMQP_DESERIALIZATION_TRUST_ALL", "true"
|
|
|
|
useJUnitPlatform()
|
|
}
|
|
|
|
checkstyle {
|
|
configDirectory.set(rootProject.file("src/checkstyle"))
|
|
toolVersion = '10.18.2'
|
|
}
|
|
|
|
jar {
|
|
manifest {
|
|
attributes(
|
|
'Implementation-Version': archiveVersion,
|
|
'Created-By': "JDK ${System.properties['java.version']} (${System.properties['java.specification.vendor']})",
|
|
'Implementation-Title': subproject.name,
|
|
'Implementation-Vendor-Id': subproject.group,
|
|
'Implementation-Vendor': 'Broadcom Inc.',
|
|
'Implementation-URL': linkHomepage,
|
|
'Automatic-Module-Name': subproject.name.replace('-', '.') // for Jigsaw
|
|
)
|
|
}
|
|
|
|
from("${rootProject.projectDir}/src/dist") {
|
|
include 'notice.txt'
|
|
into 'META-INF'
|
|
expand(copyright: new Date().format('yyyy'), version: project.version)
|
|
}
|
|
from("${rootProject.projectDir}") {
|
|
include 'LICENSE.txt'
|
|
into 'META-INF'
|
|
}
|
|
}
|
|
|
|
check.dependsOn javadoc
|
|
|
|
}
|
|
|
|
project('spring-amqp') {
|
|
description = 'Spring AMQP Core'
|
|
|
|
dependencies {
|
|
api 'org.springframework:spring-core'
|
|
api("org.springframework.retry:spring-retry:$springRetryVersion") {
|
|
exclude group: 'org.springframework'
|
|
}
|
|
optionalApi 'org.springframework:spring-messaging'
|
|
optionalApi 'org.springframework:spring-oxm'
|
|
optionalApi 'org.springframework:spring-context'
|
|
optionalApi 'com.fasterxml.jackson.core:jackson-core'
|
|
optionalApi 'com.fasterxml.jackson.core:jackson-databind'
|
|
optionalApi 'com.fasterxml.jackson.core:jackson-annotations'
|
|
optionalApi 'com.fasterxml.jackson.dataformat:jackson-dataformat-xml'
|
|
optionalApi 'com.fasterxml.jackson.datatype:jackson-datatype-jdk8'
|
|
optionalApi 'com.fasterxml.jackson.module:jackson-module-parameter-names'
|
|
optionalApi 'com.fasterxml.jackson.datatype:jackson-datatype-jsr310'
|
|
optionalApi 'com.fasterxml.jackson.datatype:jackson-datatype-joda'
|
|
optionalApi('com.fasterxml.jackson.module:jackson-module-kotlin') {
|
|
exclude group: 'org.jetbrains.kotlin'
|
|
}
|
|
// Spring Data projection message binding support
|
|
optionalApi('org.springframework.data:spring-data-commons') {
|
|
exclude group: 'org.springframework'
|
|
exclude group: 'io.micrometer'
|
|
}
|
|
optionalApi "com.jayway.jsonpath:json-path:$jaywayJsonPathVersion"
|
|
|
|
testImplementation "org.assertj:assertj-core:$assertjVersion"
|
|
}
|
|
|
|
}
|
|
|
|
project('spring-amqp-bom') {
|
|
description = 'Spring for RabbitMQ (Bill of Materials)'
|
|
|
|
apply plugin: 'java-platform'
|
|
apply from: "${rootDir}/gradle/publish-maven.gradle"
|
|
|
|
dependencies {
|
|
constraints {
|
|
javaProjects.sort { "$it.name" }.each {
|
|
api it
|
|
}
|
|
}
|
|
}
|
|
|
|
publishing {
|
|
publications {
|
|
mavenJava(MavenPublication) {
|
|
from components.javaPlatform
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
project('spring-rabbit') {
|
|
description = 'Spring RabbitMQ Support'
|
|
|
|
dependencies {
|
|
api project(':spring-amqp')
|
|
api "com.rabbitmq:amqp-client:$rabbitmqVersion"
|
|
api 'org.springframework:spring-context'
|
|
api 'org.springframework:spring-messaging'
|
|
api 'org.springframework:spring-tx'
|
|
api 'io.micrometer:micrometer-observation'
|
|
optionalApi 'org.springframework:spring-aop'
|
|
optionalApi 'org.springframework:spring-webflux'
|
|
optionalApi "org.apache.httpcomponents.client5:httpclient5:$commonsHttpClientVersion"
|
|
optionalApi 'io.projectreactor:reactor-core'
|
|
optionalApi 'io.projectreactor.netty:reactor-netty-http'
|
|
optionalApi "ch.qos.logback:logback-classic:$logbackVersion"
|
|
optionalApi 'org.apache.logging.log4j:log4j-core'
|
|
optionalApi 'io.micrometer:micrometer-core'
|
|
optionalApi 'io.micrometer:micrometer-tracing'
|
|
// Spring Data projection message binding support
|
|
optionalApi("org.springframework.data:spring-data-commons") {
|
|
exclude group: 'org.springframework'
|
|
}
|
|
optionalApi "com.jayway.jsonpath:json-path:$jaywayJsonPathVersion"
|
|
optionalApi "org.apache.commons:commons-pool2:$commonsPoolVersion"
|
|
optionalApi "org.jetbrains.kotlinx:kotlinx-coroutines-reactor:$kotlinCoroutinesVersion"
|
|
|
|
testApi project(':spring-rabbit-junit')
|
|
testImplementation("com.willowtreeapps.assertk:assertk-jvm:$assertkVersion")
|
|
testImplementation "org.hibernate.validator:hibernate-validator:$hibernateValidationVersion"
|
|
testImplementation 'io.micrometer:micrometer-observation-test'
|
|
testImplementation 'io.micrometer:micrometer-tracing-bridge-brave'
|
|
testImplementation 'io.micrometer:micrometer-tracing-test'
|
|
testImplementation 'io.micrometer:micrometer-tracing-integration-test'
|
|
testImplementation "org.testcontainers:rabbitmq"
|
|
testImplementation 'org.testcontainers:junit-jupiter'
|
|
testImplementation "org.apache.httpcomponents.client5:httpclient5:$commonsHttpClientVersion"
|
|
testRuntimeOnly 'com.fasterxml.jackson.core:jackson-core'
|
|
testRuntimeOnly 'com.fasterxml.jackson.core:jackson-databind'
|
|
testRuntimeOnly 'com.fasterxml.jackson.dataformat:jackson-dataformat-xml'
|
|
testRuntimeOnly 'com.fasterxml.jackson.module:jackson-module-kotlin'
|
|
testRuntimeOnly("junit:junit:$junit4Version") {
|
|
exclude group: 'org.hamcrest', module: 'hamcrest-core'
|
|
}
|
|
}
|
|
}
|
|
|
|
project('spring-rabbit-stream') {
|
|
description = 'Spring RabbitMQ Stream Support'
|
|
|
|
dependencies {
|
|
api project(':spring-rabbit')
|
|
api "com.rabbitmq:stream-client:$rabbitmqStreamVersion"
|
|
optionalApi 'io.micrometer:micrometer-core'
|
|
|
|
testApi project(':spring-rabbit-junit')
|
|
testRuntimeOnly 'com.fasterxml.jackson.core:jackson-core'
|
|
testRuntimeOnly 'com.fasterxml.jackson.core:jackson-databind'
|
|
testRuntimeOnly 'com.fasterxml.jackson.dataformat:jackson-dataformat-xml'
|
|
testRuntimeOnly 'com.fasterxml.jackson.module:jackson-module-kotlin'
|
|
|
|
testImplementation "org.testcontainers:rabbitmq"
|
|
testImplementation "org.testcontainers:junit-jupiter"
|
|
testImplementation 'org.apache.logging.log4j:log4j-slf4j-impl'
|
|
testImplementation 'org.springframework:spring-webflux'
|
|
testImplementation 'io.micrometer:micrometer-observation-test'
|
|
testImplementation 'io.micrometer:micrometer-tracing-bridge-brave'
|
|
testImplementation 'io.micrometer:micrometer-tracing-test'
|
|
testImplementation 'io.micrometer:micrometer-tracing-integration-test'
|
|
}
|
|
}
|
|
|
|
project('spring-rabbit-junit') {
|
|
description = 'Spring Rabbit JUnit Support'
|
|
|
|
dependencies { // no spring-amqp dependencies allowed
|
|
api 'org.springframework:spring-core'
|
|
api 'org.springframework:spring-test'
|
|
api "com.rabbitmq:amqp-client:$rabbitmqVersion"
|
|
api 'org.springframework:spring-web'
|
|
api 'org.junit.jupiter:junit-jupiter-api'
|
|
api "org.assertj:assertj-core:$assertjVersion"
|
|
optionalApi("junit:junit:$junit4Version") {
|
|
exclude group: 'org.hamcrest', module: 'hamcrest-core'
|
|
}
|
|
optionalApi "org.testcontainers:rabbitmq"
|
|
optionalApi "org.testcontainers:junit-jupiter"
|
|
optionalApi "ch.qos.logback:logback-classic:$logbackVersion"
|
|
optionalApi 'org.apache.logging.log4j:log4j-core'
|
|
compileOnly 'org.apiguardian:apiguardian-api:1.0.0'
|
|
}
|
|
}
|
|
|
|
project('spring-rabbit-test') {
|
|
description = 'Spring Rabbit Test Support'
|
|
|
|
dependencies {
|
|
api project(':spring-rabbit')
|
|
api project(':spring-rabbit-junit')
|
|
api "org.hamcrest:hamcrest-library:$hamcrestVersion"
|
|
api "org.hamcrest:hamcrest-core:$hamcrestVersion"
|
|
api "org.mockito:mockito-core:$mockitoVersion"
|
|
testImplementation project(':spring-rabbit').sourceSets.test.output
|
|
}
|
|
}
|
|
|
|
configurations {
|
|
micrometerDocs
|
|
}
|
|
|
|
dependencies {
|
|
micrometerDocs "io.micrometer:micrometer-docs-generator:$micrometerDocsVersion"
|
|
}
|
|
|
|
def observationInputDir = file('build/docs/microsources').absolutePath
|
|
def generatedDocsDir = file('build/docs/generated').absolutePath
|
|
|
|
tasks.register('copyObservation', Copy) {
|
|
from file('spring-rabbit/src/main/java/org/springframework/amqp/rabbit/support/micrometer').absolutePath
|
|
from file('spring-rabbit-stream/src/main/java/org/springframework/rabbit/stream/micrometer').absolutePath
|
|
include '*.java'
|
|
exclude 'package-info.java'
|
|
into observationInputDir
|
|
}
|
|
|
|
tasks.register('generateObservabilityDocs', JavaExec) {
|
|
dependsOn copyObservation
|
|
mainClass = 'io.micrometer.docs.DocsGeneratorCommand'
|
|
inputs.dir(observationInputDir)
|
|
outputs.dir(generatedDocsDir)
|
|
classpath configurations.micrometerDocs
|
|
args observationInputDir, /.+/, generatedDocsDir
|
|
}
|
|
|
|
tasks.register('filterMetricsDocsContent', Copy) {
|
|
dependsOn generateObservabilityDocs
|
|
from generatedDocsDir
|
|
include '_*.adoc'
|
|
into generatedDocsDir
|
|
rename { filename -> filename.replace '_', '' }
|
|
filter { line -> line.replaceAll('org.springframework.*.micrometer.', '').replaceAll('^Fully qualified n', 'N') }
|
|
}
|
|
|
|
dependencies {
|
|
javaProjects.each {
|
|
javadoc it
|
|
}
|
|
}
|
|
|
|
javadoc {
|
|
title = "${rootProject.description} ${version} API"
|
|
options {
|
|
encoding = 'UTF-8'
|
|
memberLevel = JavadocMemberLevel.PROTECTED
|
|
author = true
|
|
header = project.description
|
|
use = true
|
|
overview = 'src/api/overview.html'
|
|
splitIndex = true
|
|
links(project.ext.javadocLinks)
|
|
addBooleanOption('Xdoclint:syntax', true) // only check syntax with doclint
|
|
}
|
|
|
|
destinationDir = file('build/api')
|
|
classpath = files().from { files(javaProjects.collect { it.sourceSets.main.compileClasspath }) }
|
|
}
|
|
|
|
tasks.register('api') {
|
|
group = 'Documentation'
|
|
description = 'Generates aggregated Javadoc API documentation.'
|
|
dependsOn javadoc
|
|
}
|
|
|
|
tasks.register('schemaZip', Zip) {
|
|
group = 'Distribution'
|
|
archiveClassifier = 'schema'
|
|
description = "Builds -${archiveClassifier} archive containing all " +
|
|
"XSDs for deployment at static.springframework.org/schema."
|
|
|
|
javaProjects.each { subproject ->
|
|
Set files = new HashSet()
|
|
Properties schemas = new Properties();
|
|
def shortName = subproject.name.replaceFirst("${rootProject.name}-", '')
|
|
|
|
if (subproject.name.endsWith('-rabbit')) {
|
|
shortName = 'rabbit'
|
|
}
|
|
|
|
subproject.sourceSets.main.resources.find {
|
|
it.path.endsWith("META-INF${File.separator}spring.schemas")
|
|
}?.withInputStream { schemas.load(it) }
|
|
|
|
for (def key : schemas.keySet()) {
|
|
File xsdFile = subproject.sourceSets.main.resources.find {
|
|
it.path.replaceAll('\\\\', '/').endsWith(schemas.get(key))
|
|
}
|
|
assert xsdFile != null
|
|
if (!files.contains(xsdFile.path)) {
|
|
into("${shortName}") {
|
|
from xsdFile.path
|
|
rename { String fileName ->
|
|
String[] versionNumbers = project.version.split(/\./, 3)
|
|
fileName.replace('.xsd', "-${versionNumbers[0]}.${versionNumbers[1]}.xsd")
|
|
}
|
|
}
|
|
files.add(xsdFile.path)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
tasks.register('docsZip', Zip) {
|
|
group = 'Distribution'
|
|
archiveClassifier = 'docs'
|
|
description = "Builds -${archiveClassifier} archive containing api and reference " +
|
|
"for deployment at static.springframework.org/spring-integration/docs."
|
|
|
|
from('src/dist') {
|
|
include 'changelog.txt'
|
|
}
|
|
|
|
from(javadoc) {
|
|
into 'api'
|
|
}
|
|
}
|
|
|
|
tasks.register('distZip', Zip) {
|
|
dependsOn docsZip
|
|
dependsOn schemaZip
|
|
group = 'Distribution'
|
|
archiveClassifier = 'dist'
|
|
description = "Builds -${archiveClassifier} archive, containing all jars and docs, " +
|
|
"suitable for community download page."
|
|
|
|
ext.baseDir = "${project.name}-${project.version}";
|
|
|
|
from('src/dist') {
|
|
include 'README.md'
|
|
include 'notice.txt'
|
|
into "${baseDir}"
|
|
}
|
|
|
|
from("$project.rootDir") {
|
|
include 'LICENSE.txt'
|
|
into "${baseDir}"
|
|
}
|
|
|
|
from(zipTree(docsZip.archiveFile)) {
|
|
into "${baseDir}/docs"
|
|
}
|
|
|
|
from(zipTree(schemaZip.archiveFile)) {
|
|
into "${baseDir}/schema"
|
|
}
|
|
|
|
javaProjects.each { subproject ->
|
|
into("${baseDir}/libs") {
|
|
from subproject.jar
|
|
from subproject.sourcesJar
|
|
from subproject.javadocJar
|
|
}
|
|
}
|
|
|
|
from(project(':spring-amqp-bom').generatePomFileForMavenJavaPublication) {
|
|
into "${baseDir}/libs"
|
|
rename 'pom-default.xml', "spring-amqp-bom-${project.version}.xml"
|
|
}
|
|
|
|
}
|
|
|
|
// Create an optional "with dependencies" distribution.
|
|
// Not published by default; only for use when building from source.
|
|
tasks.register('depsZip', Zip) {
|
|
dependsOn distZip
|
|
group = 'Distribution'
|
|
archiveClassifier = 'dist-with-deps'
|
|
description = "Builds -${archiveClassifier} archive, containing everything " +
|
|
"in the -${distZip.archiveClassifier} archive plus all dependencies."
|
|
|
|
from zipTree(distZip.archiveFile)
|
|
|
|
gradle.taskGraph.whenReady { taskGraph ->
|
|
if (taskGraph.hasTask(":${zipTask.name}")) {
|
|
def projectNames = rootProject.subprojects*.name
|
|
def artifacts = new HashSet()
|
|
subprojects.each { subproject ->
|
|
subproject.configurations.runtime.resolvedConfiguration.resolvedArtifacts.each { artifact ->
|
|
def dependency = artifact.moduleVersion.id
|
|
if (!projectNames.contains(dependency.name)) {
|
|
artifacts << artifact.file
|
|
}
|
|
}
|
|
}
|
|
|
|
zipTask.from(artifacts) {
|
|
into "${distZip.baseDir}/deps"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
tasks.build.dependsOn assemble
|
|
|
|
tasks.register('dist') {
|
|
dependsOn assemble
|
|
group = 'Distribution'
|
|
description = 'Builds -dist, -docs and -schema distribution archives.'
|
|
}
|
|
|
|
apply from: "${rootProject.projectDir}/gradle/publish-maven.gradle"
|
|
|
|
publishing {
|
|
publications {
|
|
mavenJava(MavenPublication) {
|
|
artifact docsZip
|
|
artifact schemaZip
|
|
artifact distZip
|
|
}
|
|
}
|
|
}
|