forked from RTAkland/ROneBot
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.gradle.kts
More file actions
100 lines (88 loc) · 3.16 KB
/
Copy pathbuild.gradle.kts
File metadata and controls
100 lines (88 loc) · 3.16 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
import cn.rtast.rob.buildSrc.excludeModuleNames
import com.vanniktech.maven.publish.SonatypeHost
import org.jetbrains.kotlin.gradle.targets.jvm.tasks.KotlinJvmTest
import org.jetbrains.kotlin.gradle.targets.native.tasks.KotlinNativeTest
plugins {
alias(libs.plugins.signing)
alias(libs.plugins.vanniktech.maven.publish)
alias(libs.plugins.kotlin.serialization) apply false
alias(libs.plugins.kotlinMultiplatform) apply false
alias(libs.plugins.composeMultiplatform) apply false
alias(libs.plugins.composeCompiler) apply false
alias(libs.plugins.suspend.transformer) apply false
}
val libVersion: String by extra
allprojects {
group = "cn.rtast.rob"
version = libVersion
repositories {
mavenCentral()
maven("https://repo.maven.rtast.cn/releases/")
}
}
subprojects {
if (name in excludeModuleNames) return@subprojects
apply(plugin = "org.jetbrains.kotlin.plugin.serialization")
apply(plugin = "com.vanniktech.maven.publish")
apply(plugin = "signing")
apply(plugin = "org.jetbrains.kotlin.multiplatform")
val wsAddress: String? by extra
val wsPassword: String? by extra
val qqGroupId: String? by extra
tasks.withType<KotlinNativeTest> {
environment("WS_ADDRESS", wsAddress ?: "")
environment("WS_PASSWORD", wsPassword ?: "")
environment("QQ_GROUP_ID", qqGroupId ?: "")
}
tasks.withType<KotlinJvmTest> {
environment("WS_ADDRESS_PLAIN", wsAddress ?: "")
environment("WS_PASSWORD", wsPassword ?: "")
environment("QQ_GROUP_ID", qqGroupId ?: "")
}
mavenPublishing {
publishing {
repositories {
maven {
name = "RTAST"
url = uri("https://maven.rtast.cn/snapshots")
credentials {
username = "RTAkland"
password = System.getenv("RTAST_PUBLISH_PASSWORD")
}
}
mavenLocal()
}
}
publishToMavenCentral(SonatypeHost.CENTRAL_PORTAL)
if (System.getenv("RTAST_PUBLISH_PASSWORD") == null) signAllPublications()
coordinates("cn.rtast.rob", project.name, libVersion)
pom {
description = "A Kotlin multiplatform library for OneBot11 development"
url = "https://github.com/RTAkland/ROneBot"
developers {
developer {
id = "rtakland"
name = "RTAkland"
email = "me@rtast.cn"
}
}
licenses {
license {
name = "The Apache License, Version 2.0"
url = "https://www.apache.org/licenses/LICENSE-2.0.txt"
}
}
scm {
url = "https://github.com/RTAkland/ROneBot"
connection = "scm:git:git://github.com/RTAkland/ROneBot.git"
developerConnection = "scm:git:ssh://git@github.com/RTAkland/ROneBot.git"
}
}
}
}
if (System.getenv("RTAST_PUBLISH_PASSWORD") == null) {
signing {
useGpgCmd()
sign(publishing.publications)
}
}