-
Notifications
You must be signed in to change notification settings - Fork 2
/
build.gradle.kts
147 lines (127 loc) · 4.45 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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
import com.github.benmanes.gradle.versions.updates.DependencyUpdatesTask
import info.solidsoft.gradle.pitest.PitestPluginExtension
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
val junit5Version = "5.7.1"
val kotlinVersion = "1.6.10"
plugins {
java
kotlin("jvm") version "1.6.10"
kotlin("plugin.serialization") version "1.6.10"
id("com.github.ben-manes.versions") version "0.39.0"
`maven-publish`
id("info.solidsoft.pitest") version "1.7.0"
signing
id("org.jetbrains.kotlinx.kover") version "0.4.4"
}
group = "com.christophsturm"
version = "0.2.2"
repositories {
mavenCentral()
}
dependencies {
implementation(kotlin("stdlib-jdk8", kotlinVersion))
implementation(kotlin("reflect", kotlinVersion))
testImplementation("io.strikt:strikt-core:0.33.0")
testImplementation("dev.failgood:failgood:0.5.0")
testImplementation("org.jetbrains.kotlinx:kotlinx-serialization-core:1.3.1")
}
tasks {
withType<JavaCompile> {
sourceCompatibility = "1.8"
targetCompatibility = "1.8"
}
withType<Test> {
useJUnitPlatform()
}
withType<KotlinCompile> {
kotlinOptions.jvmTarget = "1.8"
}
}
java {
withJavadocJar()
withSourcesJar()
}
publishing {
repositories {
maven {
setUrl("https://oss.sonatype.org/service/local/staging/deploy/maven2/")
credentials {
username = project.properties["ossrhUsername"] as String?
password = project.properties["ossrhPassword"] as String?
}
}
}
publications {
create<MavenPublication>("mavenJava") {
from(components["java"])
groupId = project.group as String
artifactId = "randolf"
version = project.version as String
pom {
description.set("autogenerated data for your unit tests")
name.set("randolf")
url.set("https://github.com/christophsturm/randolf")
licenses {
license {
name.set("The MIT License")
url.set("https://opensource.org/licenses/MIT")
distribution.set("repo")
}
}
developers {
developer {
id.set("christophsturm")
name.set("Christoph Sturm")
email.set("[email protected]")
}
}
scm {
url.set("https://github.com/christophsturm/randolf.git")
}
}
}
}
}
signing {
sign(publishing.publications["mavenJava"])
}
plugins.withId("info.solidsoft.pitest") {
configure<PitestPluginExtension> {
// verbose.set(true)
jvmArgs.set(listOf("-Xmx512m"))
testPlugin.set("failgood")
avoidCallsTo.set(setOf("kotlin.jvm.internal"))
targetClasses.set(setOf("randolf.*")) //by default "${project.group}.*"
targetTests.set(setOf("randolf.*"))
threads.set(System.getenv("PITEST_THREADS")?.toInt() ?: Runtime.getRuntime().availableProcessors())
outputFormats.set(setOf("XML", "HTML"))
junit5PluginVersion.set("0.12")
pitestVersion.set("1.6.2")
}
}
tasks.named<DependencyUpdatesTask>("dependencyUpdates") {
resolutionStrategy {
componentSelection {
all {
val rejected = listOf("alpha", "beta", "rc", "cr", "m", "preview")
.map { qualifier -> Regex("(?i).*[.-]$qualifier[.\\d-]*") }
.any { it.matches(candidate.version) }
if (rejected) {
reject("Release candidate")
}
}
}
}
// optional parameters
checkForGradleUpdate = true
outputFormatter = "json"
outputDir = "build/dependencyUpdates"
reportfileName = "report"
}
kover {
isEnabled = true // false to disable instrumentation of all test tasks in all modules
coverageEngine.set(kotlinx.kover.api.CoverageEngine.INTELLIJ) // change instrumentation agent and reporter
//sa intellijEngineVersion.set("1.0.637") // change version of IntelliJ agent and reporter
// jacocoEngineVersion.set("0.8.7") // change version of JaCoCo agent and reporter
// generateReportOnCheck.set(true) // false to do not execute `koverReport` task before `check` task
}