-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle.kts
94 lines (75 loc) · 3.25 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
import java.net.URL
plugins {
kotlin("jvm") version "1.4.21-2"
kotlin("kapt") version "1.4.0"
id("org.jetbrains.dokka") version "1.4.0"
id("io.gitlab.arturbosch.detekt") version "1.7.0"
id("io.morethan.jmhreport") version "0.9.0"
}
group = "ray.eldath"
version = "0.0.1"
val jmhVersion = "1.25.2"
dependencies {
// https://mvnrepository.com/artifact/org.junit.jupiter/junit-jupiter
testImplementation("org.junit.jupiter:junit-jupiter:5.6.1")
// https://mvnrepository.com/artifact/org.openjdk.jmh/jmh-core
testImplementation("org.openjdk.jmh:jmh-core:$jmhVersion")
// https://mvnrepository.com/artifact/org.openjdk.jmh/jmh-generator-annprocess
kaptTest("org.openjdk.jmh:jmh-generator-annprocess:$jmhVersion")
// https://mvnrepository.com/artifact/org.json/json
implementation("org.json:json:20200518")
// https://mvnrepository.com/artifact/org.apache.commons/commons-lang3
implementation("org.apache.commons:commons-lang3:3.9")
implementation(kotlin("stdlib-jdk8"))
}
detekt {
config = files("detekt.yml")
buildUponDefaultConfig = true
reports {
xml { enabled = false }
html { enabled = false }
}
}
tasks.dokkaHtml.configure {
outputDirectory.set(buildDir.resolve("dokka"))
dokkaSourceSets {
configureEach {
reportUndocumented.set(false)
// Allows linking to documentation of the project"s dependencies (generated with Javadoc or Dokka)
// Repeat for multiple links
externalDocumentationLink {
// Root URL of the generated documentation to link with. The trailing slash is required!
url.set(URL("https://commons.apache.org/proper/commons-lang/javadocs/api-release/"))
packageListUrl.set(URL("https://commons.apache.org/proper/commons-lang/javadocs/api-release/package-list"))
}
// Specifies the location of the project source code on the Web.
// If provided, Dokka generates "source" links for each declaration.
// Repeat for multiple mappings
sourceLink {
// Unix based directory relative path to the root of the project (where you execute gradle respectively).
localDirectory.set(file("src/main/kotlin")) // or simply "./"
// URL showing where the source code can be accessed through the web browser
remoteUrl.set(URL("https://github.com/Ray-Eldath/sirius/blob/master/src/main/kotlin"))
// remove src/main/kotlin if you use "./" above
// Suffix which is used to append the line number to the URL. Use #L for GitHub
remoteLineSuffix.set("#L")
}
}
}
}
task("jmh", JavaExec::class) {
main = "ray.eldath.sirius.test.jmh.JmhTest"
classpath = sourceSets["test"].runtimeClasspath
defaultCharacterEncoding = "UTF-8"
finalizedBy(tasks.named("jmhReport"))
}
tasks.test.configure {
useJUnitPlatform()
exclude("**/experiment/**", "**/jmh/**")
}
repositories {
jcenter()
mavenCentral()
}
listOf(tasks.compileKotlin, tasks.compileTestKotlin).forEach { it.get().kotlinOptions.jvmTarget = "11" }
listOf(tasks.compileJava, tasks.compileTestJava).forEach { it.get().options.encoding = "UTF-8" }