This repository has been archived by the owner on Jul 28, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6
/
build.gradle.kts
106 lines (91 loc) · 4.31 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
import com.android.build.gradle.internal.cxx.configure.gradleLocalProperties
import org.jetbrains.dokka.gradle.DokkaTask
plugins {
// this is necessary to avoid the plugins to be loaded multiple times
// in each subproject's classloader
alias(libs.plugins.jetbrainsCompose) apply false
alias(libs.plugins.composeCompiler) apply false
alias(libs.plugins.androidApplication) apply false
alias(libs.plugins.androidLibrary) apply false
alias(libs.plugins.kotlinMultiplatform) apply false
alias(libs.plugins.kotlinNativeCocoaPods) apply false
alias(libs.plugins.dokka) apply false
alias(libs.plugins.kotlinx.binary.validator)
}
allprojects {
group = "io.github.mirzemehdi"
version = project.properties["kmpRevenueCatVersion"] as String
val sonatypeUsername = gradleLocalProperties(rootDir).getProperty("sonatypeUsername")
val sonatypePassword = gradleLocalProperties(rootDir).getProperty("sonatypePassword")
val gpgKeySecret = gradleLocalProperties(rootDir).getProperty("gpgKeySecret")
val gpgKeyPassword = gradleLocalProperties(rootDir).getProperty("gpgKeyPassword")
val excludedModules = listOf(":sampleApp:composeApp",":sampleApp")
if (project.path in excludedModules) return@allprojects
apply(plugin = "org.jetbrains.dokka")
apply(plugin = "maven-publish")
apply(plugin = "signing")
extensions.configure<PublishingExtension> {
repositories {
maven {
val isSnapshot = version.toString().endsWith("SNAPSHOT")
val repositoryId = System.getenv("SONATYPE_REPOSITORY_ID") ?: ""
url = uri(
when{
isSnapshot.not() && repositoryId.isNotEmpty() -> "https://s01.oss.sonatype.org/service/local/staging/deployByRepositoryId/${repositoryId}/"
isSnapshot.not() -> "https://s01.oss.sonatype.org/service/local/staging/deploy/maven2"
else -> "https://s01.oss.sonatype.org/content/repositories/snapshots"
}
)
credentials {
username = sonatypeUsername
password = sonatypePassword
}
}
}
val javadocJar = tasks.register<Jar>("javadocJar") {
dependsOn(tasks.getByName<DokkaTask>("dokkaHtml"))
archiveClassifier.set("javadoc")
from("${layout.buildDirectory}/dokka")
}
publications {
withType<MavenPublication> {
artifact(javadocJar)
pom {
groupId = "io.github.mirzemehdi"
name.set("KMPRevenueCat")
description.set("KMPRevenueCat is an unofficial Kotlin Multiplatform library, wrapper library around RevenueCat integration with a Kotlin-first approach, offering a unified API for subscription/in-app purchases across iOS, and Android.")
licenses {
license {
name.set("Apache-2.0")
url.set("https://opensource.org/licenses/Apache-2.0")
}
}
url.set("mirzemehdi.github.io/KMPRevenueCat/")
issueManagement {
system.set("Github")
url.set("https://github.com/mirzemehdi/KMPRevenueCat/issues")
}
scm {
connection.set("https://github.com/mirzemehdi/KMPRevenueCat.git")
url.set("https://github.com/mirzemehdi/KMPRevenueCat")
}
developers {
developer {
name.set("Mirzamehdi Karimov")
email.set("[email protected]")
}
}
}
}
}
}
val publishing = extensions.getByType<PublishingExtension>()
extensions.configure<SigningExtension> {
useInMemoryPgpKeys(gpgKeySecret, gpgKeyPassword)
sign(publishing.publications)
}
// TODO: remove after https://youtrack.jetbrains.com/issue/KT-46466 is fixed
project.tasks.withType(AbstractPublishToMaven::class.java).configureEach {
dependsOn(project.tasks.withType(Sign::class.java))
}
}