forked from UdacityAndroidDevScholarship/blood-donation
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
executable file
·104 lines (85 loc) · 3.32 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
// 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.0.2',
'firebase' : '12.0.1',
'testRunner' : '1.0.1',
'espressoCore' : '3.0.1',
'leak_canary' : '1.5.4'
]
ext.buildConfig = [
'compileSdk': 27,
'targetSdk' : 27,
'minSdk' : 15,
'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}",
'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}"
]
],
'square':[
'leackcanary':[
'debug':"com.squareup.leakcanary:leakcanary-android:${versions.leak_canary}",
'release':"com.squareup.leakcanary:leakcanary-android-no-op:${versions.leak_canary}"
]
],
'junit' : 'junit:junit:4.12'
]
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
jcenter()
}
// 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
}