Spring Framework
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

97 lines
3.5 KiB

import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
plugins {
id "com.github.johnrengelman.shadow" version "5.2.0"
}
description = "Spring Core"
apply plugin: "kotlin"
// 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 ShadowJar task to
// depend on org.springframework.asm; this avoids including two different copies of asm.
def cglibVersion = "3.3.0"
def objenesisVersion = "3.1"
configurations {
cglib
objenesis
coroutines
}
task cglibRepackJar(type: ShadowJar) {
baseName = 'spring-cglib-repack'
version = cglibVersion
configurations = [project.configurations.cglib]
relocate 'net.sf.cglib', 'org.springframework.cglib'
relocate 'org.objectweb.asm', 'org.springframework.asm'
}
task objenesisRepackJar(type: ShadowJar) {
baseName = 'spring-objenesis-repack'
version = objenesisVersion
configurations = [project.configurations.objenesis]
relocate 'org.objenesis', 'org.springframework.objenesis'
}
dependencies {
cglib("cglib:cglib:${cglibVersion}@jar")
objenesis("org.objenesis:objenesis:${objenesisVersion}@jar")
coroutines(project(path: ":kotlin-coroutines", configuration: 'classesOnlyElements'))
compile(files(cglibRepackJar))
compile(files(objenesisRepackJar))
compile(project(":spring-jcl"))
compileOnly(project(":kotlin-coroutines"))
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("io.projectreactor:reactor-core")
optional("io.reactivex:rxjava")
optional("io.reactivex:rxjava-reactive-streams")
optional("io.reactivex.rxjava2:rxjava")
optional("io.netty:netty-buffer")
testCompile(project(":kotlin-coroutines"))
testCompile("javax.annotation:javax.annotation-api")
testCompile("javax.xml.bind:jaxb-api")
testCompile("com.google.code.findbugs:jsr305")
testCompile("com.fasterxml.woodstox:woodstox-core")
testCompile("org.xmlunit:xmlunit-assertj")
testCompile("org.xmlunit:xmlunit-matchers")
testCompile("io.projectreactor:reactor-test")
testCompile("io.projectreactor.tools:blockhound")
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
// Inline repackaged cglib classes directly into spring-core jar
dependsOn cglibRepackJar
from(zipTree(cglibRepackJar.archivePath)) {
include "org/springframework/cglib/**"
exclude "org/springframework/cglib/core/AbstractClassGenerator*.class"
exclude "org/springframework/cglib/core/AsmApi*.class"
exclude "org/springframework/cglib/core/KeyFactory.class"
exclude "org/springframework/cglib/core/KeyFactory\$*.class"
exclude "org/springframework/cglib/core/ReflectUtils*.class"
exclude "org/springframework/cglib/proxy/Enhancer*.class"
exclude "org/springframework/cglib/proxy/MethodProxy*.class"
}
dependsOn objenesisRepackJar
from(zipTree(objenesisRepackJar.archivePath)) {
include "org/springframework/objenesis/**"
}
from configurations.coroutines
}