-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
54 lines (47 loc) · 1.36 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
import dependencies.Versions
import dependencies.Build
apply plugin: "com.github.ben-manes.versions"
buildscript {
ext.kotlin_version = '1.6.0'
ext.kotlin_version = Versions.INSTANCE.kotlin
repositories {
google()
mavenCentral()
gradlePluginPortal()
}
dependencies {
classpath Build.INSTANCE.build_tools
classpath Build.INSTANCE.kotlin_gradle_plugin
classpath Build.INSTANCE.google_services
classpath Build.INSTANCE.crashlytics_gradle
classpath Build.INSTANCE.gradle_versions_plugin
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
allprojects {
repositories {
google()
mavenCentral()
gradlePluginPortal()
}
}
def isNonStable = { String version ->
def stableKeyword = ['RELEASE', 'FINAL', 'GA'].any { it -> version.toUpperCase().contains(it) }
def regex = /^[0-9,.v-]+(-r)?$/
return !stableKeyword && !(version ==~ regex)
}
tasks.named("dependencyUpdates").configure {
checkForGradleUpdate = true
resolutionStrategy {
componentSelection {
all {
if (isNonStable(candidate.version) && !isNonStable(currentVersion)) {
reject('Release candidate')
}
}
}
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}