This repository has been archived by the owner on Feb 9, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
/
build.gradle
131 lines (117 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
// Top-level build file where you can add configuration options common to all sub-projects/modules.
static def gitBranch() {
def branch = 'GitHub'
try {
def gexist = 'git'.execute()
if (gexist.in.text.contains("usage: git")) {
def proc = 'git rev-parse --abbrev-ref HEAD'.execute()
proc.in.eachLine { line -> branch = line }
proc.err.eachLine { line -> println line }
proc.waitFor()
} else {
branch = '_NOGIT'
}
} catch (Exception e) {
// Do nothing
println e
}
branch
}
buildscript {
ext.kotlinVersion = '1.3.72'
repositories {
google()
jcenter()
maven { url 'https://jitpack.io' }
}
dependencies {
classpath 'com.android.tools.build:gradle:4.0.0'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion"
classpath 'com.google.gms:google-services:4.3.3'
classpath 'com.google.firebase:firebase-crashlytics-gradle:2.1.1'
classpath 'com.google.firebase:perf-plugin:1.3.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' }
}
}
def versionPropsFile = rootProject.file("version.properties")
if (versionPropsFile.canRead()) {
def versionProps = new Properties()
versionProps.load(new FileInputStream(versionPropsFile))
def currentBranch = gitBranch()
def appVersionMajor = versionProps['appVersionMajor'].toInteger()
def appVersionMinor = versionProps['appVersionMinor'].toInteger()
def appVersionBuild = versionProps['appVersionBuild'].toInteger()
def iterationNumber = versionProps['iterationNumber'].toInteger()
if (currentBranch == 'dev' ) {
if (iterationNumber >= 999 && appVersionBuild >= 99) {
throw new GradleException("We are out of version numbers to use right now. you did >98,900 builds 😳")
} else if (iterationNumber >= 999) {
appVersionBuild = appVersionBuild + 1
iterationNumber = 0
} else {
iterationNumber = iterationNumber + 1
}
}
versionProps['appVersionMajor'] = appVersionMajor.toString()
versionProps['appVersionMinor'] = appVersionMinor.toString()
versionProps['appVersionBuild'] = appVersionBuild.toString()
versionProps['iterationNumber'] = iterationNumber.toString()
versionProps.store(versionPropsFile.newWriter(), null)
// Set the extra properties
ext.appVersionMajor = appVersionMajor
ext.appVersionMinor = appVersionMinor
ext.appVersionBuild = appVersionBuild
ext.iterationNumber = iterationNumber
}
else {
throw new GradleException("Could not read version.properties!")
}
ext {
firebaseVersion = '17.3.0'
firebaseStorage = '18.0.0'
constraintVersion = '1.1.0'
firebaseRemoteConfig = '19.1.3'
firebaseDatabase = '18.0.0'
firebasePref = '19.0.6'
firebaseMessaging = '20.1.5'
firebaseAds = '18.3.0'
firebaseInappMessaging = '18.0.1'
firebaseFirestore = '21.4.3'
firebaseCrash = '16.2.1'
firebaseInvite = '17.0.0'
firebaseAuth = '18.0.0'
firebaseDeepLinks = '18.0.0'
firebaseCrashlytics = '17.0.0-beta04'
googleServicesAds = '18.3.0'
firebase = [
invites: "com.google.firebase:firebase-invites:$firebaseInvite",
ads: "com.google.firebase:firebase-ads:$firebaseAds",
adslite: "com.google.firebase:firebase-ads-lite:$firebaseAds",
config: "com.google.firebase:firebase-config:$firebaseRemoteConfig",
messaging: "com.google.firebase:firebase-messaging:$firebaseMessaging",
auth: "com.google.firebase:firebase-auth:$firebaseAuth",
database: "com.google.firebase:firebase-database:$firebaseDatabase",
core: "com.google.firebase:firebase-core:$firebaseVersion",
crashlytics: "com.google.firebase:firebase-crashlytics:$firebaseCrashlytics",
firestore: "com.google.firebase:firebase-firestore:$firebaseFirestore",
googlead: "com.google.android.gms:play-services-ads:$googleServicesAds",
googleadlite: "com.google.android.gms:play-services-ads-lite:$googleServicesAds",
inappmessagingdisplay: "com.google.firebase:firebase-inappmessaging-display:$firebaseMessaging",
inappmessaging: "com.google.firebase:firebase-inappmessaging:$firebaseMessaging",
performance: "com.google.firebase:firebase-perf:$firebasePref",
fireUI: 'com.firebaseui:firebase-ui-database:3.3.0',
storage: "com.google.firebase:firebase-storage:$firebaseStorage",
deeplinks: "com.google.firebase:firebase-dynamic-links:$firebaseDeepLinks"
]
}
task clean(type: Delete) {
delete rootProject.buildDir
}