forked from synthetichealth/synthea
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
150 lines (132 loc) · 5.18 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
/*
* This build file was generated by the Gradle 'init' task.
*
* This generated file contains a sample Java project to get you started.
* For more details take a look at the Java Quickstart chapter in the Gradle
* user guide available at https://docs.gradle.org/3.5/userguide/tutorial_java_projects.html
*/
// Apply the java plugin to add support for Java
apply plugin: 'java'
apply plugin: 'application'
apply plugin: 'eclipse'
apply plugin: 'checkstyle'
apply plugin: 'jacoco'
// In this section you declare where to find the dependencies of your project
repositories {
// Use jcenter for resolving your dependencies.
// You can declare any Maven/Ivy/file repository here.
jcenter()
}
checkstyle {
toolVersion '8.4'
//showViolations = true
}
dependencies {
// This dependency is found on compile classpath of this component and consumers.
compile 'com.google.code.gson:gson:2.8.0'
compile 'ca.uhn.hapi.fhir:hapi-fhir-base:3.4.0'
compile 'ca.uhn.hapi.fhir:hapi-fhir-structures-dstu3:3.4.0'
compile 'ca.uhn.hapi.fhir:hapi-fhir-structures-dstu2:3.4.0'
compile 'ca.uhn.hapi.fhir:hapi-fhir-structures-r4:3.4.0'
// C-CDA export uses Apache FreeMarker templates
compile 'org.freemarker:freemarker:2.3.26-incubating'
// location processing
compile group: 'org.apache.sis.core', name: 'sis-referencing', version: '0.8'
compile group: 'org.apache.sis.storage', name: 'sis-storage', version: '0.8'
compile group: 'com.h2database', name: 'h2', version: '1.4.196'
// google guava for some data structures
compile 'com.google.guava:guava:23.0'
compile group: 'guru.nidi', name: 'graphviz-java', version: '0.2.2'
// CSV Stuff
compile group: 'org.apache.commons', name: 'commons-csv', version: '1.5'
compile group: 'com.fasterxml.jackson.dataformat', name: 'jackson-dataformat-csv', version: '2.8.8'
compile group: 'org.yaml', name: 'snakeyaml', version: '1.19'
compile group: 'org.apache.commons', name: 'commons-math3', version: '3.6.1'
compile group: 'org.apache.commons', name: 'commons-text', version: '1.2'
// Java 9 no longer includes these APIs by default
compile group: 'javax.xml.bind', name: 'jaxb-api', version: '2.3.0'
compile 'org.glassfish.jaxb:jaxb-runtime:2.3.0'
compile 'javax.activation:activation:1.1.1'
// get rid of SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
// if we switch to a real logging framework we may want to switch this
compile "org.slf4j:slf4j-api:1.6.1"
compile "org.slf4j:slf4j-nop:1.6.1"
// Use JUnit test framework
testCompile 'junit:junit:4.12'
testCompile fileTree(dir: 'lib/mdhtruntime/mdht', include: '*.jar')
testCompile fileTree(dir: 'lib/mdhtruntime/non-mdht', include: '*.jar')
testCompile 'org.mockito:mockito-core:2.19.0'
testCompile 'org.powermock:powermock-module-junit4:1.7.1'
testCompile 'org.powermock:powermock-api-mockito2:1.7.1'
testCompile 'ca.uhn.hapi.fhir:hapi-fhir-validation:3.4.0'
testCompile 'ca.uhn.hapi.fhir:hapi-fhir-validation-resources-dstu3:3.4.0'
testCompile 'ca.uhn.hapi.fhir:hapi-fhir-validation-resources-dstu2:3.4.0'
testCompile 'ca.uhn.hapi.fhir:hapi-fhir-validation-resources-r4:3.4.0'
testCompile 'com.helger:ph-schematron:5.0.6'
testCompile 'com.phloc:phloc-schematron:2.7.1'
testCompile 'com.phloc:phloc-commons:4.4.11'
}
// Provide more descriptive test failure output
test {
testLogging {
exceptionFormat = 'full'
}
}
buildscript {
repositories {
jcenter()
}
dependencies {
// commons-io used in getting the version id below
classpath group: 'commons-io', name: 'commons-io', version: '2.5'
// note that commons-io is already a dependency
// of commons-csv in the primary dependencies above
}
}
jacocoTestReport {
reports {
xml.enabled true
html.enabled true
}
}
check.dependsOn jacocoTestReport
task graphviz(type: JavaExec) {
description 'Generate rule visualization'
classpath sourceSets.main.runtimeClasspath
main = "Graphviz"
}
task concepts(type: JavaExec) {
description 'Create a list of simulated concepts'
classpath sourceSets.main.runtimeClasspath
main = "org.mitre.synthea.helpers.Concepts"
}
task versionTxt() {
doLast {
// the ruby version uses `git rev-parse HEAD` which just produces the long commit hash.
// "git describe" can use tags or fallback to the commit hash if necessary.
// this assumes (as does the ruby version) that git will always be present when building
String[] cmd = ["git", "describe", "--tags", "--always"]
Process p = Runtime.getRuntime().exec(cmd)
p.waitFor()
def version = org.apache.commons.io.IOUtils.toString(p.getInputStream(), java.nio.charset.StandardCharsets.UTF_8)
def file = new File("$projectDir/src/main/resources/version.txt")
file.createNewFile()
file.text = version
}
}
compileJava.dependsOn versionTxt
task cleanOutput {
doLast {
delete fileTree(dir: 'output', include: '**/*')
}
}
// Define the main class for the application
mainClassName = 'App'
run {
// args are called "arams" because they are called with -P,
// ex. gradle run -Params="['arg1', 'args2']"
// see https://stackoverflow.com/questions/27604283/gradle-task-pass-arguments-to-java-application
if (project.hasProperty("arams")) {
args Eval.me(arams)
}
}