-
Notifications
You must be signed in to change notification settings - Fork 8
/
build.gradle
199 lines (174 loc) · 6.92 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
199
buildscript {
repositories {
mavenCentral()
}
}
plugins {
id 'org.springframework.boot' version '2.7.3'
id "com.gorylenko.gradle-git-properties" version "2.4.2"
id "io.freefair.lombok" version "8.11"
id 'org.jetbrains.kotlin.jvm' version '2.1.0'
id 'org.jetbrains.kotlin.plugin.spring' version '2.0.21'
}
springBoot {
buildInfo {
properties {
artifact = 'formplayer'
version = new Date().format('yyyy-MM-dd HH:mm:ss')
group = 'org.commcare'
name = 'Formplayer'
}
}
}
apply plugin: 'java'
apply plugin: 'eclipse'
apply plugin: 'idea'
apply plugin: 'io.spring.dependency-management'
apply plugin: 'jacoco'
jacoco {
toolVersion = "0.8.10"
}
jar {
enabled = false
}
allprojects{
apply plugin: "java"
}
repositories {
mavenCentral()
maven { url "https://jitpack.io" }
}
ext {
isTravisBuild = System.getenv().get("TRAVIS") == 'true'
sentryVersion = '7.19.0'
shedlockVersion = '6.0.2'
}
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
idea {
module {
excludeDirs += [file("libs/commcare/src/jmh")]
}
}
configurations {
developmentOnly
runtimeClasspath {
extendsFrom developmentOnly
}
}
dependencies {
//Versions managed by Spring Boot Dependency Management
implementation group: 'com.fasterxml.jackson.core', name: 'jackson-databind'
implementation group: 'com.fasterxml.jackson.core', name: 'jackson-core'
implementation group: 'commons-codec', name: 'commons-codec'
implementation group: 'org.apache.commons', name: 'commons-lang3'
implementation group: 'org.flywaydb', name: 'flyway-core'
implementation group: 'org.postgresql', name: 'postgresql'
implementation group: 'org.springframework.boot', name: 'spring-boot-starter-web'
implementation group: 'org.springframework.boot', name: 'spring-boot-starter-actuator'
implementation group: 'org.springframework.boot', name: 'spring-boot-starter'
implementation group: 'org.springframework.boot', name: 'spring-boot-starter-jdbc'
implementation group: 'org.springframework.boot', name: 'spring-boot-autoconfigure'
implementation group: 'org.springframework.boot', name: 'spring-boot-starter-data-jpa'
implementation group: 'org.springframework.boot', name: 'spring-boot-starter-cache'
implementation('org.apache.logging.log4j:log4j-to-slf4j') {
version {
strictly '2.15.0'
}
}
implementation('org.apache.logging.log4j:log4j-api') {
version {
strictly '2.15.0'
}
}
implementation 'org.springframework.boot:spring-boot-starter-security'
implementation group: 'org.xerial', name: 'sqlite-jdbc'
implementation group: 'redis.clients', name: 'jedis'
implementation group: 'io.micrometer', name: 'micrometer-registry-statsd'
implementation group: 'org.springframework', name: 'spring-web'
implementation group: 'org.springframework', name: 'spring-jdbc'
implementation group: 'org.springframework.data', name: 'spring-data-jpa'
implementation group: 'org.springframework.data', name: 'spring-data-redis'
implementation group: 'org.springframework.data', name: 'spring-data-commons'
implementation group: 'org.springframework.integration', name: 'spring-integration-redis'
implementation group: 'org.jetbrains.kotlin', name: 'kotlin-reflect'
implementation group: 'org.jetbrains.kotlin', name: 'kotlin-stdlib-jdk8'
//Unmanaged Dependencies
implementation group: 'com.datadoghq', name: 'dd-trace-api', version: '1.31.2'
implementation group: 'com.datadoghq', name: 'java-dogstatsd-client', version: '4.4.3'
implementation group: 'io.sentry', name: 'sentry-spring-boot-starter', version: "${sentryVersion}"
implementation group: 'io.sentry', name: 'sentry-logback', version: "${sentryVersion}"
implementation group: 'commons-io', name: 'commons-io', version: '2.18.0'
implementation group: 'org.json', name: 'json', version: '20231013'
implementation group: 'org.simpleframework', name: 'simple-xml', version: '2.7.1'
implementation group: 'net.javacrumbs.shedlock', name: 'shedlock-spring', version: "${shedlockVersion}"
implementation group: 'net.javacrumbs.shedlock', name: 'shedlock-provider-jdbc-template', version: "${shedlockVersion}"
implementation group: 'com.google.guava', name: 'guava', version: '32.1.3-jre'
implementation group: 'com.github.ben-manes.caffeine', name: 'jcache', version: '2.8.8'
implementation fileTree(dir: 'libs', include: '*.jar')
implementation project(path: ':commcare', configuration: 'ccapi')
implementation project(path: ':commcare', configuration: 'translate')
testImplementation project(path: ':commcare', configuration: 'ccapi')
// #### DEV / TEST DEPENDENCIES
//Versions managed by Spring Dependency Management
testImplementation('org.springframework.boot:spring-boot-starter-test') {
exclude group: 'org.junit.vintage', module: 'junit-vintage-engine'
}
testImplementation 'org.springframework.security:spring-security-test'
testImplementation group: 'com.jayway.jsonpath', name: 'json-path'
testImplementation group: 'com.jayway.jsonpath', name: 'json-path-assert'
testImplementation group: 'org.mockito', name: 'mockito-junit-jupiter'
testImplementation group: 'org.mockito', name: 'mockito-core'
testImplementation group: 'org.mockito', name: 'mockito-inline'
testImplementation "org.mockito.kotlin:mockito-kotlin:5.4.0"
testRuntimeOnly group: 'org.skyscreamer', name: 'jsonassert'
developmentOnly group: 'org.springframework.boot', name: 'spring-boot-devtools'
}
test {
useJUnitPlatform()
testLogging {
exceptionFormat 'full'
events "passed", "skipped", "failed"
}
if (isTravisBuild) {
System.out.print('Is Travis test run')
maxParallelForks = 1
maxHeapSize = '768m'
forkEvery = 100 // helps when tests leak memory
afterSuite {
System.out.print('.')
System.out.flush()
}
}
finalizedBy jacocoTestReport // report is always generated after tests run
}
task CreateSnapshotDbs(type: Test) {
useJUnitPlatform()
environment('org.commcare.formplayer.test.snapshot.mode', 'write')
filter {
//specific test method
includeTestsMatching "org.commcare.formplayer.utils.GenerateSnapshotDatabases"
}
}
task copyTestResources(type: Copy) {
from "${projectDir}/src/test/resources"
into "${buildDir}/classes/test"
}
test.dependsOn copyTestResources
task copyScripts(type: Copy) {
from "${projectDir}/scripts/archive_dbs.sh"
into "${buildDir}/scripts"
}
assemble.dependsOn copyScripts
jacocoTestReport {
dependsOn test
reports {
xml.required = true
html.required = true
}
}
tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile) {
kotlinOptions {
jvmTarget = "17"
}
}