-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbuild.gradle.kts
More file actions
115 lines (100 loc) · 3.2 KB
/
build.gradle.kts
File metadata and controls
115 lines (100 loc) · 3.2 KB
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
plugins {
idea
application
id("org.jetbrains.kotlin.jvm").version("1.3.61")
id("io.franzbecker.gradle-lombok").version("5.0.0")
id("com.github.ben-manes.versions") version "0.51.0"
}
repositories {
mavenCentral()
}
val spekVersion = "2.0.9"
val lombokVersion = "1.18.34"
val junitJupiterVersion = "5.6.0"
dependencies {
implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8")
testImplementation("org.assertj:assertj-core:3.26.3")
testImplementation("com.google.guava:guava:33.3.1-jre")
testImplementation("org.jetbrains.kotlin:kotlin-test")
testImplementation("org.jetbrains.kotlin:kotlin-test-junit")
testImplementation("org.junit.jupiter:junit-jupiter:$junitJupiterVersion")
// lombok for java classes... yes, I'm lazy:
annotationProcessor(platform("org.projectlombok:lombok:$lombokVersion"))
annotationProcessor("org.projectlombok:lombok")
testAnnotationProcessor("org.projectlombok:lombok")
// spekframework
testImplementation("org.spekframework.spek2:spek-dsl-jvm:$spekVersion") {
exclude(group = "org.jetbrains.kotlin")
}
testRuntimeOnly("org.spekframework.spek2:spek-runner-junit5:$spekVersion") {
exclude(group = "org.jetbrains.kotlin")
exclude(group = "org.junit.platform")
}
// spek requires kotlin-reflect, can be omitted if already in the classpath
testRuntimeOnly("org.jetbrains.kotlin:kotlin-reflect")
}
application {
mainClassName = "com.github.daggerok.AppKt"
}
// bash build/install/fold-java/bin/fold-java
defaultTasks("clean", "build", "installDist")
// java files location in src/main/kotlin directory workaround
sourceSets {
main {
java.srcDir("src/main/kotlin")
}
}
// gradle wrapper configuration workaround
tasks {
withType<Wrapper> {
gradleVersion = "6.1.1"
}
}
// gradle tests output stdOut workaround
tasks {
test {
// useJUnit()
useJUnitPlatform {
includeEngines.add("spek2")
}
testLogging {
showExceptions = true
showStandardStreams = true
events(
org.gradle.api.tasks.testing.logging.TestLogEvent.PASSED,
org.gradle.api.tasks.testing.logging.TestLogEvent.SKIPPED,
org.gradle.api.tasks.testing.logging.TestLogEvent.FAILED
)
}
}
}
/*tasks.withType<Test> {
addTestOutputListener { testDescriptor: TestDescriptor, outputEvent: TestOutputEvent ->
logger.quiet("${testDescriptor.parent}\n\t${testDescriptor.name}")
logger.quiet("${outputEvent.destination}")
logger.quiet("${outputEvent.message}")
}
}*/
lombok.version = lombokVersion
// you don't need this lombok stuff...
/*tasks {
val delombok by registering(io.franzbecker.gradle.lombok.task.DelombokTask::class)
delombok {
dependsOn(compileJava)
val outputDir by extra { file("$buildDir/delombok") }
outputs.dir(outputDir)
sourceSets.getByName("main").java.srcDirs.forEach {
inputs.dir(it)
args(it, "-d", outputDir)
}
doFirst {
outputDir.delete()
}
}
javadoc {
dependsOn(delombok)
val outputDir: File by delombok.get().extra
source = fileTree(outputDir)
isFailOnError = false
}
}*/