2019-09-30 20:14:36 +08:00
|
|
|
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
|
|
|
|
|
2017-08-21 20:41:55 +08:00
|
|
|
description = "Spring Core"
|
|
|
|
|
2019-08-21 02:26:43 +08:00
|
|
|
apply plugin: "kotlin"
|
|
|
|
|
2018-11-08 23:56:48 +08:00
|
|
|
// spring-core includes asm and repackages cglib, inlining both into the spring-core jar.
|
2021-01-12 19:25:01 +08:00
|
|
|
// cglib itself depends on asm and is therefore further transformed by the ShadowJar task to
|
2018-11-08 23:56:48 +08:00
|
|
|
// depend on org.springframework.asm; this avoids including two different copies of asm.
|
2019-08-13 01:36:06 +08:00
|
|
|
def cglibVersion = "3.3.0"
|
2021-03-23 06:11:30 +08:00
|
|
|
def objenesisVersion = "3.2"
|
2017-08-21 20:41:55 +08:00
|
|
|
|
|
|
|
configurations {
|
|
|
|
cglib
|
|
|
|
objenesis
|
2019-09-30 20:14:36 +08:00
|
|
|
coroutines
|
2017-08-21 20:41:55 +08:00
|
|
|
}
|
|
|
|
|
2019-09-30 20:14:36 +08:00
|
|
|
task cglibRepackJar(type: ShadowJar) {
|
2021-05-22 03:16:30 +08:00
|
|
|
archiveBaseName.set('spring-cglib-repack')
|
|
|
|
archiveVersion.set(cglibVersion)
|
2019-09-30 20:14:36 +08:00
|
|
|
configurations = [project.configurations.cglib]
|
|
|
|
relocate 'net.sf.cglib', 'org.springframework.cglib'
|
|
|
|
relocate 'org.objectweb.asm', 'org.springframework.asm'
|
2017-08-21 20:41:55 +08:00
|
|
|
}
|
|
|
|
|
2019-09-30 20:14:36 +08:00
|
|
|
task objenesisRepackJar(type: ShadowJar) {
|
2021-05-22 03:16:30 +08:00
|
|
|
archiveBaseName.set('spring-objenesis-repack')
|
|
|
|
archiveVersion.set(objenesisVersion)
|
2019-09-30 20:14:36 +08:00
|
|
|
configurations = [project.configurations.objenesis]
|
|
|
|
relocate 'org.objenesis', 'org.springframework.objenesis'
|
2017-08-21 20:41:55 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
dependencies {
|
|
|
|
cglib("cglib:cglib:${cglibVersion}@jar")
|
|
|
|
objenesis("org.objenesis:objenesis:${objenesisVersion}@jar")
|
2019-09-30 20:14:36 +08:00
|
|
|
coroutines(project(path: ":kotlin-coroutines", configuration: 'classesOnlyElements'))
|
2021-05-22 03:16:30 +08:00
|
|
|
api(files(cglibRepackJar))
|
|
|
|
api(files(objenesisRepackJar))
|
|
|
|
api(project(":spring-jcl"))
|
2019-08-21 20:28:42 +08:00
|
|
|
compileOnly(project(":kotlin-coroutines"))
|
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")
|
2017-08-21 20:41:55 +08:00
|
|
|
optional("io.projectreactor:reactor-core")
|
2019-08-27 03:13:12 +08:00
|
|
|
optional("io.reactivex:rxjava")
|
|
|
|
optional("io.reactivex:rxjava-reactive-streams")
|
|
|
|
optional("io.reactivex.rxjava2:rxjava")
|
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")
|
2021-05-22 03:16:30 +08:00
|
|
|
testImplementation("io.projectreactor:reactor-test")
|
|
|
|
testImplementation("com.google.code.findbugs:jsr305")
|
|
|
|
testImplementation("javax.annotation:javax.annotation-api")
|
|
|
|
testImplementation("javax.xml.bind:jaxb-api")
|
|
|
|
testImplementation("com.fasterxml.woodstox:woodstox-core")
|
|
|
|
testImplementation("org.xmlunit:xmlunit-assertj")
|
|
|
|
testImplementation("org.xmlunit:xmlunit-matchers")
|
|
|
|
testImplementation(project(":kotlin-coroutines"))
|
|
|
|
testImplementation("io.projectreactor.tools:blockhound")
|
2019-12-28 18:44:40 +08:00
|
|
|
testFixturesImplementation("io.projectreactor:reactor-test")
|
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")
|
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
|
|
|
|
2017-08-21 20:41:55 +08:00
|
|
|
// Inline repackaged cglib classes directly into spring-core jar
|
|
|
|
dependsOn cglibRepackJar
|
|
|
|
from(zipTree(cglibRepackJar.archivePath)) {
|
|
|
|
include "org/springframework/cglib/**"
|
2018-04-11 18:47:55 +08:00
|
|
|
exclude "org/springframework/cglib/core/AbstractClassGenerator*.class"
|
2018-10-12 19:17:01 +08:00
|
|
|
exclude "org/springframework/cglib/core/AsmApi*.class"
|
2018-04-11 21:09:32 +08:00
|
|
|
exclude "org/springframework/cglib/core/KeyFactory.class"
|
|
|
|
exclude "org/springframework/cglib/core/KeyFactory\$*.class"
|
2018-04-11 18:47:55 +08:00
|
|
|
exclude "org/springframework/cglib/core/ReflectUtils*.class"
|
|
|
|
exclude "org/springframework/cglib/proxy/Enhancer*.class"
|
|
|
|
exclude "org/springframework/cglib/proxy/MethodProxy*.class"
|
2017-08-21 20:41:55 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
dependsOn objenesisRepackJar
|
|
|
|
from(zipTree(objenesisRepackJar.archivePath)) {
|
|
|
|
include "org/springframework/objenesis/**"
|
|
|
|
}
|
2019-03-26 04:41:03 +08:00
|
|
|
|
2019-09-30 20:14:36 +08:00
|
|
|
from configurations.coroutines
|
2017-08-21 20:41:55 +08:00
|
|
|
}
|
2020-01-02 17:29:55 +08:00
|
|
|
|
|
|
|
test {
|
2020-10-16 18:22:04 +08:00
|
|
|
// Make sure the classes dir is used on the test classpath (required by ResourceTests)
|
2020-01-02 17:29:55 +08:00
|
|
|
// When test fixtures are involved, the JAR is used by default
|
|
|
|
classpath = sourceSets.main.output.classesDirs + classpath - files(jar.archiveFile)
|
2020-10-16 18:22:04 +08:00
|
|
|
}
|