-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle.kts
104 lines (92 loc) · 3.06 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
plugins {
kotlin("jvm") version "1.9.20"
`maven-publish`
signing
}
group = "com.yandex.detekt"
version = "0.1.1"
repositories {
mavenCentral()
}
val detektVersion = "1.23.4"
dependencies {
implementation("io.gitlab.arturbosch.detekt:detekt-api:$detektVersion")
implementation("io.gitlab.arturbosch.detekt:detekt-metrics:$detektVersion")
testImplementation(kotlin("test"))
testImplementation("io.gitlab.arturbosch.detekt:detekt-test:$detektVersion")
}
tasks.test {
useJUnitPlatform()
}
kotlin {
jvmToolchain(8)
}
gradle.taskGraph.whenReady {
allTasks
.filter { it.hasProperty("duplicatesStrategy") }
.forEach {
it.setProperty("duplicatesStrategy", "EXCLUDE")
}
}
val repositoryUsername get() = System.getenv("OSSRH_USERNAME") ?: ""
val repositoryPassword get() = System.getenv("OSSRH_PASSWORD") ?: ""
val signingKeyId get() = System.getenv("SIGNING_KEY_ID") ?: ""
val signingKey get() = System.getenv("SIGNING_KEY") ?: ""
val signingPassword get() = System.getenv("SIGNING_PASSWORD") ?: ""
java {
withJavadocJar()
withSourcesJar()
}
publishing {
publications {
create<MavenPublication>("mavenJava") {
artifactId = project.name
groupId = project.group.toString()
version = project.version.toString()
from(components["java"])
pom {
packaging = "jar"
name.set(project.name)
url.set("https://github.com/yandexmobile/detekt-rules-ui-tests")
description.set("A collection of Detekt rules for UI-tests")
licenses {
license {
name.set("MIT License")
url.set("https://github.com/yandexmobile/detekt-rules-ui-tests/blob/main/LICENSE")
}
}
scm {
connection.set("scm:https://github.com/yandexmobile/detekt-rules-ui-tests.git")
developerConnection.set("scm:git@github.com:yandexmobile/detekt-rules-ui-tests.git")
url.set("https://github.com/yandexmobile/detekt-rules-ui-tests")
}
developers {
developer {
id.set("primechord")
name.set("Nikolay Nedoseykin")
email.set("nedoseykin@yandex-team.ru")
}
}
}
}
}
repositories {
maven {
val releasesUrl = uri("https://oss.sonatype.org/service/local/staging/deploy/maven2/")
val snapshotsUrl = uri("https://oss.sonatype.org/content/repositories/snapshots/")
url = if (version.toString().endsWith("SNAPSHOT")) snapshotsUrl else releasesUrl
credentials {
username = repositoryUsername
password = repositoryPassword
}
}
}
}
signing {
useInMemoryPgpKeys(
signingKeyId,
signingKey,
signingPassword,
)
sign(publishing.publications["mavenJava"])
}