-
Notifications
You must be signed in to change notification settings - Fork 5
/
build.gradle.kts
169 lines (122 loc) · 4.8 KB
/
build.gradle.kts
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
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
@file:Suppress("SpellCheckingInspection", "PropertyName")
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
val ktor_version: String by project
val kotlin_version: String by project
val logback_version: String by project
val pg_driver_version: String by project
val exposed_version: String by project
val hikari_version: String by project
val spring_security_core_version: String by project
plugins {
application
kotlin("jvm") version "1.3.41"
id("org.jetbrains.kotlin.plugin.serialization") version "1.3.60"
id("com.github.johnrengelman.shadow") version "5.1.0"
id("com.avast.gradle.docker-compose") version "0.9.4"
}
group = "blogify"
version = "0.1.0"
application {
mainClassName = "blogify.backend.bootstrap.BlogifyApplicationBootstrapper"
}
buildscript {
dependencies {
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:1.3.61")
classpath("org.jetbrains.kotlin:kotlin-serialization:1.3.61")
}
}
repositories {
mavenLocal()
jcenter()
maven("https://jitpack.io")
maven { url = uri("https://dl.bintray.com/kittinunf/maven") }
maven { url = uri("https://kotlin.bintray.com/ktor") }
}
dependencies {
// Kt stdlib
implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version")
// Submodules
implementation(project(":reflect"))
// Ktor
implementation("io.ktor:ktor-server-netty:$ktor_version")
implementation("ch.qos.logback:logback-classic:$logback_version")
implementation("io.ktor:ktor-server-core:$ktor_version")
implementation("io.ktor:ktor-websockets:$ktor_version")
implementation("io.ktor:ktor-network-tls:$ktor_version")
implementation("io.ktor:ktor-locations:$ktor_version")
implementation("io.ktor:ktor-auth:$ktor_version")
implementation("io.ktor:ktor-auth-jwt:$ktor_version")
implementation("io.ktor:ktor-jackson:$ktor_version")
// Metadata Extractor
implementation("com.drewnoakes:metadata-extractor:2.12.0")
// Ktor client
implementation("io.ktor:ktor-client-cio:$ktor_version")
implementation("io.ktor:ktor-client-json:$ktor_version")
implementation("io.ktor:ktor-client-json-jvm:$ktor_version")
implementation("io.ktor:ktor-client-jackson:$ktor_version")
// Database stuff
implementation("org.postgresql:postgresql:$pg_driver_version")
implementation("org.jetbrains.exposed:exposed-core:$exposed_version")
implementation("org.jetbrains.exposed:exposed-jdbc:$exposed_version")
implementation("com.zaxxer:HikariCP:$hikari_version")
implementation("com.github.Benjozork:exposed-postgres-extensions:alpha-1")
// Spring security for hashing
implementation("org.springframework.security:spring-security-core:$spring_security_core_version")
// Kolor
implementation("com.andreapivetta.kolor:kolor:0.0.2")
// Result
implementation("com.github.kittinunf.result:result:2.2.0")
implementation("com.github.kittinunf.result:result-coroutines:2.2.0")
// JJWT
implementation("io.jsonwebtoken:jjwt-api:0.10.7")
runtime("io.jsonwebtoken:jjwt-impl:0.10.7")
runtime("io.jsonwebtoken:jjwt-jackson:0.10.7")
// Config
implementation("org.jetbrains.kotlinx:kotlinx-serialization-runtime:0.14.0")
implementation("org.jetbrains.kotlinx:kotlinx-serialization-runtime-configparser:0.14.0")
// Testing
testImplementation("org.junit.jupiter", "junit-jupiter-api", "5.5.2")
testRuntimeOnly("org.junit.jupiter", "junit-jupiter-engine", "5.5.2")
}
kotlin.sourceSets["main"].kotlin.srcDirs("src")
kotlin.sourceSets["test"].kotlin.srcDirs("test")
sourceSets["main"].resources.srcDirs("resources")
sourceSets["test"].resources.srcDirs("testresources")
tasks.withType<Test> {
useJUnitPlatform()
testLogging {
events("passed", "skipped", "failed")
}
}
tasks.withType<KotlinCompile>().configureEach {
kotlinOptions.jvmTarget = "1.8"
}
// Fat jar
tasks.withType<Jar> {
destinationDirectory.set(File("./build/dist/jar"))
manifest {
attributes (
mapOf (
"Main-Class" to application.mainClassName
)
)
}
}
dockerCompose {
useComposeFiles = mutableListOf("./docker-compose.yml")
projectName = "blogify"
waitForTcpPorts = false
stopContainers = true
}
tasks.register("buildAngularProd", Exec::class) {
workingDir = File("src/blogify/frontend")
commandLine = listOf("npm", "run", "build")
}
// blogifyDeploy : this builds angular app, packs the jar and runs the docker-compose config
tasks.register("blogifyDeploy", GradleBuild::class) {
tasks = mutableListOf("buildAngularProd", "shadowJar", "composeUp")
}
// Local test deploy : this packs the jar and runs the docker-compose config
tasks.register("localTestDeploy", GradleBuild::class) {
tasks = mutableListOf("shadowJar", "composeUp")
}