forked from patrykandpatrick/vico
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
116 lines (88 loc) · 2.94 KB
/
build.gradle
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
104
105
106
107
108
109
110
111
112
113
114
115
116
/*
* Copyright 2022 Patryk Goworowski and Patryk Michalik
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import io.gitlab.arturbosch.detekt.Detekt
import org.jetbrains.dokka.gradle.DokkaMultiModuleTask
buildscript {
apply from: "versions.gradle"
apply from: "dependencies.gradle"
repositories {
google()
mavenCentral()
gradlePluginPortal()
}
dependencies {
classpath "com.android.tools.build:gradle:$versions.agp"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$versions.kotlin"
classpath("org.jetbrains.dokka:dokka-gradle-plugin:$versions.dokka")
classpath("org.jetbrains.dokka:dokka-base:$versions.dokka")
}
}
plugins {
id "io.gitlab.arturbosch.detekt" version "1.21.0"
id "org.jetbrains.dokka" version "1.7.10"
}
dependencies {
detektPlugins "io.gitlab.arturbosch.detekt:detekt-formatting:1.21.0"
}
detekt {
buildUponDefaultConfig = true
source = files("sample", "vico/core", "vico/compose", "vico/view", "vico/compose-m3", "vico/compose-m2")
config = files(".idea/detekt-config.yml")
}
tasks.register("detektFix", Detekt) {
autoCorrect = true
buildUponDefaultConfig = true
source = files("sample", "vico/core", "vico/compose", "vico/view", "vico/compose-m3", "vico/compose-m2")
config.setFrom(files(".idea/detekt-config.yml"))
}
allprojects {
repositories {
google()
mavenLocal()
mavenCentral()
}
}
tasks.withType(Detekt).configureEach {
jvmTarget = JavaVersion.VERSION_1_8.toString()
reports {
html {
enabled = true
destination = file("build/reports/detekt/detekt.html")
}
}
}
tasks.withType(DokkaMultiModuleTask).configureEach {
pluginsMapConfiguration.set(["org.jetbrains.dokka.base.DokkaBase": """{ "customStyleSheets": ["$rootDir/logo-styles.css"] }"""])
}
tasks.dokkaHtmlMultiModule {
outputDirectory.set(file("docs"))
}
task clean(type: Delete) {
delete rootProject.buildDir
}
tasks.register("assembleVico") { task ->
task.dependsOn "clean"
allprojects.forEach { project ->
if (project.parent != null && project.parent.name.contains("vico")) {
task.dependsOn "${project.parent.name}:${project.name}:assembleRelease"
}
}
}
project(":vico").tasks.configureEach { subtask ->
if (subtask.name.contains("publishVicoCorePublication")) {
subtask.mustRunAfter(":assembleVico")
}
}