-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.gradle.kts
More file actions
127 lines (111 loc) · 3.32 KB
/
build.gradle.kts
File metadata and controls
127 lines (111 loc) · 3.32 KB
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
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
version = "0.1.7"
plugins {
kotlin("jvm") version "1.9.20"
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
}
jacoco {
toolVersion = "0.8.7"
}
repositories {
mavenLocal()
mavenCentral()
}
dependencies {
api("org.xpathqs:driver:0.1.8")
implementation(kotlin("stdlib"))
implementation("net.sourceforge.nekohtml:nekohtml:1.9.22")
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 Web")
description.set("A library that extends XpathQS-Driver with HTML semantic")
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("nikchgd@gmail.com")
}
}
scm {
connection.set("scm:git:git://github.com/xpathqs/web.git")
developerConnection.set("scm:git:ssh://github.com/xpathqs/web.git")
url.set("https://xpathqs.org/")
}
}
groupId = "org.xpathqs"
artifactId = "web"
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<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/web", "src/main/kotlin/org/xpathqs/web")
}
}
}