-
Notifications
You must be signed in to change notification settings - Fork 74
Expand file tree
/
Copy pathbuild.gradle
More file actions
217 lines (188 loc) · 8.19 KB
/
build.gradle
File metadata and controls
217 lines (188 loc) · 8.19 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
// Copyright © 2024 MarkLogic Corporation. All Rights Reserved.
plugins {
id 'java-library'
id 'maven-publish'
}
group = 'com.marklogic'
description = "The official MarkLogic Java client API."
dependencies {
// With 7.0.0, now using the Jakarta JAXB APIs instead of the JAVAX JAXB APIs that were bundled in Java 8.
// To ease support for Java 8, we are depending on version 3.x of the Jakarta JAXB APIs as those only require Java 8,
// whereas the 4.x version requires Java 11 or higher.
api "jakarta.xml.bind:jakarta.xml.bind-api:3.0.1"
implementation "org.glassfish.jaxb:jaxb-runtime:3.0.2"
implementation 'com.squareup.okhttp3:okhttp:4.12.0'
implementation 'com.squareup.okhttp3:logging-interceptor:4.12.0'
implementation 'io.github.rburgst:okhttp-digest:2.7'
// We tried upgrading to the org.eclipse.angus:angus-mail dependency, but we ran into significant performance issues
// with using the Java Client eval call in our Spark connector. Example - an eval() call for getting 50k URIs would
// take 50s instead of 2 to 3s. Haven't dug into the details, but seems like the call isn't lazy and the entire set
// of URIs is being retrieved. This implementation - in the old "com.sun.mail" package but still adhering to the new
// jakarta.mail API - works fine and performs well for eval calls.
implementation "com.sun.mail:jakarta.mail:2.0.1"
implementation 'javax.ws.rs:javax.ws.rs-api:2.1.1'
implementation 'org.slf4j:slf4j-api:2.0.16'
implementation "com.fasterxml.jackson.core:jackson-databind:${jacksonVersion}"
implementation "com.fasterxml.jackson.dataformat:jackson-dataformat-csv:${jacksonVersion}"
// Only used by extras (which some examples then depend on)
compileOnly 'org.jdom:jdom2:2.0.6.1'
compileOnly 'org.dom4j:dom4j:2.1.4'
compileOnly 'com.google.code.gson:gson:2.10.1'
testImplementation 'org.junit.jupiter:junit-jupiter:5.11.1'
// Forcing junit version to avoid vulnerability with older version in xmlunit
testImplementation 'junit:junit:4.13.2'
testImplementation 'org.xmlunit:xmlunit-legacy:2.10.0'
testImplementation project(':examples')
// Allows talking to the Manage API.
testImplementation ("com.marklogic:ml-app-deployer:5.0.0") {
exclude module: "marklogic-client-api"
}
// Starting with mockito 5.x, Java 11 is required, so sticking with 4.x as we have to support Java 8.
testImplementation "org.mockito:mockito-core:4.11.0"
testImplementation "org.mockito:mockito-inline:4.11.0"
testImplementation "com.squareup.okhttp3:mockwebserver:4.12.0"
testImplementation "com.fasterxml.jackson.dataformat:jackson-dataformat-xml:${jacksonVersion}"
testImplementation 'ch.qos.logback:logback-classic:1.3.15'
// Using this to avoid a schema validation issue with the regular xercesImpl
testImplementation 'org.opengis.cite.xerces:xercesImpl-xsd11:2.12-beta-r1667115'
testImplementation 'org.apache.commons:commons-lang3:3.17.0'
testImplementation 'com.opencsv:opencsv:5.10'
testImplementation 'org.skyscreamer:jsonassert:1.5.3'
}
// Ensure that mlHost and mlPassword can override the defaults of localhost/admin if they've been modified
test {
useJUnitPlatform()
systemProperty "TEST_HOST", mlHost
systemProperty "TEST_ADMIN_PASSWORD", mlPassword
// Needed by the tests for the example programs
systemProperty "EXAMPLE_HOST", mlHost
systemProperty "EXAMPLE_ADMIN_PASSWORD", mlPassword
systemProperty "TEST_USE_REVERSE_PROXY_SERVER", testUseReverseProxyServer
}
task sourcesJar(type: Jar) {
archiveClassifier = 'sources'
exclude ('property', '*.xsd', '*.xjb')
from sourceSets.main.allSource
}
javadoc {
maxMemory="6000m"
options.overview = "src/main/javadoc/overview.html"
options.windowTitle = "$rootProject.describedName $rootProject.version"
options.docTitle = "$rootProject.describedName $rootProject.version"
options.bottom = "Copyright © 2024 MarkLogic Corporation. All Rights Reserved."
options.links = [ 'http://docs.oracle.com/javase/8/docs/api/' ]
options.use = true
if (JavaVersion.current().isJava9Compatible()) {
options.addBooleanOption('html4', true)
}
exclude([
'**/impl/**', '**/jaxb/**', '**/test/**'
])
// workaround for bug in options.docFilesSubDirs = true
doLast{
copy{
from "${projectDir}/src/main/javadoc/doc-files"
into "${buildDir}/docs/javadoc/doc-files"
}
}
}
task javadocJar(type: Jar, dependsOn: javadoc) {
archiveClassifier = 'javadoc'
from javadoc.destinationDir
}
Node pomCustomizations = new NodeBuilder(). project {
name "$rootProject.describedName"
packaging 'jar'
textdescription "$project.description"
url 'https://github.com/marklogic/java-client-api'
scm {
url 'git@github.com:marklogic/java-client-api.git'
connection 'scm:git:git@github.com:marklogic/java-client-api.git'
developerConnection 'scm:git:git@github.com:marklogic/java-client-api.git'
}
licenses {
license {
name 'The Apache License, Version 2.0'
url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
}
}
developers {
developer {
name 'MarkLogic'
email 'java-sig@marklogic.com'
organization 'MarkLogic'
organizationUrl 'https://www.marklogic.com'
}
developer {
name 'MarkLogic Github Contributors'
email 'general@developer.marklogic.com'
organization 'Github Contributors'
organizationUrl 'https://github.com/marklogic/java-client-api/graphs/contributors'
}
}
}
publishing {
publications {
mainJava(MavenPublication) {
from components.java
pom.withXml {
asNode().append(pomCustomizations.packaging)
asNode().append(pomCustomizations.name)
asNode().appendNode("description", pomCustomizations.textdescription.text())
asNode().append(pomCustomizations.url)
asNode().append(pomCustomizations.licenses)
asNode().append(pomCustomizations.developers)
asNode().append(pomCustomizations.scm)
}
artifact sourcesJar
artifact javadocJar
}
}
repositories {
maven {
if(project.hasProperty("mavenUser")) {
credentials {
username mavenUser
password mavenPassword
}
}
url publishUrl
}
}
}
task printClassPath() {
doLast {
println sourceSets.main.runtimeClasspath.asPath+':'+sourceSets.test.runtimeClasspath.asPath
}
}
task generatePomForDependencyGraph(dependsOn: "generatePomFileForMainJavaPublication") {
description = "Prepare for a release by making a copy of the generated pom file in the root directory so that it " +
"can enable Github's Dependency Graph feature, which does not yet support Gradle"
doLast {
def preamble = '<?xml version="1.0" encoding="UTF-8"?>'
def comment = "<!--\n" +
"This file was generated via Gradle and is being used primarily for github's Dependency Graph feature.\n" +
"It is not intended to be used to build this project.\n" +
"-->"
def fileText = file("build/publications/mainJava/pom-default.xml").getText()
file("../pom.xml").setText(fileText.replace(preamble, preamble + comment))
}
}
task testRows(type: Test) {
useJUnitPlatform()
description = "Run all 'rows' tests; i.e. those exercising Optic and Optic Update functionality"
include "com/marklogic/client/test/rows/**"
}
task debugCloudAuth(type: JavaExec) {
description = "Test program for manual testing of cloud-based authentication against a Progress Data Cloud instance"
main = 'com.marklogic.client.test.MarkLogicCloudAuthenticationDebugger'
classpath = sourceSets.test.runtimeClasspath
args = [cloudHost, cloudKey, cloudBasePath]
}
task runXmlSmokeTests(type: Test) {
description = "Run a bunch of XML-related tests for smoke-testing on a particular JVM"
include "com/marklogic/client/test/BufferableHandleTest.class"
include "com/marklogic/client/test/EvalTest.class"
include "com/marklogic/client/test/HandleAsTest.class"
include "com/marklogic/client/test/JAXBHandleTest.class"
}