-
Notifications
You must be signed in to change notification settings - Fork 6
/
build.gradle.kts
117 lines (106 loc) · 3.75 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
import com.github.breadmoirai.githubreleaseplugin.GithubReleaseExtension
import net.pearx.multigradle.util.MultiGradleExtension
val projectChangelog: String by project
val projectDescription: String by project
val sonatypeOssUsername: String? by project
val sonatypeOssPassword: String? by project
val githubAccessToken: String? by project
val devBuildNumber: String? by project
description = projectDescription
plugins {
id("net.pearx.multigradle.simple.project")
id("org.jetbrains.kotlin.multiplatform") apply (false)
id("com.github.breadmoirai.github-release")
`maven-publish`
signing
}
configure<MultiGradleExtension> {
if (devBuildNumber != null) {
projectVersion = "$projectVersion-dev-$devBuildNumber"
}
}
configure<PublishingExtension> {
publications.withType<MavenPublication> {
pom {
name.set(artifactId)
description.set(projectDescription)
url.set("https://github.com/pearxteam/kasechange")
licenses {
license {
name.set("Mozilla Public License, Version 2.0")
url.set("https://mozilla.org/MPL/2.0/")
distribution.set("repo")
}
}
organization {
name.set("PearX Team")
url.set("https://pearx.net/")
}
developers {
developer {
id.set("mrAppleXZ")
name.set("mrAppleXZ")
email.set("[email protected]")
url.set("https://pearx.net/members/mrapplexz")
organization.set("PearX Team")
organizationUrl.set("https://pearx.net/")
roles.set(listOf("developer"))
timezone.set("Asia/Yekaterinburg")
}
}
scm {
url.set("https://github.com/pearxteam/kasechange")
connection.set("scm:git:git://github.com/pearxteam/kasechange")
developerConnection.set("scm:git:git://github.com/pearxteam/kasechange")
}
issueManagement {
system.set("GitHub")
url.set("https://github.com/pearxteam/kasechange/issues")
}
}
}
repositories {
maven {
credentials {
username = "pearxteam"
password = githubAccessToken
}
name = "github-all"
url = uri("https://maven.pkg.github.com/pearxteam/kasechange")
}
maven {
credentials {
username = sonatypeOssUsername
password = sonatypeOssPassword
}
name = "sonatype-oss-release"
url = uri("https://oss.sonatype.org/service/local/staging/deploy/maven2/")
}
}
}
tasks {
val publishDevelop by registering {
group = "publishing"
dependsOn(withType<PublishToMavenRepository>().matching { it.repository.name.endsWith("-develop") or it.repository.name.endsWith("-all") })
}
val publishRelease by registering {
group = "publishing"
dependsOn(withType<PublishToMavenRepository>().matching { it.repository.name.endsWith("-release") or it.repository.name.endsWith("-all") })
}
val release by registering {
group = "publishing"
dependsOn(publishRelease)
dependsOn(named("githubRelease"))
}
}
configure<SigningExtension> {
sign(publishing.publications)
}
configure<GithubReleaseExtension> {
setToken(githubAccessToken)
setOwner("pearxteam")
setRepo("kasechange")
setTargetCommitish("master")
setBody(projectChangelog)
//setReleaseAssets((publishing.publications["maven"] as MavenPublication).artifacts.map { it.file })
}