generated from outlying/android-template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
92 lines (81 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
86
87
88
89
90
91
92
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
ext {
kotlin_version = '1.3.70'
}
ext.general = [
"android": [
"sdk": [
"compile": 29 as Integer,
"min" : 21 as Integer,
"target" : 29 as Integer
]
],
"version": [
"code": 1,
"name": "0.0.1"
]
]
ext.versions = [
"androidx": [
"appcompat" : "1.2.0",
"constraintlayout": "2.0.4",
"core" : "1.3.2",
"lifecycle" : "2.2.0",
"navigation" : "2.3.1",
"test" : [
"espresso" : "3.3.0",
"extjunit" : "1.1.2"
]
],
"google" : [
"android": [
"material": "1.2.1"
]
],
"junit4" : "4.13",
"kotlin" : [
"base" : "1.4.10",
"coroutines": "1.4.1"
],
"plugins" : [
"android" : "4.1.0",
"dependencies": "0.35.0"
]
]
repositories {
google()
jcenter()
}
dependencies {
classpath "com.android.tools.build:gradle:${versions.plugins.android}"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:${versions.kotlin.base}"
classpath "com.github.ben-manes:gradle-versions-plugin:${versions.plugins.dependencies}"
}
}
apply plugin: "com.github.ben-manes.versions"
allprojects {
version = general.version.name
repositories {
google()
jcenter()
}
}
def isNonStable = { String version ->
def nonStableKeywords = ['ALPHA', 'BETA', 'M1', 'M2', 'M3', 'RC'].any { version.toUpperCase().contains(it) }
return nonStableKeywords
}
dependencyUpdates {
resolutionStrategy {
componentSelection {
all {
if (isNonStable(it.candidate.version) && !isNonStable(it.currentVersion)) {
reject('Release candidate')
}
}
}
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}