2019-09-30 20:14:36 +08:00
|
|
|
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
|
2022-02-23 03:09:37 +08:00
|
|
|
import org.springframework.build.shadow.ShadowSource
|
2019-09-30 20:14:36 +08:00
|
|
|
|
2017-08-21 20:41:55 +08:00
|
|
|
description = "Spring Core"
|
|
|
|
|
2019-08-21 02:26:43 +08:00
|
|
|
apply plugin: "kotlin"
|
|
|
|
|
2022-01-06 21:52:48 +08:00
|
|
|
def javapoetVersion = "1.13.0"
|
2021-03-23 06:11:30 +08:00
|
|
|
def objenesisVersion = "3.2"
|
2017-08-21 20:41:55 +08:00
|
|
|
|
|
|
|
configurations {
|
2022-01-06 21:52:48 +08:00
|
|
|
javapoet
|
2017-08-21 20:41:55 +08:00
|
|
|
objenesis
|
2022-06-22 18:17:40 +08:00
|
|
|
graalvm
|
2017-08-21 20:41:55 +08:00
|
|
|
}
|
|
|
|
|
2022-01-06 21:52:48 +08:00
|
|
|
task javapoetRepackJar(type: ShadowJar) {
|
2022-08-01 18:12:36 +08:00
|
|
|
archiveBaseName = 'spring-javapoet-repack'
|
|
|
|
archiveVersion = javapoetVersion
|
2022-01-06 21:52:48 +08:00
|
|
|
configurations = [project.configurations.javapoet]
|
2022-08-01 18:12:36 +08:00
|
|
|
relocate('com.squareup.javapoet', 'org.springframework.javapoet')
|
2022-01-06 21:52:48 +08:00
|
|
|
}
|
|
|
|
|
2022-02-23 03:09:37 +08:00
|
|
|
task javapoetSource(type: ShadowSource) {
|
|
|
|
configurations = [project.configurations.javapoet]
|
2022-08-01 18:12:36 +08:00
|
|
|
relocate('com.squareup.javapoet', 'org.springframework.javapoet')
|
2022-02-23 03:09:37 +08:00
|
|
|
outputDirectory = file("build/shadow-source/javapoet")
|
|
|
|
}
|
|
|
|
|
2022-08-01 18:12:36 +08:00
|
|
|
task javapoetSourceJar(type: Jar) {
|
|
|
|
archiveBaseName = 'spring-javapoet-repack'
|
|
|
|
archiveVersion = javapoetVersion
|
|
|
|
archiveClassifier = 'sources'
|
|
|
|
from javapoetSource
|
|
|
|
}
|
|
|
|
|
2019-09-30 20:14:36 +08:00
|
|
|
task objenesisRepackJar(type: ShadowJar) {
|
2022-08-01 18:12:36 +08:00
|
|
|
archiveBaseName = 'spring-objenesis-repack'
|
|
|
|
archiveVersion = objenesisVersion
|
2019-09-30 20:14:36 +08:00
|
|
|
configurations = [project.configurations.objenesis]
|
2022-08-01 18:12:36 +08:00
|
|
|
relocate('org.objenesis', 'org.springframework.objenesis')
|
2017-08-21 20:41:55 +08:00
|
|
|
}
|
|
|
|
|
2022-02-23 03:09:37 +08:00
|
|
|
task objenesisSource(type: ShadowSource) {
|
|
|
|
configurations = [project.configurations.objenesis]
|
2022-08-01 18:12:36 +08:00
|
|
|
relocate('org.objenesis', 'org.springframework.objenesis')
|
2022-02-23 03:09:37 +08:00
|
|
|
outputDirectory = file("build/shadow-source/objenesis")
|
|
|
|
}
|
|
|
|
|
2022-08-01 18:12:36 +08:00
|
|
|
task objenesisSourceJar(type: Jar) {
|
|
|
|
archiveBaseName = 'spring-objenesis-repack'
|
|
|
|
archiveVersion = objenesisVersion
|
|
|
|
archiveClassifier = 'sources'
|
|
|
|
from objenesisSource
|
|
|
|
}
|
|
|
|
|
2017-08-21 20:41:55 +08:00
|
|
|
dependencies {
|
2022-01-06 21:52:48 +08:00
|
|
|
javapoet("com.squareup:javapoet:${javapoetVersion}@jar")
|
2017-08-21 20:41:55 +08:00
|
|
|
objenesis("org.objenesis:objenesis:${objenesisVersion}@jar")
|
2022-07-28 16:43:26 +08:00
|
|
|
graalvm(project(path: ":graalvm-feature", configuration: 'classesOnlyElements'))
|
2022-01-06 21:52:48 +08:00
|
|
|
api(files(javapoetRepackJar))
|
2021-05-22 03:16:30 +08:00
|
|
|
api(files(objenesisRepackJar))
|
|
|
|
api(project(":spring-jcl"))
|
2020-02-25 01:00:06 +08:00
|
|
|
compileOnly("io.projectreactor.tools:blockhound")
|
2019-08-27 03:13:12 +08:00
|
|
|
optional("net.sf.jopt-simple:jopt-simple")
|
|
|
|
optional("org.aspectj:aspectjweaver")
|
2019-07-19 16:20:35 +08:00
|
|
|
optional("org.jetbrains.kotlin:kotlin-reflect")
|
|
|
|
optional("org.jetbrains.kotlin:kotlin-stdlib")
|
2021-08-03 01:28:20 +08:00
|
|
|
optional("org.jetbrains.kotlinx:kotlinx-coroutines-core")
|
|
|
|
optional("org.jetbrains.kotlinx:kotlinx-coroutines-reactor")
|
2017-08-21 20:41:55 +08:00
|
|
|
optional("io.projectreactor:reactor-core")
|
2020-05-11 15:40:01 +08:00
|
|
|
optional("io.reactivex.rxjava3:rxjava")
|
2021-08-28 11:20:12 +08:00
|
|
|
optional("io.smallrye.reactive:mutiny")
|
2017-08-21 20:41:55 +08:00
|
|
|
optional("io.netty:netty-buffer")
|
Introduce support for Netty 5 Buffer
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
2022-07-27 21:24:14 +08:00
|
|
|
optional("io.netty:netty5-buffer:5.0.0.Alpha4")
|
2021-09-17 15:14:07 +08:00
|
|
|
testImplementation("jakarta.annotation:jakarta.annotation-api")
|
|
|
|
testImplementation("jakarta.xml.bind:jakarta.xml.bind-api")
|
2021-09-23 21:57:43 +08:00
|
|
|
testImplementation("com.google.code.findbugs:jsr305")
|
2021-05-22 03:16:30 +08:00
|
|
|
testImplementation("com.fasterxml.woodstox:woodstox-core")
|
|
|
|
testImplementation("org.xmlunit:xmlunit-assertj")
|
|
|
|
testImplementation("org.xmlunit:xmlunit-matchers")
|
2021-09-23 21:57:43 +08:00
|
|
|
testImplementation("io.projectreactor:reactor-test")
|
2021-05-22 03:16:30 +08:00
|
|
|
testImplementation("io.projectreactor.tools:blockhound")
|
2022-03-02 17:53:17 +08:00
|
|
|
testImplementation("org.skyscreamer:jsonassert")
|
2022-08-04 04:50:34 +08:00
|
|
|
testImplementation("com.squareup.okhttp3:mockwebserver")
|
2020-10-16 18:22:04 +08:00
|
|
|
testFixturesImplementation("com.google.code.findbugs:jsr305")
|
2020-01-03 21:34:29 +08:00
|
|
|
testFixturesImplementation("org.junit.platform:junit-platform-launcher")
|
|
|
|
testFixturesImplementation("org.junit.jupiter:junit-jupiter-api")
|
|
|
|
testFixturesImplementation("org.junit.jupiter:junit-jupiter-params")
|
2020-10-16 18:22:04 +08:00
|
|
|
testFixturesImplementation("org.assertj:assertj-core")
|
2019-12-28 18:44:40 +08:00
|
|
|
testFixturesImplementation("org.xmlunit:xmlunit-assertj")
|
2021-09-23 21:57:43 +08:00
|
|
|
testFixturesImplementation("io.projectreactor:reactor-test")
|
2017-08-21 20:41:55 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
jar {
|
2020-06-13 20:36:27 +08:00
|
|
|
reproducibleFileOrder = true
|
2021-03-23 06:11:30 +08:00
|
|
|
preserveFileTimestamps = false // maybe not necessary here, but good for reproducibility
|
|
|
|
manifest.attributes["Dependencies"] = "jdk.unsupported" // for WildFly (-> Objenesis 3.2)
|
2020-06-13 20:36:27 +08:00
|
|
|
|
2022-01-06 21:52:48 +08:00
|
|
|
dependsOn javapoetRepackJar
|
|
|
|
from(zipTree(javapoetRepackJar.archivePath)) {
|
|
|
|
include "org/springframework/javapoet/**"
|
|
|
|
}
|
|
|
|
|
2017-08-21 20:41:55 +08:00
|
|
|
dependsOn objenesisRepackJar
|
|
|
|
from(zipTree(objenesisRepackJar.archivePath)) {
|
|
|
|
include "org/springframework/objenesis/**"
|
|
|
|
}
|
2022-06-22 18:17:40 +08:00
|
|
|
|
|
|
|
from configurations.graalvm
|
2017-08-21 20:41:55 +08:00
|
|
|
}
|
2020-01-02 17:29:55 +08:00
|
|
|
|
|
|
|
test {
|
2021-09-23 21:57:43 +08:00
|
|
|
// 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.
|
2022-05-11 09:32:41 +08:00
|
|
|
classpath = sourceSets.main.output.classesDirs + files(sourceSets.main.output.resourcesDir) + classpath - files(jar.archiveFile)
|
2022-01-11 21:54:59 +08:00
|
|
|
|
|
|
|
// Ensure that BlockHound tests run on JDK 13+. For details, see:
|
|
|
|
// https://github.com/reactor/BlockHound/issues/33
|
|
|
|
jvmArgs += [
|
|
|
|
"-XX:+AllowRedefinitionToAddDeleteMethods"
|
|
|
|
]
|
2020-10-16 18:22:04 +08:00
|
|
|
}
|
2022-02-23 03:09:37 +08:00
|
|
|
|
|
|
|
sourcesJar {
|
2022-08-01 18:12:36 +08:00
|
|
|
dependsOn javapoetSourceJar
|
|
|
|
dependsOn objenesisSourceJar
|
2022-02-23 03:09:37 +08:00
|
|
|
from javapoetSource
|
|
|
|
from objenesisSource
|
|
|
|
}
|
2022-08-01 18:12:36 +08:00
|
|
|
|
|
|
|
eclipse {
|
2022-08-12 17:38:43 +08:00
|
|
|
synchronizationTasks javapoetSourceJar, objenesisSourceJar
|
2022-08-01 18:12:36 +08:00
|
|
|
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))
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2022-08-13 22:18:34 +08:00
|
|
|
|
|
|
|
tasks['eclipse'].dependsOn(javapoetRepackJar, javapoetSourceJar, objenesisRepackJar, objenesisSourceJar)
|