mirror of
https://github.com/spring-projects/spring-framework
synced 2026-06-08 17:33:33 +00:00
9c33d2707a
This commit introduces support for Netty 5's Buffer, in the form of Netty5DataBuffer. Because of the new API offered by Buffer, several changes have been made to the DataBuffer API: - CloseableDataBuffer is a simpler alternative to PooledDataBuffer, and implemented by Netty5DataBuffer. DataBufferUtils::release can now handle CloseableDataBuffer as well as PooledDataBuffer. - PooledDataBuffer::touch has been moved into a separate interface: TouchableDataBuffer, which is implemented by Netty5DataBuffer. - The capacity of DataBuffers can no longer be reduced, they can only grow larger. As a consequence, DataBuffer::capacity(int) has been deprecated, but ensureWritable (formally ensureCapacity) still exists. - DataBuffer::slice and retainedSlice have been deprecated in favor of split, a new method that ensures that memory regions do not overlap. - DataBuffer::asByteBuffer has been deprecated in favor of toByteBuffer, a new method that returns a copy, instead of shared data. - DataBufferFactory::allocateBuffer has been deprecated in favor of allocateBuffer(int). Closes gh-28874
150 lines
4.9 KiB
Groovy
150 lines
4.9 KiB
Groovy
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
|
|
import org.springframework.build.shadow.ShadowSource
|
|
|
|
description = "Spring Core"
|
|
|
|
apply plugin: "kotlin"
|
|
|
|
def javapoetVersion = "1.13.0"
|
|
def objenesisVersion = "3.2"
|
|
|
|
configurations {
|
|
javapoet
|
|
objenesis
|
|
graalvm
|
|
}
|
|
|
|
task javapoetRepackJar(type: ShadowJar) {
|
|
archiveBaseName = 'spring-javapoet-repack'
|
|
archiveVersion = javapoetVersion
|
|
configurations = [project.configurations.javapoet]
|
|
relocate('com.squareup.javapoet', 'org.springframework.javapoet')
|
|
}
|
|
|
|
task javapoetSource(type: ShadowSource) {
|
|
configurations = [project.configurations.javapoet]
|
|
relocate('com.squareup.javapoet', 'org.springframework.javapoet')
|
|
outputDirectory = file("build/shadow-source/javapoet")
|
|
}
|
|
|
|
task javapoetSourceJar(type: Jar) {
|
|
archiveBaseName = 'spring-javapoet-repack'
|
|
archiveVersion = javapoetVersion
|
|
archiveClassifier = 'sources'
|
|
from javapoetSource
|
|
}
|
|
|
|
task objenesisRepackJar(type: ShadowJar) {
|
|
archiveBaseName = 'spring-objenesis-repack'
|
|
archiveVersion = objenesisVersion
|
|
configurations = [project.configurations.objenesis]
|
|
relocate('org.objenesis', 'org.springframework.objenesis')
|
|
}
|
|
|
|
task objenesisSource(type: ShadowSource) {
|
|
configurations = [project.configurations.objenesis]
|
|
relocate('org.objenesis', 'org.springframework.objenesis')
|
|
outputDirectory = file("build/shadow-source/objenesis")
|
|
}
|
|
|
|
task objenesisSourceJar(type: Jar) {
|
|
archiveBaseName = 'spring-objenesis-repack'
|
|
archiveVersion = objenesisVersion
|
|
archiveClassifier = 'sources'
|
|
from objenesisSource
|
|
}
|
|
|
|
dependencies {
|
|
javapoet("com.squareup:javapoet:${javapoetVersion}@jar")
|
|
objenesis("org.objenesis:objenesis:${objenesisVersion}@jar")
|
|
graalvm(project(path: ":graalvm-feature", configuration: 'classesOnlyElements'))
|
|
api(files(javapoetRepackJar))
|
|
api(files(objenesisRepackJar))
|
|
api(project(":spring-jcl"))
|
|
compileOnly("io.projectreactor.tools:blockhound")
|
|
optional("net.sf.jopt-simple:jopt-simple")
|
|
optional("org.aspectj:aspectjweaver")
|
|
optional("org.jetbrains.kotlin:kotlin-reflect")
|
|
optional("org.jetbrains.kotlin:kotlin-stdlib")
|
|
optional("org.jetbrains.kotlinx:kotlinx-coroutines-core")
|
|
optional("org.jetbrains.kotlinx:kotlinx-coroutines-reactor")
|
|
optional("io.projectreactor:reactor-core")
|
|
optional("io.reactivex.rxjava3:rxjava")
|
|
optional("io.smallrye.reactive:mutiny")
|
|
optional("io.netty:netty-buffer")
|
|
optional("io.netty:netty5-buffer:5.0.0.Alpha4")
|
|
testImplementation("jakarta.annotation:jakarta.annotation-api")
|
|
testImplementation("jakarta.xml.bind:jakarta.xml.bind-api")
|
|
testImplementation("com.google.code.findbugs:jsr305")
|
|
testImplementation("com.fasterxml.woodstox:woodstox-core")
|
|
testImplementation("org.xmlunit:xmlunit-assertj")
|
|
testImplementation("org.xmlunit:xmlunit-matchers")
|
|
testImplementation("io.projectreactor:reactor-test")
|
|
testImplementation("io.projectreactor.tools:blockhound")
|
|
testImplementation("org.skyscreamer:jsonassert")
|
|
testImplementation("com.squareup.okhttp3:mockwebserver")
|
|
testFixturesImplementation("com.google.code.findbugs:jsr305")
|
|
testFixturesImplementation("org.junit.platform:junit-platform-launcher")
|
|
testFixturesImplementation("org.junit.jupiter:junit-jupiter-api")
|
|
testFixturesImplementation("org.junit.jupiter:junit-jupiter-params")
|
|
testFixturesImplementation("org.assertj:assertj-core")
|
|
testFixturesImplementation("org.xmlunit:xmlunit-assertj")
|
|
testFixturesImplementation("io.projectreactor:reactor-test")
|
|
}
|
|
|
|
jar {
|
|
reproducibleFileOrder = true
|
|
preserveFileTimestamps = false // maybe not necessary here, but good for reproducibility
|
|
manifest.attributes["Dependencies"] = "jdk.unsupported" // for WildFly (-> Objenesis 3.2)
|
|
|
|
dependsOn javapoetRepackJar
|
|
from(zipTree(javapoetRepackJar.archivePath)) {
|
|
include "org/springframework/javapoet/**"
|
|
}
|
|
|
|
dependsOn objenesisRepackJar
|
|
from(zipTree(objenesisRepackJar.archivePath)) {
|
|
include "org/springframework/objenesis/**"
|
|
}
|
|
|
|
from configurations.graalvm
|
|
}
|
|
|
|
test {
|
|
// Make sure the classes dir is used on the test classpath (required by ResourceTests).
|
|
// When test fixtures are involved, the JAR is used by default.
|
|
classpath = sourceSets.main.output.classesDirs + files(sourceSets.main.output.resourcesDir) + classpath - files(jar.archiveFile)
|
|
|
|
// Ensure that BlockHound tests run on JDK 13+. For details, see:
|
|
// https://github.com/reactor/BlockHound/issues/33
|
|
jvmArgs += [
|
|
"-XX:+AllowRedefinitionToAddDeleteMethods"
|
|
]
|
|
}
|
|
|
|
sourcesJar {
|
|
dependsOn javapoetSourceJar
|
|
dependsOn objenesisSourceJar
|
|
from javapoetSource
|
|
from objenesisSource
|
|
}
|
|
|
|
eclipse {
|
|
synchronizationTasks javapoetSourceJar, objenesisSourceJar
|
|
classpath {
|
|
file {
|
|
whenMerged {
|
|
def pattern = ~/\/spring-\w+-repack-/
|
|
entries.forEach {
|
|
if (pattern.matcher(it.path).find()) {
|
|
def sourcesJar = it.path.replace('.jar', '-sources.jar');
|
|
it.sourcePath = fileReference(file(sourcesJar))
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
tasks['eclipse'].dependsOn(javapoetRepackJar, javapoetSourceJar, objenesisRepackJar, objenesisSourceJar)
|