-
Notifications
You must be signed in to change notification settings - Fork 2
/
build.gradle
136 lines (114 loc) · 3.81 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
import org.flywaydb.gradle.task.FlywayMigrateTask
buildscript {
dependencies {
classpath("org.flywaydb:flyway-database-postgresql:10.10.0")
}
}
plugins {
id 'java'
id 'application'
id 'idea'
id 'org.flywaydb.flyway' version "10.0.0"
}
group 'telraam'
version '1.0-SNAPSHOT'
sourceCompatibility = 17
// Set our project variables
project.ext {
dropwizardVersion = '4.0.5'
jettyVersion = '11.0.19'
}
repositories {
mavenCentral()
}
application {
mainClass.set('telraam.App')
}
tasks.register('runDev') {
finalizedBy {
run.environment("CONFIG_KEY", "DEVELOPMENT")
run.args('server', "$rootProject.projectDir/src/main/resources/telraam/devConfig.yml")
run
}
}
tasks.register('runProd') {
finalizedBy {
run.environment("CONFIG_KEY", "PRODUCTION")
run.args('server', "$rootProject.projectDir/src/main/resources/telraam/prodConfig.yml")
run
}
}
idea {
module {
inheritOutputDirs = true
}
}
build {
finalizedBy(javadoc)
}
dependencies {
// Web framework stuff
implementation(
'io.dropwizard:dropwizard-core:' + dropwizardVersion,
'io.dropwizard:dropwizard-hibernate:' + dropwizardVersion,
'io.dropwizard:dropwizard-auth:' + dropwizardVersion,
'io.dropwizard:dropwizard-jdbi3:' + dropwizardVersion,
'org.eclipse.jetty.websocket:websocket-jetty-api:' + jettyVersion,
'org.eclipse.jetty.websocket:websocket-jetty-server:' + jettyVersion,
)
// Websocket client libs
compileOnly 'jakarta.websocket:jakarta.websocket-client-api:2.2.0-M1'
// Impl for jakarta websocket clients
implementation 'org.eclipse.jetty.websocket:websocket-jakarta-client:11.0.20'
// Database
implementation('com.h2database:h2:2.2.220')
implementation('org.postgresql:postgresql:42.7.3')
// Testing
testImplementation('org.junit.jupiter:junit-jupiter:5.10.2')
testImplementation('org.flywaydb:flyway-core:10.10.0')
testImplementation('org.mockito:mockito-core:5.11.0')
testImplementation("io.dropwizard:dropwizard-testing:" + dropwizardVersion)
// Statistics for Viterbi-lapper
implementation("org.apache.commons:commons-math3:3.6.1")
// JAX-B dependencies for JDK 9+ -> https://stackoverflow.com/a/43574427
implementation 'jakarta.xml.bind:jakarta.xml.bind-api:4.0.2'
implementation 'org.glassfish.jaxb:jaxb-runtime:4.0.5'
// Swagger-UI
implementation('com.smoketurner:dropwizard-swagger:4.0.5-1')
// Getter & Setter via annotations
compileOnly 'org.projectlombok:lombok:1.18.32'
annotationProcessor 'org.projectlombok:lombok:1.18.32'
testCompileOnly 'org.projectlombok:lombok:1.18.32'
testAnnotationProcessor 'org.projectlombok:lombok:1.18.32'
}
test {
environment("CONFIG_KEY", "TESTING")
useJUnitPlatform()
testLogging {
events "passed", "skipped", "failed"
}
}
def prodProps = new Properties()
file("$rootProject.projectDir/src/main/resources/telraam/prodConfig.properties").withInputStream {
prodProps.load(it)
}
tasks.register('migrateProductionDatabase', FlywayMigrateTask) {
url = prodProps.getProperty("DB_URL")
}
def devProps = new Properties()
file("$rootProject.projectDir/src/main/resources/telraam/devConfig.properties").withInputStream {
devProps.load(it)
}
tasks.register('migrateDevelopmentDatabase', FlywayMigrateTask) {
url = devProps.getProperty("DB_URL")
user = devProps.getProperty("DB_USER")
password = devProps.getProperty("DB_PASSWORD")
}
def testProps = new Properties()
file("$rootProject.projectDir/src/test/resources/telraam/testConfig.properties").withInputStream {
testProps.load(it)
}
tasks.register('migrateTestingDatabase', FlywayMigrateTask) {
url = testProps.getProperty("DB_URL")
baselineOnMigrate = true
}