-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathbuild.gradle.kts
51 lines (47 loc) · 1.71 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
import com.vanniktech.maven.publish.AndroidSingleVariantLibrary
import com.vanniktech.maven.publish.MavenPublishBaseExtension
import com.vanniktech.maven.publish.SonatypeHost
import java.util.Properties
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
import org.jetbrains.kotlin.gradle.tasks.KotlinJvmCompile
plugins {
id("org.jetbrains.kotlin.android") version "1.9.23" apply false
id("org.jetbrains.kotlin.plugin.serialization") version "1.9.23" apply false
id("org.jetbrains.kotlinx.binary-compatibility-validator") version "0.14.0" apply false
id("org.jmailen.kotlinter") version "4.1.1" apply false
id("com.android.application") version "8.3.0" apply false
id("com.vanniktech.maven.publish.base") version "0.27.0" apply false
}
subprojects {
tasks.withType<KotlinJvmCompile>().configureEach {
compilerOptions {
jvmTarget.set(JvmTarget.JVM_1_8)
allWarningsAsErrors.set(true)
}
}
val signingPropsFile = rootProject.file("release/signing.properties")
if (signingPropsFile.exists()) {
val localProperties = Properties()
with(signingPropsFile.inputStream()) {
localProperties.load(this)
}
localProperties.forEach { key, value ->
if (key == "signing.secretKeyRingFile") {
project.ext.set(key as String, rootProject.file(value).absolutePath)
} else {
project.ext.set(key as String, value)
}
}
}
plugins.withId("com.vanniktech.maven.publish.base") {
@Suppress("UnstableApiUsage")
configure<MavenPublishBaseExtension> {
group = requireNotNull(project.findProperty("GROUP"))
version = requireNotNull(project.findProperty("VERSION_NAME"))
pomFromGradleProperties()
publishToMavenCentral(SonatypeHost.S01, true)
signAllPublications()
configure(AndroidSingleVariantLibrary())
}
}
}