forked from Baeldung/kotlin-tutorials
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle.kts
48 lines (40 loc) · 1.14 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
plugins {
kotlin("jvm") version "2.0.0"
kotlin("kapt") version "2.0.0"
id("io.gitlab.arturbosch.detekt") version "1.23.0"
id("org.jlleitschuh.gradle.ktlint") version "10.2.0"
}
repositories {
mavenCentral()
}
buildscript {
dependencies {
classpath("org.jlleitschuh.gradle:ktlint-gradle:10.2.0")
}
}
dependencies {
detektPlugins("io.gitlab.arturbosch.detekt:detekt-formatting:1.23.0")
testImplementation(kotlin("test"))
}
dependencies {
testImplementation(platform("org.junit:junit-bom:5.9.1"))
testImplementation("org.junit.jupiter:junit-jupiter")
}
tasks.test {
useJUnitPlatform()
}
tasks.withType<Test> {
environment("CUSTOM_PROPERTY", project.findProperty("custom.property") as String)
environment("API_URL", project.findProperty("api.url") as String)
}
tasks.register<Copy>("generateCustomProperties") {
from("${project.rootDir}/gradle.properties")
into("src/generated/resources")
rename { "custom.properties" }
}
tasks.named<Copy>("processResources") {
dependsOn("generateCustomProperties")
from("src/generated/resources") {
include("custom.properties")
}
}