-
Notifications
You must be signed in to change notification settings - Fork 6
/
build.gradle.kts
150 lines (134 loc) · 4.53 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
147
148
149
150
import info.solidsoft.gradle.pitest.PitestPluginExtension
import org.gradle.api.tasks.testing.logging.TestExceptionFormat
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
val junit5Version = "5.7.1"
val junitPlatformVersion = "1.7.1"
val kotlinVersion = "1.4.30"
plugins {
java
kotlin("jvm") version "1.4.30"
id("com.github.ben-manes.versions") version "0.36.0"
`maven-publish`
id("info.solidsoft.pitest") version "1.5.2"
signing
}
group = "com.christophsturm"
version = "0.1.3"
repositories {
// maven { setUrl("http://dl.bintray.com/kotlin/kotlin-eap") }
mavenCentral()
}
dependencies {
implementation(kotlin("stdlib-jdk8", kotlinVersion))
implementation(kotlin("reflect", kotlinVersion))
testImplementation("io.strikt:strikt-core:0.29.0")
testImplementation("com.christophsturm.failfast:failfast:0.3.0")
testImplementation("org.junit.jupiter:junit-jupiter-api:$junit5Version")
testRuntimeOnly("org.junit.platform:junit-platform-launcher:$junitPlatformVersion")
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:$junit5Version")
}
configure<JavaPluginConvention> {
sourceCompatibility = JavaVersion.VERSION_1_8
}
tasks {
withType<KotlinCompile> {
kotlinOptions.jvmTarget = "1.8"
}
withType<Test> {
useJUnitPlatform {
includeEngines("junit-jupiter")
}
testLogging {
exceptionFormat = TestExceptionFormat.FULL
events("passed", "skipped", "failed")
}
}
}
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 = "filepeek"
version = project.version as String
pom {
description.set("A library to look up kotlin source files")
name.set("filepeek")
url.set("https://github.com/christophsturm/filepeek")
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("me@christophsturm.com")
}
}
scm {
url.set("https://github.com/christophsturm/filepeek.git")
}
}
}
}
}
signing {
sign(publishing.publications["mavenJava"])
}
plugins.withId("info.solidsoft.pitest") {
configure<PitestPluginExtension> {
jvmArgs.set(listOf("-Xmx512m"))
testPlugin.set("failfast")
avoidCallsTo.set(setOf("kotlin.jvm.internal"))
// mutators.set(setOf("NEW_DEFAULTS"))
targetClasses.set(setOf("filepeek.*")) //by default "${project.group}.*"
targetTests.set(setOf("filepeek.*", "filepeektest.*"))
pitestVersion.set("1.6.2")
threads.set(System.getenv("PITEST_THREADS")?.toInt() ?: Runtime.getRuntime().availableProcessors())
outputFormats.set(setOf("XML", "HTML"))
}
}
tasks.named<com.github.benmanes.gradle.versions.updates.DependencyUpdatesTask>("dependencyUpdates") {
val filtered =
listOf("alpha", "beta", "rc", "cr", "m", "preview", "dev", "eap")
.map { qualifier -> Regex("(?i).*[.-]$qualifier[.\\d-]*.*") }
resolutionStrategy {
componentSelection {
all {
if (filtered.any { it.matches(candidate.version) }) {
reject("Release candidate")
}
}
}
// optional parameters
checkForGradleUpdate = true
outputFormatter = "json"
outputDir = "build/dependencyUpdates"
reportfileName = "report"
}
}
tasks.wrapper { distributionType = Wrapper.DistributionType.ALL }
val testMain = task("testMain", JavaExec::class) {
main = "filepeek.AllTestsKt"
classpath = sourceSets["test"].runtimeClasspath
}
tasks.check {
dependsOn(testMain)
}