forked from neowu/core-ng-project
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle.kts
165 lines (148 loc) · 6.04 KB
/
build.gradle.kts
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
165
plugins {
`java-library`
`maven-publish`
}
apply(plugin = "project")
apply(plugin = "publish")
apply(plugin = "azure-maven")
subprojects {
group = "core.framework"
version = "9.0.8"
repositories {
maven {
url = uri("https://maven.codelibs.org/")
content {
includeGroup("org.codelibs.elasticsearch.module")
}
}
}
}
val elasticVersion = "8.12.2"
val kafkaVersion = "3.7.0"
val jacksonVersion = "2.16.1"
val junitVersion = "5.10.2"
val mockitoVersion = "5.10.0"
val assertjVersion = "3.25.3"
configure(listOf(project("core-ng-api"), project("core-ng-json"), project("core-ng-common"))) {
java {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}
}
project("core-ng-api") {
apply(plugin = "lib")
}
project("core-ng-json") {
apply(plugin = "lib")
dependencies {
api(project(":core-ng-api"))
api(project(":core-ng-common"))
implementation("com.fasterxml.jackson.module:jackson-module-afterburner:${jacksonVersion}")
implementation("com.fasterxml.jackson.datatype:jackson-datatype-jsr310:${jacksonVersion}")
testImplementation("org.junit.jupiter:junit-jupiter-api:${junitVersion}")
testImplementation("org.assertj:assertj-core:${assertjVersion}")
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:${junitVersion}")
}
}
project("core-ng-common") {
apply(plugin = "lib")
dependencies {
api("org.slf4j:slf4j-api:2.0.12")
testImplementation("org.junit.jupiter:junit-jupiter-api:${junitVersion}")
testImplementation("org.assertj:assertj-core:${assertjVersion}")
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:${junitVersion}")
compileOnly("com.github.spotbugs:spotbugs-annotations:4.8.3")
}
}
project("core-ng") {
apply(plugin = "lib")
dependencies {
api(project(":core-ng-json"))
api("org.slf4j:slf4j-api:2.0.12")
implementation("org.javassist:javassist:3.30.2-GA")
implementation("com.fasterxml.jackson.module:jackson-module-afterburner:${jacksonVersion}")
implementation("com.fasterxml.jackson.datatype:jackson-datatype-jsr310:${jacksonVersion}")
implementation("com.squareup.okhttp3:okhttp:4.12.0@jar")
implementation("com.squareup.okio:okio:3.2.0") // okio 3.3.0 has synchronization issue with virtual thread
implementation("org.jetbrains.kotlin:kotlin-stdlib:1.9.22")
implementation("io.undertow:undertow-core:2.3.10.Final") // undertow 2.3.11+ has memory leak issue
implementation("org.apache.kafka:kafka-clients:${kafkaVersion}@jar")
implementation("org.xerial.snappy:snappy-java:1.1.10.5") // used by kafka message compression
compileOnly("org.jboss.logging:jboss-logging-annotations:2.2.1.Final")
compileOnly("com.github.spotbugs:spotbugs-annotations:4.8.3")
testImplementation("org.junit.jupiter:junit-jupiter-api:${junitVersion}")
testImplementation("org.mockito:mockito-junit-jupiter:${mockitoVersion}")
testImplementation("org.assertj:assertj-core:${assertjVersion}")
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:${junitVersion}")
testRuntimeOnly("org.junit.platform:junit-platform-launcher")
testRuntimeOnly("org.hsqldb:hsqldb:2.7.2")
}
}
project("core-ng-test") {
apply(plugin = "lib")
dependencies {
api("org.junit.jupiter:junit-jupiter-api:${junitVersion}")
api("org.mockito:mockito-junit-jupiter:${mockitoVersion}")
api("org.assertj:assertj-core:${assertjVersion}")
implementation(project(":core-ng"))
implementation("org.junit.jupiter:junit-jupiter-engine:${junitVersion}")
implementation("org.junit.platform:junit-platform-launcher")
testRuntimeOnly("org.hsqldb:hsqldb:2.7.2")
}
}
project("core-ng-mongo") {
apply(plugin = "lib")
dependencies {
api(project(":core-ng"))
api("org.mongodb:mongodb-driver-sync:4.11.0")
testImplementation(project(":core-ng-test"))
}
}
project("core-ng-mongo-test") {
apply(plugin = "lib")
dependencies {
implementation(project(":core-ng-test"))
implementation(project(":core-ng-mongo"))
implementation("de.bwaldvogel:mongo-java-server:1.44.0")
}
}
project("core-ng-search") {
apply(plugin = "lib")
dependencies {
api(project(":core-ng"))
api("co.elastic.clients:elasticsearch-java:${elasticVersion}")
implementation("com.fasterxml.jackson.core:jackson-databind:${jacksonVersion}")
testImplementation(project(":core-ng-test"))
}
}
project("core-ng-search-test") {
apply(plugin = "lib")
dependencies {
implementation(project(":core-ng-test"))
implementation(project(":core-ng-search"))
implementation("org.elasticsearch:elasticsearch:${elasticVersion}")
implementation("org.elasticsearch.plugin:transport-netty4:${elasticVersion}")
implementation("org.codelibs.elasticsearch.module:mapper-extras:${elasticVersion}") // used by elasticsearch scaled_float
implementation("org.codelibs.elasticsearch.module:lang-painless:${elasticVersion}")
implementation("org.codelibs.elasticsearch.module:analysis-common:${elasticVersion}") // used by elasticsearch stemmer
implementation("org.codelibs.elasticsearch.module:reindex:${elasticVersion}@jar") // used by elasticsearch deleteByQuery
}
}
val mavenURL = project.properties["mavenURL"] as String? // usage: "gradlew -PmavenURL=/path clean publish"
subprojects {
if (mavenURL != null && project.name.startsWith("core-ng")) {
apply(plugin = "maven-publish")
val mavenDir = file(mavenURL)
assert(mavenDir.exists())
publishing {
publications {
create<MavenPublication>("maven") {
from(components["java"])
}
}
repositories {
maven { url = uri(mavenURL) }
}
}
}
}