-
Notifications
You must be signed in to change notification settings - Fork 38.3k
/
Copy pathspring-core.gradle
164 lines (143 loc) · 5.31 KB
/
spring-core.gradle
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
import org.springframework.build.shadow.ShadowSource
plugins {
id 'me.champeau.mrjar'
}
description = "Spring Core"
apply plugin: "kotlin"
apply plugin: "kotlinx-serialization"
multiRelease {
targetVersions 17, 21
}
def javapoetVersion = "1.13.0"
def objenesisVersion = "3.4"
configurations {
java21Api.extendsFrom(api)
java21Implementation.extendsFrom(implementation)
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")
api(files(javapoetRepackJar))
api(files(objenesisRepackJar))
api("commons-logging:commons-logging")
api("org.jspecify:jspecify")
compileOnly("com.google.code.findbugs:jsr305")
compileOnly("io.projectreactor.tools:blockhound")
compileOnly("org.graalvm.sdk:graal-sdk")
optional("io.micrometer:context-propagation")
optional("io.netty:netty-buffer")
optional("io.netty:netty5-buffer")
optional("io.projectreactor:reactor-core")
optional("io.reactivex.rxjava3:rxjava")
optional("io.smallrye.reactive:mutiny")
optional("net.sf.jopt-simple:jopt-simple")
optional("org.aspectj:aspectjweaver")
optional("org.eclipse.jetty:jetty-io")
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")
testFixturesImplementation("io.projectreactor:reactor-test")
testFixturesImplementation("org.assertj:assertj-core")
testFixturesImplementation("org.junit.platform:junit-platform-launcher")
testFixturesImplementation("org.junit.jupiter:junit-jupiter-api")
testFixturesImplementation("org.junit.jupiter:junit-jupiter-params")
testFixturesImplementation("org.xmlunit:xmlunit-assertj")
testImplementation("com.fasterxml.jackson.core:jackson-databind")
testImplementation("com.fasterxml.woodstox:woodstox-core")
testImplementation("com.google.code.findbugs:jsr305")
testImplementation("com.squareup.okhttp3:mockwebserver")
testImplementation("io.projectreactor:reactor-test")
testImplementation("io.projectreactor.tools:blockhound")
testImplementation("jakarta.annotation:jakarta.annotation-api")
testImplementation("jakarta.xml.bind:jakarta.xml.bind-api")
testImplementation("org.jetbrains.kotlinx:kotlinx-serialization-json")
testImplementation("org.jetbrains.kotlinx:kotlinx-coroutines-reactor")
testImplementation("org.mockito:mockito-core")
testImplementation("com.networknt:json-schema-validator");
testImplementation("org.skyscreamer:jsonassert")
testImplementation("org.xmlunit:xmlunit-assertj")
testImplementation("org.xmlunit:xmlunit-matchers")
}
jar {
manifest.attributes["Dependencies"] = "jdk.unsupported,org.jboss.vfs" // for WildFly (Objenesis and VfsUtils)
dependsOn javapoetRepackJar
from(zipTree(javapoetRepackJar.archiveFile)) {
include "org/springframework/javapoet/**"
}
dependsOn objenesisRepackJar
from(zipTree(objenesisRepackJar.archiveFile)) {
include "org/springframework/objenesis/**"
}
}
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)