1
1
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
2
2
3
3
plugins {
4
- id(" org.jetbrains.kotlin.jvm" ) version " 1.4.32"
5
- kotlin(" plugin.serialization" ) version " 1.4.32"
6
- id(" io.gitlab.arturbosch.detekt" ) version " 1.16.0"
7
- id(" org.jlleitschuh.gradle.ktlint" ) version " 9.4.1"
8
- id(" org.jlleitschuh.gradle.ktlint-idea" ).version(" 9.4.1" )
4
+ val kotlinVersion = " 1.5.31"
5
+ id(" org.jetbrains.kotlin.jvm" ) version kotlinVersion
6
+ kotlin(" plugin.serialization" ) version kotlinVersion
7
+ id(" io.gitlab.arturbosch.detekt" ) version " 1.18.1"
8
+ id(" org.jlleitschuh.gradle.ktlint" ) version " 10.2.0"
9
+ id(" org.jlleitschuh.gradle.ktlint-idea" ).version(" 10.2.0" )
9
10
id(" org.jetbrains.dokka" ) version " 1.4.30"
10
- id(" com.novoda.static-analysis" ) version " 1.2"
11
- id(" com.diffplug.spotless" ) version " 5.7.0"
11
+ id(" com.diffplug.spotless" ) version " 5.15.0"
12
12
// id("com.vanniktech.maven.publish") version "0.13.0"
13
- id(" io.github.gradle-nexus.publish-plugin" ) version " 1.0 .0"
13
+ id(" io.github.gradle-nexus.publish-plugin" ) version " 1.1 .0"
14
14
signing
15
15
`maven- publish`
16
16
`java- library`
17
17
}
18
18
19
19
group = " tech.alexib"
20
- version = " 0.0.21"
21
20
22
21
repositories {
23
22
mavenCentral()
24
- jcenter {
25
- content {
26
- // Only download the 'kotlinx-html-jvm' module from JCenter, but nothing else.
27
- // detekt needs 'kotlinx-html-jvm' for the HTML report.
28
- includeModule(" org.jetbrains.kotlinx" , " kotlinx-html-jvm" )
29
- }
30
- }
23
+ // jcenter {
24
+ // content {
25
+ // // Only download the 'kotlinx-html-jvm' module from JCenter, but nothing else.
26
+ // // detekt needs 'kotlinx-html-jvm' for the HTML report.
27
+ // includeModule("org.jetbrains.kotlinx", "kotlinx-html-jvm")
28
+ // }
29
+ // }
31
30
}
32
31
33
32
dependencies {
@@ -37,20 +36,22 @@ dependencies {
37
36
implementation(Dependencies .Ktor .clientCore)
38
37
implementation(Dependencies .Ktor .serialization)
39
38
implementation(Dependencies .Ktor .clientApache)
40
- detektPlugins(" io.gitlab.arturbosch.detekt:detekt-formatting:1.15.0 " )
39
+ detektPlugins(" io.gitlab.arturbosch.detekt:detekt-formatting:1.18.1 " )
41
40
// Use JUnit Jupiter API for testing.
42
- testImplementation(" org.junit.jupiter:junit-jupiter-api:5.6.2 " )
41
+ testImplementation(" org.junit.jupiter:junit-jupiter-api:5.8.1 " )
43
42
44
43
// Use JUnit Jupiter Engine for testing.
45
- testRuntimeOnly(" org.junit.jupiter:junit-jupiter-engine:5.6.2" )
44
+ testRuntimeOnly(" org.junit.jupiter:junit-jupiter-engine:5.8.1" )
45
+ testImplementation(" app.cash.turbine:turbine:0.6.1" )
46
46
}
47
47
48
48
ktlint {
49
49
debug.set(true )
50
- version.set(" 0.40.0 " )
50
+ version.set(" 0.42.1 " )
51
51
verbose.set(true )
52
52
android.set(false )
53
53
outputToConsole.set(true )
54
+ outputColorName.set(" BLUE" )
54
55
ignoreFailures.set(true )
55
56
enableExperimentalRules.set(true )
56
57
filter {
@@ -89,12 +90,17 @@ tasks {
89
90
useJUnitPlatform()
90
91
}
91
92
92
- withType<KotlinCompile >() {
93
+ withType<KotlinCompile >().configureEach {
93
94
kotlinOptions {
94
95
jvmTarget = " 1.8"
95
- freeCompilerArgs = compilerArgs
96
- apiVersion = " 1.4"
97
- languageVersion = " 1.4"
96
+ freeCompilerArgs = freeCompilerArgs + listOf (
97
+ " -Xjsr305=strict" ,
98
+ " -Xopt-in=kotlin.Experimental" ,
99
+ " -Xopt-in=kotlinx.coroutines.ExperimentalCoroutinesApi" ,
100
+ " -Xjvm-default=enable" ,
101
+ " -Xopt-in=kotlin.time.ExperimentalTime" ,
102
+ " -Xopt-in=io.ktor.utils.io.core.ExperimentalIoApi"
103
+ )
98
104
}
99
105
}
100
106
}
@@ -135,11 +141,14 @@ spotless {
135
141
target(" src/**/*.kt" )
136
142
targetExclude(" $buildDir /**/*.kt" )
137
143
targetExclude(" spotless/copyright.kt" )
144
+ targetExclude(" **/generated/**" )
138
145
targetExclude(" buildSrc/buildSrc/**/*.kt" )
139
146
140
147
licenseHeaderFile {
141
148
rootProject.file(" spotless/copyright.kt" )
142
149
}
150
+ trimTrailingWhitespace()
151
+ endWithNewline()
143
152
}
144
153
}
145
154
0 commit comments