-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.gradle
99 lines (84 loc) · 2.69 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
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'org.postgresql:postgresql:9.4.1212'
}
}
plugins {
id 'java'
id 'application'
id 'org.flywaydb.flyway' version '6.0.1'
id 'com.github.johnrengelman.shadow' version '5.1.0'
id 'eclipse'
id 'idea'
}
version = '0.5'
sourceCompatibility = '1.8'
def vertxVersion = '3.8.1'
repositories {
jcenter()
}
dependencies {
compile "io.vertx:vertx-core:${vertxVersion}"
compile "io.vertx:vertx-web:${vertxVersion}"
compile "io.vertx:vertx-mysql-postgresql-client:${vertxVersion}"
compile "io.vertx:vertx-auth-oauth2:${vertxVersion}"
compile 'org.flywaydb:flyway-core:4.1.2'
testCompile "junit:junit:4.12"
testCompile "io.vertx:vertx-unit:${vertxVersion}"
testCompile 'com.github.stefanbirkner:system-rules:1.16.0'
runtime 'ch.qos.logback:logback-classic:1.2.3'
runtime 'ch.qos.logback:logback-core:1.2.3'
compile 'org.slf4j:slf4j-api:1.7.28'
}
ext {
configFileName = project.hasProperty('configFileName') ? project.getProperty('configFileName') : 'config.test.json'
configFile = file configFileName
databaseConfig = new groovy.json.JsonSlurper().parse(configFile).database
// not used currently, instead the SLF4J factory / logger is imported and used directly
vertxLoggingSystemProperties = [
"vertx.logger-delegate-factory-class-name": "io.vertx.core.logging.SLF4JLogDelegateFactory"
]
}
def mainVerticleName = 'de.thokari.epages.app.EpagesAppMainVerticle'
mainClassName = 'io.vertx.core.Launcher'
// Vert.x will watch for file changes in this location
def watchForChange = "src/**/*.java,${configFile}"
// Vert.x will call this task on changes
def doOnChange = './gradlew classes'
run {
args = [
'run', mainVerticleName,
"-conf", configFile.absolutePath,
"--launcher-class=$mainClassName",
"--redeploy=$watchForChange",
"--on-redeploy=$doOnChange"
]
// systemProperties = vertxLoggingSystemProperties
doFirst {
println "Using arguments: ${args}"
}
}
flyway {
url = "jdbc:postgresql://${databaseConfig.host}:${databaseConfig.port}/${databaseConfig.database}"
user = databaseConfig.username
password = databaseConfig.password
}
shadowJar {
classifier = 'fat'
manifest {
attributes 'Main-Verticle': mainVerticleName
}
mergeServiceFiles {
include 'META-INF/services/io.vertx.core.spi.VerticleFactory'
}
}
test {
dependsOn flywayClean, flywayMigrate
// systemProperties = vertxLoggingSystemProperties
}
[jar, assembleDist, distTar, distZip, installDist]*.enabled = false
build.dependsOn shadowJar
run.dependsOn flywayMigrate