-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.gradle
More file actions
90 lines (81 loc) · 2.89 KB
/
build.gradle
File metadata and controls
90 lines (81 loc) · 2.89 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
allprojects {
repositories {
google()
mavenCentral()
}
}
ext {
minSdk = 21
compileSdk = 33
targetSdk = 33
// Current version of the library
libraryVersion = "3.0.0"
}
buildscript {
repositories {
google()
mavenCentral()
maven {
url "https://plugins.gradle.org/m2/"
}
}
ext.kotlinVersion = '1.9.10'
// NB! Make sure to update the kltint version set in the root build.gradle file. subprojects / ktlint / version
// NB! ktlint-gradle doesn't always depend on the latest ktlint version, but since it is a thin wrapper around ktlint
// NB! it can be usefult to use a newer version of ktlint to get ruleset updates, etc.
ext.ktlintGradleVersion = '11.5.0'
ext.detectGradleVersion = '1.23.1'
ext.junitVersion = '4.13.1'
ext.testRunnerVersion = '1.5.2'
ext.androidxJunitVersion = '1.1.2'
ext.appCompatVersion = '1.6.1'
ext.lifecycleVersion = '2.2.0'
ext.savedStateVersion = '2.2.0'
ext.fragmentVersion = '1.6.0'
ext.vanniktech = '0.33.0'
dependencies {
classpath 'com.android.tools.build:gradle:8.10.0'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion"
classpath "org.jlleitschuh.gradle:ktlint-gradle:$ktlintGradleVersion"
classpath "io.gitlab.arturbosch.detekt:detekt-gradle-plugin:$detectGradleVersion"
classpath "com.vanniktech.maven.publish:com.vanniktech.maven.publish.gradle.plugin:$vanniktech"
}
}
subprojects {
// KTLint (Kotlin code style enforcer)
apply plugin: 'org.jlleitschuh.gradle.ktlint'
ktlint {
version = "0.50.0"
outputToConsole = true
}
// Detekt (Kotlin static analyser)
apply(plugin: 'io.gitlab.arturbosch.detekt')
detekt {
// Manually add our custom lib/java source dir here
source = files(
"src/main/java",
"src/test/java",
"java"
)
allRules = true // Include all rules
buildUponDefaultConfig = true // preconfigure defaults (see the rule set file below for explanations)
config = files("${project.rootDir}/config/detekt/detekt-config.yaml") // point to your custom config defining rules to run, overwriting default behavior
reports {
html.enabled = true // Create a HTML report
xml.enabled = false // XML report not needed
txt.enabled = false // txt report not needed
}
}
tasks.detekt.jvmTarget = "1.8"
afterEvaluate {
// Make sure detekt is executed with all the other linters for all modules
check.dependsOn "detekt"
}
def GROUP_VERIFICATION_TASKS = "Verification"
task checkCode(dependsOn: ["detekt", "ktlintCheck"])
checkCode.group = GROUP_VERIFICATION_TASKS
checkCode.description = "Run detekt and ktlint"
}
task clean(type: Delete) {
delete rootProject.buildDir
}