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.
|
|
|
|
// cglib itself depends on asm and is therefore further transformed by the JarJar task to
|
|
|
|
// 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"
|
Latest dependency updates (Tomcat 9.0.27, Undertow 2.0.27, RxJava 2.2.13, Gson 2.8.6, Apache Johnzon 1.2.1, Hibernate ORM 5.4.8, EclipseLink 2.7.5, H2 1.4.200, POI 4.1.1, Quartz 2.3.2, WebJars Locator 0.42, HtmlUnit 2.36, Checkstyle 8.26, Mockito 3.1, Objenesis 3.1)
2019-10-30 07:26:45 +08:00
|
|
|
def objenesisVersion = "3.1"
|
2017-08-21 20:41:55 +08:00
|
|
|
|
|
|
|
configurations {
|
|
|
|
jarjar
|
|
|
|
cglib
|
|
|
|
objenesis
|
2019-03-26 04:41:03 +08:00
|
|
|
coroutines {
|
|
|
|
transitive = false
|
|
|
|
}
|
2017-08-21 20:41:55 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
task cglibRepackJar(type: Jar) { repackJar ->
|
|
|
|
repackJar.baseName = "spring-cglib-repack"
|
|
|
|
repackJar.version = cglibVersion
|
|
|
|
|
|
|
|
doLast() {
|
|
|
|
project.ant {
|
2018-10-12 19:17:01 +08:00
|
|
|
taskdef name: "jarjar", classname: "org.pantsbuild.jarjar.JarJarTask",
|
2017-08-21 20:41:55 +08:00
|
|
|
classpath: configurations.jarjar.asPath
|
|
|
|
jarjar(destfile: repackJar.archivePath) {
|
|
|
|
configurations.cglib.each { originalJar ->
|
|
|
|
zipfileset(src: originalJar)
|
|
|
|
}
|
|
|
|
// Repackage net.sf.cglib => org.springframework.cglib
|
|
|
|
rule(pattern: "net.sf.cglib.**", result: "org.springframework.cglib.@1")
|
2018-04-11 18:47:55 +08:00
|
|
|
// As mentioned above, transform cglib's internal asm dependencies from
|
2017-08-21 20:41:55 +08:00
|
|
|
// org.objectweb.asm => org.springframework.asm. Doing this counts on the
|
|
|
|
// the fact that Spring and cglib depend on the same version of asm!
|
|
|
|
rule(pattern: "org.objectweb.asm.**", result: "org.springframework.asm.@1")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
task objenesisRepackJar(type: Jar) { repackJar ->
|
|
|
|
repackJar.baseName = "spring-objenesis-repack"
|
|
|
|
repackJar.version = objenesisVersion
|
|
|
|
|
|
|
|
doLast() {
|
|
|
|
project.ant {
|
2018-10-12 19:17:01 +08:00
|
|
|
taskdef name: "jarjar", classname: "org.pantsbuild.jarjar.JarJarTask",
|
2017-08-21 20:41:55 +08:00
|
|
|
classpath: configurations.jarjar.asPath
|
|
|
|
jarjar(destfile: repackJar.archivePath) {
|
|
|
|
configurations.objenesis.each { originalJar ->
|
|
|
|
zipfileset(src: originalJar)
|
|
|
|
}
|
|
|
|
// Repackage org.objenesis => org.springframework.objenesis
|
|
|
|
rule(pattern: "org.objenesis.**", result: "org.springframework.objenesis.@1")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
dependencies {
|
|
|
|
cglib("cglib:cglib:${cglibVersion}@jar")
|
|
|
|
objenesis("org.objenesis:objenesis:${objenesisVersion}@jar")
|
2018-12-12 23:03:31 +08:00
|
|
|
jarjar("org.pantsbuild:jarjar:1.7.2")
|
2019-08-21 20:28:42 +08:00
|
|
|
coroutines(project(":kotlin-coroutines"))
|
2017-08-21 20:41:55 +08:00
|
|
|
|
|
|
|
compile(files(cglibRepackJar))
|
|
|
|
compile(files(objenesisRepackJar))
|
|
|
|
compile(project(":spring-jcl"))
|
2019-08-21 20:28:42 +08:00
|
|
|
compileOnly(project(":kotlin-coroutines"))
|
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")
|
2017-08-21 20:41:55 +08:00
|
|
|
optional("io.netty:netty-buffer")
|
|
|
|
testCompile("io.projectreactor:reactor-test")
|
2019-08-27 03:13:12 +08:00
|
|
|
testCompile("org.apache.tomcat.embed:tomcat-embed-core")
|
|
|
|
testCompile("com.google.code.findbugs:jsr305")
|
|
|
|
testCompile("org.xmlunit:xmlunit-assertj")
|
|
|
|
testCompile("org.xmlunit:xmlunit-matchers")
|
|
|
|
testCompile("javax.xml.bind:jaxb-api")
|
|
|
|
testCompile("com.fasterxml.woodstox:woodstox-core")
|
2019-08-21 20:28:42 +08:00
|
|
|
testCompile(project(":kotlin-coroutines"))
|
2017-08-21 20:41:55 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
jar {
|
|
|
|
// 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
|
|
|
|
|
|
|
from { configurations.coroutines.collect { it.isDirectory() ? it : zipTree(it) } }
|
2017-08-21 20:41:55 +08:00
|
|
|
}
|