-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbuild.gradle
75 lines (62 loc) · 2.08 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
buildscript {
repositories {
jcenter()
maven {
url "https://plugins.gradle.org/m2/"
}
}
dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath "gradle.plugin.org.flywaydb:gradle-plugin-publishing:6.2.0"
}
}
apply plugin: 'kotlin'
apply plugin: 'application'
apply plugin: 'org.flywaydb.flyway'
group 'com.todo.exmaple'
version '0.0.1'
mainClassName = "io.ktor.server.tomcat.EngineMain"
jar {
manifest {
attributes 'Main-Class': "com.todo.exmaple.ApplicationKt"
}
from {
configurations.compile.collect {
it.isDirectory() ? it : zipTree(it)
}
}
}
task stage {
dependsOn installDist
}
sourceSets {
main.kotlin.srcDirs = main.java.srcDirs = ['src']
test.kotlin.srcDirs = test.java.srcDirs = ['test']
main.resources.srcDirs = ['resources']
test.resources.srcDirs = ['testresources']
}
repositories {
mavenLocal()
jcenter()
}
dependencies {
compile "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
compile "io.ktor:ktor-server-tomcat:$ktor_version"
compile "ch.qos.logback:logback-classic:$logback_version"
compile "io.ktor:ktor-jackson:$ktor_version"
compile "org.jetbrains.exposed:exposed:0.17.14"
compile 'com.zaxxer:HikariCP:5.0.1'
compile "org.postgresql:postgresql:42.3.3"
compile 'org.flywaydb:flyway-core:8.5.1'
testCompile "io.ktor:ktor-server-tests:$ktor_version"
}
def JDBC_DATABASE_URL = System.getenv()['JDBC_DATABASE_URL'] == null ? "jdbc:postgresql://localhost:5432/todo" : System.getenv()['JDBC_DATABASE_URL']
def JDBC_DATABASE_USERNAME = System.getenv()['JDBC_DATABASE_USERNAME'] == null ? "ktoruser" : System.getenv()['JDBC_DATABASE_USERNAME']
def JDBC_DATABASE_PASSWORD = System.getenv()['JDBC_DATABASE_PASSWORD'] == null ? "ktorpass" : System.getenv()['JDBC_DATABASE_PASSWORD']
flyway {
url = JDBC_DATABASE_URL
user = JDBC_DATABASE_USERNAME
password = JDBC_DATABASE_PASSWORD
baselineOnMigrate=true
locations = ["filesystem:resources/db/migration"]
}