-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.gradle
More file actions
105 lines (88 loc) · 3.03 KB
/
build.gradle
File metadata and controls
105 lines (88 loc) · 3.03 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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
import io.gitlab.arturbosch.detekt.Detekt
import io.gitlab.arturbosch.detekt.extensions.DetektExtension
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
ext {
nav_version = "2.5.3"
hilt_version = "2.44"
hilt_androidX_version = "1.0.0"
room_version = "2.4.3"
lifecycle_version = "2.4.0"
glide_version = '4.11.0'
retrofit_version = '2.9.0'
paging_version = '3.1.0'
datastore_version = '1.0.0-alpha02'
material_version = '1.10.0'
coroutines_version = '1.6.1'
junit_version = '5.8.1'
recycler_view_version = "1.3.0"
event_bus_version = "3.2.0"
activity_version = "1.8.0"
androidx_core_version = "1.8.0"
detekt_version = "1.23.1"
ktlint_version = "11.5.1"
}
dependencies {
classpath "com.google.dagger:hilt-android-gradle-plugin:$hilt_version"
classpath "androidx.navigation:navigation-safe-args-gradle-plugin:$nav_version"
classpath "de.mannodermaus.gradle.plugins:android-junit5:1.8.2.1"
classpath "io.gitlab.arturbosch.detekt:detekt-gradle-plugin:$detekt_version"
classpath "org.jlleitschuh.gradle:ktlint-gradle:$ktlint_version"
}
repositories {
maven {
url "https://plugins.gradle.org/m2/"
}
}
}
plugins {
id 'com.android.application' version '8.1.1' apply false
id 'com.android.library' version '8.1.1' apply false
id 'org.jetbrains.kotlin.android' version '1.8.0' apply false
id 'com.google.dagger.hilt.android' version "$hilt_version" apply false
id "io.gitlab.arturbosch.detekt" version "$detekt_version"
id "org.jlleitschuh.gradle.ktlint" version "$ktlint_version" apply true
alias(libs.plugins.ksp) apply false
}
ktlint {
version = "0.43.1"
}
subprojects {
apply plugin: "org.jlleitschuh.gradle.ktlint" // Version should be inherited from parent
repositories {
// Required to download KtLint
mavenCentral()
}
// Optionally configure plugin
ktlint {
debug = true
reporting {
}
}
}
dependencies {
detektPlugins "io.gitlab.arturbosch.detekt:detekt-formatting:1.23.1"
}
def projectSource = file(projectDir)
def configFile = files("$rootDir/config/detekt/detekt.yml")
def baselineFile = file("$rootDir/config/detekt/baseline.xml")
def kotlinFiles = "**/*.kt"
def resourceFiles = "**/resources/**"
def buildFiles = "**/build/**"
apply plugin: 'io.gitlab.arturbosch.detekt'
tasks.register("detektAll", Detekt) {
def autoFix = project.hasProperty('detektAutoFix')
description = "Custom DETEKT build for all modules"
parallel = true
ignoreFailures = false
autoCorrect = autoFix
buildUponDefaultConfig = true
setSource(projectSource)
baseline.set(baselineFile)
config.setFrom(configFile)
include(kotlinFiles)
exclude(resourceFiles, buildFiles)
reports.xml.setRequired(true)
reports.html.setRequired(true)
reports.txt.setRequired(true)
}