-
Notifications
You must be signed in to change notification settings - Fork 12
/
utils.gradle
47 lines (40 loc) · 1.29 KB
/
utils.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
def build_versions = [:]
build_versions.min_sdk = 23
build_versions.compile_sdk = 34
build_versions.target_sdk = 34
ext.build_versions = build_versions
static def addRepos(RepositoryHandler handler) {
handler.mavenLocal()
handler.google()
handler.mavenCentral()
}
def forceVersions(ConfigurationContainer configurations) {
configurations.configureEach { configuration ->
configuration.resolutionStrategy {
force libs.jackson.databind // Vulnerability fix: OKTA-609904
}
}
}
def configureSpotless(Project project) {
project.apply plugin: 'com.diffplug.spotless'
project.spotless {
format 'misc', {
target '**/*.gradle', '**/*.md', '**/.gitignore', '**/*.xml', '**/*.json', '**/*.properties', '**/*.yml', '**/*.kt'
targetExclude '.idea/*', '**/build/*', '.gradle/*'
trimTrailingWhitespace()
endWithNewline()
}
}
project.plugins.withId('kotlin-android') {
project.spotless {
kotlin {
target '**/*.kt'
ktlint()
licenseHeaderFile rootProject.file('licenseTemplate.txt')
}
}
}
}
ext.addRepos = this.&addRepos
ext.forceVersions = this.&forceVersions
ext.configureSpotless = this.&configureSpotless