-
Notifications
You must be signed in to change notification settings - Fork 122
/
build.gradle
executable file
·138 lines (114 loc) · 4.86 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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
ext.versions = [
'supportLibrary' : '27.1.1',
'constraintLayout': '1.1.0',
'firebase' : '15.0.2',
'testRunner' : '1.0.1',
'espressoCore' : '3.0.1',
'leak_canary' : '1.5.4',
'timber' : '4.7.0',
'play_services' : '15.0.0',
'geo_fire' : '2.3.1',
'gson' : '2.8.4',
'fcm' : '15.0.2',
'firebase_auth' : '15.1.0',
'firebase_database':'15.0.0'
]
ext.buildConfig = [
'compileSdk': 27,
'targetSdk' : 27,
'minSdk' : 16,
'isSnapshot': false,
'version' : [
'major' : 1,
'minor' : 0,
'patch' : 0,
'classifier': null, // dev, beta, alpha etc.
]
]
String versionName = "${buildConfig.version.major}.${buildConfig.version.minor}.${buildConfig.version.patch}"
if (buildConfig.version.classifier == null) {
if (buildConfig.isSnapshot) {
buildConfig.version.classifier = 'SNAPSHOT'
}
}
if (buildConfig.version.classifier != null) {
versionName += "-" + buildConfig.version.classifier
}
ext.buildConfig.version['name'] = versionName
ext.buildConfig.version['code'] = buildConfig.version.major * 100000 + buildConfig.version.minor * 10000 + buildConfig.version.patch * 100
ext.deps = [
'android': [
'support': [
'appcompatV7' : "com.android.support:appcompat-v7:${versions.supportLibrary}",
'annotations' : "com.android.support:support-annotations:${versions.supportLibrary}",
'constraintLayout': "com.android.support.constraint:constraint-layout:${versions.constraintLayout}",
'design' : "com.android.support:design:${versions.supportLibrary}",
'test' : [
'runner' : "com.android.support.test:runner:${versions.testRunner}",
'espressoCore': "com.android.support.test.espresso:espresso-core:${versions.espressoCore}"
]
],
],
'google' : [
'firebase': [
'auth': "com.google.firebase:firebase-auth:${versions.firebase_auth}",
'database':"com.google.firebase:firebase-database:${versions.firebase_database}",
'geo_fire':"com.firebase:geofire-android:${versions.geo_fire}",
'cloud_messaging':"com.google.firebase:firebase-messaging:${versions.fcm}"
],
'play_services':[
'location':"com.google.android.gms:play-services-location:${versions.play_services}",
'maps':"com.google.android.gms:play-services-maps:${versions.play_services}"
],
'gson':[
'gson': "com.google.code.gson:gson:${versions.gson}"
]
],
'square':[
'leackcanary':[
'debug':"com.squareup.leakcanary:leakcanary-android:${versions.leak_canary}",
'release':"com.squareup.leakcanary:leakcanary-android-no-op:${versions.leak_canary}"
]
],
'other':[
'timber':"com.jakewharton.timber:timber:${versions.timber}"
],
'junit' : 'junit:junit:4.12'
]
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.2.0-alpha13'
classpath 'com.google.gms:google-services:3.2.1'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
jcenter()
maven { url "https://jitpack.io" }
}
// Force all of the primary support libraries to use the same version.
configurations.all {
resolutionStrategy.eachDependency { details ->
if (details.requested.group == 'com.android.support') {
details.useVersion versions.supportLibrary
}
}
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
def propOrThrow(String name) {
if (hasProperty(name))
return getProperty(name)
else
throw new GradleException("Can't find property `$name`, make sure you have added them to the global 'gradle.properties' file")
}