-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle.kts
129 lines (105 loc) · 3.08 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
plugins {
alias(libs.plugins.kotlin.jvm)
alias(libs.plugins.dokka)
alias(libs.plugins.detekt)
alias(libs.plugins.versions)
`maven-publish`
signing
idea
}
// recommended to define this in ~/.gradle/gradle.properties or pass through -P
val ossrhUsername: String? by project
val ossrhPassword: String? by project
group = "com.iamincendium.common"
version = "0.1.0"
repositories {
mavenCentral()
}
detekt {
ignoreFailures = false
config.from("${rootDir}/.detekt/config.yml")
buildUponDefaultConfig = true
baseline = file("${rootDir}/.detekt/baseline.xml")
}
idea {
module {
isDownloadSources = true
isDownloadJavadoc = true
}
}
dependencies {
implementation(kotlin("reflect"))
testImplementation(libs.bundles.commonTest)
}
tasks {
test {
useJUnitPlatform()
}
val javadocJar by registering(Jar::class) {
dependsOn(dokkaHtml)
archiveClassifier.set("javadoc")
from(dokkaHtml.flatMap { it.outputDirectory })
}
}
kotlin {
jvmToolchain(17)
explicitApi()
}
java {
withJavadocJar()
withSourcesJar()
}
publishing {
publications.create<MavenPublication>("enumUtils") {
from(components["java"])
pom {
name.set("enum-utils")
description.set("A utility for working with Enums and Enum-like Sealed Interface/Classes in Kotlin.")
url.set("https://github.com/incendium/enum-utils")
licenses {
license {
name.set("ISC License")
url.set("https://spdx.org/licenses/ISC.html")
}
}
developers {
developer {
id.set("incendium")
name.set("Matthew Gast")
email.set("[email protected]")
}
}
scm {
url.set("https://github.com/incendium/enum-utils")
connection.set("scm:git:https://github.com/incendium/enum-utils.git")
developerConnection.set("scm:git:https://github.com/incendium/enum-utils.git")
}
}
}
repositories {
maven {
name = "ossrhSnapshots"
url = uri("https://oss.sonatype.org/content/repositories/snapshots/")
credentials {
username = ossrhUsername ?: System.getenv("OSSRH_USERNAME")
password = ossrhPassword ?: System.getenv("OSSRH_PASSWORD")
}
}
maven {
name = "ossrhStaging"
url = uri("https://oss.sonatype.org/service/local/staging/deploy/maven2/")
credentials {
username = ossrhUsername ?: System.getenv("OSSRH_USERNAME")
password = ossrhPassword ?: System.getenv("OSSRH_PASSWORD")
}
}
}
}
signing {
if (System.getenv("SIGNING_KEY_PATH") != null) {
useInMemoryPgpKeys(System.getenv("SIGNING_KEY_PATH"), System.getenv("SIGNING_KEY_PASSWORD"))
} else {
useGpgCmd()
}
publishing.publications.forEach { sign(it) }
}