-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.gradle
115 lines (101 loc) · 3.59 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
/*
* Copyright (C) 2019 Silverbackhq <https://github.com/silverbackhq>
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
* in compliance with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under the License
* is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
* or implied. See the License for the specific language governing permissions and limitations under
* the License.
*/
plugins {
id 'java'
id 'application'
id 'jacoco'
id 'com.diffplug.gradle.spotless' version '4.5.1'
id 'com.github.johnrengelman.shadow' version '7.1.1'
}
spotless {
java {
licenseHeaderFile '.license'
importOrder 'java'
googleJavaFormat('1.1').aosp()
target 'src/**/*.java'
}
}
group = 'org.silverbackhq'
version = '1.1.3'
repositories {
mavenCentral()
}
ext {
junitJupiterEngineVersion = '5.9.1'
vertxVersion = '3.9.12'
javaDotenvVersion = '5.2.2'
flywayCoreVersion = '8.5.2'
h2Version = '1.4.200'
googleJsonSimpleVersion = '1.1.1'
googleGsonVersion = '2.9.0'
googleInjectGuiceVersion = '5.1.0'
clivernKangarooVersion = '0.0.1'
tinylogVersion = '2.4.1'
mysqlConnectorVersion = '8.0.28'
hibernateVersion = '5.6.5.Final'
}
application {
mainClassName = 'io.vertx.core.Launcher'
}
sourceCompatibility = '1.8'
def mainVerticleName = 'org.silverbackhq.reindeer.Application'
def watchForChange = 'src/**/*'
def doOnChange = './gradlew classes'
dependencies {
implementation "io.vertx:vertx-web:$vertxVersion"
implementation "io.github.cdimascio:java-dotenv:$javaDotenvVersion"
implementation "org.flywaydb:flyway-core:$flywayCoreVersion"
implementation "com.h2database:h2:$h2Version"
implementation "com.googlecode.json-simple:json-simple:$googleJsonSimpleVersion"
implementation "com.google.code.gson:gson:$googleGsonVersion"
implementation "com.google.inject:guice:$googleInjectGuiceVersion"
implementation "com.clivern:kangaroo:$clivernKangarooVersion"
implementation "org.tinylog:tinylog-api:$tinylogVersion"
implementation "org.tinylog:tinylog-impl:$tinylogVersion"
implementation "mysql:mysql-connector-java:$mysqlConnectorVersion"
implementation "org.hibernate:hibernate-core:$hibernateVersion"
implementation "org.hibernate:hibernate-c3p0:$hibernateVersion"
testImplementation "io.vertx:vertx-unit:$vertxVersion"
testImplementation "io.vertx:vertx-junit5:$vertxVersion"
testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:$junitJupiterEngineVersion"
testImplementation "org.junit.jupiter:junit-jupiter-api:$junitJupiterEngineVersion"
}
shadowJar {
classifier = 'fat'
manifest {
attributes 'Main-Verticle': mainVerticleName
}
mergeServiceFiles {
include 'META-INF/services/io.vertx.core.spi.VerticleFactory'
}
}
test {
useJUnitPlatform()
testLogging {
events 'PASSED', 'FAILED', 'SKIPPED'
}
}
run {
args = [
'run',
mainVerticleName,
"--redeploy=$watchForChange",
"--launcher-class=$mainClassName",
"--on-redeploy=$doOnChange",
// ./gradlew run -Dexec=migrate -Denv=/path/to/.env
// make ARGS="-Dexec=migrate -Denv=/path/to/.env" run
(System.getProperty("exec") == null) ? "--exec=" : "--exec=" + System.getProperty("exec"),
(System.getProperty("env") == null) ? "--env=" : "--env=" + System.getProperty("env")
]
}