-
Notifications
You must be signed in to change notification settings - Fork 20
Expand file tree
/
Copy pathbuild.gradle
More file actions
253 lines (206 loc) · 7.9 KB
/
Copy pathbuild.gradle
File metadata and controls
253 lines (206 loc) · 7.9 KB
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
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
/*
** OKafka Java Client version 23.6.
**
** Copyright (c) 2019, 2024 Oracle and/or its affiliates.
** Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
*/
buildscript {
repositories {
mavenCentral()
}
}
allprojects {
repositories {
mavenCentral()
}
group = 'org.oracle.okafka'
version = '23.8.0.0'
tasks.withType(Javadoc) {
// disable the crazy super-strict doclint tool in Java 8
// noinspection SpellCheckingInspection
title ="Oracle Kafka 23.8.0.0 API"
options.addStringOption('Xdoclint:none', '-quiet')
options.windowTitle = "Oracle Database Transactional Event Queues Java API Reference"
options.header = """<b>Oracle® Database Transactional Event Queues Java API Reference<br>23ai</b><br>FF46992-04<br>"""
options.bottom = """<center><small>Copyright © 2001, 2024, Oracle and/or its affiliates. All rights reserved.<small></center><p><small><br></small></p>"""
options.links("https://kafka.apache.org/36/javadoc/")
}
}
ext {
gradleVersion = '8.8'
minJavaVersion = JavaVersion.VERSION_11
mavenUrl = project.hasProperty('mavenUrl') ? project.mavenUrl : ''
mavenUsername = project.hasProperty('mavenUsername') ? project.mavenUsername : ''
mavenPassword = project.hasProperty('mavenPassword') ? project.mavenPassword : ''
}
project(':clients') {
apply plugin : 'java-library'
java {
sourceCompatibility = minJavaVersion
targetCompatibility = minJavaVersion
}
sourceSets {
main {
java {
srcDir 'src/main/java'
}
}
}
println 'Building okafka 23.8.0.0 Java API jar'
dependencies {
// These dependencies are used by the application.
implementation group: 'com.oracle.database.jdbc', name: 'ojdbc11', version: '23.4.0.24.05'
implementation group: 'com.oracle.database.messaging', name: 'aqapi', version: '23.3.0.0'
implementation group: 'javax.transaction', name: 'jta', version: '1.1'
implementation group: 'javax.jms', name: 'javax.jms-api', version: '2.0'
implementation group: 'com.oracle.database.security', name: 'oraclepki', version: '23.4.0.24.05'
implementation group: 'org.slf4j', name: 'slf4j-api', version: '2.0.0-alpha0'
runtimeOnly group: 'org.slf4j', name: 'slf4j-simple', version: '2.0.0-alpha0'
implementation group: 'org.apache.kafka', name: 'kafka-clients', version: '3.9.2'
// Test dependencies
testImplementation group: 'junit', name: 'junit', version: '4.12'
}
javadoc {
include "org/oracle/okafka/clients/admin/*"
include "org/oracle/okafka/clients/consumer/*"
include "org/oracle/okafka/clients/producer/*"
include "org/oracle/okafka/common/errors/*"
}
tasks.named('jar') {
description('Generates okafka 23.8.0.0 API jar ')
archiveBaseName = 'okafka'
archiveVersion = '23.8.0.0'
from "${rootProject.projectDir}/LICENSE.txt"
from "${rootProject.projectDir}/NOTICE"
manifest {
attributes (
'Implementation-Title' : 'okafka',
'Implementation-Version': project.version,
'Version': '23.8.0.0',
'Build-Time-ISO-8601':new Date().format("yyyy-MM-dd HH:mm:ss")
)
}
}
tasks.register('fullJar', Jar) {
archiveBaseName = 'okafka'
archiveClassifier = 'full'
manifest {
attributes( 'Implementation-Title' : 'okafka',
'Implementation-Version': project.version)
}
from "${rootProject.projectDir}/LICENSE.txt"
from "${rootProject.projectDir}/NOTICE"
from sourceSets.main.output
dependsOn configurations.runtimeClasspath
from {
configurations.runtimeClasspath.findAll { it.name.endsWith('jar') }.collect { zipTree(it) }
}
duplicatesStrategy 'exclude'
}
tasks.named('test') {
description = 'Runs fast unit tests. OKafka TEQ integration tests run with integrationTest.'
exclude 'org/oracle/okafka/tests/**'
testLogging {
events 'passed', 'skipped', 'failed'
exceptionFormat 'full'
}
}
tasks.register('integrationTest', Test) {
description = 'Runs OKafka integration tests that require Oracle TEQ configuration.'
group = 'verification'
testClassesDirs = sourceSets.test.output.classesDirs
classpath = sourceSets.test.runtimeClasspath
include 'org/oracle/okafka/tests/**'
shouldRunAfter tasks.named('test')
testLogging {
events 'passed', 'skipped', 'failed'
exceptionFormat 'full'
}
}
tasks.register('runIntegrationTestSuite', JavaExec) {
description = 'Runs the OKafka integration test suite through org.oracle.okafka.tests.TestRunner.'
group = 'verification'
dependsOn tasks.named('testClasses')
classpath = sourceSets.test.runtimeClasspath
mainClass = 'org.oracle.okafka.tests.TestRunner'
}
tasks.named('check') {
if (project.hasProperty('runIntegrationTests')) {
dependsOn tasks.named('integrationTest')
}
}
}
project(':examples:consumer') {
apply plugin : 'java'
apply plugin : 'application'
java {
sourceCompatibility = minJavaVersion
targetCompatibility = minJavaVersion
}
dependencies {
// These dependencies are used by the application.
implementation project(':clients')
implementation group: 'com.oracle.database.security', name: 'oraclepki', version: '23.4.0.24.05'
implementation group: 'org.apache.kafka', name: 'kafka-clients', version: '3.9.2'
}
tasks.named('jar') {
description('Generates okafka client consumer jar ')
archiveBaseName = 'okafka'
archiveClassifier = 'consumer'
from "${rootProject.projectDir}/LICENSE.txt"
from "${rootProject.projectDir}/NOTICE"
manifest {
attributes( 'Implementation-Title' : 'okafka consumer',
'Implementation-Version': project.version)
}
}
tasks.named('run') {
description('Run okafka client simple consumer')
application {
mainClass = 'org.oracle.okafka.examples.ConsumerOKafka'
}
}
}
project(':examples:producer') {
apply plugin : 'java'
apply plugin : 'application'
java {
sourceCompatibility = minJavaVersion
targetCompatibility = minJavaVersion
}
dependencies {
// These dependencies are used by the application.
implementation project(':clients')
implementation group: 'com.oracle.database.security', name: 'oraclepki', version: '23.4.0.24.05'
implementation group: 'org.apache.kafka', name: 'kafka-clients', version: '3.9.2'
}
tasks.named('jar') {
description('Generates okafka client simple producer jar ')
archiveBaseName = 'okafka'
archiveClassifier = 'producer'
from "${rootProject.projectDir}/LICENSE.txt"
from "${rootProject.projectDir}/NOTICE"
manifest {
attributes( 'Implementation-Title' : 'okafka producer',
'Implementation-Version': project.version)
}
}
tasks.named('run') {
description('Run okafka client simple producer')
application {
mainClass = 'org.oracle.okafka.examples.ProducerOKafka'
}
}
}
configurations {
childJar
}
dependencies {
subprojects.each {
childJar project(it.path)
}
}
task multiProjectJar (type: Jar, dependsOn: configurations.childJar) {
description 'Generates a jar containing okafka client, all its dependencies and examples for okafka demo'
from { configurations.childJar.collect { zipTree(it) } }
}