-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle.kts
76 lines (65 loc) · 2.68 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
// Top-level build file where you can add configuration options common to all sub-projects/modules.
import org.jetbrains.kotlin.konan.properties.loadProperties
plugins {
alias(libs.plugins.android.application) apply false
alias(libs.plugins.android.library) apply false
alias(libs.plugins.kotlin.android) apply false
alias(libs.plugins.notificare.services) apply false
alias(libs.plugins.google.services) apply false
alias(libs.plugins.google.ksp) apply false
alias(libs.plugins.ktlint)
alias(libs.plugins.detekt)
}
subprojects {
if (this.name != "sample" && this.name != "sample-user-inbox") {
apply(plugin = "com.android.library")
apply(plugin = "kotlin-android")
apply(plugin = "com.google.devtools.ksp")
apply(plugin = "kotlin-parcelize")
apply(plugin = "maven-publish")
apply(plugin = "org.jlleitschuh.gradle.ktlint")
apply(plugin = "io.gitlab.arturbosch.detekt")
ktlint {
debug.set(true)
verbose.set(true)
android.set(true)
baseline.set(file("ktlint-baseline.xml"))
}
detekt {
config.setFrom(rootProject.files("config/detekt/detekt.yml"))
buildUponDefaultConfig = true
baseline = file("detekt-baseline.xml")
}
group = rootProject.libs.versions.maven.artifactGroup.get()
version = rootProject.libs.versions.maven.artifactVersion.get()
val properties = loadProperties("local.properties")
val awsS3AccessKeyId = System.getenv("AWS_ACCESS_KEY_ID")
?: properties.getProperty("aws.s3.access_key_id")
val awsS3SecretAccessKey = System.getenv("AWS_SECRET_ACCESS_KEY")
?: properties.getProperty("aws.s3.secret_access_key")
val artifactChannel =
if (Regex("^([0-9]+)\\.([0-9]+)\\.([0-9]+)\$").matches(version.toString())) "releases" else "prereleases"
afterEvaluate {
configure<PublishingExtension> {
publications {
register("release", MavenPublication::class) {
from(components["release"])
}
}
repositories {
maven {
name = "S3"
url = uri("s3://maven.notifica.re/$artifactChannel")
credentials(AwsCredentials::class) {
accessKey = awsS3AccessKeyId
secretKey = awsS3SecretAccessKey
}
}
}
}
}
}
}
tasks.register("clean", Delete::class) {
delete(rootProject.layout.buildDirectory)
}