-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle.kts
135 lines (116 loc) · 3.59 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
import io.gitlab.arturbosch.detekt.Detekt
val logbackVersion = "1.2.5"
val koinVersion = "3.1.2"
val ktorVersion = "1.6.2"
val arrowVersion = "0.13.2"
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:1.5.21")
}
}
dependencies {
swaggerUI("org.webjars:swagger-ui:3.51.2")
}
plugins {
id("io.gitlab.arturbosch.detekt") version "1.18.0"
id("org.hidetake.swagger.generator") version "2.18.2"
java
}
val analysisDir = file(projectDir)
val baselineFile = file("$rootDir/config/detekt/baseline.xml")
val configFile = file("$rootDir/config/detekt/detekt.yml")
val statisticsConfigFile = file("$rootDir/config/detekt/statistics.yml")
val kotlinFiles = "**/*.kt"
val kotlinScriptFiles = "**/*.kts"
val resourceFiles = "**/resources/**"
val buildFiles = "**/build/**"
val detektFormat by tasks.registering(Detekt::class) {
description = "Formats whole project."
parallel = true
disableDefaultRuleSets = true
buildUponDefaultConfig = true
autoCorrect = true
setSource(analysisDir)
config.setFrom(listOf(statisticsConfigFile, configFile))
include(kotlinFiles)
include(kotlinScriptFiles)
exclude(resourceFiles)
exclude(buildFiles)
baseline.set(baselineFile)
reports {
xml.enabled = false
html.enabled = false
txt.enabled = false
}
}
val detektAll by tasks.registering(Detekt::class) {
description = "Runs the whole project at once."
parallel = true
buildUponDefaultConfig = true
setSource(analysisDir)
config.setFrom(listOf(statisticsConfigFile, configFile))
include(kotlinFiles)
include(kotlinScriptFiles)
exclude(resourceFiles)
exclude(buildFiles)
baseline.set(baselineFile)
reports {
xml.enabled = false
html.enabled = false
txt.enabled = true
}
}
allprojects {
group = "fr.hadaly"
version = "0.0.1"
extra["arrowVersion"] = "0.13.2"
extra["assertjVersion"] = "3.20.2"
extra["exposedVersion"] = "0.32.1"
extra["flywayVersion"] = "7.11.2"
extra["h2Version"] = "1.4.200"
extra["hikariCpVersion"] = "4.0.3"
extra["junitVersion"] = "5.7.2"
extra["koinVersion"] = "3.1.2"
extra["kotlinVersion"] = "1.5.21"
extra["ktorVersion"] = "1.6.1"
extra["logbackVersion"] = "1.2.3"
extra["postgreVersion"] = "42.2.23"
extra["restAssuredVersion"] = "4.4.0"
extra["web3j"] = "5.0.0"
apply {
plugin("org.jetbrains.kotlin.jvm")
}
repositories {
mavenCentral()
}
dependencies {
implementation("io.insert-koin:koin-ktor:$koinVersion")
implementation("io.insert-koin:koin-logger-slf4j:$koinVersion")
implementation("ch.qos.logback:logback-classic:$logbackVersion")
implementation("io.arrow-kt:arrow-core:$arrowVersion")
testImplementation("io.ktor:ktor-server-test-host:$ktorVersion")
testImplementation("org.jetbrains.kotlin:kotlin-test:1.5.21")
}
tasks.withType<Test> {
useJUnitPlatform()
}
}
swaggerSources {
create("centurio") {
val restApiDir = project(":centurio-restapi").projectDir
setInputFile(file(restApiDir.resolve("src/main/resources/centurio.yaml")))
ui.outputDir = file(restApiDir.resolve("src/main/resources/swagger"))
code.language = "html"
}
}
// Task for Heroku deployment
tasks.create("stage") {
dependsOn("centurio-restapi:installDist")
}
tasks.withType<Detekt>().configureEach {
// Target version of the generated JVM bytecode. It is used for type resolution.
this.jvmTarget = "1.8"
}