forked from Kamel-Media/Kamel
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle.kts
115 lines (92 loc) · 4.04 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
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
import java.util.*
plugins {
alias(libs.plugins.org.jetbrains.kotlin.multiplatform) apply false
alias(libs.plugins.com.android.application) apply false
alias(libs.plugins.com.android.library) apply false
alias(libs.plugins.org.jetbrains.compose) apply false
alias(libs.plugins.com.vanniktech.maven.publish) apply false
}
val file = project.file("local.properties")
if (file.exists()) {
Properties().apply {
val inputStream = file.inputStream()
load(inputStream)
ext {
set("signing.keyId", getProperty("signing.keyId"))
set("signing.password", getProperty("signing.password"))
set("ossrh.username", getProperty("ossrh.username"))
set("ossrh.password", getProperty("ossrh.password"))
set("signing.secretKeyRingFile", getProperty("signing.secretKeyRingFile"))
set("stagingProfileId", getProperty("stagingProfileId"))
}
inputStream.close()
}
} else {
ext {
set("signing.keyId", System.getenv("SIGNING_KEY_ID"))
set("signing.password", System.getenv("SIGNING_PASSWORD"))
set("ossrh.username", System.getenv("OSSRH_USERNAME"))
set("ossrh.password", System.getenv("OSSRH_PASSWORD"))
set("signing.secretKeyRingFile", System.getenv("SIGNING_SECRET_KEY_RING_FILE"))
set("stagingProfileId", System.getenv("STAGING_PROFILE_ID"))
}
}
allprojects {
group = project.property("GROUP") as String
version = project.property("VERSION_NAME") as String
val emptyJavadocJar by tasks.registering(Jar::class) {
archiveClassifier.set("javadoc")
}
afterEvaluate {
extensions.findByType<PublishingExtension>()?.apply {
publications.withType<MavenPublication>().configureEach {
artifact(emptyJavadocJar.get())
pom {
name.set("Kamel")
description.set("Kotlin Asynchronous Media Loading Library that supports Compose")
url.set("https://github.com/Kamel-Media/Kamel")
licenses {
license {
name.set("The Apache Software License, Version 2.0")
url.set("http://www.apache.org/licenses/LICENSE-2.0.txt")
distribution.set("repo")
}
}
developers {
developer {
id.set("alialbaali")
name.set("Ali Albaali")
}
developer {
id.set("luca992")
name.set("Luca Spinazzola")
}
}
scm {
connection.set("scm:git:github.com/Kamel-Media/Kamel.git")
developerConnection.set("scm:git:ssh://github.com/alialbaali/Kamel.git")
url.set("https://github.com/Kamel-Media/Kamel/tree/main")
}
}
}
repositories {
maven {
name = "MavenCentral"
val releasesRepoUrl = "https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/"
val snapshotsRepoUrl = "https://s01.oss.sonatype.org/content/repositories/snapshots/"
url = if (version.toString().endsWith("SNAPSHOT")) uri(snapshotsRepoUrl) else uri(releasesRepoUrl)
credentials {
username = rootProject.ext["ossrh.username"] as String? ?: ""
password = rootProject.ext["ossrh.password"] as String? ?: ""
}
}
}
extensions.findByType<SigningExtension>()?.sign(publications)
}
}
tasks.withType<KotlinCompile> {
compilerOptions.jvmTarget = JvmTarget.JVM_1_8
}
}