-
Notifications
You must be signed in to change notification settings - Fork 63
Expand file tree
/
Copy pathbuild.gradle.kts
More file actions
84 lines (70 loc) · 3.18 KB
/
build.gradle.kts
File metadata and controls
84 lines (70 loc) · 3.18 KB
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
import org.jetbrains.dokka.base.DokkaBase
import org.jetbrains.dokka.base.DokkaBaseConfiguration
import org.jetbrains.dokka.versioning.VersioningConfiguration
import org.jetbrains.dokka.versioning.VersioningPlugin
// Top-level build file where you can add configuration options common to all sub-projects/modules.
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.ktlint) apply false
alias(libs.plugins.detekt) apply false
alias(libs.plugins.dokka)
alias(libs.plugins.roborazzi) apply false
alias(libs.plugins.openapi.generator) apply false
alias(libs.plugins.binary.compatibility.validator)
alias(libs.plugins.ksp) apply false
alias(libs.plugins.vanniktech.maven.publish) apply false
alias(libs.plugins.compose.compiler) apply false
}
buildscript {
dependencies {
classpath("org.jetbrains.dokka:dokka-base:1.9.20")
classpath("org.jetbrains.dokka:versioning-plugin:1.9.20")
/**
* Forcing the use of Jackson Core to avoid a conflict between the version used by
* Dokka and the one used by OpenAPI Generator.
*/
classpath("com.fasterxml.jackson.core:jackson-core:2.15.3")
}
}
dependencies {
dokkaHtmlMultiModulePlugin("org.jetbrains.dokka:versioning-plugin:1.9.20")
dokkaHtmlMultiModulePlugin("org.jetbrains.dokka:android-documentation-plugin:1.9.20")
}
apiValidation {
/**
* Sub-projects that are excluded from API validation
*/
ignoredProjects.addAll(listOf("demo-app", "uitestutils"))
}
val isTagBuild: Boolean = System.getenv("BUILDKITE_TAG")?.isNotEmpty() == true
val rawSdkVersion = providers.exec {
commandLine("git", "describe", "--tags")
}.standardOutput.asText.get().trim()
extra["sdkVersion"] = rawSdkVersion + if (isTagBuild) "" else "-SNAPSHOT" // Add -SNAPSHOT suffix once 0.31.0 version is released
tasks.dokkaHtmlMultiModule {
notCompatibleWithConfigurationCache("https://github.com/Kotlin/dokka/issues/2231")
val mainDir = projectDir.resolve("docs/dokka/") // docs/dokka/
val historyDir = mainDir.resolve("history/") // docs/dokka/history/ - all versions
val currentDir = mainDir.resolve("current/") // docs/dokka/current/ - what we'll serve in github pages
val newVersionDir = historyDir.resolve(rawSdkVersion) // docs/dokka/history/x.x.x/ - new version
moduleName.set("Gravatar Android SDK")
outputDirectory.set(newVersionDir)
pluginConfiguration<DokkaBase, DokkaBaseConfiguration> {
customAssets = listOf(file("./docs/images/dokka/logo-icon.svg"))
footerMessage = "© Automattic Inc."
}
pluginConfiguration<VersioningPlugin, VersioningConfiguration> {
version = rawSdkVersion
olderVersionsDir = historyDir
}
doLast {
// Delete the current directory, it will be replaced by the new version
currentDir.deleteRecursively()
// Copy the new version to the current directory
newVersionDir.copyRecursively(currentDir)
// Delete the "older" directory from the new version
newVersionDir.resolve("older").deleteRecursively()
}
}