-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle.kts
157 lines (146 loc) · 5.16 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
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
import com.github.breadmoirai.githubreleaseplugin.GithubReleaseExtension
import net.pearx.multigradle.util.MultiGradleExtension
import net.pearx.multigradle.util.kotlinMpp
val projectChangelog: String by project
val projectDescription: String by project
val pearxRepoUsername: String? by project
val pearxRepoPassword: String? by project
val sonatypeOssUsername: String? by project
val sonatypeOssPassword: String? by project
val githubAccessToken: String? by project
val devBuildNumber: String? by project
val ktorVersion: String by project
val kotlinxSerializationVersion: String by project
plugins {
id("net.pearx.multigradle.simple.project")
kotlin("multiplatform") apply (false)
id("com.github.breadmoirai.github-release")
kotlin("plugin.serialization")
`maven-publish`
signing
}
group = "net.pearx.cursekt"
description = projectDescription
kotlinMpp {
sourceSets {
val commonMain by getting {
dependencies {
implementation("io.ktor:ktor-client-serialization:$ktorVersion")
implementation("io.ktor:ktor-client-json:$ktorVersion")
implementation("io.ktor:ktor-client-core:$ktorVersion")
}
}
val jvmMain by getting {
dependencies {
implementation("io.ktor:ktor-client-serialization-jvm:$ktorVersion")
implementation("io.ktor:ktor-client-json-jvm:$ktorVersion")
implementation("io.ktor:ktor-client-cio:$ktorVersion")
}
}
val jsMain by getting {
dependencies {
implementation("io.ktor:ktor-client-serialization-js:$ktorVersion")
implementation("io.ktor:ktor-client-json-js:$ktorVersion")
implementation("io.ktor:ktor-client-js:$ktorVersion")
}
}
}
}
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/cursekt")
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/cursekt")
connection.set("scm:git:git://github.com/pearxteam/cursekt")
developerConnection.set("scm:git:git://github.com/pearxteam/cursekt")
}
issueManagement {
system.set("GitHub")
url.set("https://github.com/pearxteam/cursekt/issues")
}
ciManagement {
system.set("Jenkins")
url.set("https://ci.pearx.net/job/pearxteam/job/cursekt")
}
}
}
repositories {
maven {
credentials {
username = pearxRepoUsername
password = pearxRepoPassword
}
name = "pearx-repo-develop"
url = uri("https://repo.pearx.net/maven2/develop/")
}
maven {
credentials {
username = pearxRepoUsername
password = pearxRepoPassword
}
name = "pearx-repo-release"
url = uri("https://repo.pearx.net/maven2/release/")
}
maven {
credentials {
username = sonatypeOssUsername
password = sonatypeOssPassword
}
name = "sonatype-oss-release"
url = uri("https://oss.sonatype.org/service/local/staging/deploy/maven2/")
}
}
}
tasks {
register("publishDevelop") {
group = "publishing"
dependsOn(withType<PublishToMavenRepository>().matching { it.repository.name.endsWith("-develop") })
}
register("publishRelease") {
group = "publishing"
dependsOn(withType<PublishToMavenRepository>().matching { it.repository.name.endsWith("-release") })
dependsOn(named("githubRelease"))
}
}
configure<SigningExtension> {
sign(publishing.publications)
}
configure<GithubReleaseExtension> {
setToken(githubAccessToken)
setOwner("pearxteam")
setRepo("cursekt")
setTargetCommitish("master")
setBody(projectChangelog)
//setReleaseAssets((publishing.publications["maven"] as MavenPublication).artifacts.map { it.file })
}