This repository has been archived by the owner on Sep 22, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 7
/
build.gradle
104 lines (91 loc) · 2.94 KB
/
build.gradle
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
buildscript {
ext {
kotlin_version = '1.3.11'
dokka_version = '0.9.17'
shadow_version = '4.0.3'
slf4j_version = '1.7.25'
logback_version = '1.2.3'
kotlin_logging_version = '1.6.10'
spotless_version = '3.17.0'
}
repositories {
jcenter()
maven { url "https://plugins.gradle.org/m2/" }
}
dependencies {
classpath "org.jetbrains.kotlin:kotlin-allopen:$kotlin_version"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath "org.jetbrains.dokka:dokka-gradle-plugin:$dokka_version"
classpath "com.github.jengelman.gradle.plugins:shadow:$shadow_version"
classpath "com.diffplug.spotless:spotless-plugin-gradle:$spotless_version"
}
}
allprojects {
group 'com.github.kvnxiao'
version '1.0.0-SNAPSHOT'
wrapper {
gradleVersion = '5.1.1'
distributionUrl = "https://services.gradle.org/distributions/gradle-$gradleVersion-all.zip"
}
}
subprojects {
repositories {
jcenter()
}
apply plugin: 'kotlin'
apply plugin: 'kotlin-spring'
apply plugin: 'kotlin-allopen'
apply plugin: 'jacoco'
apply plugin: 'org.jetbrains.dokka'
apply plugin: 'com.github.johnrengelman.shadow'
apply plugin: 'com.diffplug.gradle.spotless'
sourceCompatibility = 1.8
targetCompatibility = 1.8
compileKotlin {
kotlinOptions {
freeCompilerArgs = ["-Xjsr305=strict"]
jvmTarget = "1.8"
}
}
compileTestKotlin {
kotlinOptions {
freeCompilerArgs = ["-Xjsr305=strict"]
jvmTarget = "1.8"
}
}
dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
implementation "org.jetbrains.kotlin:kotlin-reflect:$kotlin_version"
implementation "org.slf4j:slf4j-api:$slf4j_version"
implementation "io.github.microutils:kotlin-logging:$kotlin_logging_version"
testImplementation "org.slf4j:slf4j-api:$slf4j_version"
testImplementation "ch.qos.logback:logback-classic:$logback_version"
testImplementation "junit:junit:4.12"
}
spotless {
kotlin {
trimTrailingWhitespace()
endWithNewline()
ktlint("0.29.0")
licenseHeaderFile "${rootProject.projectDir}/docs/spotless.header"
}
}
dokka {
outputFormat = 'html'
outputDirectory = "$buildDir/javadoc"
}
jacoco {
toolVersion = "0.8.2"
reportsDir = file("$buildDir/reports")
}
jacocoTestReport.dependsOn test
jacocoTestReport {
reports {
xml.enabled = true
xml.destination file("${buildDir}/reports/jacoco/report.xml")
csv.enabled = true
html.destination file("${buildDir}/reports/jacoco/html")
csv.destination file("${buildDir}/reports/jacoco/jacocoTestReport.csv")
}
}
}