-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle.kts
125 lines (110 loc) · 3.22 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
group = "org.xpathqs"
version = "0.1.6"
plugins {
kotlin("jvm") version "1.6.0"
id("org.jetbrains.dokka") version "1.4.32"
`java-library`
jacoco
maven
`maven-publish`
signing
}
java {
withJavadocJar()
withSourcesJar()
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
}
repositories {
mavenLocal()
mavenCentral()
}
jacoco {
toolVersion = "0.8.7"
}
dependencies {
implementation(kotlin("stdlib"))
implementation("com.diogonunes:JColor:5.0.1")
testImplementation(kotlin("test-junit5"))
testImplementation("org.junit.jupiter:junit-jupiter-api:5.6.0")
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:5.6.0")
testImplementation("com.willowtreeapps.assertk:assertk-jvm:0.23.1")
}
publishing {
publications {
beforeEvaluate {
signing.sign(this@publications)
}
create<MavenPublication>("mavenJava") {
pom {
name.set("XpathQS Log")
description.set("Log library")
url.set("https://xpathqs.org/")
licenses {
license {
name.set("MIT License")
url.set("http://www.opensource.org/licenses/mit-license.php")
}
}
developers {
developer {
id.set("nachg")
name.set("Nikita A. Chegodaev")
email.set("[email protected]")
}
}
scm {
connection.set("scm:git:git://github.com/xpathqs/log.git")
developerConnection.set("scm:git:ssh://github.com/xpathqs/log.git")
url.set("https://xpathqs.org/")
}
}
groupId = "org.xpathqs"
artifactId = "log"
from(components["java"])
}
}
repositories {
maven {
val releasesRepoUrl = uri("https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/")
val snapshotsRepoUrl = uri("https://s01.oss.sonatype.org/content/repositories/snapshots/")
url = if (version.toString().endsWith("SNAPSHOT")) snapshotsRepoUrl else releasesRepoUrl
credentials {
username = project.property("ossrhUsername").toString()
password = project.property("ossrhPassword").toString()
}
}
}
}
signing {
sign(publishing.publications["mavenJava"])
}
tasks.test {
useJUnitPlatform()
}
tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile> {
kotlinOptions.jvmTarget = "11"
}
tasks.jar {
manifest {
attributes(
mapOf(
"Implementation-Title" to project.name,
"Implementation-Version" to project.version
)
)
}
}
tasks.jacocoTestReport {
reports {
xml.isEnabled = false
csv.isEnabled = true
}
}
tasks.withType<org.jetbrains.dokka.gradle.DokkaTask>().configureEach {
dokkaSourceSets {
configureEach {
samples.from("src/test/kotlin/org/xpathqs/log", "src/main/kotlin/org/xpathqs/log")
}
}
}