-
Notifications
You must be signed in to change notification settings - Fork 4
/
build.gradle.kts
74 lines (64 loc) · 2.35 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
import com.vanniktech.maven.publish.MavenPublishBaseExtension
plugins {
alias(libs.plugins.android.library) apply false
alias(libs.plugins.jetbrains.kotlin.android) apply false
alias(libs.plugins.kotlin.jvm).apply(false)
alias(libs.plugins.kotlin.multiplatform).apply(false)
alias(libs.plugins.ksp).apply(false)
alias(libs.plugins.publish)
alias(libs.plugins.dokka)
}
allprojects {
tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile>().configureEach {
kotlinOptions {
jvmTarget = "1.8"
}
}
}
extra["buildKRouterPom"] = { extension: MavenPublishBaseExtension, artifactName: String ->
setupKRouterMavenPublication(extension, artifactName)
}
fun setupKRouterMavenPublication(extension: MavenPublishBaseExtension, artifactName: String) {
with(extension) {
coordinates("io.github.0xzhangke", artifactName, ProjectVersion.VERSION)
publishToMavenCentral(com.vanniktech.maven.publish.SonatypeHost.CENTRAL_PORTAL)
signAllPublications()
pom {
name.set("KRouter")
description.set("Lightweight Kotlin router.")
url.set("https://github.com/0xZhangKe/KRouter")
licenses {
license {
name.set("Apache 2.0")
url.set("https://www.apache.org/licenses/LICENSE-2.0")
distribution.set("repo")
}
}
developers {
developer {
id.set("zhangke")
name.set("Zhangke")
url.set("https://github.com/0xZhangKe/KRouter")
}
}
scm {
url.set("https://github.com/0xZhangKe/KRouter")
connection.set("scm:git:git://github.com/0xZhangKe/KRouter.git")
developerConnection.set("scm:git:ssh://[email protected]/0xZhangKe/KRouter.git")
}
}
}
}
object ProjectVersion {
// incompatible API changes
private const val MAJOR = "1"
// functionality in a backwards compatible manner
private const val MONIR = "0"
// backwards compatible bug fixes
private const val PATH = "2"
const val VERSION = "$MAJOR.$MONIR.$PATH"
}
tasks.dokkaHtmlMultiModule {
moduleVersion.set(ProjectVersion.VERSION)
outputDirectory.set(rootDir.resolve("docs/static/api"))
}