-
Notifications
You must be signed in to change notification settings - Fork 2
/
build.gradle
85 lines (72 loc) · 2.44 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
import io.gitlab.arturbosch.detekt.Detekt
buildscript {
ext.versions = [
kotlin : '1.7.20',
minSdk : 23,
compileSdk : 33,
androidTools : '30.3.1',
detekt : '1.22.0',
androidGradlePlugin: '7.3.1',
publishPlugin : '0.23.1',
junit : '4.13.2'
]
ext.deps = [
'kotlin': [
'stdlib' : "org.jetbrains.kotlin:kotlin-stdlib-jdk8:${versions.kotlin}",
'reflect': "org.jetbrains.kotlin:kotlin-reflect:${versions.kotlin}",
],
'lint' : [
'core' : "com.android.tools.lint:lint:${versions.androidTools}",
'api' : "com.android.tools.lint:lint-api:${versions.androidTools}",
'checks': "com.android.tools.lint:lint-checks:${versions.androidTools}",
'tests' : "com.android.tools.lint:lint-tests:${versions.androidTools}",
],
]
repositories {
google()
mavenCentral()
gradlePluginPortal()
}
dependencies {
classpath "com.android.tools.build:gradle:${versions.androidGradlePlugin}"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:${versions.kotlin}"
classpath "io.gitlab.arturbosch.detekt:detekt-gradle-plugin:${versions.detekt}"
classpath "com.vanniktech:gradle-maven-publish-plugin:${versions.publishPlugin}"
}
}
plugins {
id("io.gitlab.arturbosch.detekt").version("1.22.0")
}
def projectSource = file(projectDir)
def configFile = files("$rootDir/config/detekt/detekt.yml")
def kotlinFiles = "**/*.kt"
def resourceFiles = "**/resources/**"
def buildFiles = "**/build/**"
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)
config.setFrom(configFile)
include(kotlinFiles)
exclude(resourceFiles, buildFiles)
reports {
html.enabled = true
xml.enabled = false
}
}
dependencies {
detektPlugins "io.gitlab.arturbosch.detekt:detekt-formatting:${versions.detekt}"
}
allprojects {
repositories {
mavenCentral()
google()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}