-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathbuild.gradle
187 lines (167 loc) · 5.78 KB
/
build.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
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
plugins {
id "java"
id "maven-publish"
id "signing"
id "net.saliman.properties" version "1.5.1"
// Used to deploy the test app
id "com.marklogic.ml-gradle" version "4.4.0"
// Only used for testing
id "org.sonarqube" version "3.5.0.2730"
}
repositories {
mavenLocal()
mavenCentral()
// Needed for some mlcp dependencies; mlcp is used for loading data for the test app
maven { url "https://developer.marklogic.com/maven2/" }
}
configurations {
mlcp
}
dependencies {
mlcp "com.marklogic:mlcp:10.0.9.5"
mlcp "org.apache.commons:commons-csv:1.2"
mlcp files("mlcp-logging")
testImplementation "io.rest-assured:json-path:5.3.0"
testImplementation "io.rest-assured:rest-assured:5.3.0"
testImplementation "io.rest-assured:json-schema-validator:5.3.0"
testImplementation "junit:junit:4.13.2"
testImplementation "com.googlecode.json-simple:json-simple:1.1.1"
}
test {
systemProperty "sonar.projectVersion", project.version
}
task loadTestData(dependsOn: [
"loadGDeltTestData",
"loadGeoLocationTestData"
])
task loadGDeltTestData(type: com.marklogic.gradle.task.MlcpTask) {
classpath = configurations.mlcp
command = "IMPORT"
port = mlAppConfig.restPort
database = mlAppConfig.contentDatabaseName
input_file_path = "data/test/gkg_geojson"
input_compressed = "true"
output_collections = "example-gkg,test-data"
output_permissions = "geo-data-services-reader,read,geo-data-services-writer,update"
output_uri_replace = ".*/data/test/,'/'"
transform_module = "/transform-gkg.sjs"
transform_function = "transformGKG"
}
task loadGeoLocationTestData(type: com.marklogic.gradle.task.MlcpTask) {
classpath = configurations.mlcp
command = "IMPORT"
port = mlAppConfig.restPort
database = mlAppConfig.contentDatabaseName
input_file_path = "data/test/GeoLocation"
input_compressed = "true"
output_collections = "example-geo,test-data"
output_permissions = "geo-data-services-reader,read,geo-data-services-writer,update"
output_uri_replace = ".*/data/test/,'/'"
}
task resetAndTest {
description = "Full reset and test. To run, include the argument -Pconfirm=true (required by mlClearContentDatabase)"
dependsOn 'mlClearContentDatabase', 'mlRedeploy', 'loadTestData', 'cleanTest', 'test'
tasks.findByName('mlRedeploy').mustRunAfter 'mlClearContentDatabase'
tasks.findByName('loadTestData').mustRunAfter 'mlRedeploy'
tasks.findByName('cleanTest').mustRunAfter 'loadTestData'
tasks.findByName('test').mustRunAfter 'cleanTest'
}
/*
* Tasks needed for deploying a gradle plugin to Maven Central
*/
// Defines a configuration for the MarkLogic modules; used by the modulesJar task below
configurations {
modules
}
task sourcesJar(type: Jar) {
description = "Create a jar of the modules to meet Maven Central's requirements for publishing"
classifier "sources"
from "src/main/ml-modules"
destinationDir file("build/libs")
}
task javadocJar(type: Jar, dependsOn: javadoc) {
classifier "javadoc"
from javadoc
}
task modulesJar(type: Jar) {
description = "Creates a package of all GDS files that can be published to Maven Central"
from("src/main/ml-config") {
into "marklogic-geo-data-services/ml-config"
}
from("src/main/ml-modules") {
into "marklogic-geo-data-services/ml-modules"
exclude "root/marklogic-geo-data-services/version.sjs"
}
from("src/main/ml-modules") {
into "marklogic-geo-data-services/ml-modules"
include "root/marklogic-geo-data-services/version.sjs"
filter { String line -> line.replaceAll("%%version%%", version) }
}
from("src/main/ml-plugins") {
into "marklogic-geo-data-services/ml-plugins"
exclude "**/*.o"
exclude "**/*.dylib"
exclude "**/*.zip"
}
destinationDir file("build/libs")
baseName "marklogic-geo-data-services"
}
artifacts {
archives sourcesJar, javadocJar, modulesJar
}
signing {
sign configurations.archives
}
publishing {
publications {
mainJava(MavenPublication) {
pom {
name = "${group}:${project.name}"
description = "Geo Data Services supporting Esri Koop Provider"
packaging = "jar"
url = "https://github.com/marklogic-community/${project.name}"
licenses {
license {
name = "The Apache License, Version 2.0"
url = "http://www.apache.org/licenses/LICENSE-2.0.txt"
}
}
developers {
developer {
id = "marklogic"
name = "MarkLogic Github Contributors"
email = "[email protected]"
organization = "MarkLogic"
organizationUrl = "https://www.marklogic.com"
}
}
scm {
url = "[email protected]:marklogic-community/${project.name}.git"
connection = "scm:[email protected]:marklogic-community/${project.name}.git"
developerConnection = "scm:[email protected]:marklogic-community/${project.name}.git"
}
}
artifact sourcesJar
artifact javadocJar
artifact modulesJar
}
}
repositories {
maven {
if (project.hasProperty("mavenUser")) {
credentials {
username mavenUser
password mavenPassword
}
url publishUrl
} else {
name = "central"
url = mavenCentralUrl
credentials {
username mavenCentralUsername
password mavenCentralPassword
}
}
}
}
}