-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbuild.gradle
97 lines (86 loc) · 2.69 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
import io.gitlab.arturbosch.detekt.DetektCreateBaselineTask
plugins {
id 'org.jetbrains.kotlin.jvm' version '1.7.10'
id 'com.github.ben-manes.versions' version '0.42.0'
id 'io.gitlab.arturbosch.detekt' version '1.21.0'
id 'org.sonarqube' version '3.3'
id 'maven-publish'
id 'signing'
}
group 'io.gitlab.arturbosch'
version kutilsVersion
repositories {
mavenCentral()
}
tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile) {
kotlinOptions {
freeCompilerArgs = ["-Xopt-in=kotlin.Experimental"]
jvmTarget = "1.8"
}
}
detekt {
buildUponDefaultConfig = true
allRules = true
autoCorrect = true
config = files("$projectDir/detekt/config.yml")
baseline = file("$projectDir/detekt/baseline.xml")
reports {
txt.enabled = true
html.enabled = false
xml.enabled = false
}
}
task detektProjectBaseline(type: DetektCreateBaselineTask) {
description = "Overrides current baseline."
ignoreFailures.set(true)
parallel.set(true)
buildUponDefaultConfig.set(true)
setSource(files(
"$rootDir/src/main",
"$rootDir/src/test"
))
config.setFrom(files("$rootDir/detekt/config.yml"))
baseline.set(file("$rootDir/detekt/baseline.xml"))
include("**/*.kt")
include("**/*.kts")
}
dependencies {
detekt "io.gitlab.arturbosch.detekt:detekt-cli:$detektVersion"
detektPlugins "io.gitlab.arturbosch.detekt:detekt-formatting:$detektVersion"
compileOnly "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlinVersion"
testImplementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlinVersion"
testImplementation "org.jetbrains.kotlin:kotlin-reflect:$kotlinVersion"
testImplementation "org.jetbrains.kotlin:kotlin-test:$kotlinVersion"
testImplementation "io.kotlintest:kotlintest-runner-junit5:$kotlintestVersion"
testImplementation "org.slf4j:slf4j-nop:$slf4jVersion"
testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:$junitEngineVersion"
}
test {
useJUnitPlatform()
testLogging {
events "failed"
}
}
def repositoryPath = property("reposilite.repository.name")
def repositoryUrl = property("reposilite.repository.url")
publishing {
publications {
maven(MavenPublication) {
groupId = project.group
artifactId = project.name
version = project.version
from components.java
}
}
repositories {
maven {
name = repositoryPath
url = repositoryUrl
allowInsecureProtocol = true // intranet
credentials(PasswordCredentials)
authentication {
basic(BasicAuthentication)
}
}
}
}