-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
115 lines (93 loc) · 3.34 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
plugins {
id 'java'
// Gradle Properties plugin
id 'net.saliman.properties' version '1.4.6'
// Data Hub plugin
id 'com.marklogic.ml-data-hub' version '5.5.1'
// Data Service plugin
id 'com.marklogic.ml-development-tools' version '4.1.1'
}
repositories {
jcenter()
// Needed for some mlcp dependencies, such as commons-csv:1.5.1-marklogic
maven { url "http://developer.marklogic.com/maven2/" }
}
configurations {
mlcp
}
dependencies {
// MarkLogic Client dependencies
compile group: 'com.marklogic', name: 'marklogic-client-api', version: '5.3.1'
compile group: 'com.marklogic', name: 'ml-javaclient-util', version: '4.1.0'
// Java Logging dependencies
compile group: 'ch.qos.logback', name: 'logback-classic', version: '1.2.3'
// JAX-B dependencies for JDK 9+
implementation "jakarta.xml.bind:jakarta.xml.bind-api:2.3.2"
implementation "org.glassfish.jaxb:jaxb-runtime:2.3.2"
// MarkLogic Content Pump
mlcp "com.marklogic:mlcp:10.0.5"
/**
* mlcp uses Log4j for logging, and if Log4j can't find a configuration file, it will complain and you'll
* get none of mlcp's usually-useful logging. It is recommended then that your Gradle configuration for
* mlcp include a directory or some other resource that provides a log4j.properties file.
*/
mlcp files("lib")
}
ext {
randomJobId = UUID.randomUUID().toString()
}
task loadArticles(type: com.marklogic.gradle.task.MlcpTask) {
classpath = configurations.mlcp
command = "IMPORT"
mode = "local"
host = mlHost
port = mlStagingPort.toInteger()
ssl = sslFlag.toBoolean()
restrict_hosts = mlIsHostLoadBalancer.toBoolean()
input_file_path = "data/articles/pubmed20n0499.xml.gz"
input_file_type = "aggregates"
aggregate_record_element = "PubmedArticle"
uri_id = "PMID"
output_uri_prefix = "/data/pubmed/"
output_uri_suffix = ".xml"
output_collections = "IngestArticles"
output_permissions = "data-hub-common,read,data-hub-common,update"
input_compression_codec = "gzip"
input_compressed = true
}
task harmonizeArticles(type: com.marklogic.gradle.task.RunFlowTask) {
doFirst {
mlUsername = mlFlowOperatorUserName
mlPassword = mlFlowOperatorPassword
}
flowName = "PubMedFlow"
steps = ["2"]
jobId = randomJobId
showOptions = true
}
task loadMeSH(type: com.marklogic.gradle.task.MlcpTask) {
classpath = configurations.mlcp
command = "IMPORT"
mode = "local"
host = mlHost
port = mlFinalPort.toInteger()
ssl = sslFlag.toBoolean()
restrict_hosts = mlIsHostLoadBalancer.toBoolean()
input_file_path = "data/mesh/mesh.nt"
input_file_type = "RDF"
output_graph = "http://id.nlm.nih.gov/mesh"
output_permissions = "data-hub-common,read,data-hub-common,update"
}
task initLoad {
dependsOn 'loadMeSH'
dependsOn 'loadArticles'
dependsOn 'harmonizeArticles'
tasks.findByName('loadMesh')
tasks.findByName('harmonizeArticles').mustRunAfter 'loadArticles'
}
task generateSearchService(type: com.marklogic.client.tools.gradle.EndpointProxiesGenTask) {
serviceDeclarationFile = 'src/main/ml-modules/root/ds/search/service.json'
}
task generateCommentService(type: com.marklogic.client.tools.gradle.EndpointProxiesGenTask) {
serviceDeclarationFile = 'src/main/ml-modules/root/ds/comments/service.json'
}