-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.gradle.kts
103 lines (90 loc) · 3.5 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
/*
* Copyright (c) SRG SSR. All rights reserved.
* License information is available from the LICENSE file.
*/
// 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.kotlin.compose.compiler) apply false
alias(libs.plugins.kotlin.parcelize) apply false
alias(libs.plugins.detekt)
alias(libs.plugins.dependency.analysis.gradle.plugin)
alias(libs.plugins.dokka)
alias(libs.plugins.dokka.javadoc)
alias(libs.plugins.kotlinx.kover)
alias(libs.plugins.pillarbox.detekt)
}
dokka {
moduleVersion = providers.environmentVariable("VERSION_NAME").orElse("dev")
dokkaPublications.html {
includes.from("config/dokka/Pillarbox.md")
}
pluginsConfiguration.html {
// See the overridable images here:
// https://github.com/Kotlin/dokka/tree/master/dokka-subprojects/plugin-base/src/main/resources/dokka/images
customAssets.from("config/dokka/images/logo-icon.svg") // TODO Use Pillarbox logo
customStyleSheets.from("config/dokka/styles/pillarbox.css")
footerMessage.set("© SRG SSR")
// TODO Enable this once we have some content there
// homepageLink.set("https://android.pillarbox.ch/")
templatesDir.set(file("config/dokka/templates"))
}
}
dependencies {
dokka(project(":pillarbox-analytics"))
dokka(project(":pillarbox-cast"))
dokka(project(":pillarbox-core-business"))
dokka(project(":pillarbox-player"))
dokka(project(":pillarbox-ui"))
}
// Configure the `wrapper` task, so it can easily be updated by simply running `./gradlew wrapper`.
tasks.wrapper {
distributionType = Wrapper.DistributionType.ALL
gradleVersion = "latest"
}
val clean by tasks.getting(Delete::class) {
delete(rootProject.layout.buildDirectory)
}
/*
* https://detekt.dev/docs/gettingstarted/git-pre-commit-hook
* https://medium.com/@alistair.cerio/android-ktlint-and-pre-commit-git-hook-5dd606e230a9
*/
val installGitHook by tasks.registering(Copy::class) {
description = "Install the Git pre-commit hook locally"
from(rootProject.projectDir.resolve("config/git/pre-commit"))
into { rootProject.projectDir.resolve(".git/hooks") }
filePermissions {
unix("rwxr-xr-x")
}
}
tasks.getByPath(":pillarbox-demo:preBuild").dependsOn(installGitHook)
dependencyAnalysis {
issues {
all {
onUnusedDependencies {
severity("fail")
exclude(libs.androidx.compose.ui.tooling.asProvider())
}
}
project(":pillarbox-cast") {
onUnusedDependencies {
// This dependency is not used directly, but needed if we want to use the default Media3 cast receiver
exclude(libs.androidx.media3.cast)
}
}
project(":pillarbox-core-business") {
onUnusedDependencies {
// This dependency is not used directly, but required to be able to compile `CommandersActStreaming`
exclude(libs.tagcommander.core)
}
}
project(":pillarbox-player") {
onUnusedDependencies {
// These dependencies are not used directly, but automatically used by libs.androidx.media3.exoplayer
exclude(libs.androidx.media3.dash, libs.androidx.media3.hls)
}
}
}
}