-
Notifications
You must be signed in to change notification settings - Fork 10
/
build.gradle
198 lines (174 loc) · 7.01 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
188
189
190
191
192
193
194
195
196
197
198
buildscript {
ext {
springBootVersion = '2.4.1'
}
repositories {
mavenCentral()
maven { url 'https://repo.spring.io/snapshot' }
maven { url 'https://repo.jenkins-ci.org/releases/' }
}
dependencies {
classpath group: 'io.github.http-builder-ng', name: 'http-builder-ng-core', version: '1.0.3'
classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
}
}
plugins {
id 'java'
id 'maven-publish'
id 'war'
}
apply plugin: 'org.springframework.boot'
apply plugin: 'io.spring.dependency-management'
repositories {
mavenLocal()
maven {
url = uri('https://oss.sonatype.org/content/repositories/snapshots/')
}
maven {
url = uri('https://repo.maven.apache.org/maven2/')
}
}
bootRun {
if (project.hasProperty('debug')) {
jvmArgs=["-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=0.0.0.0:8081"]
}
}
dependencies {
implementation "io.github.http-builder-ng:http-builder-ng-core:1.0.3"
developmentOnly("org.springframework.boot:spring-boot-devtools")
implementation 'org.eclipse.jetty.websocket:websocket-api:9.4.24.v20191120'
implementation 'org.eclipse.jetty.websocket:websocket-client:9.4.24.v20191120'
implementation 'mysql:mysql-connector-java:8.0.11'
implementation 'org.postgresql:postgresql:42.2.9'
implementation 'com.sun.mail:javax.mail:1.6.1'
implementation 'ca.uhn.hapi.fhir:hapi-fhir-base:5.4.0'
implementation 'ca.uhn.hapi.fhir:hapi-fhir-jpaserver-base:5.4.0'
implementation 'ca.uhn.hapi.fhir:hapi-fhir-jpaserver-cql:5.4.0'
implementation 'ca.uhn.hapi.fhir:hapi-fhir-jpaserver-mdm:5.4.0'
implementation 'ca.uhn.hapi.fhir:hapi-fhir-testpage-overlay:5.4.0'
implementation('org.springframework.boot:spring-boot-starter-data-jpa')
implementation 'org.springframework.boot:spring-boot-starter-web'
implementation 'org.springframework.boot:spring-boot-starter-actuator'
implementation 'ch.qos.logback:logback-classic:1.2.3'
implementation 'org.thymeleaf:thymeleaf:3.0.11.RELEASE'
implementation 'org.springframework:spring-web'
implementation 'org.springframework.boot:spring-boot-autoconfigure'
implementation 'org.springframework:spring-jdbc'
implementation 'org.apache.commons:commons-dbcp2:2.7.0'
implementation 'com.h2database:h2:1.4.200'
implementation 'org.webjars:bootstrap:3.3.7'
implementation 'org.webjars:Eonasdan-bootstrap-datetimepicker:4.17.43'
implementation 'org.webjars:font-awesome:5.8.2'
implementation 'org.webjars.bower:awesome-bootstrap-checkbox:1.0.1'
implementation 'org.webjars:jstimezonedetect:1.0.6'
implementation 'org.webjars:select2:4.0.3'
implementation 'org.webjars.bower:jquery:3.3.1'
implementation 'org.webjars.bower:moment:2.15.1'
implementation 'org.yaml:snakeyaml:1.28'
implementation 'org.ebaysf.web:cors-filter:1.0.1'
implementation 'org.apache.derby:derby:10.14.2.0'
implementation 'org.apache.derby:derbynet:10.14.2.0'
implementation 'org.apache.derby:derbyclient:10.14.2.0'
testImplementation 'org.eclipse.jetty:jetty-servlets:9.4.24.v20191120'
testImplementation 'org.eclipse.jetty:jetty-servlet:9.4.24.v20191120'
testImplementation 'org.eclipse.jetty.websocket:websocket-server:9.4.24.v20191120'
testImplementation 'org.eclipse.jetty:jetty-server:9.4.24.v20191120'
testImplementation 'org.eclipse.jetty:jetty-util:9.4.24.v20191120'
testImplementation 'org.eclipse.jetty:jetty-webapp:9.4.24.v20191120'
testImplementation 'ca.uhn.hapi.fhir:hapi-fhir-test-utilities:4.2.0'
testImplementation 'junit:junit:4.12'
testImplementation 'org.hamcrest:java-hamcrest:2.0.0.0'
testImplementation 'org.mockito:mockito-core:3.2.0'
//implementation 'ca.uhn.hapi.fhir:hapi-fhir-testpage-overlay:4.2.0:war'
implementation 'ca.uhn.hapi.fhir:hapi-fhir-testpage-overlay:4.2.0:classes'
// providedImplementation 'javax.servlet:javax.servlet-api:3.1.0'
implementation 'javax.interceptor:javax.interceptor-api:1.2.2'
}
task loadData{
doLast {
def dataDir = new File(projectDir, "fhirResourcesToLoad/")
def http = groovyx.net.http.HttpBuilder.configure{
request.uri = 'http://localhost:8080'
request.contentType = 'application/json'
}
dataDir.listFiles().sort{ it.name }.each { file->
if (file.name.startsWith(".")){
return
}
println 'Trying to load '+file.name
def resource = new groovy.json.JsonSlurper().parseText(file.text)
http.put {
request.uri.path = '/test-ehr/r4/'+resource.resourceType+'/'+resource.id
request.body = file.text
response.success {
println '... success. '
}
}
}
}
}
task loadBundleResource{
doLast {
def bundleFileDir = new File(projectDir, "bundlefile")
def fileList = bundleFileDir.listFiles()
println(fileList)
fileList.each{bundleFile ->
println '------ Processing file ' + bundleFile.getName()
def bundleResource = new groovy.json.JsonSlurper().parseText(bundleFile.text)
println '---- bundleResource ' + bundleResource
def http = groovyx.net.http.HttpBuilder.configure{
request.uri = 'http://localhost:8080'
request.contentType = 'application/json'
}
def entryResource = bundleResource.entry.resource
entryResource.each { item->
println 'Item type:' + item.resourceType + ' with id:' + item.id
println 'Json of item: ' + groovy.json.JsonOutput.toJson(item)
http.put {
request.uri.path = '/test-ehr/r4/'+item.resourceType+'/'+item.id
request.body = groovy.json.JsonOutput.toJson(item)
response.success {
println '... success. '
}
}
}
}
}
}
task loadRequestBuilder() {
doLast {
setup()
cleanup()
}
}
void setup() {
exec {
workingDir 'src/main/webapp/'
commandLine 'git','clone','--single-branch', '--branch','settings-change-hotfix','https://github.com/HL7-DaVinci/crd-request-generator.git','tempFolder'
}
exec {
workingDir 'src/main/webapp/tempFolder'
commandLine 'npm', 'install'
}
exec {
workingDir 'src/main/webapp/tempFolder'
commandLine 'npm','run-script', 'build'
}
}
void cleanup(){
def folder = new File(rootProject.projectDir.absolutePath + "/src/main/webapp/WEB-INF/build")
if(folder.exists()) {
exec {
workingDir 'src/main/webapp/'
commandLine 'rm', '-rf', 'WEB-INF/build'
}
}
exec {
workingDir 'src/main/webapp'
commandLine 'mv','tempFolder/build', 'WEB-INF/'
}
exec {
workingDir 'src/main/webapp'
commandLine 'rm','-rf','tempFolder'
}
}