-
Notifications
You must be signed in to change notification settings - Fork 49
/
build.gradle
83 lines (71 loc) · 1.96 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
buildscript {
repositories {
google()
mavenCentral()
}
dependencies {
classpath libs.android.gradle
classpath libs.bintray.gradle
classpath libs.kotlin.gradle
}
}
plugins {
alias(libs.plugins.detekt)
alias(libs.plugins.ben.manes)
alias(libs.plugins.ksp) apply false
}
subprojects {
if (path.contains("integrations") || path.contains("models-") || path.contains("example")) {
return
}
apply {
plugin "io.gitlab.arturbosch.detekt"
plugin "com.github.ben-manes.versions"
}
apply from: "../detekt_configuration.gradle"
dependencies {
detektPlugins(libs.detekt.formatting)
}
tasks.register("detektFormat", io.gitlab.arturbosch.detekt.Detekt) {
description "Reformats whole code base."
parallel true
disableDefaultRuleSets true
buildUponDefaultConfig true
autoCorrect true
setSource(files("$projectDir/src/main/java"))
include "**/*.kt"
include "**/*.kts"
exclude "**/resources/**"
exclude "**/build/**"
config.setFrom(files("$rootDir/detekt.yml"))
reports {
xml { enabled = false }
html { enabled = false }
}
}
}
allprojects {
repositories {
google()
mavenCentral()
}
apply plugin: "com.jfrog.bintray"
tasks.withType(Javadoc).all { enabled = false }
tasks.withType(JavaCompile) { options.fork = true }
}
def isNonStable = { String version ->
def unStableKeyword = ['ALPHA', 'RC', 'BETA', 'DEV', "M"].any { it -> version.toUpperCase().contains(it) }
def regex = /^[0-9,.v-]+(-r)?$/
return unStableKeyword && !(version ==~ regex)
}
tasks.named("dependencyUpdates").configure {
rejectVersionIf {
isNonStable(it.candidate.version)
}
}
tasks.named('wrapper') {
distributionType = Wrapper.DistributionType.ALL
}
task clean(type: Delete) {
delete rootProject.buildDir
}