forked from kiwicom/orbit-compose
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle.kts
85 lines (77 loc) · 2.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
@file:Suppress("DSL_SCOPE_VIOLATION")
import com.vanniktech.maven.publish.AndroidSingleVariantLibrary
import com.vanniktech.maven.publish.MavenPublishBaseExtension
import com.vanniktech.maven.publish.SonatypeHost
import java.time.Year
import java.util.Properties
import org.jetbrains.dokka.base.DokkaBase
import org.jetbrains.dokka.base.DokkaBaseConfiguration
import org.jetbrains.dokka.gradle.DokkaTaskPartial
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
plugins {
alias(libs.plugins.kotlin.jvm)
alias(libs.plugins.kotlin.android) apply false
alias(libs.plugins.kotlin.serialization) apply false
alias(libs.plugins.agp.application) apply false
alias(libs.plugins.kotlinter) apply false
alias(libs.plugins.mavenPublish) apply false
alias(libs.plugins.paparazzi) apply false
alias(libs.plugins.appDistribution) apply false
alias(libs.plugins.dokka)
}
buildscript {
dependencies {
classpath(libs.kotlin.dokka)
}
}
subprojects {
tasks.withType<KotlinCompile>().configureEach {
kotlinOptions {
jvmTarget = "1.8"
allWarningsAsErrors = true
freeCompilerArgs = freeCompilerArgs.toMutableList().apply {
add("-Xskip-prerelease-check")
}.toList()
}
}
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())
}
}
tasks.withType<DokkaTaskPartial>().configureEach {
pluginConfiguration<DokkaBase, DokkaBaseConfiguration> {
customStyleSheets = listOf(file("dokka/orbit-style.css"))
customAssets = listOf(file("dokka/logo-icon.svg"))
footerMessage = "© ${Year.now().value} Kiwi.com"
}
}
}
tasks.dokkaHtmlMultiModule.configure {
pluginConfiguration<DokkaBase, DokkaBaseConfiguration> {
moduleName.set("Orbit Compose")
customStyleSheets = listOf(file("dokka/orbit-style.css"))
customAssets = listOf(file("dokka/logo-icon.svg"))
footerMessage = "© ${Year.now().value} Kiwi.com"
}
}