This repository has been archived by the owner on Feb 23, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathbuild.gradle
85 lines (69 loc) · 2.44 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
buildscript {
ext.kotlin_version = '1.2.10'
ext.vertx_version = '3.5.0'
ext.shadow_version = '2.0.0'
ext.slf4j_version = '1.7.25' // Logging in the app
ext.logback_version = '1.2.3' // Logging to a file, implements SLF4J API, so we can use it with slf4j
ext.retrofit_version = '2.3.0' // HTTP client
ext.retrofit_coroutines_version = '0.9.0' // makes retrofit's calls work with coroutines
ext.kotson_version = '2.5.0' // JSON (w/ Gson) parser
repositories {
jcenter()
}
dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version",
"com.github.jengelman.gradle.plugins:shadow:$shadow_version"
}
}
apply plugin: 'kotlin'
apply plugin: 'application'
apply plugin: 'com.github.johnrengelman.shadow'
repositories {
jcenter()
}
dependencies {
compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
compile "org.jetbrains.kotlin:kotlin-reflect:$kotlin_version"
compile "com.github.salomonbrys.kotson:kotson:$kotson_version"
compile "com.squareup.retrofit2:retrofit:$retrofit_version"
compile "com.squareup.retrofit2:converter-gson:$retrofit_version"
compile "ru.gildor.coroutines:kotlin-coroutines-retrofit:$retrofit_coroutines_version"
compile "io.vertx:vertx-core:$vertx_version"
compile "io.vertx:vertx-web:$vertx_version"
compile "io.vertx:vertx-lang-kotlin:$vertx_version"
compile "io.vertx:vertx-lang-kotlin-coroutines:$vertx_version"
// runtime "org.slf4j:slf4j-jdk14:$slf4j_version"
runtime "ch.qos.logback:logback-classic:$logback_version"
compile "org.slf4j:slf4j-api:$slf4j_version"
}
// this is made for watching classes to redeploy a verticle
mainClassName = "io.vertx.core.Launcher"
def mainVerticleName = "team.ggc.kanzitdinov.vertx_boilerplate.verticles.MainVerticle"
def watchForChange = 'src/**/*.kt'
def doOnChange = 'gradle classes'
run{
args = ['run', mainVerticleName, "--redeploy=$watchForChange",
"--launcher-class=$mainClassName", "--on-redeploy=$doOnChange"]
}
compileKotlin {
kotlinOptions.jvmTarget= "1.8"
}
// Naming and packaging settings for the "shadow jar".
shadowJar {
baseName = 'app'
classifier = 'shadow'
manifest {
attributes 'Main-Verticle': mainVerticleName
}
mergeServiceFiles {
include 'META-INF/services/io.vertx.core.spi.VerticleFactory'
}
}
// when we run `gradle wrapper`
task wrapper(type: Wrapper) {
gradleVersion = '4.4'
}
// Heroku relies on the 'stage' task to deploy.
task stage {
dependsOn shadowJar
}