-
Notifications
You must be signed in to change notification settings - Fork 24
/
build.gradle.kts
101 lines (87 loc) · 3.92 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
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.googleServices) apply false
alias(libs.plugins.kotlinx.serialization).apply(false)
alias(libs.plugins.kotlinx.binary.validator)
alias(libs.plugins.nexusPublish)
}
allprojects {
group = "io.github.mirzemehdi"
version = project.properties["kmpAuthVersion"] as String
val gpgKeySecret = gradleLocalProperties(rootDir, providers).getProperty("gpgKeySecret")
val gpgKeyPassword = gradleLocalProperties(rootDir, providers).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> {
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("KMPAuth")
description.set(" Kotlin Multiplatform Authentication Library targeting ios and android")
licenses {
license {
name.set("Apache-2.0")
url.set("https://opensource.org/licenses/Apache-2.0")
}
}
url.set("mirzemehdi.github.io/KMPAuth/")
issueManagement {
system.set("Github")
url.set("https://github.com/mirzemehdi/KMPAuth/issues")
}
scm {
connection.set("https://github.com/mirzemehdi/KMPAuth.git")
url.set("https://github.com/mirzemehdi/KMPAuth")
}
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))
}
}
nexusPublishing {
repositories {
sonatype { //only for users registered in Sonatype after 24 Feb 2021
nexusUrl.set(uri("https://s01.oss.sonatype.org/service/local/"))
snapshotRepositoryUrl.set(uri("https://s01.oss.sonatype.org/content/repositories/snapshots/"))
val sonatypeUsername = gradleLocalProperties(rootDir, providers).getProperty("sonatypeUsername")
val sonatypePassword = gradleLocalProperties(rootDir, providers).getProperty("sonatypePassword")
username = sonatypeUsername
password = sonatypePassword
}
}
}